Skip to contentSkip to conversation

irqchip/s3c24xx: Remove unneeded comparison of unsigned long to 0

PATCH Applied Krzysztof Kozlowski 2 participants 2 messages Aug 13, 2018

Subsystems (2)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/1 irqchip/s3c24xx: Remove unneeded comparison of unsigned long to 0

irq_data->hwirq is unsigned long. This fixes GCC warning:

drivers/irqchip/irq-s3c24xx.c: In function 's3c_irqext0_type':
drivers/irqchip/irq-s3c24xx.c:253:19: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if ((data->hwirq >= 0) && (data->hwirq <= 3)) {
^~

---
 drivers/irqchip/irq-s3c24xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-s3c24xx.c +1 -1
index f6fd57ebe6e6..c19766fe8a1a 100644
@@ -250,7 +250,7 @@ static int s3c_irqext0_type(struct irq_data *data, unsigned int type)
 	void __iomem *gpcon_reg;
 	unsigned long gpcon_offset, extint_offset;
 
-	if ((data->hwirq >= 0) && (data->hwirq <= 3)) {
+	if (data->hwirq <= 3) {
 		gpcon_reg = S3C2410_GPFCON;
 		extint_reg = S3C24XX_EXTINT0;
 		gpcon_offset = (data->hwirq) * 2;
Signature · 1 line
2.14.1
Applied
#1 lore raw
Quoted 18 lines · Krzysztof Kozlowski

irq_data->hwirq is unsigned long. This fixes GCC warning:

drivers/irqchip/irq-s3c24xx.c: In function 's3c_irqext0_type':
drivers/irqchip/irq-s3c24xx.c:253:19: warning: comparison of unsigned expression >= 0 is always true [-Wtype-limits]
if ((data->hwirq >= 0) && (data->hwirq <= 3)) {
^~

---
 drivers/irqchip/irq-s3c24xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-s3c24xx.c +0 -0
index f6fd57ebe6e6..c19766fe8a1a 100644

drivers/irqchip/irq-s3c24xx.c static int s3c_irqext0_type(struct irq_data *data, unsigned int type) · line 256

Quoted 8 lines
drivers/irqchip/irq-s3c24xx.c +1 -1
@@ -250,7 +250,7 @@ static int s3c_irqext0_type(struct irq_data *data, unsigned int type)
 	void __iomem *gpcon_reg;
 	unsigned long gpcon_offset, extint_offset;
 
-	if ((data->hwirq >= 0) && (data->hwirq <= 3)) {
+	if (data->hwirq <= 3) {
 		gpcon_reg = S3C2410_GPFCON;
 		extint_reg = S3C24XX_EXTINT0;
 		gpcon_offset = (data->hwirq) * 2;

Queued, thanks.

	M.
Signature · 1 line
Jazz is not dead. It just smells funny...