- 20 Oct, 2014 40 commits
-
-
Aya Mahfouz authored
staging: vt6655: wmgr.c and wmgr.h: replace memcpy() by ether_addr_copy() using coccinelle and pack variable This patch focuses on fixing the following warning generated by checkpatch.pl for the file wmgr.c : Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) The changes were applied using the following coccinelle rule: @@ expression e1, e2; @@ - memcpy(e1, e2, ETH_ALEN); + ether_addr_copy(e1, e2); According to ether_addr_copy() description and functionality, all Ethernet addresses should align to the u16 datatype. To maintain that the array abyCurrBSSID in tagSMgmtObject is aligned, it was placed after the int uCurrChannel in the struct definition. This was done in wmgr.h Here is the output of pahole for the relevant datastructures: struct sockaddr { sa_family_t sa_family; /* 0 2 */ char sa_data[14]; /* 2 14 */ /* size: 16, cachelines: 1, members: 2 */ /* last cacheline: 16 bytes */ }; struct tagSMgmtObject { void * pAdapter; /* 0 4 */ unsigned char abyMACAddr[6]; /* 4 6 */ /* XXX 2 bytes hole, try to pack */ WMAC_CONFIG_MODE eConfigMode; /* 12 4 */ CARD_PHY_TYPE eCurrentPHYMode; /* 16 4 */ CARD_PHY_TYPE eConfigPHYMode; /* 20 4 */ WMAC_CURRENT_MODE eCurrMode; /* 24 4 */ WMAC_BSS_STATE eCurrState; /* 28 4 */ PKnownBSS pCurrBSS; /* 32 4 */ unsigned char byCSSGK; /* 36 1 */ unsigned char byCSSPK; /* 37 1 */ /* XXX 2 bytes hole, try to pack */ unsigned int uCurrChannel; /* 40 4 */ unsigned char abyCurrBSSID[6]; /* 44 6 */ unsigned char abyCurrSuppRates[19]; /* 50 19 */ /* --- cacheline 1 boundary (64 bytes) was 5 bytes ago --- */ unsigned char abyCurrExtSuppRates[19]; /* 69 19 */ unsigned char abyCurrSSID[35]; /* 88 35 */ /* XXX 1 byte hole, try to pack */ short unsigned int wCurrCapInfo; /* 124 2 */ short unsigned int wCurrAID; /* 126 2 */ /* --- cacheline 2 boundary (128 bytes) --- */ short unsigned int wCurrATIMWindow; /* 128 2 */ short unsigned int wCurrBeaconPeriod; /* 130 2 */ bool bIsDS; /* 132 1 */ unsigned char byERPContext; /* 133 1 */ /* XXX 2 bytes hole, try to pack */ CMD_STATE eCommandState; /* 136 4 */ unsigned int uScanChannel; /* 140 4 */ unsigned char abyDesireSSID[35]; /* 144 35 */ unsigned char abyDesireBSSID[6]; /* 179 6 */ /* XXX 1 byte hole, try to pack */ short unsigned int wIBSSBeaconPeriod; /* 186 2 */ short unsigned int wIBSSATIMWindow; /* 188 2 */ /* XXX 2 bytes hole, try to pack */ /* --- cacheline 3 boundary (192 bytes) --- */ unsigned int uIBSSChannel; /* 192 4 */ unsigned char abyIBSSSuppRates[19]; /* 196 19 */ unsigned char byAPBBType; /* 215 1 */ unsigned char abyWPAIE[64]; /* 216 64 */ /* --- cacheline 4 boundary (256 bytes) was 24 bytes ago --- */ short unsigned int wWPAIELen; /* 280 2 */ /* XXX 2 bytes hole, try to pack */ unsigned int uAssocCount; /* 284 4 */ bool bMoreData; /* 288 1 */ /* XXX 3 bytes hole, try to pack */ WMAC_SCAN_STATE eScanState; /* 292 4 */ WMAC_SCAN_TYPE eScanType; /* 296 4 */ unsigned int uScanStartCh; /* 300 4 */ unsigned int uScanEndCh; /* 304 4 */ short unsigned int wScanSteps; /* 308 2 */ /* XXX 2 bytes hole, try to pack */ unsigned int uScanBSSType; /* 312 4 */ unsigned char abyScanSSID[35]; /* 316 35 */ /* --- cacheline 5 boundary (320 bytes) was 31 bytes ago --- */ unsigned char abyScanBSSID[6]; /* 351 6 */ /* XXX 3 bytes hole, try to pack */ WMAC_AUTHENTICATION_MODE eAuthenMode; /* 360 4 */ WMAC_ENCRYPTION_MODE eEncryptionMode; /* 364 4 */ bool bShareKeyAlgorithm; /* 368 1 */ unsigned char abyChallenge[128]; /* 369 128 */ /* --- cacheline 7 boundary (448 bytes) was 49 bytes ago --- */ bool bPrivacyInvoked; /* 497 1 */ bool bInTIM; /* 498 1 */ bool bMulticastTIM; /* 499 1 */ unsigned char byDTIMCount; /* 500 1 */ unsigned char byDTIMPeriod; /* 501 1 */ /* XXX 2 bytes hole, try to pack */ WMAC_POWER_MODE ePSMode; /* 504 4 */ short unsigned int wListenInterval; /* 508 2 */ short unsigned int wCountToWakeUp; /* 510 2 */ /* --- cacheline 8 boundary (512 bytes) --- */ bool bInTIMWake; /* 512 1 */ /* XXX 3 bytes hole, try to pack */ unsigned char * pbyPSPacketPool; /* 516 4 */ unsigned char byPSPacketPool[36]; /* 520 36 */ bool bRxBeaconInTBTTWake; /* 556 1 */ unsigned char abyPSTxMap[65]; /* 557 65 */ /* XXX 2 bytes hole, try to pack */ /* --- cacheline 9 boundary (576 bytes) was 48 bytes ago --- */ unsigned int uCmdBusy; /* 624 4 */ unsigned int uCmdHostAPBusy; /* 628 4 */ unsigned char * pbyMgmtPacketPool; /* 632 4 */ unsigned char byMgmtPacketPool[2352]; /* 636 2352 */ /* --- cacheline 46 boundary (2944 bytes) was 44 bytes ago --- */ struct timer_list sTimerSecondCallback; /* 2988 52 */ /* --- cacheline 47 boundary (3008 bytes) was 32 bytes ago --- */ SRxMgmtPacket sRxPacket; /* 3040 28 */ KnownBSS sBSSList[42]; /* 3068 57288 */ /* --- cacheline 943 boundary (60352 bytes) was 4 bytes ago --- */ KnownNodeDB sNodeDBTable[65]; /* 60356 20800 */ /* --- cacheline 1268 boundary (81152 bytes) was 4 bytes ago --- */ /* Bitfield combined with previous fields */ SPMKIDCache gsPMKIDCache; /* 0 356 */ bool bRoaming; /* 0 1 */ SAssocInfo sAssocInfo; /* 0 7064 */ bool b11hEnable; /* 0 1 */ bool bSwitchChannel; /* 0 1 */ unsigned char byNewChannel; /* 0 1 */ PWLAN_IE_MEASURE_REP pCurrMeasureEIDRep; /* 0 4 */ unsigned int uLengthOfRepEIDs; /* 0 4 */ unsigned char abyCurrentMSRReq[2352]; /* 0 2352 */ unsigned char abyCurrentMSRRep[2352]; /* 0 2352 */ unsigned char abyIECountry[2340]; /* 0 2340 */ unsigned char abyIBSSDFSOwner[6]; /* 0 6 */ unsigned char byIBSSDFSRecovery; /* 0 1 */ struct sk_buff skb; /* 0 192 */ /* XXX last struct has 4 bytes of padding */ /* --- cacheline 1497 boundary (95808 bytes) was 32 bytes ago --- */ /* size: 95840, cachelines: 1498, members: 81 */ /* sum members: 95813, holes: 13, sum holes: 27 */ /* padding: 30112 */ /* paddings: 1, sum paddings: 4 */ /* last cacheline: 32 bytes */ /* BRAIN FART ALERT! 95840 != 95813 + 27(holes), diff = 0 */ }; struct pmkid_candidate { NDIS_802_11_MAC_ADDRESS BSSID; /* 0 6 */ /* XXX 2 bytes hole, try to pack */ long unsigned int Flags; /* 8 4 */ /* size: 12, cachelines: 1, members: 2 */ /* sum members: 10, holes: 1, sum holes: 2 */ /* last cacheline: 12 bytes */ }; Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Aya Mahfouz authored
This patch focuses on fixing the following warning generated by checkpatch.pl for the file dpc.c : Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) The changes were applied using the following coccinelle rule: @@ expression e1, e2; @@ - memcpy(e1, e2, ETH_ALEN); + ether_addr_copy(e1, e2); According to ether_addr_copy() description and functionality, all Ethernet addresses should align to the u16 datatype. Here is the output of pahole for the relevant datastructures: struct tagS802_11Header { short unsigned int wFrameCtl; /* 0 2 */ short unsigned int wDurationID; /* 2 2 */ unsigned char abyAddr1[6]; /* 4 6 */ unsigned char abyAddr2[6]; /* 10 6 */ unsigned char abyAddr3[6]; /* 16 6 */ short unsigned int wSeqCtl; /* 22 2 */ unsigned char abyAddr4[6]; /* 24 6 */ /* size: 30, cachelines: 1, members: 7 */ /* last cacheline: 30 bytes */ }; struct iw_michaelmicfailure { __u32 flags; /* 0 4 */ struct sockaddr src_addr; /* 4 16 */ __u8 tsc[8]; /* 20 8 */ /* size: 28, cachelines: 1, members: 3 */ /* last cacheline: 28 bytes */ }; struct sockaddr { sa_family_t sa_family; /* 0 2 */ char sa_data[14]; /* 2 14 */ /* size: 16, cachelines: 1, members: 2 */ /* last cacheline: 16 bytes */ }; There is one thing to note though, sa_data is a char array of size 14. And the number of bytes copied using memcpy() or ether_addr_copy() is 6. Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Aya Mahfouz authored
This patch focuses on fixing the following warning generated by checkpatch.pl for the file rxtx.c : Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) The changes were applied using the following coccinelle rule: @@ expression e1, e2; @@ - memcpy(e1, e2, ETH_ALEN); + ether_addr_copy(e1, e2); According to ether_addr_copy() description and functionality, all Ethernet addresses should align to the u16 datatype. Here is the output of pahole for the relevant datastructures: struct pmkid_candidate { NDIS_802_11_MAC_ADDRESS BSSID; /* 0 6 */ /* XXX 2 bytes hole, try to pack */ long unsigned int Flags; /* 8 4 */ /* size: 12, cachelines: 1, members: 2 */ /* sum members: 10, holes: 1, sum holes: 2 */ /* last cacheline: 12 bytes */ }; Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
We don't do anything with these, so get rid of them Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Half the entries of struct wlan_phy_info weren't used and this makes the code a little cleaner Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
This fixes a potential endian bug Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Be consistent in the use of enum VCS_TYPE Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Jes Sorensen authored
Make sure struct eeprom_priv->mac_addr is 2 byte aligned to work with ether_addr_copy() Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vladimir A. Nazarenko authored
It's never enabled, so we can safely remove it. Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tapasweni Pathak authored
This patch removes dead code in private_ioctl function and iwctl_siwmode function, in file ioctl.c. Inside switch, for a case no code gets executed after break. This was detected by smatch. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
John Ledbetter authored
This fixes the following checkpatch.pl errors: drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1290 error: "foo* bar" should be "foo *bar" drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c:1305 error: "foo * bar" should be "foo *bar" Signed-off-by: John Ledbetter <john@throttle.io> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Rene Kolarik authored
Wrapping two too long lines in two files of the imx-drm driver. Signed-off-by: Rene Kolarik <rene.kolarik@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dzmitry Sledneu authored
Fix "out of memory" error handling Signed-off-by: Dzmitry Sledneu <dzmitry.sledneu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vladimir A. Nazarenko authored
There is code encapsulated in #if 1, let's remove it. Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Daeseok Youn authored
The dgap_init_module() need to unwind for cleanup variables properly. Because dgap_init_module() calls dgap_cleanup_module() for freeing variables but this function is possible to free variables which are not allocated. Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vladimir A. Nazarenko authored
This variable unused, so remove it. Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vladimir A. Nazarenko authored
Custom ioctl 0xff is legacy code that was used for patched version of wpa_supplicant, where function wpa_authen_Status_transfer() called this ioctl to tell authentication status to the driver. While from upstream was added only driver code to the kernel but not patches to the wpa_supplicant we can safely remove this unused ioctl. Signed-off-by: Vladimir A. Nazarenko <naszar@ya.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_ap.c WARNING: void function return statements are not generally useful Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_security.c WARNING: void function return statements are not generally useful Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_wlan_util.c WARNING: void function return statements are not generally useful Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_pwrctrl.c WARNING: void function return statements are not generally useful Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_mlme.c WARNING: void function return statements are not generally useful Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tapasweni Pathak authored
Below return statement dm_send_rssi_tofw function has dead code. This patch removes dead code from dm_send_rssi_tofw. This was detected by smatch. Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Tina Johnson authored
The following checkpatch warning was fixed: WARNING: line over 80 characters Signed-off-by: Tina Johnson <tinajohnson.1234@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Esra Altintas authored
This fixes the following checkpatch.pl warning: WARNING: Unnecessary parentheses - maybe == should be = ? Signed-off-by: Esra Altintas <es.altintas@gmail.com> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Esra Altintas authored
The following patch fixes the checkpatch.pl warning: ERROR: do not use C99 // comments Signed-off-by: Esra Altintas <es.altintas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dilek Uzulmez authored
This patch fixes the following checkpatch.pl warnings: WARNING: "Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)" in file device_main.c Pahole shows that the addresses are aligned Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_xmit.c WARNING: Missing a blank line after declarations Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_recv.c WARNING: Missing a blank line after declarations Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_wlan_util.c WARNING: Missing a blank line after declarations Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_pwrctrl.c WARNING: Missing a blank line after declarations Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_mlme_ext.c WARNING: Missing a blank line after declarations Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Yeliz Taneroglu authored
The following patch fixes the checkpatch.pl warning: drivers/staging/rtl8723au/core/rtw_mlme.c WARNING: Missing a blank line after declarations Signed-off-by: Yeliz Taneroglu <yeliztaneroglu@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-