Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1297354

[PATCH v5 2/5] ARM: sa1111: ensure no negative value gets returned on positive match

From Marek Szyprowski <m.szyprowski@samsung.com>
Newsgroups linux.kernel
Subject [PATCH v5 2/5] ARM: sa1111: ensure no negative value gets returned on positive match
Date 2015-12-23 12:10 +0100
Message-ID <qIPsS-oU-9@gated-at.bofh.it> (permalink)
References <qIPsS-oU-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch ensures that existing bus match callbacks don't return
negative values (which might be interpreted as potential errors in the
future) in case of positive match.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
 arch/arm/common/sa1111.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
index 3d22494..fb0a0a4 100644
--- a/arch/arm/common/sa1111.c
+++ b/arch/arm/common/sa1111.c
@@ -1290,7 +1290,7 @@ static int sa1111_match(struct device *_dev, struct device_driver *_drv)
 	struct sa1111_dev *dev = SA1111_DEV(_dev);
 	struct sa1111_driver *drv = SA1111_DRV(_drv);
 
-	return dev->devid & drv->devid;
+	return !!(dev->devid & drv->devid);
 }
 
 static int sa1111_bus_suspend(struct device *dev, pm_message_t state)
-- 
1.9.2

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/5] AMBA: add complete support for power domains Marek Szyprowski <m.szyprowski@samsung.com> - 2015-12-23 12:10 +0100
  [PATCH v5 2/5] ARM: sa1111: ensure no negative value gets returned on  positive match Marek Szyprowski <m.szyprowski@samsung.com> - 2015-12-23 12:10 +0100
    Re: [PATCH v5 2/5] ARM: sa1111: ensure no negative value gets  returned on positive match Russell King - ARM Linux <linux@arm.linux.org.uk> - 2015-12-23 12:10 +0100
  [PATCH v5 1/5] drivers: nvdimm: ensure no negative value gets returned  on positive match Marek Szyprowski <m.szyprowski@samsung.com> - 2015-12-23 12:10 +0100
  [PATCH v5 4/5] ARM: amba: Move reading of periphid to amba_match() Marek Szyprowski <m.szyprowski@samsung.com> - 2015-12-23 12:10 +0100
  [PATCH v5 3/5] driver core: handle -EPROBE_DEFER from bus_type.match() Marek Szyprowski <m.szyprowski@samsung.com> - 2015-12-23 12:10 +0100
  [PATCH v5 5/5] ARM: amba: Properly handle devices with power domains Marek Szyprowski <m.szyprowski@samsung.com> - 2015-12-23 12:10 +0100

csiph-web