From: Julia Lawall <Julia.Lawall@xxxxxxx> Rewrite a duplicated test to test the correct value The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression E; @@ ( * E || ... || E | * E && ... && E ) // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@xxxxxxx> --- drivers/staging/gma500/mdfld_dsi_pkg_sender.c | 6 ++---- drivers/staging/rtl8192e/rtllib_rx.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c index 6c5061f..13979b5 100644 --- a/drivers/staging/rtl8192e/rtllib_rx.c +++ b/drivers/staging/rtl8192e/rtllib_rx.c @@ -2453,7 +2453,7 @@ static inline void update_network(struct rtllib_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->SignalStrength = src->SignalStrength; diff --git a/drivers/staging/gma500/mdfld_dsi_pkg_sender.c b/drivers/staging/gma500/mdfld_dsi_pkg_sender.c index 9b96a5c..3a9f44f 100644 --- a/drivers/staging/gma500/mdfld_dsi_pkg_sender.c +++ b/drivers/staging/gma500/mdfld_dsi_pkg_sender.c @@ -1249,8 +1249,7 @@ int mdfld_dsi_read_gen_hs(struct mdfld_dsi_pkg_sender *sender, u32 *data, u16 len) { - if (!sender || !data || param_num < 0 || param_num > 2 - || !data || !len) { + if (!sender || param_num < 0 || param_num > 2 || !data || !len) { DRM_ERROR("Invalid parameters\n"); return -EINVAL; } @@ -1267,8 +1266,7 @@ int mdfld_dsi_read_gen_lp(struct mdfld_dsi_pkg_sender *sender, u32 *data, u16 len) { - if (!sender || !data || param_num < 0 || param_num > 2 - || !data || !len) { + if (!sender || param_num < 0 || param_num > 2 || !data || !len) { DRM_ERROR("Invalid parameters\n"); return -EINVAL; } _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/devel