Skip to contentSkip to conversation

r852: remove casts from void*

PATCH Applied Kulikov Vasiliy 4 participants 6 messages Jun 29, 2010 – Jul 13, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/25 r852: remove casts from void*

Remove unnesessary casts from void*.

---
 drivers/mtd/nand/r852.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/mtd/nand/r852.c +2 -2
index 78a4232..c0a9835 100644
@@ -64,8 +64,8 @@ static inline void r852_write_reg_dword(struct r852_device *dev,
 /* returns pointer to our private structure */
 static inline struct r852_device *r852_get_dev(struct mtd_info *mtd)
 {
-	struct nand_chip *chip = (struct nand_chip *)mtd->priv;
-	return (struct r852_device *)chip->priv;
+	struct nand_chip *chip = mtd->priv;
+	return chip->priv;
 }
 
 
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 2 lines · Kulikov Vasiliy

Remove unnesessary casts from void*.

1) The subjects are not helpful. This one should say something about "mtd" but it doesn't.
2) These haven't been run through checkpatch.pl. In fact, I can't be certain anyone looked at these patches when I see things like:

- if((( lp = (struct wl_private *)dev->priv ) != NULL ) &&
- !( lp->flags & WVLAN2_UIL_BUSY )) {
+ if((( lp = dev->priv ) != NULL ) &&
+ !( lp->flags & WVLAN2_UIL_BUSY )) {

On the recieving end, someone has to review every patch that gets merged.

regards,
dan carpenter

#2 lore raw
Quoted 14 lines · Dan Carpenter
Quoted 2 lines · Kulikov Vasiliy

Remove unnesessary casts from void*.

1) The subjects are not helpful. This one should say something about "mtd" but it doesn't.
2) These haven't been run through checkpatch.pl. In fact, I can't be certain anyone looked at these patches when I see things like:

(quoted diff) +2 -2
-    if((( lp = (struct wl_private *)dev->priv ) != NULL ) &&
-          !( lp->flags & WVLAN2_UIL_BUSY )) {
+    if((( lp = dev->priv ) != NULL ) &&
+       !( lp->flags & WVLAN2_UIL_BUSY )) {
Quoted 2 lines

On the recieving end, someone has to review every patch that gets merged.

same problem in drivers/scsi/sg.c but that would requiere a additional patch.

re,
wh

#3 lore raw
In reply to Dan Carpenter
Quoted 2 lines

1) The subjects are not helpful. This one should say something about "mtd" but it doesn't.

ok

Quoted 1 line

2) These haven't been run through checkpatch.pl.

Sorry for dummy question, but shouldn't code style be consistent? Somebody who will see old code and patched code will see one line with wrong-style code then one line with ok then one with wrong etc. Imho it's better to fix style in one big patch.

#4 lore raw
Quoted 9 lines · Kulikov Vasiliy
Quoted 2 lines

1) The subjects are not helpful. This one should say something about "mtd" but it doesn't.

ok

Quoted 1 line

2) These haven't been run through checkpatch.pl.

Sorry for dummy question, but shouldn't code style be consistent? Somebody who will see old code and patched code will see one line with wrong-style code then one line with ok then one with wrong etc. Imho it's better to fix style in one big patch.

No. If there's only one good line in a whole file, that's at least better than nothing.

regards,
dan carpenter