* [PATCH v2] ata: atp867x: Cleanup pointer value print
@ 2021-09-30 3:05 Guo Zhi
2021-10-12 1:06 ` Damien Le Moal
0 siblings, 1 reply; 3+ messages in thread
From: Guo Zhi @ 2021-09-30 3:05 UTC (permalink / raw)
To: Damien Le Moal; +Cc: Guo Zhi, linux-ide, linux-kernel
Pointers should be printed with %p or %px rather than cast to
'unsigned long' and printed with %lx
Change %lx to %p to print the secured pointer.
Signed-off-by: Guo Zhi <qtxuning1999@sjtu.edu.cn>
---
drivers/ata/pata_atp867x.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/ata/pata_atp867x.c b/drivers/ata/pata_atp867x.c
index 2bc5fc81efe3..c32b95f48e50 100644
--- a/drivers/ata/pata_atp867x.c
+++ b/drivers/ata/pata_atp867x.c
@@ -447,11 +447,11 @@ static int atp867x_ata_pci_sff_init_host(struct ata_host *host)
#ifdef ATP867X_DEBUG
atp867x_check_ports(ap, i);
#endif
- ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
- (unsigned long)ioaddr->cmd_addr,
- (unsigned long)ioaddr->ctl_addr);
- ata_port_desc(ap, "bmdma 0x%lx",
- (unsigned long)ioaddr->bmdma_addr);
+ ata_port_desc(ap, "cmd 0x%p ctl 0x%p",
+ ioaddr->cmd_addr,
+ ioaddr->ctl_addr);
+ ata_port_desc(ap, "bmdma 0x%p",
+ ioaddr->bmdma_addr);
mask |= 1 << i;
}
--
2.33.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ata: atp867x: Cleanup pointer value print
2021-09-30 3:05 [PATCH v2] ata: atp867x: Cleanup pointer value print Guo Zhi
@ 2021-10-12 1:06 ` Damien Le Moal
2021-10-12 8:08 ` Sergey Shtylyov
0 siblings, 1 reply; 3+ messages in thread
From: Damien Le Moal @ 2021-10-12 1:06 UTC (permalink / raw)
To: Guo Zhi; +Cc: linux-ide, linux-kernel, Sergey Shtylyov
On 9/30/21 12:05, Guo Zhi wrote:
> Pointers should be printed with %p or %px rather than cast to
> 'unsigned long' and printed with %lx
> Change %lx to %p to print the secured pointer.
>
> Signed-off-by: Guo Zhi <qtxuning1999@sjtu.edu.cn>
> ---
> drivers/ata/pata_atp867x.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/ata/pata_atp867x.c b/drivers/ata/pata_atp867x.c
> index 2bc5fc81efe3..c32b95f48e50 100644
> --- a/drivers/ata/pata_atp867x.c
> +++ b/drivers/ata/pata_atp867x.c
> @@ -447,11 +447,11 @@ static int atp867x_ata_pci_sff_init_host(struct ata_host *host)
> #ifdef ATP867X_DEBUG
> atp867x_check_ports(ap, i);
> #endif
> - ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
> - (unsigned long)ioaddr->cmd_addr,
> - (unsigned long)ioaddr->ctl_addr);
> - ata_port_desc(ap, "bmdma 0x%lx",
> - (unsigned long)ioaddr->bmdma_addr);
> + ata_port_desc(ap, "cmd 0x%p ctl 0x%p",
> + ioaddr->cmd_addr,
> + ioaddr->ctl_addr);
> + ata_port_desc(ap, "bmdma 0x%p",
> + ioaddr->bmdma_addr);
>
> mask |= 1 << i;
> }
>
I lost track of this one. Any v3 to be expected to address Sergey comment ?
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] ata: atp867x: Cleanup pointer value print
2021-10-12 1:06 ` Damien Le Moal
@ 2021-10-12 8:08 ` Sergey Shtylyov
0 siblings, 0 replies; 3+ messages in thread
From: Sergey Shtylyov @ 2021-10-12 8:08 UTC (permalink / raw)
To: Damien Le Moal, Guo Zhi; +Cc: linux-ide, linux-kernel
On 12.10.2021 4:06, Damien Le Moal wrote:
>> Pointers should be printed with %p or %px rather than cast to
>> 'unsigned long' and printed with %lx
>> Change %lx to %p to print the secured pointer.
>>
>> Signed-off-by: Guo Zhi <qtxuning1999@sjtu.edu.cn>
>> ---
>> drivers/ata/pata_atp867x.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/ata/pata_atp867x.c b/drivers/ata/pata_atp867x.c
>> index 2bc5fc81efe3..c32b95f48e50 100644
>> --- a/drivers/ata/pata_atp867x.c
>> +++ b/drivers/ata/pata_atp867x.c
>> @@ -447,11 +447,11 @@ static int atp867x_ata_pci_sff_init_host(struct ata_host *host)
>> #ifdef ATP867X_DEBUG
>> atp867x_check_ports(ap, i);
>> #endif
>> - ata_port_desc(ap, "cmd 0x%lx ctl 0x%lx",
>> - (unsigned long)ioaddr->cmd_addr,
>> - (unsigned long)ioaddr->ctl_addr);
>> - ata_port_desc(ap, "bmdma 0x%lx",
>> - (unsigned long)ioaddr->bmdma_addr);
>> + ata_port_desc(ap, "cmd 0x%p ctl 0x%p",
>> + ioaddr->cmd_addr,
>> + ioaddr->ctl_addr);
>> + ata_port_desc(ap, "bmdma 0x%p",
>> + ioaddr->bmdma_addr);
>>
>> mask |= 1 << i;
>> }
>>
>
> I lost track of this one. Any v3 to be expected to address Sergey comment ?
No, this patch isn't needed at all.
MBR, Sergey
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-10-12 8:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-30 3:05 [PATCH v2] ata: atp867x: Cleanup pointer value print Guo Zhi
2021-10-12 1:06 ` Damien Le Moal
2021-10-12 8:08 ` Sergey Shtylyov
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.