mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86: lg-laptop: fix %s null argument warning
@ 2024-04-03 14:34 Gergo Koteles
  2024-04-04 19:36 ` Kuppuswamy Sathyanarayanan
  2024-04-08 15:42 ` Ilpo Järvinen
  0 siblings, 2 replies; 3+ messages in thread
From: Gergo Koteles @ 2024-04-03 14:34 UTC (permalink / raw)
  To: Matan Ziv-Av, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel, Gergo Koteles

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>
---
 drivers/platform/x86/lg-laptop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
index ad3c39e9e9f5..e714ee6298dd 100644
--- a/drivers/platform/x86/lg-laptop.c
+++ b/drivers/platform/x86/lg-laptop.c
@@ -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;

base-commit: 39cd87c4eb2b893354f3b850f916353f2658ae6f
-- 
2.44.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: lg-laptop: fix %s null argument warning
  2024-04-03 14:34 [PATCH] platform/x86: lg-laptop: fix %s null argument warning Gergo Koteles
@ 2024-04-04 19:36 ` Kuppuswamy Sathyanarayanan
  2024-04-08 15:42 ` Ilpo Järvinen
  1 sibling, 0 replies; 3+ messages in thread
From: Kuppuswamy Sathyanarayanan @ 2024-04-04 19:36 UTC (permalink / raw)
  To: Gergo Koteles, Matan Ziv-Av, Hans de Goede, Ilpo Järvinen
  Cc: platform-driver-x86, linux-kernel


On 4/3/24 7:34 AM, Gergo Koteles wrote:
> 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>

>  drivers/platform/x86/lg-laptop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/lg-laptop.c b/drivers/platform/x86/lg-laptop.c
> index ad3c39e9e9f5..e714ee6298dd 100644
> --- a/drivers/platform/x86/lg-laptop.c
> +++ b/drivers/platform/x86/lg-laptop.c
> @@ -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;
>
> base-commit: 39cd87c4eb2b893354f3b850f916353f2658ae6f

-- 
Sathyanarayanan Kuppuswamy
Linux Kernel Developer


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] platform/x86: lg-laptop: fix %s null argument warning
  2024-04-03 14:34 [PATCH] platform/x86: lg-laptop: fix %s null argument warning Gergo Koteles
  2024-04-04 19:36 ` Kuppuswamy Sathyanarayanan
@ 2024-04-08 15:42 ` Ilpo Järvinen
  1 sibling, 0 replies; 3+ messages in thread
From: Ilpo Järvinen @ 2024-04-08 15:42 UTC (permalink / raw)
  To: Matan Ziv-Av, Hans de Goede, Gergo Koteles
  Cc: platform-driver-x86, linux-kernel

On Wed, 03 Apr 2024 16:34:27 +0200, Gergo Koteles wrote:

> 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.
> 
> 
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo branch. Note it will show up in the public
platform-drivers-x86/review-ilpo branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: lg-laptop: fix %s null argument warning
      commit: e71c8481692582c70cdfd0996c20cdcc71e425d3

--
 i.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-08 15:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-03 14:34 [PATCH] platform/x86: lg-laptop: fix %s null argument warning Gergo Koteles
2024-04-04 19:36 ` Kuppuswamy Sathyanarayanan
2024-04-08 15:42 ` Ilpo Järvinen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®