X86 platform drivers
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Hongling Zeng <zenghongling@kylinos.cn>
Cc: LKML <linux-kernel@vger.kernel.org>,
	platform-driver-x86@vger.kernel.org,  stuart.w.hayes@gmail.com,
	Hans de Goede <hdegoede@redhat.com>,
	 zhongling0719@126.com
Subject: Re: [PATCH] platform/x86: dell-dcdbase: Replace snprintf in show  functions with sysfs_emit
Date: Mon, 21 Oct 2024 13:53:59 +0300 (EEST)	[thread overview]
Message-ID: <49db5473-c7cc-b4e5-6166-cb56ba3dd7b0@linux.intel.com> (raw)
In-Reply-To: <20241021021412.5728-1-zenghongling@kylinos.cn>

On Mon, 21 Oct 2024, Hongling Zeng wrote:

>   show() must not use snprintf() when formatting the value to be

Please remove the extra spaces.

> returned to user space

Missing .

> Signed-off-by: Hongling Zeng <zenghongling@kylinos.cn>
> ---
>  drivers/platform/x86/dell/dcdbas.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/platform/x86/dell/dcdbas.c b/drivers/platform/x86/dell/dcdbas.c
> index a60e350..143fd0a 100644
> --- a/drivers/platform/x86/dell/dcdbas.c
> +++ b/drivers/platform/x86/dell/dcdbas.c
> @@ -132,14 +132,14 @@ static ssize_t smi_data_buf_phys_addr_show(struct device *dev,
>  					   struct device_attribute *attr,
>  					   char *buf)
>  {

Add #include <linux/sysfs.h> (I did this for you in the other patch when 
I realized it's missing).

Once you've fixed those 3 issues mentioned above, please send v2.

-- 
 i.

> -	return sprintf(buf, "%x\n", (u32)smi_buf.dma);
> +	return sysfs_emit(buf, "%x\n", (u32)smi_buf.dma);
>  }
>  
>  static ssize_t smi_data_buf_size_show(struct device *dev,
>  				      struct device_attribute *attr,
>  				      char *buf)
>  {
> -	return sprintf(buf, "%lu\n", smi_buf.size);
> +	return sysfs_emit(buf, "%lu\n", smi_buf.size);
>  }
>  
>  static ssize_t smi_data_buf_size_store(struct device *dev,
> @@ -200,7 +200,7 @@ static ssize_t host_control_action_show(struct device *dev,
>  					struct device_attribute *attr,
>  					char *buf)
>  {
> -	return sprintf(buf, "%u\n", host_control_action);
> +	return sysfs_emit(buf, "%u\n", host_control_action);
>  }
>  
>  static ssize_t host_control_action_store(struct device *dev,
> @@ -224,7 +224,7 @@ static ssize_t host_control_smi_type_show(struct device *dev,
>  					  struct device_attribute *attr,
>  					  char *buf)
>  {
> -	return sprintf(buf, "%u\n", host_control_smi_type);
> +	return sysfs_emit(buf, "%u\n", host_control_smi_type);
>  }
>  
>  static ssize_t host_control_smi_type_store(struct device *dev,
> @@ -239,7 +239,7 @@ static ssize_t host_control_on_shutdown_show(struct device *dev,
>  					     struct device_attribute *attr,
>  					     char *buf)
>  {
> -	return sprintf(buf, "%u\n", host_control_on_shutdown);
> +	return sysfs_emit(buf, "%u\n", host_control_on_shutdown);
>  }
>  
>  static ssize_t host_control_on_shutdown_store(struct device *dev,
> 

      reply	other threads:[~2024-10-21 10:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-21  2:14 [PATCH] platform/x86: dell-dcdbase: Replace snprintf in show functions with sysfs_emit Hongling Zeng
2024-10-21 10:53 ` Ilpo Järvinen [this message]

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=49db5473-c7cc-b4e5-6166-cb56ba3dd7b0@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=stuart.w.hayes@gmail.com \
    --cc=zenghongling@kylinos.cn \
    --cc=zhongling0719@126.com \
    /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