Skip to contentSkip to conversation

staging: greybus: i2c: remove unused pointers

PATCH Superseded Lourdes Pedrajas 4 participants 6 messages Mar 12, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: greybus: i2c: remove unused pointers

Remove unused pointers in gb_i2c_functionality() and int gb_i2c_probe() functions.

---
 drivers/staging/greybus/i2c.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/greybus/i2c.c +0 -2
index c48fa1de89b0..de2f6516da09 100644
@@ -224,7 +224,6 @@ static u32 gb_i2c_functionality(struct i2c_adapter *adap)
 
 static const struct i2c_algorithm gb_i2c_algorithm = {
 	.master_xfer	= gb_i2c_master_xfer,
-	/* .smbus_xfer	= gb_i2c_smbus_xfer, */
 	.functionality	= gb_i2c_functionality,
 };
 
@@ -267,7 +266,6 @@ static int gb_i2c_probe(struct gbphy_device *gbphy_dev,
 	adapter->owner = THIS_MODULE;
 	adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
 	adapter->algo = &gb_i2c_algorithm;
-	/* adapter->algo_data = what? */
 
 	adapter->dev.parent = &gbphy_dev->dev;
 	snprintf(adapter->name, sizeof(adapter->name), "Greybus i2c adapter");
Signature · 1 line
2.17.1
#1 lore raw
Quoted 2 lines · Lourdes Pedrajas

Remove unused pointers in gb_i2c_functionality() and int gb_i2c_probe() functions.

There is no connection to gb_i2c_functionality. Diff doesn't provide the right location information when the code extract covers two top level entities.

You can refer to gb_i2c_probe without the return type.

It could be helpful to mention how long this code has been commented out. You can find this with git blame.

julia

Quoted 35 lines
---
 drivers/staging/greybus/i2c.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/greybus/i2c.c +0 -3
index c48fa1de89b0..de2f6516da09 100644
@@ -224,7 +224,6 @@ static u32 gb_i2c_functionality(struct i2c_adapter *adap)
 
 static const struct i2c_algorithm gb_i2c_algorithm = {
 	.master_xfer	= gb_i2c_master_xfer,
-	/* .smbus_xfer	= gb_i2c_smbus_xfer, */
 	.functionality	= gb_i2c_functionality,
 };
 
@@ -267,7 +266,6 @@ static int gb_i2c_probe(struct gbphy_device *gbphy_dev,
 	adapter->owner = THIS_MODULE;
 	adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
 	adapter->algo = &gb_i2c_algorithm;
-	/* adapter->algo_data = what? */
 
 	adapter->dev.parent = &gbphy_dev->dev;
 	snprintf(adapter->name, sizeof(adapter->name), "Greybus i2c adapter");
--

2.17.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20200312121222.6609-1-lu%40pplo.net.

#3 lore raw
In reply to Lourdes Pedrajas
Quoted 1 line · On Thu, 12 Mar 2020 13:12:22 +0100 Lourdes Pedrajas <[email protected]> wrote:

Remove unused pointers in gb_i2c_functionality() and int gb_i2c_probe()

No, wait, gb_i2c_functionality() is a function, but you're not touching it. I guess you got confused by 'git diff'.

Quoted 4 lines

functions.

This might be a pet peeve of mine, I'm quite sure I've seen similar observations by others (on netdev?) but I can't find related messages right now: I think it's nice to reflect a temporal or causal ordering here.

That is, Johan suggested it, and you made the change, so Suggested-by:
should come first. It helps following the logic, especially with growing numbers of tags.

What I personally do, and this is totally subject to taste (hence not documented or formalised), is:

1. Reported-by/Suggested-by: (if any)
2. Fixes: (if any)
3. Co-authored-by: (if any)
4. Signed-off-by:
5. Reviewed-by/Acked-by: (if I'm carrying any before they are added by the maintainer)

Signature · 1 line
Stefano
maintainer
#5 lore raw
In reply to Lourdes Pedrajas
Quoted 2 lines · Lourdes Pedrajas

Remove unused pointers in gb_i2c_functionality() and int gb_i2c_probe() functions.

The out-commented function pointer is in the gb_i2c_algorithm struct, not gb_i2c_functionality().

Looks good otherwise.

Quoted 19 lines
---
 drivers/staging/greybus/i2c.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/greybus/i2c.c +0 -1
index c48fa1de89b0..de2f6516da09 100644
@@ -224,7 +224,6 @@ static u32 gb_i2c_functionality(struct i2c_adapter *adap)
 
 static const struct i2c_algorithm gb_i2c_algorithm = {
 	.master_xfer	= gb_i2c_master_xfer,
-	/* .smbus_xfer	= gb_i2c_smbus_xfer, */
 	.functionality	= gb_i2c_functionality,
 };
 

drivers/staging/greybus/i2c.c static int gb_i2c_probe(struct gbphy_device *gbphy_dev, · line 271

Quoted 7 lines
drivers/staging/greybus/i2c.c +0 -1
@@ -267,7 +266,6 @@ static int gb_i2c_probe(struct gbphy_device *gbphy_dev,
 	adapter->owner = THIS_MODULE;
 	adapter->class = I2C_CLASS_HWMON | I2C_CLASS_SPD;
 	adapter->algo = &gb_i2c_algorithm;
-	/* adapter->algo_data = what? */
 
 	adapter->dev.parent = &gbphy_dev->dev;
 	snprintf(adapter->name, sizeof(adapter->name), "Greybus i2c adapter");

Johan

#2 lore raw
In reply to Julia Lawall
Quoted 11 lines · Julia Lawall
Quoted 2 lines · Lourdes Pedrajas

Remove unused pointers in gb_i2c_functionality() and int gb_i2c_probe() functions.

There is no connection to gb_i2c_functionality. Diff doesn't provide the right location information when the code extract covers two top level entities.

Quoted 7 lines

You can refer to gb_i2c_probe without the return type.

It could be helpful to mention how long this code has been commented out. You can find this with git blame.

julia

I agree, thank you, Julia.

Lourdes.

#4 lore raw
In reply to Stefano Brivio
Quoted 18 lines · Stefano Brivio
Quoted 2 lines · On Thu, 12 Mar 2020 13:12:22 +0100 Lourdes Pedrajas <[email protected]> wrote:

This might be a pet peeve of mine, I'm quite sure I've seen similar observations by others (on netdev?) but I can't find related messages right now: I think it's nice to reflect a temporal or causal ordering here.

That is, Johan suggested it, and you made the change, so Suggested-by:
should come first. It helps following the logic, especially with growing numbers of tags.

What I personally do, and this is totally subject to taste (hence not documented or formalised), is:

Quoted 10 lines

1. Reported-by/Suggested-by: (if any)
2. Fixes: (if any)
3. Co-authored-by: (if any)
4. Signed-off-by:
5. Reviewed-by/Acked-by: (if I'm carrying any before they are added by the maintainer)

Signature · 1 line
Stefano

I will follow your advice for the ordering, thank you, Stefano!

Lourdes.