All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] isdn: hisax: Fix misuse of %x in config.c
@ 2019-04-23  2:25 Fuqian Huang
  2019-04-23  3:24 ` Stephen Hemminger
  2019-04-24  1:33 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Fuqian Huang @ 2019-04-23  2:25 UTC (permalink / raw)
  Cc: Fuqian Huang, Karsten Keil, netdev, linux-kernel

Pointers should be printed with %p or %px rather than
cast to (u_long) type and printed with %lX.
As the function seems to be for debug purpose.
Change %lX to %px to print the pointer value.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
 drivers/isdn/hisax/config.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index b12e6ca..de96511 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1294,9 +1294,9 @@ void HiSax_reportcard(int cardnr, int sel)
 	printk(KERN_DEBUG "HiSax: reportcard No %d\n", cardnr + 1);
 	printk(KERN_DEBUG "HiSax: Type %s\n", CardType[cs->typ]);
 	printk(KERN_DEBUG "HiSax: debuglevel %x\n", cs->debug);
-	printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%lX\n",
-	       (ulong) & HiSax_reportcard);
-	printk(KERN_DEBUG "HiSax: cs 0x%lX\n", (ulong) cs);
+	printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%px\n",
+		HiSax_reportcard);
+	printk(KERN_DEBUG "HiSax: cs 0x%px\n", cs);
 	printk(KERN_DEBUG "HiSax: HW_Flags %lx bc0 flg %lx bc1 flg %lx\n",
 	       cs->HW_Flags, cs->bcs[0].Flag, cs->bcs[1].Flag);
 	printk(KERN_DEBUG "HiSax: bcs 0 mode %d ch%d\n",
-- 
2.11.0


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

* Re: [PATCH] isdn: hisax: Fix misuse of %x in config.c
  2019-04-23  2:25 [PATCH] isdn: hisax: Fix misuse of %x in config.c Fuqian Huang
@ 2019-04-23  3:24 ` Stephen Hemminger
  2019-04-24  1:33 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2019-04-23  3:24 UTC (permalink / raw)
  To: Fuqian Huang; +Cc: Karsten Keil, netdev

On Tue, 23 Apr 2019 10:25:28 +0800
Fuqian Huang <huangfq.daxian@gmail.com> wrote:

> Pointers should be printed with %p or %px rather than
> cast to (u_long) type and printed with %lX.
> As the function seems to be for debug purpose.
> Change %lX to %px to print the pointer value.
> 
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
> ---
>  drivers/isdn/hisax/config.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
> index b12e6ca..de96511 100644
> --- a/drivers/isdn/hisax/config.c
> +++ b/drivers/isdn/hisax/config.c
> @@ -1294,9 +1294,9 @@ void HiSax_reportcard(int cardnr, int sel)
>  	printk(KERN_DEBUG "HiSax: reportcard No %d\n", cardnr + 1);
>  	printk(KERN_DEBUG "HiSax: Type %s\n", CardType[cs->typ]);
>  	printk(KERN_DEBUG "HiSax: debuglevel %x\n", cs->debug);
> -	printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%lX\n",
> -	       (ulong) & HiSax_reportcard);
> -	printk(KERN_DEBUG "HiSax: cs 0x%lX\n", (ulong) cs);
> +	printk(KERN_DEBUG "HiSax: HiSax_reportcard address 0x%px\n",
> +		HiSax_reportcard);
> +	printk(KERN_DEBUG "HiSax: cs 0x%px\n", cs);
>  	printk(KERN_DEBUG "HiSax: HW_Flags %lx bc0 flg %lx bc1 flg %lx\n",
>  	       cs->HW_Flags, cs->bcs[0].Flag, cs->bcs[1].Flag);
>  	printk(KERN_DEBUG "HiSax: bcs 0 mode %d ch%d\n",

Why not just remove the useless prints. There is no context where
a pointer has any meaning in userspace.  Then again most of ISDN
should probably go to staging anyway....

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

* Re: [PATCH] isdn: hisax: Fix misuse of %x in config.c
  2019-04-23  2:25 [PATCH] isdn: hisax: Fix misuse of %x in config.c Fuqian Huang
  2019-04-23  3:24 ` Stephen Hemminger
@ 2019-04-24  1:33 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-04-24  1:33 UTC (permalink / raw)
  To: huangfq.daxian; +Cc: isdn, netdev, linux-kernel

From: Fuqian Huang <huangfq.daxian@gmail.com>
Date: Tue, 23 Apr 2019 10:25:28 +0800

> Pointers should be printed with %p or %px rather than
> cast to (u_long) type and printed with %lX.
> As the function seems to be for debug purpose.
> Change %lX to %px to print the pointer value.
> 
> Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>

I agree with Stephen that we should probably remove this stuff entirely
but I'll apply this for now.

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

end of thread, other threads:[~2019-04-24  1:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23  2:25 [PATCH] isdn: hisax: Fix misuse of %x in config.c Fuqian Huang
2019-04-23  3:24 ` Stephen Hemminger
2019-04-24  1:33 ` David Miller

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.