* [PATCH 0/3] Rid W=1 warnings from HWMON
@ 2020-11-12 9:57 Lee Jones
2020-11-12 9:57 ` [PATCH 3/3] hwmon: ibmpowernv: Silence strncpy() warning Lee Jones
0 siblings, 1 reply; 2+ messages in thread
From: Lee Jones @ 2020-11-12 9:57 UTC (permalink / raw)
To: jdelvare, linux
Cc: linux-hwmon, Michael Hennerich, linuxppc-dev, linux-kernel,
Andrew F. Davis, Paul Mackerras, Neelesh Gupta, Lee Jones,
Beniamin Bia
This set is part of a larger effort attempting to clean-up W=1
kernel builds, which are currently overwhelmingly riddled with
niggly little warnings.
Lee Jones (3):
hwmon: adm1177: Fix kerneldoc attribute formatting
hwmon: ina3221: Demote seemingly unintentional kerneldoc header
hwmon: ibmpowernv: Silence strncpy() warning
drivers/hwmon/adm1177.c | 10 +++++-----
drivers/hwmon/ibmpowernv.c | 2 +-
drivers/hwmon/ina3221.c | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
Cc: "Andrew F. Davis" <afd@ti.com>
Cc: Beniamin Bia <beniamin.bia@analog.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Jean Delvare <jdelvare@suse.com>
Cc: linux-hwmon@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Michael Hennerich <Michael.Hennerich@analog.com>
Cc: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Cc: Paul Mackerras <paulus@samba.org>
--
2.25.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 3/3] hwmon: ibmpowernv: Silence strncpy() warning
2020-11-12 9:57 [PATCH 0/3] Rid W=1 warnings from HWMON Lee Jones
@ 2020-11-12 9:57 ` Lee Jones
0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2020-11-12 9:57 UTC (permalink / raw)
To: jdelvare, linux
Cc: linux-hwmon, linuxppc-dev, linux-kernel, Paul Mackerras,
Neelesh Gupta, Lee Jones
Fixes the following W=1 kernel build warning(s):
from drivers/hwmon/ibmpowernv.c:11:
In function ‘strncpy’,
inlined from ‘get_sensor_index_attr’ at drivers/hwmon/ibmpowernv.c:243:2,
inlined from ‘create_device_attrs’ at drivers/hwmon/ibmpowernv.c:280:8:
include/linux/string.h:297:30: warning: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
include/linux/string.h:307:9: note: in expansion of macro ‘__underlying_strncpy’
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
Cc: Jean Delvare <jdelvare@suse.com>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Neelesh Gupta <neelegup@linux.vnet.ibm.com>
Cc: linux-hwmon@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/hwmon/ibmpowernv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/ibmpowernv.c b/drivers/hwmon/ibmpowernv.c
index a750647e66a47..8e3724728cce0 100644
--- a/drivers/hwmon/ibmpowernv.c
+++ b/drivers/hwmon/ibmpowernv.c
@@ -240,7 +240,7 @@ static int get_sensor_index_attr(const char *name, u32 *index, char *attr)
if (err)
return err;
- strncpy(attr, dash_pos + 1, MAX_ATTR_LEN);
+ strscpy(attr, dash_pos + 1, MAX_ATTR_LEN);
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-11-12 10:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-12 9:57 [PATCH 0/3] Rid W=1 warnings from HWMON Lee Jones
2020-11-12 9:57 ` [PATCH 3/3] hwmon: ibmpowernv: Silence strncpy() warning Lee Jones
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).