From: Guenter Roeck <linux@roeck-us.net>
To: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Cc: Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (ad7414) cleanup codestyle
Date: Fri, 15 Oct 2021 15:01:26 -0700 [thread overview]
Message-ID: <c46c3b62-ee95-8d01-2f45-0110ecf942b8@roeck-us.net> (raw)
In-Reply-To: <20211015122843.135814-1-sohaib.amhmd@gmail.com>
On 10/15/21 5:28 AM, Sohaib Mohamed wrote:
> - Add a blank line after declarations
> - Prefer using '"%s...", __func__' to using 'ad7414_probe'
> - Don't split strings across lines
>
> Signed-off-by: Sohaib Mohamed <sohaib.amhmd@gmail.com>
Please refrain from such cleanup patches unless you also make functional changes to a driver.
Guenter
> ---
> drivers/hwmon/ad7414.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c
> index 0afb89c4629d..52df6005812c 100644
> --- a/drivers/hwmon/ad7414.c
> +++ b/drivers/hwmon/ad7414.c
> @@ -107,6 +107,7 @@ static ssize_t temp_input_show(struct device *dev,
> struct device_attribute *attr, char *buf)
> {
> struct ad7414_data *data = ad7414_update_device(dev);
> +
> return sprintf(buf, "%d\n", ad7414_temp_from_reg(data->temp_input));
> }
> static SENSOR_DEVICE_ATTR_RO(temp1_input, temp_input, 0);
> @@ -116,6 +117,7 @@ static ssize_t max_min_show(struct device *dev, struct device_attribute *attr,
> {
> int index = to_sensor_dev_attr(attr)->index;
> struct ad7414_data *data = ad7414_update_device(dev);
> +
> return sprintf(buf, "%d\n", data->temps[index] * 1000);
> }
>
> @@ -152,6 +154,7 @@ static ssize_t alarm_show(struct device *dev, struct device_attribute *attr,
> int bitnr = to_sensor_dev_attr(attr)->index;
> struct ad7414_data *data = ad7414_update_device(dev);
> int value = (data->temp_input >> bitnr) & 1;
> +
> return sprintf(buf, "%d\n", value);
> }
>
> @@ -192,7 +195,7 @@ static int ad7414_probe(struct i2c_client *client)
> /* Make sure the chip is powered up. */
> conf = i2c_smbus_read_byte_data(client, AD7414_REG_CONF);
> if (conf < 0)
> - dev_warn(dev, "ad7414_probe unable to read config register.\n");
> + dev_warn(dev, "%s unable to read config register.\n", __func__);
> else {
> conf &= ~(1 << 7);
> i2c_smbus_write_byte_data(client, AD7414_REG_CONF, conf);
> @@ -227,8 +230,7 @@ static struct i2c_driver ad7414_driver = {
>
> module_i2c_driver(ad7414_driver);
>
> -MODULE_AUTHOR("Stefan Roese <sr at denx.de>, "
> - "Frank Edelhaeuser <frank.edelhaeuser at spansion.com>");
> +MODULE_AUTHOR("Stefan Roese <sr at denx.de>, Frank Edelhaeuser <frank.edelhaeuser at spansion.com>");
>
> MODULE_DESCRIPTION("AD7414 driver");
> MODULE_LICENSE("GPL");
>
prev parent reply other threads:[~2021-10-15 22:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 12:28 [PATCH] hwmon: (ad7414) cleanup codestyle Sohaib Mohamed
2021-10-15 22:01 ` Guenter Roeck [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=c46c3b62-ee95-8d01-2f45-0110ecf942b8@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sohaib.amhmd@gmail.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;
as well as URLs for NNTP newsgroup(s).