mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: Maxwell Doose <m32285159@gmail.com>,
	ak@it-klinger.de, dlechner@baylibre.com, nuno.sa@analog.com,
	andy@kernel.org, linux-iio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5] iio: proximity: srf08: Replace sprintf() with sysfs_emit()
Date: Fri, 24 Apr 2026 18:53:27 +0100	[thread overview]
Message-ID: <20260424185327.66914793@jic23-huawei> (raw)
In-Reply-To: <aejE42knD_s5rsGy@ashevche-desk.local>

On Wed, 22 Apr 2026 15:53:55 +0300
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:

> On Wed, Apr 22, 2026 at 07:45:05AM -0500, Maxwell Doose wrote:
> > Replace sprintf() function calls with sysfs_emit() and
> > sysfs_emit_at(). While the current code is fine, sysfs_emit() is
> > preferred over sprintf(), and will help modernize the driver.  
> 
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> 
> ...
> 
> >  v5:
> >  - Reversed decision to put sysfs_emit() call on one line per Jonathan
> >    Cameron's request.  
> 
> Oh, I missed that. In any case I consider my suggestion is still better,
> it keeps driver in limits and makes the wrap on logical boundary.
I'm a bit lost on which of us is asking for what and can't figure it out
from the patch history.  Anyhow, I did make one tweak whilst applying -
I think some confusion occurred as I don't think we'd disagree on this one
and you called it out in an earlier review.

diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c
index 2ec8d0732763..92a37ba331f6 100644
--- a/drivers/iio/proximity/srf08.c
+++ b/drivers/iio/proximity/srf08.c
@@ -317,7 +317,7 @@ static ssize_t srf08_show_sensitivity_available(struct device *dev,
        for (i = 0; i < data->chip_info->num_sensitivity_avail; i++)
                if (data->chip_info->sensitivity_avail[i])
                        len += sysfs_emit_at(buf, len, "%d ",
-                               data->chip_info->sensitivity_avail[i]);
+                                            data->chip_info->sensitivity_avail[i]);
 
        len += sysfs_emit_at(buf, len, "\n");

It's only just over 80 chars and flipping to 
		if (!data->chip_info->sensitivity_avail[i])
			continue;
		len += sysfs_emit_at(..

doesn't seem worth the effort.
 
With that applied to the testing branch of iio.git.

Thanks,

Jonathan

> 
> >  - Fixed some of my editor's tab-spacing issues  
> 


  reply	other threads:[~2026-04-24 17:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22 12:45 Maxwell Doose
2026-04-22 12:53 ` Andy Shevchenko
2026-04-24 17:53   ` Jonathan Cameron [this message]
2026-04-24 18:18     ` Maxwell Doose

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=20260424185327.66914793@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=ak@it-klinger.de \
    --cc=andriy.shevchenko@intel.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m32285159@gmail.com \
    --cc=nuno.sa@analog.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

all inboxes | Powered by JetHome®