Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1451892
| From | "Lino Sanfilippo" <LinoSanfilippo@gmx.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Aw: Re: staging: wilc1000: Reduce scope for a few variables in mac_ioctl() |
| Date | 2016-07-28 13:50 +0200 |
| Message-ID | <rZRZ8-5HN-7@gated-at.bofh.it> (permalink) |
| References | <rZRZ8-5HN-9@gated-at.bofh.it> <rZ42m-6Xo-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> Gesendet: Dienstag, 26. Juli 2016 um 08:25 Uhr
> Von: "SF Markus Elfring" <elfring@users.sourceforge.net>
>
> >> - if (strncasecmp(buff, "RSSI", length) == 0) {
> >> + if (strncasecmp(buff, "RSSI", 0) == 0) {
> >> + s8 rssi;
> >> +
> >
> > Um, please think a second about if it makes any sense at all to compare
> > zero chars of two strings.
>
> Under which circumstances should the variable "length" contain an other
> value than zero?
Which circumstances do "not any sense at all" imply?
>
> How can this open issue be fixed better?
The code is not too complicated and I think it is very obvious which value/variable
should be passed instead of 0. I suggest to fix this since it is indeed a bug, instead of
doing "micro optimizations" - which is the last thing that code in the staging area
needs (as IIRC you have already been told by others, including the staging maintainer).
Regards,
Lino
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: staging: wilc1000: Reduce scope for a few variables in mac_ioctl() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-26 08:30 +0200
Aw: Re: staging: wilc1000: Reduce scope for a few variables in mac_ioctl() "Lino Sanfilippo" <LinoSanfilippo@gmx.de> - 2016-07-28 13:50 +0200
Re: staging: wilc1000: Reduce scope for a few variables in mac_ioctl() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-07-28 18:10 +0200
csiph-web