* [PATCH] PCI: xilinx: fix harmless format string warning
@ 2015-01-13 14:20 Arnd Bergmann
2015-01-13 14:43 ` Maxime Coquelin
2015-01-23 21:42 ` Bjorn Helgaas
0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2015-01-13 14:20 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-arm-kernel, linux-pci, Srikanth Thokala, Maxime COQUELIN
The xilinx pcie driver prints a register value whose type is
propagated to the type returned by the GENMASK() macro.
Unfortunately, that type has recently changed as the result
of a bug fix, so now we get a warning about the type:
drivers/pci/host/pcie-xilinx.c: In function 'xilinx_pcie_clear_err_interrupts':
drivers/pci/host/pcie-xilinx.c:154:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
This changes the code so we always print the number as an
'unsigned long' type to avoid the warning. The original code
was fine on 32-bit architectures but not on 64-bit. Now it
works as expected on both.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 00b4d9a1412 ("bitops: Fix shift overflow in GENMASK macros")
diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
index ef3ebaf9a738..ce1c61d85b2c 100644
--- a/drivers/pci/host/pcie-xilinx.c
+++ b/drivers/pci/host/pcie-xilinx.c
@@ -148,10 +148,10 @@ static inline bool xilinx_pcie_link_is_up(struct xilinx_pcie_port *port)
*/
static void xilinx_pcie_clear_err_interrupts(struct xilinx_pcie_port *port)
{
- u32 val = pcie_read(port, XILINX_PCIE_REG_RPEFR);
+ unsigned long val = pcie_read(port, XILINX_PCIE_REG_RPEFR);
if (val & XILINX_PCIE_RPEFR_ERR_VALID) {
- dev_dbg(port->dev, "Requester ID %d\n",
+ dev_dbg(port->dev, "Requester ID %lu\n",
val & XILINX_PCIE_RPEFR_REQ_ID);
pcie_write(port, XILINX_PCIE_RPEFR_ALL_MASK,
XILINX_PCIE_REG_RPEFR);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: xilinx: fix harmless format string warning
2015-01-13 14:20 [PATCH] PCI: xilinx: fix harmless format string warning Arnd Bergmann
@ 2015-01-13 14:43 ` Maxime Coquelin
2015-01-23 21:42 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2015-01-13 14:43 UTC (permalink / raw)
To: Arnd Bergmann, Bjorn Helgaas
Cc: linux-arm-kernel, linux-pci, Srikanth Thokala
Hi Arnd,
On 01/13/2015 03:20 PM, Arnd Bergmann wrote:
> The xilinx pcie driver prints a register value whose type is
> propagated to the type returned by the GENMASK() macro.
> Unfortunately, that type has recently changed as the result
> of a bug fix, so now we get a warning about the type:
>
> drivers/pci/host/pcie-xilinx.c: In function 'xilinx_pcie_clear_err_interrupts':
> drivers/pci/host/pcie-xilinx.c:154:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
>
> This changes the code so we always print the number as an
> 'unsigned long' type to avoid the warning. The original code
> was fine on 32-bit architectures but not on 64-bit. Now it
> works as expected on both.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 00b4d9a1412 ("bitops: Fix shift overflow in GENMASK macros")
>
>
You can add my:
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>
Thanks!
Maxime
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: xilinx: fix harmless format string warning
2015-01-13 14:20 [PATCH] PCI: xilinx: fix harmless format string warning Arnd Bergmann
2015-01-13 14:43 ` Maxime Coquelin
@ 2015-01-23 21:42 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2015-01-23 21:42 UTC (permalink / raw)
To: Arnd Bergmann
Cc: linux-arm-kernel, linux-pci, Srikanth Thokala, Maxime COQUELIN
On Tue, Jan 13, 2015 at 03:20:05PM +0100, Arnd Bergmann wrote:
> The xilinx pcie driver prints a register value whose type is
> propagated to the type returned by the GENMASK() macro.
> Unfortunately, that type has recently changed as the result
> of a bug fix, so now we get a warning about the type:
>
> drivers/pci/host/pcie-xilinx.c: In function 'xilinx_pcie_clear_err_interrupts':
> drivers/pci/host/pcie-xilinx.c:154:3: warning: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Wformat=]
>
> This changes the code so we always print the number as an
> 'unsigned long' type to avoid the warning. The original code
> was fine on 32-bit architectures but not on 64-bit. Now it
> works as expected on both.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 00b4d9a1412 ("bitops: Fix shift overflow in GENMASK macros")
Applied with Maxime's ack to pci/host-xilinx for v3.20, thanks!
> diff --git a/drivers/pci/host/pcie-xilinx.c b/drivers/pci/host/pcie-xilinx.c
> index ef3ebaf9a738..ce1c61d85b2c 100644
> --- a/drivers/pci/host/pcie-xilinx.c
> +++ b/drivers/pci/host/pcie-xilinx.c
> @@ -148,10 +148,10 @@ static inline bool xilinx_pcie_link_is_up(struct xilinx_pcie_port *port)
> */
> static void xilinx_pcie_clear_err_interrupts(struct xilinx_pcie_port *port)
> {
> - u32 val = pcie_read(port, XILINX_PCIE_REG_RPEFR);
> + unsigned long val = pcie_read(port, XILINX_PCIE_REG_RPEFR);
>
> if (val & XILINX_PCIE_RPEFR_ERR_VALID) {
> - dev_dbg(port->dev, "Requester ID %d\n",
> + dev_dbg(port->dev, "Requester ID %lu\n",
> val & XILINX_PCIE_RPEFR_REQ_ID);
> pcie_write(port, XILINX_PCIE_RPEFR_ALL_MASK,
> XILINX_PCIE_REG_RPEFR);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-01-23 21:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-13 14:20 [PATCH] PCI: xilinx: fix harmless format string warning Arnd Bergmann
2015-01-13 14:43 ` Maxime Coquelin
2015-01-23 21:42 ` Bjorn Helgaas
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).