All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] phy: stm32: Fix printing of wrong uninitialized port number
@ 2018-04-05  9:46 ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-04-05  9:46 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Maxime Coquelin, Alexandre Torgue, Delaunay
  Cc: linux-arm-kernel, linux-kernel, Geert Uytterhoeven

drivers/phy/st/phy-stm32-usbphyc.c: In function ‘stm32_usbphyc_probe’:
drivers/phy/st/phy-stm32-usbphyc.c:364: warning: ‘i’ may be used uninitialized in this function

Indeed, during the first loop iteration, "i" is uninitialized.
However, "i" does not represent the intended PHY instance number to
print.

Fix this by printing the correct variable instead.

Fixes: 94c358da3a054520 ("phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/phy/st/phy-stm32-usbphyc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
index bc4e78a19c913dc9..1f682c176fd6239e 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -367,8 +367,8 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
 		if (IS_ERR(phy)) {
 			ret = PTR_ERR(phy);
 			if (ret != -EPROBE_DEFER)
-				dev_err(dev,
-					"failed to create phy%d: %d\n", i, ret);
+				dev_err(dev, "failed to create phy%d: %d\n",
+					port, ret);
 			goto put_child;
 		}
 
-- 
2.7.4

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

* [PATCH] phy: stm32: Fix printing of wrong uninitialized port number
@ 2018-04-05  9:46 ` Geert Uytterhoeven
  0 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2018-04-05  9:46 UTC (permalink / raw)
  To: linux-arm-kernel

drivers/phy/st/phy-stm32-usbphyc.c: In function ?stm32_usbphyc_probe?:
drivers/phy/st/phy-stm32-usbphyc.c:364: warning: ?i? may be used uninitialized in this function

Indeed, during the first loop iteration, "i" is uninitialized.
However, "i" does not represent the intended PHY instance number to
print.

Fix this by printing the correct variable instead.

Fixes: 94c358da3a054520 ("phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)")
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---
 drivers/phy/st/phy-stm32-usbphyc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c
index bc4e78a19c913dc9..1f682c176fd6239e 100644
--- a/drivers/phy/st/phy-stm32-usbphyc.c
+++ b/drivers/phy/st/phy-stm32-usbphyc.c
@@ -367,8 +367,8 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
 		if (IS_ERR(phy)) {
 			ret = PTR_ERR(phy);
 			if (ret != -EPROBE_DEFER)
-				dev_err(dev,
-					"failed to create phy%d: %d\n", i, ret);
+				dev_err(dev, "failed to create phy%d: %d\n",
+					port, ret);
 			goto put_child;
 		}
 
-- 
2.7.4

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

* RE: [PATCH] phy: stm32: Fix printing of wrong uninitialized port number
  2018-04-05  9:46 ` Geert Uytterhoeven
@ 2018-04-05 10:49   ` Amelie DELAUNAY
  -1 siblings, 0 replies; 4+ messages in thread
From: Amelie DELAUNAY @ 2018-04-05 10:49 UTC (permalink / raw)
  To: Geert Uytterhoeven, Kishon Vijay Abraham I, Maxime Coquelin,
	Alexandre TORGUE
  Cc: linux-arm-kernel, linux-kernel

Hi Geert,

Just to let you know, this warning is already fixed by a pending patch I've sent two weeks ago: https://lkml.org/lkml/2018/3/20/424.

Thanks,
Amelie

> -----Original Message-----
> From: Geert Uytterhoeven [mailto:geert@linux-m68k.org]
> Sent: jeudi 5 avril 2018 11:47
> To: Kishon Vijay Abraham I <kishon@ti.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; Alexandre TORGUE
> <alexandre.torgue@st.com>; Amelie DELAUNAY <amelie.delaunay@st.com>
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org;
> Geert Uytterhoeven <geert@linux-m68k.org>
> Subject: [PATCH] phy: stm32: Fix printing of wrong uninitialized port number
> 
> drivers/phy/st/phy-stm32-usbphyc.c: In function ‘stm32_usbphyc_probe’:
> drivers/phy/st/phy-stm32-usbphyc.c:364: warning: ‘i’ may be used
> uninitialized in this function
> 
> Indeed, during the first loop iteration, "i" is uninitialized.
> However, "i" does not represent the intended PHY instance number to print.
> 
> Fix this by printing the correct variable instead.
> 
> Fixes: 94c358da3a054520 ("phy: stm32: add support for STM32 USB PHY
> Controller (USBPHYC)")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  drivers/phy/st/phy-stm32-usbphyc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-
> stm32-usbphyc.c
> index bc4e78a19c913dc9..1f682c176fd6239e 100644
> --- a/drivers/phy/st/phy-stm32-usbphyc.c
> +++ b/drivers/phy/st/phy-stm32-usbphyc.c
> @@ -367,8 +367,8 @@ static int stm32_usbphyc_probe(struct
> platform_device *pdev)
>  		if (IS_ERR(phy)) {
>  			ret = PTR_ERR(phy);
>  			if (ret != -EPROBE_DEFER)
> -				dev_err(dev,
> -					"failed to create phy%d: %d\n", i, ret);
> +				dev_err(dev, "failed to create phy%d: %d\n",
> +					port, ret);
>  			goto put_child;
>  		}
> 
> --
> 2.7.4

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

* [PATCH] phy: stm32: Fix printing of wrong uninitialized port number
@ 2018-04-05 10:49   ` Amelie DELAUNAY
  0 siblings, 0 replies; 4+ messages in thread
From: Amelie DELAUNAY @ 2018-04-05 10:49 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Geert,

Just to let you know, this warning is already fixed by a pending patch I've sent two weeks ago: https://lkml.org/lkml/2018/3/20/424.

Thanks,
Amelie

> -----Original Message-----
> From: Geert Uytterhoeven [mailto:geert at linux-m68k.org]
> Sent: jeudi 5 avril 2018 11:47
> To: Kishon Vijay Abraham I <kishon@ti.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>; Alexandre TORGUE
> <alexandre.torgue@st.com>; Amelie DELAUNAY <amelie.delaunay@st.com>
> Cc: linux-arm-kernel at lists.infradead.org; linux-kernel at vger.kernel.org;
> Geert Uytterhoeven <geert@linux-m68k.org>
> Subject: [PATCH] phy: stm32: Fix printing of wrong uninitialized port number
> 
> drivers/phy/st/phy-stm32-usbphyc.c: In function ?stm32_usbphyc_probe?:
> drivers/phy/st/phy-stm32-usbphyc.c:364: warning: ?i? may be used
> uninitialized in this function
> 
> Indeed, during the first loop iteration, "i" is uninitialized.
> However, "i" does not represent the intended PHY instance number to print.
> 
> Fix this by printing the correct variable instead.
> 
> Fixes: 94c358da3a054520 ("phy: stm32: add support for STM32 USB PHY
> Controller (USBPHYC)")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
>  drivers/phy/st/phy-stm32-usbphyc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-
> stm32-usbphyc.c
> index bc4e78a19c913dc9..1f682c176fd6239e 100644
> --- a/drivers/phy/st/phy-stm32-usbphyc.c
> +++ b/drivers/phy/st/phy-stm32-usbphyc.c
> @@ -367,8 +367,8 @@ static int stm32_usbphyc_probe(struct
> platform_device *pdev)
>  		if (IS_ERR(phy)) {
>  			ret = PTR_ERR(phy);
>  			if (ret != -EPROBE_DEFER)
> -				dev_err(dev,
> -					"failed to create phy%d: %d\n", i, ret);
> +				dev_err(dev, "failed to create phy%d: %d\n",
> +					port, ret);
>  			goto put_child;
>  		}
> 
> --
> 2.7.4

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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05  9:46 [PATCH] phy: stm32: Fix printing of wrong uninitialized port number Geert Uytterhoeven
2018-04-05  9:46 ` Geert Uytterhoeven
2018-04-05 10:49 ` Amelie DELAUNAY
2018-04-05 10:49   ` Amelie DELAUNAY

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.