staging: rtl8193*: Remove double test
authorJulia Lawall <julia@diku.dk>
Sat, 28 Aug 2010 15:41:00 +0000 (17:41 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 31 Aug 2010 22:22:37 +0000 (15:22 -0700)
The 1 element of the array is tested twice.  Change the code so that the
remaining 3 element of the array is tested instead of testing the 1 element
a second time.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/rtl8192e/ieee80211/ieee80211_rx.c
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c

index aaf9b9dc45e648b87ce77aada3a83b46e3d370e9..9318695042fb09b0f85786bca8ea85eeb2f4b910 100644 (file)
@@ -2579,7 +2579,7 @@ static inline void update_network(struct ieee80211_network *dst,
        if(src->wmm_param[0].ac_aci_acm_aifsn|| \
           src->wmm_param[1].ac_aci_acm_aifsn|| \
           src->wmm_param[2].ac_aci_acm_aifsn|| \
-          src->wmm_param[1].ac_aci_acm_aifsn) {
+          src->wmm_param[3].ac_aci_acm_aifsn) {
          memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
        }
        //dst->QoS_Enable = src->QoS_Enable;
index 192123fbec7fa3cd8a00e9917ac46abd3cb60e54..c8ca9d8ed5d2121aa1bb18012abe2269d863f92c 100644 (file)
@@ -2391,7 +2391,7 @@ static inline void update_network(struct ieee80211_network *dst,
        if(src->wmm_param[0].ac_aci_acm_aifsn|| \
           src->wmm_param[1].ac_aci_acm_aifsn|| \
           src->wmm_param[2].ac_aci_acm_aifsn|| \
-          src->wmm_param[1].ac_aci_acm_aifsn) {
+          src->wmm_param[3].ac_aci_acm_aifsn) {
          memcpy(dst->wmm_param, src->wmm_param, WME_AC_PRAM_LEN);
        }
        //dst->QoS_Enable = src->QoS_Enable;