linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()
@ 2025-06-17 20:45 pip-izony
  2025-06-18  6:02 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: pip-izony @ 2025-06-17 20:45 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, pip-izony

The variable `of_match` was incorrectly declared as a `bool`.
It is assigned the return value of of_match_device(), which is a pointer of
type `const struct of_device_id *`.

Signed-off-by: pip-izony <eeodqql09@gmail.com>
---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6dab142e7278..49eb874b1d81 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
-- 
2.43.0


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

* Re: [PATCH] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()
  2025-06-17 20:45 [PATCH] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe() pip-izony
@ 2025-06-18  6:02 ` Greg Kroah-Hartman
  2025-06-18 19:27   ` Seungjin Bae
  0 siblings, 1 reply; 6+ messages in thread
From: Greg Kroah-Hartman @ 2025-06-18  6:02 UTC (permalink / raw)
  To: pip-izony; +Cc: Mathias Nyman, linux-usb, linux-kernel

On Tue, Jun 17, 2025 at 04:45:00PM -0400, pip-izony wrote:
> The variable `of_match` was incorrectly declared as a `bool`.
> It is assigned the return value of of_match_device(), which is a pointer of
> type `const struct of_device_id *`.
> 
> Signed-off-by: pip-izony <eeodqql09@gmail.com>

We need a real name here, please.

Also, what commit id does this fix?

And finally, how is this even building if the type is wrong?

confused,

greg k-h

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

* [PATCH] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()
  2025-06-18  6:02 ` Greg Kroah-Hartman
@ 2025-06-18 19:27   ` Seungjin Bae
  2025-06-19  4:01     ` Greg Kroah-Hartman
  0 siblings, 1 reply; 6+ messages in thread
From: Seungjin Bae @ 2025-06-18 19:27 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, pip-izony

From: pip-izony <eeodqql09@gmail.com>

The variable `of_match` was incorrectly declared as a `bool`.
It is assigned the return value of of_match_device(), which is a pointer of
type `const struct of_device_id *`.

Fixes: 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")

Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>
---
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6dab142e7278..49eb874b1d81 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
-- 
2.43.0

Hello Greg,

Thank you for your review and the helpful feedback.

I've corrected Signed-off-by line to use my real name.
I also updated Fixes tag in the commit.

Regarding the original issue:
I'm not exactly sure why the compiler didn't catch this,
but I assume implicit casting from pointer to bool is allowed in this context.

Thank you for your email!

Best regards,
Seungjin Bae

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

* Re: [PATCH] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()
  2025-06-18 19:27   ` Seungjin Bae
@ 2025-06-19  4:01     ` Greg Kroah-Hartman
  2025-06-19  5:45       ` [PATCH v3] " Seungjin Bae
  2025-06-19  5:57       ` [PATCH v4] " Seungjin Bae
  0 siblings, 2 replies; 6+ messages in thread
From: Greg Kroah-Hartman @ 2025-06-19  4:01 UTC (permalink / raw)
  To: Seungjin Bae; +Cc: Mathias Nyman, linux-usb, linux-kernel

On Wed, Jun 18, 2025 at 03:27:14PM -0400, Seungjin Bae wrote:
> From: pip-izony <eeodqql09@gmail.com>

This line doesn't match up with:

> 
> The variable `of_match` was incorrectly declared as a `bool`.
> It is assigned the return value of of_match_device(), which is a pointer of
> type `const struct of_device_id *`.
> 
> Fixes: 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")
> 
> Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>

That line :(

Also, no need for a blank line after Fixes:

Also:

> ---
>  drivers/usb/host/xhci-plat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
> index 6dab142e7278..49eb874b1d81 100644
> --- a/drivers/usb/host/xhci-plat.c
> +++ b/drivers/usb/host/xhci-plat.c
> @@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
>  	int			ret;
>  	int			irq;
>  	struct xhci_plat_priv	*priv = NULL;
> -	bool			of_match;
> +	const struct of_device_id *of_match;
>  
>  	if (usb_disabled())
>  		return -ENODEV;
> -- 
> 2.43.0
> 
> Hello Greg,
> 
> Thank you for your review and the helpful feedback.
> 
> I've corrected Signed-off-by line to use my real name.
> I also updated Fixes tag in the commit.
> 
> Regarding the original issue:
> I'm not exactly sure why the compiler didn't catch this,
> but I assume implicit casting from pointer to bool is allowed in this context.

That info should go below the --- line, and this is a version 2 of this
change, right?  Take a look at the kernel documentation for how to
number your patch revisions.

thanks,

greg k-h

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

* [PATCH v3] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()
  2025-06-19  4:01     ` Greg Kroah-Hartman
@ 2025-06-19  5:45       ` Seungjin Bae
  2025-06-19  5:57       ` [PATCH v4] " Seungjin Bae
  1 sibling, 0 replies; 6+ messages in thread
From: Seungjin Bae @ 2025-06-19  5:45 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Seungjin Bae

The variable `of_match` was incorrectly declared as a `bool`.
It is assigned the return value of of_match_device(), which is a pointer of
type `const struct of_device_id *`.

Fixes: 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")
Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>
---
 v2 -> v3: Added version of patch and used real name
 v1 -> v2: Updated Fixes tag and corrected Signed-off-by line

 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6dab142e7278..49eb874b1d81 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
-- 
2.43.0


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

* [PATCH v4] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe()
  2025-06-19  4:01     ` Greg Kroah-Hartman
  2025-06-19  5:45       ` [PATCH v3] " Seungjin Bae
@ 2025-06-19  5:57       ` Seungjin Bae
  1 sibling, 0 replies; 6+ messages in thread
From: Seungjin Bae @ 2025-06-19  5:57 UTC (permalink / raw)
  To: Mathias Nyman, Greg Kroah-Hartman; +Cc: linux-usb, linux-kernel, Seungjin Bae

The variable `of_match` was incorrectly declared as a `bool`.
It is assigned the return value of of_match_device(), which is a pointer of
type `const struct of_device_id *`.

Fixes: 16b7e0cccb243 ("USB: xhci-plat: fix legacy PHY double init")
Signed-off-by: Seungjin Bae <eeodqql09@gmail.com>
---
 v3 -> v4: Corrected a typo in the changelog
 v2 -> v3: Added version of patch and used real name
 v1 -> v2: Updated Fixes tag and corrected Signed-off-by line
 
 drivers/usb/host/xhci-plat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 6dab142e7278..49eb874b1d81 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -152,7 +152,7 @@ int xhci_plat_probe(struct platform_device *pdev, struct device *sysdev, const s
 	int			ret;
 	int			irq;
 	struct xhci_plat_priv	*priv = NULL;
-	bool			of_match;
+	const struct of_device_id *of_match;
 
 	if (usb_disabled())
 		return -ENODEV;
-- 
2.43.0


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

end of thread, other threads:[~2025-06-19  5:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17 20:45 [PATCH] usb: host: xhci-plat: fix incorrect type for of_match variable in xhci_plat_probe() pip-izony
2025-06-18  6:02 ` Greg Kroah-Hartman
2025-06-18 19:27   ` Seungjin Bae
2025-06-19  4:01     ` Greg Kroah-Hartman
2025-06-19  5:45       ` [PATCH v3] " Seungjin Bae
2025-06-19  5:57       ` [PATCH v4] " Seungjin Bae

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