aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2025-03-09 22:01:54 +0100
committerHelge Deller <deller@gmx.de>2025-03-09 22:27:54 +0100
commite822b8f01b40eb193cf7ebb059ac7c560a562d6f (patch)
treed30d1f88442b02c492e559727abfec17f40ec20a /drivers
parentInput: gscps2 - Describe missing function parameters (diff)
downloadwireguard-linux-e822b8f01b40eb193cf7ebb059ac7c560a562d6f.tar.xz
wireguard-linux-e822b8f01b40eb193cf7ebb059ac7c560a562d6f.zip
parisc: led: Use scnprintf() to avoid string truncation warning
We intentionally truncate the string and store only up to 20 characters since the LCD display does not provide more chars. For that use scnprintf() instead of snprintf() to avoid the warning. Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/parisc/led.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index e71674753711..016c9d5a60a8 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -39,7 +39,6 @@ static unsigned char led_type; /* bitmask of LED_HAS_XXX */
static unsigned char lastleds; /* LED state from most recent update */
static unsigned char lcd_new_text;
static unsigned char lcd_text[20];
-static unsigned char lcd_text_default[20];
static unsigned char lcd_no_led_support; /* KittyHawk doesn't support LED on its LCD */
struct lcd_block {
@@ -456,9 +455,8 @@ static int __init early_led_init(void)
struct pdc_chassis_info chassis_info;
int ret;
- snprintf(lcd_text_default, sizeof(lcd_text_default),
+ scnprintf(lcd_text, sizeof(lcd_text),
"Linux %s", init_utsname()->release);
- strcpy(lcd_text, lcd_text_default);
lcd_new_text = 1;
/* Work around the buggy PDC of KittyHawk-machines */