[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1326403988-872-2-git-send-email-Julia.Lawall@lip6.fr>
Date: Thu, 12 Jan 2012 22:33:05 +0100
From: Julia Lawall <Julia.Lawall@...6.fr>
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: kernel-janitors@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] drivers/staging: adjust double test
From: Julia Lawall <Julia.Lawall@...6.fr>
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@...6.fr>
---
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;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists