Skip to contentSkip to conversation

exynos-gsc: remove an always false condition

PATCH New Mauro Carvalho Chehab 2 participants 2 messages Apr 13, 2016 – Apr 14, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 exynos-gsc: remove an always false condition

As reported by smatch:
drivers/media/platform/exynos-gsc/gsc-core.c:1073 gsc_probe() warn: impossible condition '(gsc->id < 0) => (0-65535 < 0)' drivers/media/platform/exynos-gsc/gsc-core.c: In function 'gsc_probe':
drivers/media/platform/exynos-gsc/gsc-core.c:1073:51: warning: comparison is always false due to limited range of data type [-Wtype-limits]

  if (gsc->id >= drv_data->num_entities || gsc->id < 0) {
                                                   ^

gsc->id is an u16, so it can never be a negative number. So, remove the always false condition.

Fixes c1ac057173ba "[media] exynos-gsc: remove non-device-tree init code"
Cc Sylwester Nawrocki <[email protected]>
---
 drivers/media/platform/exynos-gsc/gsc-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/exynos-gsc/gsc-core.c +1 -1
index 032a423fb892..c595723f5031 100644
@@ -1070,7 +1070,7 @@ static int gsc_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	gsc->id = of_alias_get_id(pdev->dev.of_node, "gsc");
-	if (gsc->id >= drv_data->num_entities || gsc->id < 0) {
+	if (gsc->id >= drv_data->num_entities) {
 		dev_err(dev, "Invalid platform device id: %d\n", gsc->id);
 		return -EINVAL;
 	}
Signature · 1 line
2.5.5
#1 lore raw

PATCH 1/1 exynos-gsc: remove an always false condition

Quoted 7 lines · Mauro Carvalho Chehab

As reported by smatch:
drivers/media/platform/exynos-gsc/gsc-core.c:1073 gsc_probe() warn: impossible condition '(gsc->id < 0) => (0-65535 < 0)' drivers/media/platform/exynos-gsc/gsc-core.c: In function 'gsc_probe':
drivers/media/platform/exynos-gsc/gsc-core.c:1073:51: warning: comparison is always false due to limited range of data type [-Wtype-limits]

  if (gsc->id >= drv_data->num_entities || gsc->id < 0) {
                                                   ^
Quoted 6 lines

gsc->id is an u16, so it can never be a negative number. So, remove the always false condition.

Fixes c1ac057173ba "[media] exynos-gsc: remove non-device-tree init code"
Cc Sylwester Nawrocki <[email protected]>

Thanks for fixing this.

Signature · 2 lines
Regards,
Sylwester