[Intel-wired-lan] [PATCH] ixgbe: fix simple_return.cocci warnings

Rustad, Mark D mark.d.rustad at intel.com
Wed Jul 29 20:55:20 UTC 2015


> On Jul 29, 2015, at 12:11 AM, Wu, Fengguang <fengguang.wu at 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 at intel.com>
> Signed-off-by: Fengguang Wu <fengguang.wu at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 841 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20150729/142f57fd/attachment.asc>


More information about the Intel-wired-lan mailing list