* [PATCH] sata: nv: fix debug format string mismatch
@ 2021-05-14 14:01 Arnd Bergmann
2021-05-17 15:13 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2021-05-14 14:01 UTC (permalink / raw)
To: Jens Axboe, Tejun Heo
Cc: Arnd Bergmann, Sascha Hauer, linux-ide, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
Turning on debugging in this this driver reveals a type mismatch:
In file included from include/linux/kernel.h:17,
from drivers/ata/sata_nv.c:23:
drivers/ata/sata_nv.c: In function 'nv_swncq_sdbfis':
drivers/ata/sata_nv.c:2121:10: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u64' {aka 'long long unsigned int'} [-Werror=format=]
2121 | DPRINTK("id 0x%x QC: qc_active 0x%x,"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
2124 | ap->print_id, ap->qc_active, pp->qc_active,
| ~~~~~~~~~~~~~
| |
| u64 {aka long long unsigned int}
include/linux/printk.h:142:10: note: in definition of macro 'no_printk'
142 | printk(fmt, ##__VA_ARGS__); \
| ^~~
drivers/ata/sata_nv.c:2121:2: note: in expansion of macro 'DPRINTK'
2121 | DPRINTK("id 0x%x QC: qc_active 0x%x,"
| ^~~~~~~
drivers/ata/sata_nv.c:2121:36: note: format string is defined here
2121 | DPRINTK("id 0x%x QC: qc_active 0x%x,"
| ~^
| |
| unsigned int
| %llx
Use the correct format string for the u64 type.
Fixes: e3ed89396441 ("libata: bump ->qc_active to a 64-bit type")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/ata/sata_nv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/sata_nv.c b/drivers/ata/sata_nv.c
index 20190f66ced9..de4504556669 100644
--- a/drivers/ata/sata_nv.c
+++ b/drivers/ata/sata_nv.c
@@ -2118,7 +2118,7 @@ static int nv_swncq_sdbfis(struct ata_port *ap)
*/
lack_dhfis = 1;
- DPRINTK("id 0x%x QC: qc_active 0x%x,"
+ DPRINTK("id 0x%x QC: qc_active 0x%llx,"
"SWNCQ:qc_active 0x%X defer_bits %X "
"dhfis 0x%X dmafis 0x%X last_issue_tag %x\n",
ap->print_id, ap->qc_active, pp->qc_active,
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] sata: nv: fix debug format string mismatch
2021-05-14 14:01 [PATCH] sata: nv: fix debug format string mismatch Arnd Bergmann
@ 2021-05-17 15:13 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2021-05-17 15:13 UTC (permalink / raw)
To: Arnd Bergmann, Tejun Heo
Cc: Arnd Bergmann, Sascha Hauer, linux-ide, linux-kernel
On 5/14/21 8:01 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> Turning on debugging in this this driver reveals a type mismatch:
>
> In file included from include/linux/kernel.h:17,
> from drivers/ata/sata_nv.c:23:
> drivers/ata/sata_nv.c: In function 'nv_swncq_sdbfis':
> drivers/ata/sata_nv.c:2121:10: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'u64' {aka 'long long unsigned int'} [-Werror=format=]
> 2121 | DPRINTK("id 0x%x QC: qc_active 0x%x,"
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ......
> 2124 | ap->print_id, ap->qc_active, pp->qc_active,
> | ~~~~~~~~~~~~~
> | |
> | u64 {aka long long unsigned int}
> include/linux/printk.h:142:10: note: in definition of macro 'no_printk'
> 142 | printk(fmt, ##__VA_ARGS__); \
> | ^~~
> drivers/ata/sata_nv.c:2121:2: note: in expansion of macro 'DPRINTK'
> 2121 | DPRINTK("id 0x%x QC: qc_active 0x%x,"
> | ^~~~~~~
> drivers/ata/sata_nv.c:2121:36: note: format string is defined here
> 2121 | DPRINTK("id 0x%x QC: qc_active 0x%x,"
> | ~^
> | |
> | unsigned int
> | %llx
>
> Use the correct format string for the u64 type.
Applied, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-17 16:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-14 14:01 [PATCH] sata: nv: fix debug format string mismatch Arnd Bergmann
2021-05-17 15:13 ` Jens Axboe
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).