netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Huacai Chen <chenhc@lemote.com>,
	Giuseppe Cavallaro <peppe.cavallaro@st.com>
Cc: Vince Bridgers <vbridgers2013@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] stmmac: platform: Move plat_dat checking earlier
Date: Thu, 27 Nov 2014 15:52:20 +0300	[thread overview]
Message-ID: <54771E84.20806@cogentembedded.com> (raw)
In-Reply-To: <1417058072-22527-1-git-send-email-chenhc@lemote.com>

Hello.

On 11/27/2014 6:14 AM, Huacai Chen wrote:

> Original code only check/alloc plat_dat for the CONFIG_OF case, this
> patch check/alloc it earlier and unconditionally to avoid kernel build
> warnings:

> drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:275
> stmmac_pltfr_probe() warn: variable dereferenced before check 'plat_dat'

> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
>   .../net/ethernet/stmicro/stmmac/stmmac_platform.c  |   18 +++++++++---------
>   1 files changed, 9 insertions(+), 9 deletions(-)

> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 5b0da39..d254950 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -265,6 +265,15 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
>
>   	plat_dat = dev_get_platdata(&pdev->dev);
>
> +	if (!plat_dat)
> +		plat_dat = devm_kzalloc(&pdev->dev,
> +				sizeof(struct plat_stmmacenet_data),
> +				GFP_KERNEL);

    Please start the continuation lines exactly under & on the first line.

[...]

WBR, Sergei

      reply	other threads:[~2014-11-27 12:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27  3:14 [PATCH] stmmac: platform: Move plat_dat checking earlier Huacai Chen
2014-11-27 12:52 ` Sergei Shtylyov [this message]

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=54771E84.20806@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=chenhc@lemote.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=vbridgers2013@gmail.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;
as well as URLs for NNTP newsgroup(s).