Re: [PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask

2015-05-04 Thread Linus Walleij
On Mon, Apr 20, 2015 at 5:59 PM, Colin King  wrote:

> From: Colin Ian King 
>
> cppcheck detected an uninitialized variable:
>
> [drivers/pinctrl/mediatek/pinctrl-mtk-common.c:897]:
>   (error) Uninitialized variable: unmask
>
> unmask should be initialized to zero to ensure unmasking
> only occurs if a previous mask occurred. The current situation
> is that the unmask variable could contain any random garbage
> causing random unexpected unmasking.
>
> Signed-off-by: Colin Ian King 

Patch applied for fixes.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask

2015-05-04 Thread Linus Walleij
On Mon, Apr 20, 2015 at 5:59 PM, Colin King colin.k...@canonical.com wrote:

 From: Colin Ian King colin.k...@canonical.com

 cppcheck detected an uninitialized variable:

 [drivers/pinctrl/mediatek/pinctrl-mtk-common.c:897]:
   (error) Uninitialized variable: unmask

 unmask should be initialized to zero to ensure unmasking
 only occurs if a previous mask occurred. The current situation
 is that the unmask variable could contain any random garbage
 causing random unexpected unmasking.

 Signed-off-by: Colin Ian King colin.k...@canonical.com

Patch applied for fixes.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask

2015-04-20 Thread Colin King
From: Colin Ian King 

cppcheck detected an uninitialized variable:

[drivers/pinctrl/mediatek/pinctrl-mtk-common.c:897]:
  (error) Uninitialized variable: unmask

unmask should be initialized to zero to ensure unmasking
only occurs if a previous mask occurred. The current situation
is that the unmask variable could contain any random garbage
causing random unexpected unmasking.

Signed-off-by: Colin Ian King 
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c 
b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 493294c..474812e 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, 
unsigned offset,
if (!mtk_eint_get_mask(pctl, eint_num)) {
mtk_eint_mask(d);
unmask = 1;
+   } else {
+   unmask = 0;
}
 
clr_bit = 0xff << eint_offset;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH][V2] pinctrl: mediatek: mtk-common: initialize unmask

2015-04-20 Thread Colin King
From: Colin Ian King colin.k...@canonical.com

cppcheck detected an uninitialized variable:

[drivers/pinctrl/mediatek/pinctrl-mtk-common.c:897]:
  (error) Uninitialized variable: unmask

unmask should be initialized to zero to ensure unmasking
only occurs if a previous mask occurred. The current situation
is that the unmask variable could contain any random garbage
causing random unexpected unmasking.

Signed-off-by: Colin Ian King colin.k...@canonical.com
---
 drivers/pinctrl/mediatek/pinctrl-mtk-common.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c 
b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
index 493294c..474812e 100644
--- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
+++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c
@@ -881,6 +881,8 @@ static int mtk_gpio_set_debounce(struct gpio_chip *chip, 
unsigned offset,
if (!mtk_eint_get_mask(pctl, eint_num)) {
mtk_eint_mask(d);
unmask = 1;
+   } else {
+   unmask = 0;
}
 
clr_bit = 0xff  eint_offset;
-- 
2.1.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/