提交 5881c067 编写于 作者: A Arnd Bergmann 提交者: Zheng Zengkai

usb: sl811-hcd: improve misleading indentation

stable inclusion
from stable-5.10.39
commit c6034b618c1abc0084c12c6514fdae184d70df94
bugzilla: 51881
CVE: NA

--------------------------------

commit 8460f600 upstream.

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: NArnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210322164244.827589-1-arnd@kernel.orgSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 901e79c8
...@@ -1287,11 +1287,10 @@ sl811h_hub_control( ...@@ -1287,11 +1287,10 @@ sl811h_hub_control(
goto error; goto error;
put_unaligned_le32(sl811->port1, buf); put_unaligned_le32(sl811->port1, buf);
#ifndef VERBOSE if (__is_defined(VERBOSE) ||
if (*(u16*)(buf+2)) /* only if wPortChange is interesting */ *(u16*)(buf+2)) /* only if wPortChange is interesting */
#endif dev_dbg(hcd->self.controller, "GetPortStatus %08x\n",
dev_dbg(hcd->self.controller, "GetPortStatus %08x\n", sl811->port1);
sl811->port1);
break; break;
case SetPortFeature: case SetPortFeature:
if (wIndex != 1 || wLength != 0) if (wIndex != 1 || wLength != 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册