public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: mapphone-mdm6600: add gpiolib dependency
@ 2018-04-04 10:27 Arnd Bergmann
  2018-04-04 11:56 ` Sebastian Reichel
  0 siblings, 1 reply; 3+ messages in thread
From: Arnd Bergmann @ 2018-04-04 10:27 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Arnd Bergmann, Rob Herring, Tony Lindgren,
	Sebastian Reichel
  Cc: linux-kernel

Without gpiolib, the gpiod_get_array_value_cansleep() is an empty stub,
so gcc notices that the resulting array is never initialized:

drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_status':
drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[0]' is used uninitialized in this function [-Werror=uninitialized]
   val |= values[i] << i;
          ~~~~~~^~~
drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[1]' is used uninitialized in this function [-Werror=uninitialized]
drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[2]' is used uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors

With gpiolib enabled, this can't happen and we don't get the warning, so
let's just add a Kconfig dependency for it.

Fixes: 5d1ebbda0318 ("phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4")
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/phy/motorola/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/motorola/Kconfig b/drivers/phy/motorola/Kconfig
index 82651524ffb9..718f8729701d 100644
--- a/drivers/phy/motorola/Kconfig
+++ b/drivers/phy/motorola/Kconfig
@@ -13,7 +13,7 @@ config PHY_CPCAP_USB
 
 config PHY_MAPPHONE_MDM6600
 	tristate "Motorola Mapphone MDM6600 modem USB PHY driver"
-	depends on OF && USB_SUPPORT
+	depends on OF && USB_SUPPORT && GPIOLIB
 	select GENERIC_PHY
 	help
 	  Enable this for MDM6600 USB modem to work on Motorola phones
-- 
2.9.0

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

* Re: [PATCH] phy: mapphone-mdm6600: add gpiolib dependency
  2018-04-04 10:27 [PATCH] phy: mapphone-mdm6600: add gpiolib dependency Arnd Bergmann
@ 2018-04-04 11:56 ` Sebastian Reichel
  2018-04-05 20:28   ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Reichel @ 2018-04-04 11:56 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kishon Vijay Abraham I, Rob Herring, Tony Lindgren, linux-kernel

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

Hi,

On Wed, Apr 04, 2018 at 12:27:19PM +0200, Arnd Bergmann wrote:
> Without gpiolib, the gpiod_get_array_value_cansleep() is an empty stub,
> so gcc notices that the resulting array is never initialized:
> 
> drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_status':
> drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[0]' is used uninitialized in this function [-Werror=uninitialized]
>    val |= values[i] << i;
>           ~~~~~~^~~
> drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[1]' is used uninitialized in this function [-Werror=uninitialized]
> drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[2]' is used uninitialized in this function [-Werror=uninitialized]
> cc1: all warnings being treated as errors
> 
> With gpiolib enabled, this can't happen and we don't get the warning, so
> let's just add a Kconfig dependency for it.
> 
> Fixes: 5d1ebbda0318 ("phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4")
> Cc: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

> ---
>  drivers/phy/motorola/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/phy/motorola/Kconfig b/drivers/phy/motorola/Kconfig
> index 82651524ffb9..718f8729701d 100644
> --- a/drivers/phy/motorola/Kconfig
> +++ b/drivers/phy/motorola/Kconfig
> @@ -13,7 +13,7 @@ config PHY_CPCAP_USB
>  
>  config PHY_MAPPHONE_MDM6600
>  	tristate "Motorola Mapphone MDM6600 modem USB PHY driver"
> -	depends on OF && USB_SUPPORT
> +	depends on OF && USB_SUPPORT && GPIOLIB
>  	select GENERIC_PHY
>  	help
>  	  Enable this for MDM6600 USB modem to work on Motorola phones
> -- 
> 2.9.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] phy: mapphone-mdm6600: add gpiolib dependency
  2018-04-04 11:56 ` Sebastian Reichel
@ 2018-04-05 20:28   ` Tony Lindgren
  0 siblings, 0 replies; 3+ messages in thread
From: Tony Lindgren @ 2018-04-05 20:28 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Arnd Bergmann, Kishon Vijay Abraham I, Rob Herring, linux-kernel

* Sebastian Reichel <sre@kernel.org> [180404 11:57]:
> Hi,
> 
> On Wed, Apr 04, 2018 at 12:27:19PM +0200, Arnd Bergmann wrote:
> > Without gpiolib, the gpiod_get_array_value_cansleep() is an empty stub,
> > so gcc notices that the resulting array is never initialized:
> > 
> > drivers/phy/motorola/phy-mapphone-mdm6600.c: In function 'phy_mdm6600_status':
> > drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[0]' is used uninitialized in this function [-Werror=uninitialized]
> >    val |= values[i] << i;
> >           ~~~~~~^~~
> > drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[1]' is used uninitialized in this function [-Werror=uninitialized]
> > drivers/phy/motorola/phy-mapphone-mdm6600.c:188:16: error: 'values[2]' is used uninitialized in this function [-Werror=uninitialized]
> > cc1: all warnings being treated as errors
> > 
> > With gpiolib enabled, this can't happen and we don't get the warning, so
> > let's just add a Kconfig dependency for it.
> > 
> > Fixes: 5d1ebbda0318 ("phy: mapphone-mdm6600: Add USB PHY driver for MDM6600 on Droid 4")
> > Cc: Tony Lindgren <tony@atomide.com>
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

Acked-by: Tony Lindgren <tony@atomide.com>

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

end of thread, other threads:[~2018-04-05 20:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-04 10:27 [PATCH] phy: mapphone-mdm6600: add gpiolib dependency Arnd Bergmann
2018-04-04 11:56 ` Sebastian Reichel
2018-04-05 20:28   ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox