]> git.dujemihanovic.xyz Git - linux.git/commitdiff
platform/x86: lg-laptop: fix %s null argument warning
authorGergo Koteles <soyer@irl.hu>
Wed, 3 Apr 2024 14:34:27 +0000 (16:34 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Mon, 8 Apr 2024 15:32:14 +0000 (18:32 +0300)
W=1 warns about null argument to kprintf:
warning: ‘%s’ directive argument is null [-Wformat-overflow=]
pr_info("product: %s  year: %d\n", product, year);

Use "unknown" instead of NULL.

Signed-off-by: Gergo Koteles <soyer@irl.hu>
Reviewed-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
Link: https://lore.kernel.org/r/33d40e976f08f82b9227d0ecae38c787fcc0c0b2.1712154684.git.soyer@irl.hu
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/lg-laptop.c

index ad3c39e9e9f586d301abd572c83e76d554a5c382..e714ee6298dda8a66637aa918e33c861508ce15e 100644 (file)
@@ -736,7 +736,7 @@ static int acpi_add(struct acpi_device *device)
                default:
                        year = 2019;
                }
-       pr_info("product: %s  year: %d\n", product, year);
+       pr_info("product: %s  year: %d\n", product ?: "unknown", year);
 
        if (year >= 2019)
                battery_limit_use_wmbb = 1;