usb: gadget: avoid unusual inline assembly
Subsystems (2)
RFC PATCH 1/1 usb: gadget: avoid unusual inline assembly
From: Arnd Bergmann <[email protected]>
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?
--- drivers/usb/gadget/udc/pxa25x_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/gadget/udc/pxa25x_udc.c +1 -1
@@ -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 ;
Signature · 1 line
2.29.2
Greg Kroah-Hartman
maintainerQuoted 32 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
clang does not understand the "mrc%?" syntax:
drivers/usb/gadget/udc/pxa25x_udc.c:2330:11: error: invalid % escape in inline assembly stringI 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 <[email protected]>--- drivers/usb/gadget/udc/pxa25x_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/pxa25x_udc.c +1
-1@@ -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 ;Signature · 1 line
2.29.2
Given that no one had any objections, I'll queue this up and see what breaks :)
thanks,
greg k-h
Quoted 11 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
clang does not understand the "mrc%?" syntax:
drivers/usb/gadget/udc/pxa25x_udc.c:2330:11: error: invalid % escape in inline assembly stringI 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:
Quoted 1 line
Quoted 1 line
‘%’ 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.
Quoted 22 lines
Signed-off-by Arnd Bergmann <[email protected]>--- drivers/usb/gadget/udc/pxa25x_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/pxa25x_udc.c +1
-2@@ -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
Signature · 2 lines
Thanks, ~Nick Desaulniers
Quoted 21 lines · Arnd Bergmann
From: Arnd Bergmann <[email protected]>
clang does not understand the "mrc%?" syntax:
drivers/usb/gadget/udc/pxa25x_udc.c:2330:11: error: invalid % escape in inline assembly stringI 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 <[email protected]>--- drivers/usb/gadget/udc/pxa25x_udc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/gadget/udc/pxa25x_udc.c +0
-0
drivers/usb/gadget/udc/pxa25x_udc.c static int pxa25x_udc_probe(struct platform_device *pdev) · line 2328
Quoted 5 lines
drivers/usb/gadget/udc/pxa25x_udc.c +1
-1@@ -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.
Quoted 4 lines
drivers/usb/gadget/udc/pxa25x_udc.c +0
-0if ((chiprev &CP15R0_VENDOR_MASK ) !=CP15R0_XSCALE_VALUE ) {pr_err ("%s: not XScale!\n" , driver_name);return -ENODEV ;
Signature · 1 line
Florian