Skip to contentSkip to conversation

gsc-m2m: Use an unsigned data type for a variable

PATCH In review SF Markus Elfring 2 participants 2 messages Dec 19, 2015

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

PATCH 1/1 gsc-m2m: Use an unsigned data type for a variable

From: Markus Elfring <[email protected]>
Date: Sat, 19 Dec 2015 15:28:37 +0100

The data type "int" was used by the variable "ret" in the gsc_m2m_poll() function despite of the aspect that the type "unsigned int" will usually be needed for the return value from a call of the v4l2_m2m_poll() function.
Improve this implementation detail by addition of the type modifier then.

This issue was detected by using the Coccinelle software.

---
 drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/exynos-gsc/gsc-m2m.c +1 -1
index d82e717..f2c091c 100644
@@ -701,7 +701,7 @@ static unsigned int gsc_m2m_poll(struct file *file,
 {
 	struct gsc_ctx *ctx = fh_to_ctx(file->private_data);
 	struct gsc_dev *gsc = ctx->gsc_dev;
-	int ret;
+	unsigned int ret;
 
 	if (mutex_lock_interruptible(&gsc->lock))
 		return -ERESTARTSYS;
Signature · 1 line
2.6.3
#1 lore raw

drivers/media/platform/exynos-gsc/gsc-m2m.c static unsigned int gsc_m2m_poll(struct file *file, · line 707

Quoted 13 lines · SF Markus Elfring
drivers/media/platform/exynos-gsc/gsc-m2m.c +1 -1
index d82e717..f2c091c 100644
@@ -701,7 +701,7 @@ static unsigned int gsc_m2m_poll(struct file *file,
 {
 	struct gsc_ctx *ctx = fh_to_ctx(file->private_data);
 	struct gsc_dev *gsc = ctx->gsc_dev;
-	int ret;
+	unsigned int ret;
 
 	if (mutex_lock_interruptible(&gsc->lock))
 		return -ERESTARTSYS;

I'm suspect returning -ERESTARTSYS is a bug.

regards,
dan carpenter