Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756075AbbKRPTJ (ORCPT ); Wed, 18 Nov 2015 10:19:09 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:50285 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755753AbbKRPTH (ORCPT ); Wed, 18 Nov 2015 10:19:07 -0500 From: Arnd Bergmann To: Ludovic Desroches Cc: Linus Walleij , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] pinctrl: at91-pio4: use %pr format string for resource Date: Wed, 18 Nov 2015 16:18:36 +0100 Message-ID: <5158594.z9FlJvJfpz@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <20151117133341.GG16931@odux.rfo.atmel.com> References: <3726450.XyTgssZ1KT@wuerfel> <20151117133341.GG16931@odux.rfo.atmel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:EggSL9bVW0oGtJmbt3DkQaVeQGwrMp24ak07fzseTP2JliDcBbF 8EcEv9hXMAf4tpSy5z/2tKTyvBS1lpjluL3eqcox87XOlWJV+DUL2F1E8WFM/O5o1DFIK29 2a0B4+JbLIT7VTqouXfYE6wlUGvqSl8a6RQGSqmk6X6XNv+3EVyApHe7ePbs5k8siTQXzJV ueHrmSz3xl8I+OM7MnaMA== X-UI-Out-Filterresults: notjunk:1;V01:K0:MVSxZP5f3bo=:vnq8df1zvlNq4rbI5dnBMx IwdPvH1wnM/0OKgCldGSeMlcjqkvHCXmbbgAk388UKQOY1V2pvdIozopbLfiCJ/LdAG8ZHhb9 e3ngaljZn1UW2AWbf0Eb3iMEA7+AYcp2YY8+EQ+0v5ewC3WQG2fgzZ4m2NDL3feE5ve/oxBCh 8QOq4t0iWidmtQYSvQPbsWoB1Qc4qHHI2mUGCvNob0+IMvKovbiOVbV/DkskB/gu4s/j8u/UB LiQ+iVzv1hjeazq0yLLixHYwIcRQT2ZrMU5NZ3ngShKEZg+gTQ+efnq/J9CJU3IUG3xdGjTm7 RBNngu1RIqS5iyI2hBRAYE7tXYY0Efw5VRczTbbjmm9Gcu5Sx8U7dCdiz6xAfAqzXMwcNXtAN YlVv482+o/Whwaj/gKaq4Dwz55fjiXuUNwIYR1Vgw+YMJ+KR/474gmepXjD1o5J+MtlkvJnLl A5t7MgP15lDhME4MpmVX7DWHyr3QMGEyTgIHcDDd/tSqifb8UMn5yJInTzDlsmSui1vXuTMga 7hLH6iVdzQkZasOVvwu3xtMylk6cK0VFOE319K1IJoGdw+4U3ExpEPffYHM2kXqHw/kPQdrFG sfRlHX+lmJrhuS47U5kLUYUeUUPs9b2RbHGchAnLC8nnwT+u4qJwH+VfV3Rh0/Zm6CRHlT0t6 NBt4kucSkYbD6SwoC9/rEfOuYBQ79gmp3t73FazqLVVmGsbv/9fc4xB8tU2rieP7nso+usEBx rK1H3f+SRqZF2YD1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2318 Lines: 51 On Tuesday 17 November 2015 14:33:41 Ludovic Desroches wrote: > Hi Arnd, > > On Thu, Nov 12, 2015 at 03:15:38PM +0100, Arnd Bergmann wrote: > > resource_size_t may be defined as 32 or 64 bit depending on configuration, > > so it cannot be printed using the normal format strings, as gcc correctly > > warns: > > > > pinctrl-at91-pio4.c: In function 'atmel_pinctrl_probe': > > pinctrl-at91-pio4.c:1003:41: warning: format '%u' expects argument of type 'unsigned int', but argument 5 has type 'resource_size_t {aka long long unsigned int}' [-Wformat=] > > dev_dbg(dev, "bank %i: hwirq=%u\n", i, res->start); > > > > This changes the format string to use the special "%pr" format > > string that prints a resource, and changes the arguments so we > > the resource structure directly. I'm also swapping out the arguments > > to match the text in the format string. > > > > I agree the format change but not swapping out the arguments. Why do you have > the feeling they are not matching the text? > > Few lines before you have: > res = platform_get_resource(pdev, IORESOURCE_IRQ, i); > atmel_pioctrl->irqs[i] = res->start; > > Each bank has its own irq line this is what I want to print with hwirq. > Of course it assumes that interrupts are declared in the right order. Sorry, my mistake. You are completely right and I don't know how I concluded it was wrong. It's possible I got confused by the 'hwirq' string and thought it could not refer to the resource, which is a virtual irq number rather than a hwirq. Anyway, I'll submit a new version with this fixup folded in: @@ -1000,7 +1000,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev) atmel_pioctrl->irqs[i] = res->start; irq_set_chained_handler(res->start, atmel_gpio_irq_handler); irq_set_handler_data(res->start, atmel_pioctrl); - dev_dbg(dev, "bank %pr: hwirq=%u\n", res, i); + dev_dbg(dev, "bank %i: irq=%pr\n", i, res); } atmel_pioctrl->irq_domain = irq_domain_add_linear(dev->of_node, Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/