From 9dbad4457f9cfe48b57f39055498559639fb04c0 Mon Sep 17 00:00:00 2001 From: Wolfram Sang Date: Thu, 18 Aug 2022 15:05:06 -0700 Subject: [PATCH 1/2] Input: move from strlcpy with unused retval to strscpy Follow the advice of the below link and prefer 'strscpy' in this subsystem. Conversion is 1:1 because the return value is not used. Generated by a coccinelle script. Signed-off-by: Wolfram Sang Link: https://lore.kernel.org/r/20220818210022.6865-1-wsa+renesas@sang-engineering.com Signed-off-by: Dmitry Torokhov [jason.gerecke@wacom.com: Imported into input-wacom (a9f08ad7adb3) Signed-off-by: Jason Gerecke --- 4.5/wacom_w8001.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/4.5/wacom_w8001.c b/4.5/wacom_w8001.c index 691285ac..928c5ee3 100644 --- a/4.5/wacom_w8001.c +++ b/4.5/wacom_w8001.c @@ -625,7 +625,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv) /* For backwards-compatibility we compose the basename based on * capabilities and then just append the tool type */ - strlcpy(basename, "Wacom Serial", sizeof(basename)); + strscpy(basename, "Wacom Serial", sizeof(basename)); err_pen = w8001_setup_pen(w8001, basename, sizeof(basename)); err_touch = w8001_setup_touch(w8001, basename, sizeof(basename)); @@ -635,7 +635,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv) } if (!err_pen) { - strlcpy(w8001->pen_name, basename, sizeof(w8001->pen_name)); + strscpy(w8001->pen_name, basename, sizeof(w8001->pen_name)); strlcat(w8001->pen_name, " Pen", sizeof(w8001->pen_name)); input_dev_pen->name = w8001->pen_name; @@ -651,7 +651,7 @@ static int w8001_connect(struct serio *serio, struct serio_driver *drv) } if (!err_touch) { - strlcpy(w8001->touch_name, basename, sizeof(w8001->touch_name)); + strscpy(w8001->touch_name, basename, sizeof(w8001->touch_name)); strlcat(w8001->touch_name, " Finger", sizeof(w8001->touch_name)); input_dev_touch->name = w8001->touch_name; From e83a9bb3e48d2d1b52ec709e60f73b9960d568e5 Mon Sep 17 00:00:00 2001 From: Jason Gerecke Date: Thu, 2 May 2024 11:07:47 -0700 Subject: [PATCH 2/2] github: Temporarily set -Wno-error=unused-result to bypass upstream warning Commit a9f08ad7adb3 upstream introduces an unused-result warning. While we wait for a fix to be made upstream, this commit has our Github runner not treat the warning as an error. This will need to be reverted after a fix is accepted upstream. Signed-off-by: Jason Gerecke --- .github/workflows/main.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1f67f57..ca87b81c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -30,22 +30,22 @@ jobs: compile_cflags: -fno-pie -Wno-error=format-truncation prepare_cflags: -fno-pie -no-pie - kernel: "4.5" - compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign + compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result prepare_cflags: -fno-pie -no-pie - kernel: "4.6" - compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign + compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result prepare_cflags: -fno-pie -no-pie - kernel: "4.10" - compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign + compile_cflags: -fno-pie -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result prepare_cflags: -fno-pie -no-pie - kernel: "4.14" - compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign + compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result - kernel: "4.19" - compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign + compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result - kernel: "5.10" - compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign + compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result - kernel: "6.3" - compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign + compile_cflags: -Wno-error=format-truncation -Wno-error=pointer-sign -Wno-error=unused-result build_makeflags: KBUILD_MODPOST_WARN=1 steps: - name: Install dependencies