Use ARRAY_SIZE() macro
Replace the common sizeof(a)/sizeof(a[0]) constructions with a more readable version. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
39044a7033
commit
e7ecab4a3b
22 changed files with 51 additions and 56 deletions
|
@ -182,7 +182,7 @@ set80211priv(struct madwifi_driver_data *drv, int op, void *data, int len)
|
|||
#endif /* MADWIFI_NG */
|
||||
int idx = op - first;
|
||||
if (first <= op &&
|
||||
idx < (int) (sizeof(opnames) / sizeof(opnames[0])) &&
|
||||
idx < (int) ARRAY_SIZE(opnames) &&
|
||||
opnames[idx])
|
||||
perror(opnames[idx]);
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue