Re: [PATCH v3 1/2] ata: pata_falcon: fix IO base selection for Q40

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Geert,

Am 21.08.2023 um 19:50 schrieb Geert Uytterhoeven:
+       ap->ioaddr.data_addr = (void __iomem *)base_mem_res->start;
+
+       if (base_res) {         /* only Q40 has IO resources */
+               io_offset = 0x10000;
+               reg_scale = 1;
+               base = (void __iomem *)base_res->start;
+               ctl_base = (void __iomem *)ctl_res->start;
+
+               ata_port_desc(ap, "cmd %pa ctl %pa",
+                             &base_res->start,
+                             &ctl_res->start);

This can be  moved outside the else, using %px to format base and
ctl_base.

I get a checkpatch warning for %px, but not for %pa (used for . &ap->ioaddr.data_addr). What gives?


WARNING: Using vsprintf specifier '%px' potentially exposes the kernel memory layout, if you don't really need the address please consider using '%p'.
#148: FILE: drivers/ata/pata_falcon.c:194:
+	ata_port_desc(ap, "cmd %px ctl %px data %pa",
+		      base, ctl_base, &ap->ioaddr.data_addr);

Using %pa and &base, &ctl_base just to shut that up seems a little silly ...

Cheers,

	Michael


+       } else {
+               base = (void __iomem *)base_mem_res->start;
+               ctl_base = (void __iomem *)ctl_mem_res->start;
+
+               ata_port_desc(ap, "cmd %pa ctl %pa",
+                             &base_mem_res->start,
+                             &ctl_mem_res->start);
+       }

Gr{oetje,eeting}s,

                        Geert




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux