Linux Input/HID development
 help / color / mirror / Atom feed
From: hanyu001@208suo.com
To: erazor_de@users.sourceforge.net, jikos@kernel.org,
	benjamin.tissoires@redhat.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Fwd: [PATCH] hid:  Replace snprintf() with sysfs_emit()
Date: Thu, 13 Jul 2023 17:40:53 +0800	[thread overview]
Message-ID: <bad7fd90191a531ebf10816f48d3012f@208suo.com> (raw)
In-Reply-To: <tencent_F6951CE34644A8B408B524E70F0283D50F08@qq.com>

coccinelle report:
./drivers/scsi/mvsas/mv_init.c:699:8-16:
WARNING: use scnprintf or sprintf
./drivers/scsi/mvsas/mv_init.c:747:8-16:
WARNING: use scnprintf or sprintf

./drivers/hid/hid-roccat-kovaplus.c:330:8-16: WARNING: use scnprintf or 
sprintf
./drivers/hid/hid-roccat-kovaplus.c:277:8-16: WARNING: use scnprintf or 
sprintf
./drivers/hid/hid-roccat-kovaplus.c:339:8-16: WARNING: use scnprintf or 
sprintf
./drivers/hid/hid-roccat-kovaplus.c:349:8-16: WARNING: use scnprintf or 
sprintf
./drivers/hid/hid-roccat-kovaplus.c:370:8-16: WARNING: use scnprintf or 
sprintf

Signed-off-by: ztt <1549089851@qq.com>
---
  drivers/hid/hid-roccat-kovaplus.c | 10 +++++-----
  1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/hid-roccat-kovaplus.c 
b/drivers/hid/hid-roccat-kovaplus.c
index 1a1d96e11683..282e26f55074 100644
--- a/drivers/hid/hid-roccat-kovaplus.c
+++ b/drivers/hid/hid-roccat-kovaplus.c
@@ -274,7 +274,7 @@ static ssize_t 
kovaplus_sysfs_show_actual_profile(struct device *dev,
  {
      struct kovaplus_device *kovaplus =
              hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-    return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile);
+    return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_profile);
  }

  static ssize_t kovaplus_sysfs_set_actual_profile(struct device *dev,
@@ -327,7 +327,7 @@ static ssize_t kovaplus_sysfs_show_actual_cpi(struct 
device *dev,
  {
      struct kovaplus_device *kovaplus =
              hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-    return snprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi);
+    return scnprintf(buf, PAGE_SIZE, "%d\n", kovaplus->actual_cpi);
  }
  static DEVICE_ATTR(actual_cpi, 0440, kovaplus_sysfs_show_actual_cpi, 
NULL);

@@ -336,7 +336,7 @@ static ssize_t 
kovaplus_sysfs_show_actual_sensitivity_x(struct device *dev,
  {
      struct kovaplus_device *kovaplus =
              hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-    return snprintf(buf, PAGE_SIZE, "%d\n", 
kovaplus->actual_x_sensitivity);
+    return scnprintf(buf, PAGE_SIZE, "%d\n", 
kovaplus->actual_x_sensitivity);
  }
  static DEVICE_ATTR(actual_sensitivity_x, 0440,
             kovaplus_sysfs_show_actual_sensitivity_x, NULL);
@@ -346,7 +346,7 @@ static ssize_t 
kovaplus_sysfs_show_actual_sensitivity_y(struct device *dev,
  {
      struct kovaplus_device *kovaplus =
              hid_get_drvdata(dev_get_drvdata(dev->parent->parent));
-    return snprintf(buf, PAGE_SIZE, "%d\n", 
kovaplus->actual_y_sensitivity);
+    return scnprintf(buf, PAGE_SIZE, "%d\n", 
kovaplus->actual_y_sensitivity);
  }
  static DEVICE_ATTR(actual_sensitivity_y, 0440,
             kovaplus_sysfs_show_actual_sensitivity_y, NULL);
@@ -367,7 +367,7 @@ static ssize_t 
kovaplus_sysfs_show_firmware_version(struct device *dev,
              &info, KOVAPLUS_SIZE_INFO);
      mutex_unlock(&kovaplus->kovaplus_lock);

-    return snprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
+    return scnprintf(buf, PAGE_SIZE, "%d\n", info.firmware_version);
  }
  static DEVICE_ATTR(firmware_version, 0440,
             kovaplus_sysfs_show_firmware_version, NULL);

           reply	other threads:[~2023-07-13  9:42 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <tencent_F6951CE34644A8B408B524E70F0283D50F08@qq.com>]

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=bad7fd90191a531ebf10816f48d3012f@208suo.com \
    --to=hanyu001@208suo.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=erazor_de@users.sourceforge.net \
    --cc=jikos@kernel.org \
    --cc=linux-input@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