[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aHd4MIJR4JjJTIWC@smile.fi.intel.com>
Date: Wed, 16 Jul 2025 13:00:16 +0300
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: Jonathan Cameron <jic23@...nel.org>, Jean Delvare <jdelvare@...e.com>,
Guenter Roeck <linux@...ck-us.net>, linux-iio@...r.kernel.org,
linux-hwmon@...r.kernel.org, Andy Shevchenko <andy@...nel.org>,
Nuno Sá <nuno.sa@...log.com>,
linux-kernel@...r.kernel.org, David Lechner <dlechner@...libre.com>
Subject: Re: [PATCH 5/7] hwmon: iio: Add helper function for creating
attributes
On Tue, Jul 15, 2025 at 11:55:08AM -0400, Sean Anderson wrote:
> On 7/15/25 04:38, Andy Shevchenko wrote:
> > On Mon, Jul 14, 2025 at 09:20:21PM -0400, Sean Anderson wrote:
...
> >> +static int add_device_attr(struct device *dev, struct iio_hwmon_state *st,
> >
> > This should hint that this is managed:
> >
> > add_device_managed_attr()
>
> That just makes it more difficult to format the calling code within 80 columns...
Choose your name, but important that it should hint the caller that it's only
for the ->probe() stages.
...
> >> + ssize_t (*show)(struct device *dev,
> >> + struct device_attribute *attr,
> >> + char *buf),
> >> + int i, const char *fmt, ...)
> >
> > __printf() attribute is missing.
>
> It's static, so I thought the compiler could infer it but I guess not.
TBH, I haven't checked, but I think it might be the good style to add.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists