mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Dan Carpenter <dan.carpenter@oracle.com>, kbuild@01.org
Cc: kbuild-all@01.org, lee.jones@linaro.org, gwendal@chromium.org,
	drinkcat@chromium.org, linux-kernel@vger.kernel.org,
	groeck@chromium.org, kernel@collabora.com, bleung@chromium.org,
	Olof Johansson <olof@lixom.net>
Subject: Re: [PATCH 5/7] mfd / platform: cros_ec: move device sysfs attributes to its own driver.
Date: Thu, 29 Nov 2018 15:43:14 +0100	[thread overview]
Message-ID: <43f05051-b1ad-88a9-abea-2111fbc2be94@collabora.com> (raw)
In-Reply-To: <20181129112141.GR3073@unbuntlaptop>

Hi Dan,

On 29/11/18 12:21, Dan Carpenter wrote:
> Hi Enric,
> 
> I love your patch! Perhaps something to improve:
> 
> url:    https://github.com/0day-ci/linux/commits/Enric-Balletbo-i-Serra/mfd-cros_ec-use-devm_mfd_add_devices/20181123-025253
> 
> smatch warnings:
> drivers/platform/chrome/cros_ec_sysfs.c:366 cros_ec_sysfs_probe() warn: variable dereferenced before check 'ec_dev' (see line 362)
> 
> # https://github.com/0day-ci/linux/commit/b3074e331f36fff8890e7bd5c1f5874f4c59d38f
> git remote add linux-review https://github.com/0day-ci/linux
> git remote update linux-review
> git checkout b3074e331f36fff8890e7bd5c1f5874f4c59d38f
> vim +/ec_dev +366 drivers/platform/chrome/cros_ec_sysfs.c
> 
> b3074e33 Enric Balletbo i Serra 2018-11-22  358  
> b3074e33 Enric Balletbo i Serra 2018-11-22  359  static int cros_ec_sysfs_probe(struct platform_device *pd)
> b3074e33 Enric Balletbo i Serra 2018-11-22  360  {
> b3074e33 Enric Balletbo i Serra 2018-11-22  361  	struct cros_ec_dev *ec_dev = dev_get_drvdata(pd->dev.parent);
> b3074e33 Enric Balletbo i Serra 2018-11-22 @362  	struct cros_ec_platform *ec_platform = dev_get_platdata(ec_dev->dev);
>                                                                                                                 ^^^^^^^^^^^
> b3074e33 Enric Balletbo i Serra 2018-11-22  363  	struct device *dev = &pd->dev;
> b3074e33 Enric Balletbo i Serra 2018-11-22  364  	int ret;
> b3074e33 Enric Balletbo i Serra 2018-11-22  365  
> b3074e33 Enric Balletbo i Serra 2018-11-22 @366  	if (!ec_dev) {
>                                                              ^^^^^^
> Presumable this test can be removed?
> 

Yes, Guenter detected this and I already sent another patchset that removes
this. Thanks.

> b3074e33 Enric Balletbo i Serra 2018-11-22  367  		dev_err(dev, "No EC dev found\n");
> b3074e33 Enric Balletbo i Serra 2018-11-22  368  		return -EINVAL;
> b3074e33 Enric Balletbo i Serra 2018-11-22  369  	}
> b3074e33 Enric Balletbo i Serra 2018-11-22  370  
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 

I had this question on my mind for some time but I didn't look for an answer, in
fact, I'm not sure if I already asked you this before, sorry about that if I
did, the question is. There is a easy way to run your smatch scripts locally to
check the patch before I send to the ML?

Best regards,
 Enric

  reply	other threads:[~2018-11-29 14:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 11:33 [PATCH 0/7] mfd / platform: cros_ec: move cros_ec sysfs attributes to its own drivers Enric Balletbo i Serra
2018-11-22 11:33 ` [PATCH 1/7] mfd: cros_ec: use devm_mfd_add_devices Enric Balletbo i Serra
2018-11-22 11:33 ` [PATCH 2/7] mfd / platform: cros_ec: move lightbar attributes to its own driver Enric Balletbo i Serra
2018-11-22 17:41   ` Guenter Roeck
2018-11-23 11:52     ` Enric Balletbo i Serra
2018-11-23 12:03       ` Guenter Roeck
2018-11-22 11:33 ` [PATCH 3/7] mfd / platform: cros_ec: move vbc " Enric Balletbo i Serra
2018-11-22 11:33 ` [PATCH 4/7] mfd / platform: cros_ec: move debugfs " Enric Balletbo i Serra
2018-11-22 18:52   ` Guenter Roeck
2018-11-22 11:33 ` [PATCH 5/7] mfd / platform: cros_ec: move device sysfs " Enric Balletbo i Serra
2018-11-22 19:09   ` Guenter Roeck
2018-11-29 11:21   ` Dan Carpenter
2018-11-29 14:43     ` Enric Balletbo i Serra [this message]
2018-11-29 14:56       ` Dan Carpenter
2018-11-22 11:33 ` [PATCH 6/7] mfd / platform: cros_ec: instantiate only if th EC has a VBC NVRAM Enric Balletbo i Serra
2018-11-22 19:14   ` Guenter Roeck
2018-11-23 10:37     ` Enric Balletbo i Serra
2018-11-22 11:33 ` [PATCH 7/7] platform/chrome: cros_ec_lightbar: instantiate only if the EC has a lightbar Enric Balletbo i Serra
2018-11-22 19:25   ` Guenter Roeck
2018-11-23 11:10     ` Enric Balletbo i Serra
2018-11-23 11:39       ` Guenter Roeck

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=43f05051-b1ad-88a9-abea-2111fbc2be94@collabora.com \
    --to=enric.balletbo@collabora.com \
    --cc=bleung@chromium.org \
    --cc=dan.carpenter@oracle.com \
    --cc=drinkcat@chromium.org \
    --cc=groeck@chromium.org \
    --cc=gwendal@chromium.org \
    --cc=kbuild-all@01.org \
    --cc=kbuild@01.org \
    --cc=kernel@collabora.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olof@lixom.net \
    /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

all inboxes | Powered by JetHome®