From: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
To: "Gergo Koteles" <soyer@irl.hu>,
"Matan Ziv-Av" <matan@svgalib.org>,
"Hans de Goede" <hdegoede@redhat.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86: lg-laptop: fix %s null argument warning
Date: Thu, 4 Apr 2024 12:36:19 -0700 [thread overview]
Message-ID: <5f040ba2-627b-4b5d-959a-59f97b6ad0af@linux.intel.com> (raw)
In-Reply-To: <33d40e976f08f82b9227d0ecae38c787fcc0c0b2.1712154684.git.soyer@irl.hu>
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
next prev parent reply other threads:[~2024-04-04 19:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-03 14:34 Gergo Koteles
2024-04-04 19:36 ` Kuppuswamy Sathyanarayanan [this message]
2024-04-08 15:42 ` Ilpo Järvinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f040ba2-627b-4b5d-959a-59f97b6ad0af@linux.intel.com \
--to=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=matan@svgalib.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=soyer@irl.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®