[PATCH Resend] staging: media: cxd2099: style fix - replace hard-coded function names

2017-11-29 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the cxd2099
module. Instead of hard coding the function name the __func__ variable
should be used.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'i2c_read_reg', this
function's name, in a string

Signed-off-by: Martin Homuth <martin.hom...@martinhomuth.de>
---
 drivers/staging/media/cxd2099/cxd2099.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c
b/drivers/staging/media/cxd2099/cxd2099.c
index 3e30f48..6641dd2 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -101,7 +101,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter,
u8 adr,
   .buf = val, .len = 1} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(>dev, "error in i2c_read_reg\n");
+   dev_err(>dev, "error in %s\n", __func__);
return -1;
}
return 0;
@@ -116,7 +116,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
   .buf = data, .len = n} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(>dev, "error in i2c_read\n");
+   dev_err(>dev, "error in %s\n", __func__);
return -1;
}
return 0;
-- 
2.10.0




Re: [PATCH Resend] staging: media: cxd2099: style fix - replace hard-coded function names

2017-11-29 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the cxd2099
module. Instead of hard coding the function name the __func__ variable
should be used.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'i2c_read_reg', this
function's name, in a string

Signed-off-by: Martin Homuth <martin.hom...@martinhomuth.de>
---
 drivers/staging/media/cxd2099/cxd2099.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c
b/drivers/staging/media/cxd2099/cxd2099.c
index 3e30f48..6641dd2 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -101,7 +101,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter,
u8 adr,
   .buf = val, .len = 1} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(>dev, "error in i2c_read_reg\n");
+   dev_err(>dev, "error in %s\n", __func__);
return -1;
}
return 0;
@@ -116,7 +116,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
   .buf = data, .len = n} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(>dev, "error in i2c_read\n");
+   dev_err(>dev, "error in %s\n", __func__);
return -1;
}
return 0;
-- 
2.10.0




[PATCH] staging: media: cxd2099: style fix - replace hard-coded function names

2017-11-29 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the lirc module.
Instead of hard coding the function name the __func__ variable
should be used.


It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string

Signed-off-by: Martin Homuth <martin.hom...@martinhomuth.de>
---
 drivers/staging/media/cxd2099/cxd2099.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c
b/drivers/staging/media/cxd2099/cxd2099.c
index 3e30f48..6641dd2 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -101,7 +101,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter,
u8 adr,
   .buf = val, .len = 1} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(>dev, "error in i2c_read_reg\n");
+   dev_err(>dev, "error in %s\n", __func__);
return -1;
}
return 0;
@@ -116,7 +116,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
   .buf = data, .len = n} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(>dev, "error in i2c_read\n");
+   dev_err(>dev, "error in %s\n", __func__);
return -1;
}
return 0;
-- 
2.10.0



[PATCH Resend] staging: media: lirc: style fix - replace hard-coded function names

2017-11-28 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the lirc module.
Instead of hard coding the function name the __func__ variable
should be used.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string

Signed-off-by: Martin Homuth <mar...@martinhomuth.de>
---
 drivers/staging/media/lirc/lirc_zilog.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c
b/drivers/staging/media/lirc/lirc_zilog.c
index 6bd0717bf76e..be68ee652071 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
unsigned int m;
DECLARE_WAITQUEUE(wait, current);

-   dev_dbg(ir->dev, "read called\n");
+   dev_dbg(ir->dev, "%s called\n", __func__);
if (n % rbuf->chunk_size) {
-   dev_dbg(ir->dev, "read result = -EINVAL\n");
+   dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
return -EINVAL;
}

@@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
retries++;
}
if (retries >= 5) {
-   dev_err(ir->dev, "Buffer read failed!\n");
+   dev_err(ir->dev, "%s failed!\n", __func__);
ret = -EIO;
}
}
@@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
put_ir_rx(rx, false);
set_current_state(TASK_RUNNING);

-   dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
+   dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
ret ? "Error" : "OK");

return ret ? ret : written;
-- 
2.13.6



[PATCH] staging/media: lirc: style fix - replace hard-coded function names

2017-11-26 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the lirc module.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string
>From f11f24667ba6696cb71ac33a67fc0c7d3b4cd542 Mon Sep 17 00:00:00 2001
From: Martin Homuth <martin.hom...@emlix.com>
Date: Sun, 26 Nov 2017 20:14:33 +0100
Subject: [PATCH] lirc: style fix - replace hard-coded function names

Instead of hard coding the function name the __func__ variable
should be used.

Signed-off-by: Martin Homuth <martin.hom...@emlix.com>
---
 drivers/staging/media/lirc/lirc_zilog.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c
index 6bd0717bf76e..be68ee652071 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 	unsigned int m;
 	DECLARE_WAITQUEUE(wait, current);
 
-	dev_dbg(ir->dev, "read called\n");
+	dev_dbg(ir->dev, "%s called\n", __func__);
 	if (n % rbuf->chunk_size) {
-		dev_dbg(ir->dev, "read result = -EINVAL\n");
+		dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
 		return -EINVAL;
 	}
 
@@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 retries++;
 			}
 			if (retries >= 5) {
-dev_err(ir->dev, "Buffer read failed!\n");
+dev_err(ir->dev, "%s failed!\n", __func__);
 ret = -EIO;
 			}
 		}
@@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 	put_ir_rx(rx, false);
 	set_current_state(TASK_RUNNING);
 
-	dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
+	dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
 		ret ? "Error" : "OK");
 
 	return ret ? ret : written;
-- 
2.13.6