diff mbox series

[03/21] eeprom: at24: arrange local variables

Message ID 20180319091721.18193-4-brgl@bgdev.pl
State Awaiting Upstream
Headers show
Series None | expand

Commit Message

Bartosz Golaszewski March 19, 2018, 9:17 a.m. UTC
Arrange declarations of local variables by line length as visually
it's easier to read.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 drivers/misc/eeprom/at24.c | 26 ++++++++++++++++----------
 1 file changed, 16 insertions(+), 10 deletions(-)

Comments

gregkh@linuxfoundation.org March 23, 2018, 3:21 p.m. UTC | #1
On Mon, Mar 19, 2018 at 10:17:03AM +0100, Bartosz Golaszewski wrote:
> Arrange declarations of local variables by line length as visually
> it's easier to read.

That's the craziest thing I've seen in a while...

ok, if it makes it easier for you :)

greg k-h
Bartosz Golaszewski March 23, 2018, 4:06 p.m. UTC | #2
2018-03-23 16:21 GMT+01:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> On Mon, Mar 19, 2018 at 10:17:03AM +0100, Bartosz Golaszewski wrote:
>> Arrange declarations of local variables by line length as visually
>> it's easier to read.
>
> That's the craziest thing I've seen in a while...
>
> ok, if it makes it easier for you :)
>
> greg k-h

Hi Greg,

this isn't something unusual, see for example:

bef6b1b7a6ff ("nfp: reorder variables in nfp_net_tx()")
5318c53d5b4b ("crypto: s5p-sss - Use consistent indentation for
variables and members")

Thanks,
Bart
gregkh@linuxfoundation.org March 23, 2018, 4:37 p.m. UTC | #3
On Fri, Mar 23, 2018 at 05:06:30PM +0100, Bartosz Golaszewski wrote:
> 2018-03-23 16:21 GMT+01:00 Greg Kroah-Hartman <gregkh@linuxfoundation.org>:
> > On Mon, Mar 19, 2018 at 10:17:03AM +0100, Bartosz Golaszewski wrote:
> >> Arrange declarations of local variables by line length as visually
> >> it's easier to read.
> >
> > That's the craziest thing I've seen in a while...
> >
> > ok, if it makes it easier for you :)
> >
> > greg k-h
> 
> Hi Greg,
> 
> this isn't something unusual, see for example:
> 
> bef6b1b7a6ff ("nfp: reorder variables in nfp_net_tx()")
> 5318c53d5b4b ("crypto: s5p-sss - Use consistent indentation for
> variables and members")

I still say it is crazy :)
diff mbox series

Patch

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 2600657c7034..2a4154eeb1bd 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -370,11 +370,14 @@  static ssize_t at24_regmap_write(struct at24_data *at24, const char *buf,
 
 static int at24_read(void *priv, unsigned int off, void *val, size_t count)
 {
-	struct at24_data *at24 = priv;
-	struct device *dev = &at24->client[0].client->dev;
+	struct at24_data *at24;
+	struct device *dev;
 	char *buf = val;
 	int ret;
 
+	at24 = priv;
+	dev = &at24->client[0].client->dev;
+
 	if (unlikely(!count))
 		return count;
 
@@ -416,11 +419,14 @@  static int at24_read(void *priv, unsigned int off, void *val, size_t count)
 
 static int at24_write(void *priv, unsigned int off, void *val, size_t count)
 {
-	struct at24_data *at24 = priv;
-	struct device *dev = &at24->client[0].client->dev;
+	struct at24_data *at24;
+	struct device *dev;
 	char *buf = val;
 	int ret;
 
+	at24 = priv;
+	dev = &at24->client[0].client->dev;
+
 	if (unlikely(!count))
 		return -EINVAL;
 
@@ -515,15 +521,15 @@  static unsigned int at24_get_offset_adj(u8 flags, unsigned int byte_len)
 
 static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
 {
-	struct at24_platform_data chip = { 0 };
-	const struct at24_chip_data *cd = NULL;
-	bool writable;
-	struct at24_data *at24;
-	int err;
-	unsigned int i, num_addresses;
 	struct regmap_config regmap_config = { };
 	struct nvmem_config nvmem_config = { };
+	const struct at24_chip_data *cd = NULL;
+	struct at24_platform_data chip = { 0 };
+	unsigned int i, num_addresses;
+	struct at24_data *at24;
+	bool writable;
 	u8 test_byte;
+	int err;
 
 	if (client->dev.platform_data) {
 		chip = *(struct at24_platform_data *)client->dev.platform_data;