usb: sl811-hcd: improve misleading indentation
PATCH 1/1 usb: sl811-hcd: improve misleading indentation
From: Arnd Bergmann <[email protected]>
gcc-11 now warns about a confusingly indented code block:
drivers/usb/host/sl811-hcd.c: In function ‘sl811h_hub_control’:drivers/usb/host/sl811-hcd.c:1291:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation]
1291 | if (*(u16*)(buf+2)) /* only if wPortChange is interesting */
| ^~drivers/usb/host/sl811-hcd.c:1295:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
1295 | break;
Rewrite this to use a single if() block with the __is_defined() macro.
Signed-off-by Arnd Bergmann <[email protected]>
--- drivers/usb/host/sl811-hcd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/usb/host/sl811-hcd.c +4 -5
@@ -1287,11 +1287,10 @@ sl811h_hub_control( goto error;put_unaligned_le32 (sl811->port1, buf); -#ifndef VERBOSE - if (*(u16*)(buf+2)) /* only if wPortChange is interesting */ -#endif -dev_dbg (hcd->self.controller,"GetPortStatus %08x\n" , - sl811->port1); +if (__is_defined (VERBOSE ) || + *(u16 *)(buf+2 ))/* only if wPortChange is interesting */ +dev_dbg (hcd->self.controller,"GetPortStatus %08x\n" , + sl811->port1);break ;case SetPortFeature:if (wIndex !=1 || wLength !=0 )
Signature · 1 line
2.29.2