LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used uninitialized in this function
@ 2018-05-31 12:23 kbuild test robot
  2018-05-31 17:08 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2018-05-31 12:23 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: kbuild-all, linux-kernel, Kishon Vijay Abraham I, Rob Herring

[-- Attachment #1: Type: text/plain, Size: 2201 bytes --]

Hi Tony,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   88a867653065dc14b0fdeeb626efb8d7ebe39be5
commit: 5d1ebbda0318b1ba55eaa1fae3fd867af17b0774 phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4
date:   3 months ago
config: x86_64-randconfig-s5-05311957 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        git checkout 5d1ebbda0318b1ba55eaa1fae3fd867af17b0774
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   #'target_mem_ref' not supported by expression#'drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_status':
>> drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used uninitialized in this function [-Wuninitialized]
      val |= values[i] << i;
             ~~~~~~^~~

vim +188 drivers/phy/motorola/phy-mapphone-mdm6600.c

   166	
   167	/**
   168	 * phy_mdm6600_status() - read mdm6600 status lines
   169	 * @ddata: device driver data
   170	 */
   171	static void phy_mdm6600_status(struct work_struct *work)
   172	{
   173		struct phy_mdm6600 *ddata;
   174		struct device *dev;
   175		int values[PHY_MDM6600_NR_STATUS_LINES];
   176		int error, i, val = 0;
   177	
   178		ddata = container_of(work, struct phy_mdm6600, status_work.work);
   179		dev = ddata->dev;
   180	
   181		error = gpiod_get_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES,
   182						       ddata->status_gpios->desc,
   183						       values);
   184		if (error)
   185			return;
   186	
   187		for (i = 0; i < PHY_MDM6600_NR_CMD_LINES; i++) {
 > 188			val |= values[i] << i;
   189			dev_dbg(ddata->dev, "XXX %s: i: %i values[i]: %i val: %i\n",
   190				__func__, i, values[i], val);
   191		}
   192		ddata->status = val;
   193	
   194		dev_info(dev, "modem status: %i %s\n",
   195			 ddata->status,
   196			 phy_mdm6600_status_name[ddata->status & 7]);
   197		complete(&ddata->ack);
   198	}
   199	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28617 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used uninitialized in this function
  2018-05-31 12:23 drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning: is used uninitialized in this function kbuild test robot
@ 2018-05-31 17:08 ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2018-05-31 17:08 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, linux-kernel, Kishon Vijay Abraham I, Rob Herring

* kbuild test robot <lkp@intel.com> [180531 12:26]:
> Hi Tony,
> 
> FYI, the error/warning still remains.

Oh OK. I just resent the fix separately as "[PATCH] phy: mapphone-mdm6600: Fix
wrong enum used for status lines". The previous fix was sent as a response
to your mail and that probably caused it to be lost in patchwork or something.

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used uninitialized in this function
  2018-04-18 17:46 kbuild test robot
@ 2018-04-27 16:05 ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2018-04-27 16:05 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, linux-kernel, Kishon Vijay Abraham I, Rob Herring

Hi,

* kbuild test robot <lkp@intel.com> [180418 17:48]:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   a27fc14219f2e3c4a46ba9177b04d9b52c875532
> commit: 5d1ebbda0318b1ba55eaa1fae3fd867af17b0774 phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4
> date:   5 weeks ago
> config: x86_64-randconfig-a0-04190121 (attached as .config)
> compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
> reproduce:
>         git checkout 5d1ebbda0318b1ba55eaa1fae3fd867af17b0774
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All warnings (new ones prefixed by >>):
> 
>    #'target_mem_ref' not supported by expression#'drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_status':
> >> drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used uninitialized in this function [-Wuninitialized]
>       val |= values[i] << i;
>              ~~~~~~^~~

Thanks for the report and sorry for the delay in responding. Looks
like gpiod_get_array_value_cansleep initializes values. But we do
have wrong defines here, see the patch belwo.

Not sure if that is enough to fix the warning here though? I'm not
seeing the warning here with gcc-7.3.0 binutils-2.30.

Regards,

Tony

8< ---------------------
>From tony Mon Sep 17 00:00:00 2001
From: Tony Lindgren <tony@atomide.com>
Date: Wed, 25 Apr 2018 07:47:57 -0700
Subject: [PATCH] phy: mapphone-mdm6600: Fix wrong enum used for status
 lines

Kbuilt test robot reported:

drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used
uninitialized in this function [-Wuninitialized]
        val |= values[i] << i;
               ~~~~~~^~~

Looking at the phy_mdm6600_status() values does get initialized by
gpiod_get_array_value_cansleep(), but we are using wrong enum
in that function. Let's fix the use, both end up being three though
so urgent rush on this one AFAIK.

Fixes: 5d1ebbda0318 ("phy: mapphone-mdm6600: Add USB PHY driver for
MDM6600 on Droid 4")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/phy/motorola/phy-mapphone-mdm6600.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
+++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
@@ -178,13 +178,13 @@ static void phy_mdm6600_status(struct work_struct *work)
 	ddata = container_of(work, struct phy_mdm6600, status_work.work);
 	dev = ddata->dev;
 
-	error = gpiod_get_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES,
+	error = gpiod_get_array_value_cansleep(PHY_MDM6600_NR_STATUS_LINES,
 					       ddata->status_gpios->desc,
 					       values);
 	if (error)
 		return;
 
-	for (i = 0; i < PHY_MDM6600_NR_CMD_LINES; i++) {
+	for (i = 0; i < PHY_MDM6600_NR_STATUS_LINES; i++) {
 		val |= values[i] << i;
 		dev_dbg(ddata->dev, "XXX %s: i: %i values[i]: %i val: %i\n",
 			__func__, i, values[i], val);
-- 
2.17.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used uninitialized in this function
@ 2018-04-18 17:46 kbuild test robot
  2018-04-27 16:05 ` Tony Lindgren
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2018-04-18 17:46 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: kbuild-all, linux-kernel, Kishon Vijay Abraham I, Rob Herring

[-- Attachment #1: Type: text/plain, Size: 2151 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   a27fc14219f2e3c4a46ba9177b04d9b52c875532
commit: 5d1ebbda0318b1ba55eaa1fae3fd867af17b0774 phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4
date:   5 weeks ago
config: x86_64-randconfig-a0-04190121 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-16) 7.3.0
reproduce:
        git checkout 5d1ebbda0318b1ba55eaa1fae3fd867af17b0774
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All warnings (new ones prefixed by >>):

   #'target_mem_ref' not supported by expression#'drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_status':
>> drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning:  is used uninitialized in this function [-Wuninitialized]
      val |= values[i] << i;
             ~~~~~~^~~

vim +188 drivers/phy/motorola/phy-mapphone-mdm6600.c

   166	
   167	/**
   168	 * phy_mdm6600_status() - read mdm6600 status lines
   169	 * @ddata: device driver data
   170	 */
   171	static void phy_mdm6600_status(struct work_struct *work)
   172	{
   173		struct phy_mdm6600 *ddata;
   174		struct device *dev;
   175		int values[PHY_MDM6600_NR_STATUS_LINES];
   176		int error, i, val = 0;
   177	
   178		ddata = container_of(work, struct phy_mdm6600, status_work.work);
   179		dev = ddata->dev;
   180	
   181		error = gpiod_get_array_value_cansleep(PHY_MDM6600_NR_CMD_LINES,
   182						       ddata->status_gpios->desc,
   183						       values);
   184		if (error)
   185			return;
   186	
   187		for (i = 0; i < PHY_MDM6600_NR_CMD_LINES; i++) {
 > 188			val |= values[i] << i;
   189			dev_dbg(ddata->dev, "XXX %s: i: %i values[i]: %i val: %i\n",
   190				__func__, i, values[i], val);
   191		}
   192		ddata->status = val;
   193	
   194		dev_info(dev, "modem status: %i %s\n",
   195			 ddata->status,
   196			 phy_mdm6600_status_name[ddata->status & 7]);
   197		complete(&ddata->ack);
   198	}
   199	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31597 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-31 17:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 12:23 drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: warning: is used uninitialized in this function kbuild test robot
2018-05-31 17:08 ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2018-04-18 17:46 kbuild test robot
2018-04-27 16:05 ` Tony Lindgren

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).