Linux-fbdev Archive mirror
 help / color / mirror / Atom feed
From: Cong Liu <liucong2@kylinos.cn>
To: Helge Deller <deller@gmx.de>
Cc: Cong Liu <liucong2@kylinos.cn>,
	linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] fbdev/sh_mobile_lcdcfb: Replace deprecated simple_strtol with kstrtol
Date: Thu,  1 Feb 2024 15:01:27 +0800	[thread overview]
Message-ID: <20240201070127.3290465-1-liucong2@kylinos.cn> (raw)

This patch replaces the use of the deprecated simple_strtol [1] function
in the sh_mobile_lcdcfb.c file with the recommended kstrtol function.
This change improves error handling and boundary checks.

[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull

Signed-off-by: Cong Liu <liucong2@kylinos.cn>
---
 drivers/video/fbdev/sh_mobile_lcdcfb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index eb2297b37504..5fc7d74b273e 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -1278,11 +1278,11 @@ overlay_position_store(struct device *dev, struct device_attribute *attr,
 	int pos_x;
 	int pos_y;
 
-	pos_x = simple_strtol(buf, &endp, 10);
+	pos_x = kstrtol(buf, &endp, 10);
 	if (*endp != ',')
 		return -EINVAL;
 
-	pos_y = simple_strtol(endp + 1, &endp, 10);
+	pos_y = kstrtol(endp + 1, &endp, 10);
 	if (isspace(*endp))
 		endp++;
 
-- 
2.34.1


             reply	other threads:[~2024-02-01  7:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01  7:01 Cong Liu [this message]
2024-02-01 10:04 ` [PATCH] fbdev/sh_mobile_lcdcfb: Replace deprecated simple_strtol with kstrtol Jani Nikula

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=20240201070127.3290465-1-liucong2@kylinos.cn \
    --to=liucong2@kylinos.cn \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).