diff mbox

ixgbe: fix simple_return.cocci warnings

Message ID 20150729071125.GA23999@lkp-nex05
State Changes Requested
Headers show

Commit Message

kbuild test robot July 29, 2015, 7:11 a.m. UTC
drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c:153:1-7: WARNING: end returns can be simpified

 Simplify a trivial if-return sequence.  Possibly combine with a
 preceding function call.
Generated by: scripts/coccinelle/misc/simple_return.cocci

CC: Mark Rustad <mark.d.rustad@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
---

 ixgbe_x550.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Rustad, Mark D July 29, 2015, 8:55 p.m. UTC | #1
> On Jul 29, 2015, at 12:11 AM, Wu, Fengguang <fengguang.wu@intel.com> wrote:
> 
> drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c:153:1-7: WARNING: end returns can be simpified
> 
> Simplify a trivial if-return sequence.  Possibly combine with a
> preceding function call.
> Generated by: scripts/coccinelle/misc/simple_return.cocci
> 
> CC: Mark Rustad <mark.d.rustad@intel.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> ---
> 
> ixgbe_x550.c |    6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
> 
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
> @@ -150,12 +150,8 @@ static s32 ixgbe_get_cs4227_status(struc
> 	if (status)
> 		return status;
> 
> -	status = ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_HOST_SPARE24_LSB +
> +	return ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_HOST_SPARE24_LSB +
> 					(1 << 12));
> -	if (status)
> -		return status;
> -
> -	return 0;
> }
> 
> /**

Please don't apply this as-is. It will introduce an indentation error that checkpatch will complain about. I can either respin the series to incorporate this, or this patch can be changed to adjust the indentation. Whichever you prefer.

--
Mark Rustad, Networking Division, Intel Corporation
diff mbox

Patch

--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
@@ -150,12 +150,8 @@  static s32 ixgbe_get_cs4227_status(struc
 	if (status)
 		return status;
 
-	status = ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_HOST_SPARE24_LSB +
+	return ixgbe_check_cs4227_reg(hw, IXGBE_CS4227_HOST_SPARE24_LSB +
 					(1 << 12));
-	if (status)
-		return status;
-
-	return 0;
 }
 
 /**