* [PATCH] [RFC] usb: gadget: avoid unusual inline assembly
@ 2021-09-27 12:38 Arnd Bergmann
2021-10-13 12:03 ` Greg Kroah-Hartman
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2021-09-27 12:38 UTC (permalink / raw)
To: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Felipe Balbi,
Greg Kroah-Hartman, Nathan Chancellor, Nick Desaulniers
Cc: Arnd Bergmann, Rikard Falkeborn, linux-arm-kernel, linux-usb,
linux-kernel, llvm
From: Arnd Bergmann <arnd@arndb.de>
clang does not understand the "mrc%?" syntax:
drivers/usb/gadget/udc/pxa25x_udc.c:2330:11: error: invalid % escape in inline assembly string
I don't understand it either, but removing the %? here gets it to build.
This is probably wrong and someone else should do a proper patch.
Any suggestions?
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
index a09ec1d826b2..52cdfd8212d6 100644
--- a/drivers/usb/gadget/udc/pxa25x_udc.c
+++ b/drivers/usb/gadget/udc/pxa25x_udc.c
@@ -2325,7 +2325,7 @@ static int pxa25x_udc_probe(struct platform_device *pdev)
pr_info("%s: version %s\n", driver_name, DRIVER_VERSION);
/* insist on Intel/ARM/XScale */
- asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev));
+ asm("mrc p15, 0, %0, c0, c0" : "=r" (chiprev));
if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) {
pr_err("%s: not XScale!\n", driver_name);
return -ENODEV;
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] [RFC] usb: gadget: avoid unusual inline assembly
2021-09-27 12:38 [PATCH] [RFC] usb: gadget: avoid unusual inline assembly Arnd Bergmann
@ 2021-10-13 12:03 ` Greg Kroah-Hartman
2021-10-13 18:35 ` Nick Desaulniers
2021-10-13 18:54 ` Florian Fainelli
2 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2021-10-13 12:03 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Felipe Balbi,
Nathan Chancellor, Nick Desaulniers, Arnd Bergmann,
Rikard Falkeborn, linux-arm-kernel, linux-usb, linux-kernel,
llvm
On Mon, Sep 27, 2021 at 02:38:20PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> clang does not understand the "mrc%?" syntax:
>
> drivers/usb/gadget/udc/pxa25x_udc.c:2330:11: error: invalid % escape in inline assembly string
>
> I don't understand it either, but removing the %? here gets it to build.
> This is probably wrong and someone else should do a proper patch.
>
> Any suggestions?
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> index a09ec1d826b2..52cdfd8212d6 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> @@ -2325,7 +2325,7 @@ static int pxa25x_udc_probe(struct platform_device *pdev)
> pr_info("%s: version %s\n", driver_name, DRIVER_VERSION);
>
> /* insist on Intel/ARM/XScale */
> - asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev));
> + asm("mrc p15, 0, %0, c0, c0" : "=r" (chiprev));
> if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) {
> pr_err("%s: not XScale!\n", driver_name);
> return -ENODEV;
> --
> 2.29.2
>
Given that no one had any objections, I'll queue this up and see what
breaks :)
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [RFC] usb: gadget: avoid unusual inline assembly
2021-09-27 12:38 [PATCH] [RFC] usb: gadget: avoid unusual inline assembly Arnd Bergmann
2021-10-13 12:03 ` Greg Kroah-Hartman
@ 2021-10-13 18:35 ` Nick Desaulniers
2021-10-13 18:54 ` Florian Fainelli
2 siblings, 0 replies; 4+ messages in thread
From: Nick Desaulniers @ 2021-10-13 18:35 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Daniel Mack, Haojian Zhuang, Robert Jarzmik, Felipe Balbi,
Greg Kroah-Hartman, Nathan Chancellor, Arnd Bergmann,
Rikard Falkeborn, linux-arm-kernel, linux-usb, linux-kernel,
llvm
On Mon, Sep 27, 2021 at 5:38 AM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> clang does not understand the "mrc%?" syntax:
>
> drivers/usb/gadget/udc/pxa25x_udc.c:2330:11: error: invalid % escape in inline assembly string
>
> I don't understand it either, but removing the %? here gets it to build.
> This is probably wrong and someone else should do a proper patch.
>
> Any suggestions?
https://gcc.gnu.org/onlinedocs/gccint/Output-Template.html says:
>> ‘%’ followed by a punctuation character specifies a substitution that does not use an operand. Only one case is standard: ‘%%’ outputs a ‘%’ into the assembler code.
I don't think the intention was to have `mrc?` in the emitted
assembler (is that even valid?), so it's not clear to me what this
point of `%?` was. Patch LGTM.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> index a09ec1d826b2..52cdfd8212d6 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> @@ -2325,7 +2325,7 @@ static int pxa25x_udc_probe(struct platform_device *pdev)
> pr_info("%s: version %s\n", driver_name, DRIVER_VERSION);
>
> /* insist on Intel/ARM/XScale */
> - asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev));
> + asm("mrc p15, 0, %0, c0, c0" : "=r" (chiprev));
> if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) {
> pr_err("%s: not XScale!\n", driver_name);
> return -ENODEV;
> --
> 2.29.2
>
--
Thanks,
~Nick Desaulniers
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] [RFC] usb: gadget: avoid unusual inline assembly
2021-09-27 12:38 [PATCH] [RFC] usb: gadget: avoid unusual inline assembly Arnd Bergmann
2021-10-13 12:03 ` Greg Kroah-Hartman
2021-10-13 18:35 ` Nick Desaulniers
@ 2021-10-13 18:54 ` Florian Fainelli
2 siblings, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2021-10-13 18:54 UTC (permalink / raw)
To: Arnd Bergmann, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
Felipe Balbi, Greg Kroah-Hartman, Nathan Chancellor,
Nick Desaulniers
Cc: Arnd Bergmann, Rikard Falkeborn, linux-arm-kernel, linux-usb,
linux-kernel, llvm
On 9/27/21 5:38 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> clang does not understand the "mrc%?" syntax:
>
> drivers/usb/gadget/udc/pxa25x_udc.c:2330:11: error: invalid % escape in inline assembly string
>
> I don't understand it either, but removing the %? here gets it to build.
> This is probably wrong and someone else should do a proper patch.
>
> Any suggestions?
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/usb/gadget/udc/pxa25x_udc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/gadget/udc/pxa25x_udc.c b/drivers/usb/gadget/udc/pxa25x_udc.c
> index a09ec1d826b2..52cdfd8212d6 100644
> --- a/drivers/usb/gadget/udc/pxa25x_udc.c
> +++ b/drivers/usb/gadget/udc/pxa25x_udc.c
> @@ -2325,7 +2325,7 @@ static int pxa25x_udc_probe(struct platform_device *pdev)
> pr_info("%s: version %s\n", driver_name, DRIVER_VERSION);
>
> /* insist on Intel/ARM/XScale */
> - asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev));
> + asm("mrc p15, 0, %0, c0, c0" : "=r" (chiprev));
You could consider using read_cpuid() from
arch/arm/include/asm/cputype.h as this driver really does not seem to
have portability in mind.
> if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) {
> pr_err("%s: not XScale!\n", driver_name);
> return -ENODEV;
>
--
Florian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-13 18:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-27 12:38 [PATCH] [RFC] usb: gadget: avoid unusual inline assembly Arnd Bergmann
2021-10-13 12:03 ` Greg Kroah-Hartman
2021-10-13 18:35 ` Nick Desaulniers
2021-10-13 18:54 ` Florian Fainelli
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).