From aad6e1f3291f9ac24cff07f34f6c5f5061409e08 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 19 May 2021 19:20:25 +0200 Subject: [PATCH] 5.12-stable patches added patches: kgdb-fix-gcc-11-warning-on-indentation.patch usb-sl811-hcd-improve-misleading-indentation.patch --- ...db-fix-gcc-11-warning-on-indentation.patch | 71 +++++++++++++++++++ queue-5.12/series | 2 + ...1-hcd-improve-misleading-indentation.patch | 48 +++++++++++++ 3 files changed, 121 insertions(+) create mode 100644 queue-5.12/kgdb-fix-gcc-11-warning-on-indentation.patch create mode 100644 queue-5.12/usb-sl811-hcd-improve-misleading-indentation.patch diff --git a/queue-5.12/kgdb-fix-gcc-11-warning-on-indentation.patch b/queue-5.12/kgdb-fix-gcc-11-warning-on-indentation.patch new file mode 100644 index 00000000000..95e8988276b --- /dev/null +++ b/queue-5.12/kgdb-fix-gcc-11-warning-on-indentation.patch @@ -0,0 +1,71 @@ +From 40cc3a80bb42587db1e6ae21d6f3090582d33e89 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 22 Mar 2021 17:43:03 +0100 +Subject: kgdb: fix gcc-11 warning on indentation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Arnd Bergmann + +commit 40cc3a80bb42587db1e6ae21d6f3090582d33e89 upstream. + +gcc-11 starts warning about misleading indentation inside of macros: + +drivers/misc/kgdbts.c: In function ‘kgdbts_break_test’: +drivers/misc/kgdbts.c:103:9: error: this ‘if’ clause does not guard... [-Werror=misleading-indentation] + 103 | if (verbose > 1) \ + | ^~ +drivers/misc/kgdbts.c:200:9: note: in expansion of macro ‘v2printk’ + 200 | v2printk("kgdbts: breakpoint complete\n"); + | ^~~~~~~~ +drivers/misc/kgdbts.c:105:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’ + 105 | touch_nmi_watchdog(); \ + | ^~~~~~~~~~~~~~~~~~ + +The code looks correct to me, so just reindent it for readability. + +Fixes: e8d31c204e36 ("kgdb: add kgdb internal test suite") +Acked-by: Daniel Thompson +Signed-off-by: Arnd Bergmann +Link: https://lore.kernel.org/r/20210322164308.827846-1-arnd@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/kgdbts.c | 26 +++++++++++++------------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +--- a/drivers/misc/kgdbts.c ++++ b/drivers/misc/kgdbts.c +@@ -95,19 +95,19 @@ + + #include + +-#define v1printk(a...) do { \ +- if (verbose) \ +- printk(KERN_INFO a); \ +- } while (0) +-#define v2printk(a...) do { \ +- if (verbose > 1) \ +- printk(KERN_INFO a); \ +- touch_nmi_watchdog(); \ +- } while (0) +-#define eprintk(a...) do { \ +- printk(KERN_ERR a); \ +- WARN_ON(1); \ +- } while (0) ++#define v1printk(a...) do { \ ++ if (verbose) \ ++ printk(KERN_INFO a); \ ++} while (0) ++#define v2printk(a...) do { \ ++ if (verbose > 1) \ ++ printk(KERN_INFO a); \ ++ touch_nmi_watchdog(); \ ++} while (0) ++#define eprintk(a...) do { \ ++ printk(KERN_ERR a); \ ++ WARN_ON(1); \ ++} while (0) + #define MAX_CONFIG_LEN 40 + + static struct kgdb_io kgdbts_io_ops; diff --git a/queue-5.12/series b/queue-5.12/series index 62e696f2277..4536464f122 100644 --- a/queue-5.12/series +++ b/queue-5.12/series @@ -1,3 +1,5 @@ x86-msr-fix-wr-rdmsr_safe_regs_on_cpu-prototypes.patch drm-i915-display-fix-compiler-warning-about-array-overrun.patch airo-work-around-stack-usage-warning.patch +kgdb-fix-gcc-11-warning-on-indentation.patch +usb-sl811-hcd-improve-misleading-indentation.patch diff --git a/queue-5.12/usb-sl811-hcd-improve-misleading-indentation.patch b/queue-5.12/usb-sl811-hcd-improve-misleading-indentation.patch new file mode 100644 index 00000000000..c973f606e29 --- /dev/null +++ b/queue-5.12/usb-sl811-hcd-improve-misleading-indentation.patch @@ -0,0 +1,48 @@ +From 8460f6003a1d2633737b89c4f69d6f4c0c7c65a3 Mon Sep 17 00:00:00 2001 +From: Arnd Bergmann +Date: Mon, 22 Mar 2021 17:42:26 +0100 +Subject: usb: sl811-hcd: improve misleading indentation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Arnd Bergmann + +commit 8460f6003a1d2633737b89c4f69d6f4c0c7c65a3 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: Arnd Bergmann +Link: https://lore.kernel.org/r/20210322164244.827589-1-arnd@kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/host/sl811-hcd.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +--- a/drivers/usb/host/sl811-hcd.c ++++ b/drivers/usb/host/sl811-hcd.c +@@ -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) -- 2.47.3