Search Linux Wireless

RE: [PATCH] mwifiex: remove casts of void pointers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Julian,

Thanks for your comments.

> -----Original Message-----
> From: Julian Calaby [mailto:julian.calaby@xxxxxxxxx]
> Sent: Sunday, June 19, 2011 6:10 PM
> To: Bing Zhao
> Cc: linux-wireless@xxxxxxxxxxxxxxx; John W. Linville; Johannes Berg; Amitkumar Karwar; Kiran Divekar;
> Yogesh Powar; Frank Huang; Joe Perches
> Subject: Re: [PATCH] mwifiex: remove casts of void pointers
> 
> Bing,
> 
> Good work!
> 
> There's one minor issue I've seen:
> 
> On Sat, Jun 18, 2011 at 09:14, Bing Zhao <bzhao@xxxxxxxxxxx> wrote:
> > diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
> > index 8af3a78..d5c987a 100644
> > --- a/drivers/net/wireless/mwifiex/sta_cmd.c
> > +++ b/drivers/net/wireless/mwifiex/sta_cmd.c
> > @@ -300,7 +291,7 @@ static int mwifiex_cmd_tx_power_cfg(struct host_cmd_ds_command *cmd,
> >                                  sizeof(struct mwifiex_types_power_group) +
> >                                  pg_tlv->length);
> >                } else {
> > -                       memmove(cmd_txp_cfg, data_buf,
> > +                       memmove(cmd_txp_cfg, txp,
> >                                sizeof(struct host_cmd_ds_txpwr_cfg));
> 
> this could be replace with
> 
> memmove(cmd_txp_cfg, txp, sizeof(*txp));
> 
> I think (I might be wrong about the argument to sizeof().)

I think that sizeof(struct host_cmd_ds_txpwr_cfg) and sizeof(*txp) are the same. Since more people prefer the later I will re-send v2 patch to address above change.

> 
> 
> Also, there are a number of functions touched by this patch that
> return a value through the former *data_buf parameter. Is it possible
> to refactor them to return the value directly? This would make the
> function flow a lot cleaner and easier to follow.

We will investigate this and update you later.

Thanks,
Bing
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux