linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: ralink: phy-mt7621-pci: properly print pointer address
@ 2021-05-07  6:01 Sergio Paracuellos
  2021-05-07  6:27 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sergio Paracuellos @ 2021-05-07  6:01 UTC (permalink / raw)
  To: vkoul
  Cc: linux-phy, kishon, linux-kernel, linux-staging, gregkh, neil,
	ilya.lipnitskiy, kernel test robot

The way of printing the pointer address for the 'port_base'
address got into compile warnings on some architectures
[-Wpointer-to-int-cast]. Instead of use '%08x' and cast
to an 'unsigned int' just make use of '%px' and avoid the
cast.

Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
---
 drivers/phy/ralink/phy-mt7621-pci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/ralink/phy-mt7621-pci.c b/drivers/phy/ralink/phy-mt7621-pci.c
index 753cb5bab930..4705931fb072 100644
--- a/drivers/phy/ralink/phy-mt7621-pci.c
+++ b/drivers/phy/ralink/phy-mt7621-pci.c
@@ -272,8 +272,8 @@ static struct phy *mt7621_pcie_phy_of_xlate(struct device *dev,
 
 	mt7621_phy->has_dual_port = args->args[0];
 
-	dev_info(dev, "PHY for 0x%08x (dual port = %d)\n",
-		 (unsigned int)mt7621_phy->port_base, mt7621_phy->has_dual_port);
+	dev_info(dev, "PHY for 0x%px (dual port = %d)\n",
+		 mt7621_phy->port_base, mt7621_phy->has_dual_port);
 
 	return mt7621_phy->phy;
 }
-- 
2.25.1


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

* Re: [PATCH] phy: ralink: phy-mt7621-pci: properly print pointer address
  2021-05-07  6:01 [PATCH] phy: ralink: phy-mt7621-pci: properly print pointer address Sergio Paracuellos
@ 2021-05-07  6:27 ` Greg KH
  2021-05-07  6:41   ` Sergio Paracuellos
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-05-07  6:27 UTC (permalink / raw)
  To: Sergio Paracuellos
  Cc: vkoul, linux-phy, kishon, linux-kernel, linux-staging, neil,
	ilya.lipnitskiy, kernel test robot

On Fri, May 07, 2021 at 08:01:42AM +0200, Sergio Paracuellos wrote:
> The way of printing the pointer address for the 'port_base'
> address got into compile warnings on some architectures
> [-Wpointer-to-int-cast]. Instead of use '%08x' and cast
> to an 'unsigned int' just make use of '%px' and avoid the
> cast.
> 
> Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  drivers/phy/ralink/phy-mt7621-pci.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/ralink/phy-mt7621-pci.c b/drivers/phy/ralink/phy-mt7621-pci.c
> index 753cb5bab930..4705931fb072 100644
> --- a/drivers/phy/ralink/phy-mt7621-pci.c
> +++ b/drivers/phy/ralink/phy-mt7621-pci.c
> @@ -272,8 +272,8 @@ static struct phy *mt7621_pcie_phy_of_xlate(struct device *dev,
>  
>  	mt7621_phy->has_dual_port = args->args[0];
>  
> -	dev_info(dev, "PHY for 0x%08x (dual port = %d)\n",
> -		 (unsigned int)mt7621_phy->port_base, mt7621_phy->has_dual_port);
> +	dev_info(dev, "PHY for 0x%px (dual port = %d)\n",
> +		 mt7621_phy->port_base, mt7621_phy->has_dual_port);

This whole message should be dropped as drivers should be quiet if all
is going well, and only print messages when things go wrong.

And why cc: linux-staging?

thanks,

greg k-h

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

* Re: [PATCH] phy: ralink: phy-mt7621-pci: properly print pointer address
  2021-05-07  6:27 ` Greg KH
@ 2021-05-07  6:41   ` Sergio Paracuellos
  0 siblings, 0 replies; 3+ messages in thread
From: Sergio Paracuellos @ 2021-05-07  6:41 UTC (permalink / raw)
  To: Greg KH
  Cc: Vinod Koul, linux-phy, Kishon Vijay Abraham I, linux-kernel,
	linux-staging, NeilBrown, Ilya Lipnitskiy, kernel test robot

Hi,

On Fri, May 7, 2021 at 8:27 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Fri, May 07, 2021 at 08:01:42AM +0200, Sergio Paracuellos wrote:
> > The way of printing the pointer address for the 'port_base'
> > address got into compile warnings on some architectures
> > [-Wpointer-to-int-cast]. Instead of use '%08x' and cast
> > to an 'unsigned int' just make use of '%px' and avoid the
> > cast.
> >
> > Fixes: d87da32372a0 ("phy: ralink: Add PHY driver for MT7621 PCIe PHY")
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> > ---
> >  drivers/phy/ralink/phy-mt7621-pci.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/phy/ralink/phy-mt7621-pci.c b/drivers/phy/ralink/phy-mt7621-pci.c
> > index 753cb5bab930..4705931fb072 100644
> > --- a/drivers/phy/ralink/phy-mt7621-pci.c
> > +++ b/drivers/phy/ralink/phy-mt7621-pci.c
> > @@ -272,8 +272,8 @@ static struct phy *mt7621_pcie_phy_of_xlate(struct device *dev,
> >
> >       mt7621_phy->has_dual_port = args->args[0];
> >
> > -     dev_info(dev, "PHY for 0x%08x (dual port = %d)\n",
> > -              (unsigned int)mt7621_phy->port_base, mt7621_phy->has_dual_port);
> > +     dev_info(dev, "PHY for 0x%px (dual port = %d)\n",
> > +              mt7621_phy->port_base, mt7621_phy->has_dual_port);
>
> This whole message should be dropped as drivers should be quiet if all
> is going well, and only print messages when things go wrong.

Got it. Will move this into dev_dbg instead. Thanks.

>
> And why cc: linux-staging?

True, sorry for that. Ctrl + r search for previous git send-mail and I
forgot to drop staging from there.

>
> thanks,
>
> greg k-h

Best regards,
    Sergio Paracuellos

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

end of thread, other threads:[~2021-05-07  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07  6:01 [PATCH] phy: ralink: phy-mt7621-pci: properly print pointer address Sergio Paracuellos
2021-05-07  6:27 ` Greg KH
2021-05-07  6:41   ` Sergio Paracuellos

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