dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Han Jingoo <jingoohan1@gmail.com>
To: cgel.zte@gmail.com
Cc: daniel.thompson@linaro.org, ye xingchen <ye.xingchen@zte.com.cn>,
	deller@gmx.de, lee@kernel.org, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH linux-next] backlight: use sysfs_emit() to instead of scnprintf()
Date: Fri, 23 Sep 2022 14:04:03 -0700	[thread overview]
Message-ID: <CAPOBaE5FHNUCND1zOr3H7sBw_H7fK8Pvfi+Y=6SQHmkGSt9wUg@mail.gmail.com> (raw)
In-Reply-To: <20220923063448.239259-1-ye.xingchen@zte.com.cn>

On Thu, Sep 22, 2022 <cgel.zte@gmail.com> wrote:
>
> From: ye xingchen <ye.xingchen@zte.com.cn>
>
> Replace the open-code with sysfs_emit() to simplify the code.
>
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/lm3533_bl.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/video/backlight/lm3533_bl.c b/drivers/video/backlight/lm3533_bl.c
> index 1df1b6643c0b..5e2ce9285245 100644
> --- a/drivers/video/backlight/lm3533_bl.c
> +++ b/drivers/video/backlight/lm3533_bl.c
> @@ -66,7 +66,7 @@ static ssize_t show_id(struct device *dev,
>  {
>         struct lm3533_bl *bl = dev_get_drvdata(dev);
>
> -       return scnprintf(buf, PAGE_SIZE, "%d\n", bl->id);
> +       return sysfs_emit(buf, "%d\n", bl->id);
>  }
>
>  static ssize_t show_als_channel(struct device *dev,
> @@ -75,7 +75,7 @@ static ssize_t show_als_channel(struct device *dev,
>         struct lm3533_bl *bl = dev_get_drvdata(dev);
>         unsigned channel = lm3533_bl_get_ctrlbank_id(bl);
>
> -       return scnprintf(buf, PAGE_SIZE, "%u\n", channel);
> +       return sysfs_emit(buf, "%u\n", channel);
>  }
>
>  static ssize_t show_als_en(struct device *dev,
> @@ -95,7 +95,7 @@ static ssize_t show_als_en(struct device *dev,
>         mask = 1 << (2 * ctrlbank);
>         enable = val & mask;
>
> -       return scnprintf(buf, PAGE_SIZE, "%d\n", enable);
> +       return sysfs_emit(buf, "%d\n", enable);
>  }
>
>  static ssize_t store_als_en(struct device *dev,
> @@ -147,7 +147,7 @@ static ssize_t show_linear(struct device *dev,
>         else
>                 linear = 0;
>
> -       return scnprintf(buf, PAGE_SIZE, "%x\n", linear);
> +       return sysfs_emit(buf, "%x\n", linear);
>  }
>
>  static ssize_t store_linear(struct device *dev,
> @@ -190,7 +190,7 @@ static ssize_t show_pwm(struct device *dev,
>         if (ret)
>                 return ret;
>
> -       return scnprintf(buf, PAGE_SIZE, "%u\n", val);
> +       return sysfs_emit(buf, "%u\n", val);
>  }
>
>  static ssize_t store_pwm(struct device *dev,
> --
> 2.25.1

  reply	other threads:[~2022-09-23 21:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-23  6:34 [PATCH linux-next] backlight: use sysfs_emit() to instead of scnprintf() cgel.zte
2022-09-23 21:04 ` Han Jingoo [this message]
2022-09-26 13:26 ` Daniel Thompson
2022-12-05  7:56 ye.xingchen
2022-12-09 12:51 ` Daniel Thompson
2023-01-04 16:21 ` Lee Jones

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='CAPOBaE5FHNUCND1zOr3H7sBw_H7fK8Pvfi+Y=6SQHmkGSt9wUg@mail.gmail.com' \
    --to=jingoohan1@gmail.com \
    --cc=cgel.zte@gmail.com \
    --cc=daniel.thompson@linaro.org \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=lee@kernel.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ye.xingchen@zte.com.cn \
    /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 NNTP newsgroup(s).