diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2014-09-24 07:30:24 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2014-09-24 07:30:24 -0400 |
commit | 58a3b92d33d289e2f3390b40a2c5cfd7f32cfe7a (patch) | |
tree | fc3134dc67e785162531c19ed4f2af319a836ad8 /drivers/gpio | |
parent | 513d3c0f40c8e22fac019d5b0694374d17fbe682 (diff) |
gpio: dwapb: fix pointer to integer cast
The statements BUG_ON(ctx == 0) was implicitly casting a pointer
to an integer for comparison. Do this with a bool test instead
to get away from sparse warnings.
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-dwapb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 7feaf9d3f3ca..b43cd84b61f1 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c | |||
@@ -626,7 +626,7 @@ static int dwapb_gpio_suspend(struct device *dev) | |||
626 | unsigned int idx = gpio->ports[i].idx; | 626 | unsigned int idx = gpio->ports[i].idx; |
627 | struct dwapb_context *ctx = gpio->ports[i].ctx; | 627 | struct dwapb_context *ctx = gpio->ports[i].ctx; |
628 | 628 | ||
629 | BUG_ON(ctx == 0); | 629 | BUG_ON(!ctx); |
630 | 630 | ||
631 | offset = GPIO_SWPORTA_DDR + idx * GPIO_SWPORT_DDR_SIZE; | 631 | offset = GPIO_SWPORTA_DDR + idx * GPIO_SWPORT_DDR_SIZE; |
632 | ctx->dir = dwapb_read(gpio, offset); | 632 | ctx->dir = dwapb_read(gpio, offset); |
@@ -668,7 +668,7 @@ static int dwapb_gpio_resume(struct device *dev) | |||
668 | unsigned int idx = gpio->ports[i].idx; | 668 | unsigned int idx = gpio->ports[i].idx; |
669 | struct dwapb_context *ctx = gpio->ports[i].ctx; | 669 | struct dwapb_context *ctx = gpio->ports[i].ctx; |
670 | 670 | ||
671 | BUG_ON(ctx == 0); | 671 | BUG_ON(!ctx); |
672 | 672 | ||
673 | offset = GPIO_SWPORTA_DR + idx * GPIO_SWPORT_DR_SIZE; | 673 | offset = GPIO_SWPORTA_DR + idx * GPIO_SWPORT_DR_SIZE; |
674 | dwapb_write(gpio, offset, ctx->data); | 674 | dwapb_write(gpio, offset, ctx->data); |