2010-06-29 10:15:06

by Kulikov Vasiliy

[permalink] [raw]
Subject: [PATCH 01/25] r852: remove casts from void*

Remove unnesessary casts from void*.

Signed-off-by: Kulikov Vasiliy <[email protected]>
---
drivers/mtd/nand/r852.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/r852.c b/drivers/mtd/nand/r852.c
index 78a4232..c0a9835 100644
--- a/drivers/mtd/nand/r852.c
+++ b/drivers/mtd/nand/r852.c
@@ -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;
}


--
1.7.0.4


2010-06-29 12:44:44

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/25] r852: remove casts from void*

On Tue, Jun 29, 2010 at 02:14:57PM +0400, Kulikov Vasiliy wrote:
> 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

2010-06-29 12:57:06

by walter harms

[permalink] [raw]
Subject: Re: [PATCH 01/25] r852: remove casts from void*



Dan Carpenter schrieb:
> On Tue, Jun 29, 2010 at 02:14:57PM +0400, Kulikov Vasiliy wrote:
>> 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.
>


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

re,
wh

2010-06-29 15:28:32

by Kulikov Vasiliy

[permalink] [raw]
Subject: Re: [PATCH 01/25] r852: remove casts from void*

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

> 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.

2010-06-29 19:03:26

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH 01/25] r852: remove casts from void*

On Tue, Jun 29, 2010 at 07:28:26PM +0400, Kulikov Vasiliy wrote:
> > 1) The subjects are not helpful. This one should say something about
> > "mtd" but it doesn't.
> ok
>
> > 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

2010-07-13 10:22:44

by Artem Bityutskiy

[permalink] [raw]
Subject: Re: [PATCH 01/25] r852: remove casts from void*

On Tue, 2010-06-29 at 14:14 +0400, Kulikov Vasiliy wrote:
> Remove unnesessary casts from void*.
>
> Signed-off-by: Kulikov Vasiliy <[email protected]>

Pushed whole series to l2-mtd-2.6.git / master.

--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)