Patchwork [Open-FCoE,4/4] libfcoe: Fix meaningless log statement

login
register
mail settings
Submitter Robert Love
Date June 10, 2013, 11:28 p.m.
Message ID <20130610232819.26115.97835.stgit@fritz>
Download mbox | patch
Permalink /patch/61/
State Accepted
Headers show

Comments

Robert Love - June 10, 2013, 11:28 p.m.
ctlr_dev was initialized to NULL, and never re-assigned. This
caused the log statement to always report failure. This patch
removes the unused variable and fixes the log statement to always
report 'success', as that is what should be logged if the code
reaches this point.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Tested-by: Jack Morgan<jack.morgan@intel.com>
---
 drivers/scsi/fcoe/fcoe_transport.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
Neil Horman - June 12, 2013, 11:51 a.m.
On Mon, Jun 10, 2013 at 04:28:19PM -0700, Robert Love wrote:
> ctlr_dev was initialized to NULL, and never re-assigned. This
> caused the log statement to always report failure. This patch
> removes the unused variable and fixes the log statement to always
> report 'success', as that is what should be logged if the code
> reaches this point.
> 
> Signed-off-by: Robert Love <robert.w.love@intel.com>
> Tested-by: Jack Morgan<jack.morgan@intel.com>
> ---
>  drivers/scsi/fcoe/fcoe_transport.c |    6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
> index f3a5a53..58c867c 100644
> --- a/drivers/scsi/fcoe/fcoe_transport.c
> +++ b/drivers/scsi/fcoe/fcoe_transport.c
> @@ -721,7 +721,6 @@ ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
>  {
>  	struct net_device *netdev = NULL;
>  	struct fcoe_transport *ft = NULL;
> -	struct fcoe_ctlr_device *ctlr_dev = NULL;
>  	int rc = 0;
>  	int err;
>  
> @@ -768,9 +767,8 @@ ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
>  		goto out_putdev;
>  	}
>  
> -	LIBFCOE_TRANSPORT_DBG("transport %s %s to create fcoe on %s.\n",
> -			      ft->name, (ctlr_dev) ? "succeeded" : "failed",
> -			      netdev->name);
> +	LIBFCOE_TRANSPORT_DBG("transport %s succeeded to create fcoe on %s.\n",
> +			      ft->name, netdev->name);
>  
>  out_putdev:
>  	dev_put(netdev);
> 
> _______________________________________________
> fcoe-devel mailing list
> fcoe-devel@open-fcoe.org
> http://lists.open-fcoe.org/mailman/listinfo/fcoe-devel
> 
Acked-by: Neil Horman <nhorman@tuxdriver.com>

Patch

diff --git a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
index f3a5a53..58c867c 100644
--- a/drivers/scsi/fcoe/fcoe_transport.c
+++ b/drivers/scsi/fcoe/fcoe_transport.c
@@ -721,7 +721,6 @@  ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
 {
 	struct net_device *netdev = NULL;
 	struct fcoe_transport *ft = NULL;
-	struct fcoe_ctlr_device *ctlr_dev = NULL;
 	int rc = 0;
 	int err;
 
@@ -768,9 +767,8 @@  ssize_t fcoe_ctlr_create_store(struct bus_type *bus,
 		goto out_putdev;
 	}
 
-	LIBFCOE_TRANSPORT_DBG("transport %s %s to create fcoe on %s.\n",
-			      ft->name, (ctlr_dev) ? "succeeded" : "failed",
-			      netdev->name);
+	LIBFCOE_TRANSPORT_DBG("transport %s succeeded to create fcoe on %s.\n",
+			      ft->name, netdev->name);
 
 out_putdev:
 	dev_put(netdev);