From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752463AbdCSSZz (ORCPT ); Sun, 19 Mar 2017 14:25:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41912 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbdCSSZx (ORCPT ); Sun, 19 Mar 2017 14:25:53 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 81E2A3B716 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=hdegoede@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 81E2A3B716 Subject: Re: [PATCH] extcon: Allow registering a single notifier for all cables on an extcon_dev To: kbuild test robot References: <201703192109.PLGQIwS9%fengguang.wu@intel.com> Cc: kbuild-all@01.org, MyungJoo Ham , Chanwoo Choi , linux-kernel@vger.kernel.org From: Hans de Goede Message-ID: <447bfb17-e735-e700-0ff3-982b079cf865@redhat.com> Date: Sun, 19 Mar 2017 19:18:51 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201703192109.PLGQIwS9%fengguang.wu@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Sun, 19 Mar 2017 18:18:55 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > :::::: CC: Chanwoo Choi > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation >