Netdev List
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>,
	davem@davemloft.net, michal.simek@xilinx.com, andrew@lunn.ch
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/5] net: emaclite: Simplify if-else statements
Date: Thu, 28 Jun 2018 04:04:24 -0700	[thread overview]
Message-ID: <fc15913c3800923ef35e9db9508cbb9f67d0525f.camel@perches.com> (raw)
In-Reply-To: <1530171584-20673-3-git-send-email-radhey.shyam.pandey@xilinx.com>

On Thu, 2018-06-28 at 13:09 +0530, Radhey Shyam Pandey wrote:
> Remove else as it is not required with if doing a return.
> Fixes below checkpatch warning.
[]
> diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
[]
> @@ -1052,13 +1051,13 @@ static bool get_bool(struct platform_device *ofdev, const char *s)
>  {
>  	u32 *p = (u32 *)of_get_property(ofdev->dev.of_node, s, NULL);
>  
> -	if (p) {
> -		return (bool)*p;
> -	} else {
> +	if (!p) {
>  		dev_warn(&ofdev->dev, "Parameter %s not found,"
>  			"defaulting to false\n", s);

Please coalesce the format onto a single line
and add the missing space after the comma.

>  		return false;
>  	}
> +
> +	return (bool)*p;
>  }
>  
>  static const struct net_device_ops xemaclite_netdev_ops;

  reply	other threads:[~2018-06-28 11:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-28  7:39 [PATCH v2 0/5] Fixes coding style in xilinx_emaclite.c Radhey Shyam Pandey
2018-06-28  7:39 ` [PATCH v2 1/5] net: emaclite: Use __func__ instead of hardcoded name Radhey Shyam Pandey
2018-06-28  7:39 ` [PATCH v2 2/5] net: emaclite: Simplify if-else statements Radhey Shyam Pandey
2018-06-28 11:04   ` Joe Perches [this message]
2018-06-28  7:39 ` [PATCH v2 3/5] net: emaclite: update kernel-doc comments Radhey Shyam Pandey
2018-06-28  7:39 ` [PATCH v2 4/5] net: emaclite: Fix block comments style Radhey Shyam Pandey
2018-06-28  7:39 ` [PATCH v2 5/5] net: emaclite: Remove unnecessary spaces Radhey Shyam Pandey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fc15913c3800923ef35e9db9508cbb9f67d0525f.camel@perches.com \
    --to=joe@perches.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=radhey.shyam.pandey@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox