From: Chris Packham <chris.packham@alliedtelesis.co.nz>
To: jdelvare@suse.com, linux@roeck-us.net
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
Chris Packham <chris.packham@alliedtelesis.co.nz>
Subject: [PATCH v2 1/4] hwmon: (adt7470) Fix some style issues
Date: Thu, 26 Aug 2021 14:41:18 +1200 [thread overview]
Message-ID: <20210826024121.15665-2-chris.packham@alliedtelesis.co.nz> (raw)
In-Reply-To: <20210826024121.15665-1-chris.packham@alliedtelesis.co.nz>
In preparation for the changes that follow fix up some existing style
issues.
Specifically:
- add blank line between variable declaration and code
- use strscpy instead of strlcpy
- remove unnecessary braces
Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
Changes in v2:
- new
drivers/hwmon/adt7470.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c
index 2e8feacccf84..3358ec58b977 100644
--- a/drivers/hwmon/adt7470.c
+++ b/drivers/hwmon/adt7470.c
@@ -174,6 +174,7 @@ struct adt7470_data {
static inline int adt7470_read_word_data(struct i2c_client *client, u8 reg)
{
u16 foo;
+
foo = i2c_smbus_read_byte_data(client, reg);
foo |= ((u16)i2c_smbus_read_byte_data(client, reg + 1) << 8);
return foo;
@@ -1282,7 +1283,7 @@ static int adt7470_detect(struct i2c_client *client,
if (revision != ADT7470_REVISION)
return -ENODEV;
- strlcpy(info->type, "adt7470", I2C_NAME_SIZE);
+ strscpy(info->type, "adt7470", I2C_NAME_SIZE);
return 0;
}
@@ -1331,9 +1332,8 @@ static int adt7470_probe(struct i2c_client *client)
data->auto_update = kthread_run(adt7470_update_thread, client, "%s",
dev_name(hwmon_dev));
- if (IS_ERR(data->auto_update)) {
+ if (IS_ERR(data->auto_update))
return PTR_ERR(data->auto_update);
- }
return 0;
}
--
2.32.0
next prev parent reply other threads:[~2021-08-26 2:42 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 2:41 [PATCH v2 0/4] hwmon: (adt7470) Clean up Chris Packham
2021-08-26 2:41 ` Chris Packham [this message]
2021-08-27 21:15 ` [PATCH v2 1/4] hwmon: (adt7470) Fix some style issues Guenter Roeck
2021-08-26 2:41 ` [PATCH v2 2/4] hwmon: (adt7470) Convert to use regmap Chris Packham
2021-08-27 21:17 ` Guenter Roeck
2021-08-26 2:41 ` [PATCH v2 3/4] hwmon: (adt7470) Convert to devm_hwmon_device_register_with_info API Chris Packham
2021-08-27 21:26 ` Guenter Roeck
2021-08-26 2:41 ` [PATCH v2 4/4] hwmon: (adt7470) Use standard update_interval property Chris Packham
2021-08-27 21:29 ` Guenter Roeck
2021-08-29 21:09 ` Chris Packham
2021-08-30 15:36 ` Guenter Roeck
2021-08-30 20:59 ` Chris Packham
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=20210826024121.15665-2-chris.packham@alliedtelesis.co.nz \
--to=chris.packham@alliedtelesis.co.nz \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
/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).