On Mon, 2007-02-26 at 20:18 -0500, Pavel Roskin wrote: > That's subtraction of pointers to types with sizes that are not power of > two. This could lead to expensive division operations. In may cases, > this warning indicates that using array indices instead of pointers > would be more effective (and probably safer). Yeah, figured that out after I sent it but then went to bed instead. The fix in that case is pretty easy, just replace the looping through with an index-based loop and then you already have rateidx. > > net/d80211/ieee80211_ioctl.c:779:4: warning: incorrect type in argument 6 (different signedness) > > net/d80211/ieee80211_ioctl.c:779:4: expected int *err > > net/d80211/ieee80211_ioctl.c:779:4: got unsigned int *<noident> > > ieee80211_set_encryption() expects a pointer to (signed) integer, be the > code is giving it a pointer to u32. Please decide what type "err" > should have, and change the function accordingly. > > I think "u32" would be better, since it's a part of the hostapd > compatibility code and we don't want to touch the userspace now. This > code is going to be obsoleted with the rest of hostapd interface. For > now, it's better to do exactly what the userspace expects. I guess. The argument appears to also not be used in any case other than this one. > In case you are wondering, the test case is: Yeah, I thought it'd be due to the locked flag. But Linus is perfectly right, we should have a _locked version instead of using a flag. But on the topic of sparse/locks: Does anybody know how to make sparse recognise that I provide my own locking wrapper? If you check out bcm43xx-d80211, it'll complain about the phy lock function since it just locks, and then complain about phy unlock since it only unlocks. Would be nice if it could be told that these are opaque, correct, and lock a certain lock that it should check for in the callers. johannes
Attachment:
signature.asc
Description: This is a digitally signed message part