mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: kbuild test robot <lkp@intel.com>
Cc: kbuild-all@01.org, MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extcon: Allow registering a single notifier for all cables on an extcon_dev
Date: Sun, 19 Mar 2017 19:18:51 +0100	[thread overview]
Message-ID: <447bfb17-e735-e700-0ff3-982b079cf865@redhat.com> (raw)
In-Reply-To: <201703192109.PLGQIwS9%fengguang.wu@intel.com>

Hi,

On 19-03-17 14:06, kbuild test robot wrote:
> Hi Hans,
>
> [auto build test WARNING on chanwoo-extcon/extcon-next]
> [also build test WARNING on v4.11-rc2 next-20170310]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
>
> url:    https://github.com/0day-ci/linux/commits/Hans-de-Goede/extcon-Allow-registering-a-single-notifier-for-all-cables-on-an-extcon_dev/20170319-204610
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon.git extcon-next
> config: i386-randconfig-x072-201712 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386
>
> Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
>
> All warnings (new ones prefixed by >>):
>
>    drivers/extcon/extcon.c: In function 'extcon_unregister_notifier':
>>> drivers/extcon/extcon.c:962:48: warning: 'idx' may be used uninitialized in this function [-Wmaybe-uninitialized]
>       ret = raw_notifier_chain_unregister(&edev->nh[idx], nb);

I was already afraid this would happen, I was actually pleasantly surprised
when I did not get this warning during my own testing. But it seems other
compiler versions are not as smart as the very recent gcc I'm using.

I'll send a v2 fixing this.

Regards,

Hans




>                                                    ^
>
> vim +/idx +962 drivers/extcon/extcon.c
>
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  946  				struct notifier_block *nb)
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  947  {
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  948  	unsigned long flags;
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19  949  	int ret, idx;
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19  950
> 7eae43ae drivers/extcon/extcon.c       Chanwoo Choi  2015-06-21  951  	if (!edev || !nb)
> 7eae43ae drivers/extcon/extcon.c       Chanwoo Choi  2015-06-21  952  		return -EINVAL;
> 7eae43ae drivers/extcon/extcon.c       Chanwoo Choi  2015-06-21  953
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  954  	if ((int)id != -1) {
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19  955  		idx = find_cable_index_by_id(edev, id);
> a05f44c8 drivers/extcon/extcon.c       Stephen Boyd  2016-06-23  956  		if (idx < 0)
> a05f44c8 drivers/extcon/extcon.c       Stephen Boyd  2016-06-23  957  			return idx;
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  958  	}
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  959
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  960  	spin_lock_irqsave(&edev->lock, flags);
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  961  	if ((int)id != -1)
> 046050f6 drivers/extcon/extcon.c       Chanwoo Choi  2015-05-19 @962  		ret = raw_notifier_chain_unregister(&edev->nh[idx], nb);
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  963  	else
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  964  		ret = raw_notifier_chain_unregister(&edev->nh_all, nb);
> 8f482488 drivers/extcon/extcon.c       Hans de Goede 2017-03-17  965
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  966  	spin_unlock_irqrestore(&edev->lock, flags);
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  967
> 66bee35f drivers/extcon/extcon.c       Hans de Goede 2015-03-21  968  	return ret;
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  969  }
> 74c5d09b drivers/extcon/extcon_class.c Donggeun Kim  2012-04-20  970  EXPORT_SYMBOL_GPL(extcon_unregister_notifier);
>
> :::::: The code at line 962 was first introduced by commit
> :::::: 046050f6e623e442e9c71c525462ebd395dae526 extcon: Update the prototype of extcon_register_notifier() with enum extcon
>
> :::::: TO: Chanwoo Choi <cw00.choi@samsung.com>
> :::::: CC: Chanwoo Choi <cw00.choi@samsung.com>
>
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
>

      reply	other threads:[~2017-03-19 18:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17  8:46 Hans de Goede
2017-03-19 13:06 ` kbuild test robot
2017-03-19 18:18   ` Hans de Goede [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=447bfb17-e735-e700-0ff3-982b079cf865@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=cw00.choi@samsung.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=myungjoo.ham@samsung.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

Powered by JetHome