Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1460173 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2016-08-11 07:20 +0200 |
| Last post | 2016-08-14 14:10 +0200 |
| Articles | 20 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:20 +0200
[PATCH v2 02/10] staging: ks7010: Delete unnecessary assignments for buffer variables SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:30 +0200
[PATCH v2 01/10] staging: ks7010: Delete unnecessary checks before the function call "kfree" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:30 +0200
[PATCH v2 04/10] staging: ks7010: Rename jump labels SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:40 +0200
[PATCH v2 03/10] staging: ks7010: Return directly after a failed kmalloc() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:40 +0200
[PATCH v2 05/10] staging: ks7010: Delete unnecessary uses of the variable "retval" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:40 +0200
[PATCH v2 06/10] staging: ks7010: Delete unnecessary braces SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:50 +0200
[PATCH v2 07/10] staging: ks7010: Add the macro "pr_fmt" SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:50 +0200
[PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 07:50 +0200
Re: [PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err() Joe Perches <joe@perches.com> - 2016-08-12 21:50 +0200
Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-13 13:20 +0200
Re: staging: ks7010: Replace three printk() calls by pr_err() Joe Perches <joe@perches.com> - 2016-08-13 19:40 +0200
Re: staging: ks7010: Replace three printk() calls by pr_err() Joe Perches <joe@perches.com> - 2016-08-14 11:00 +0200
Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 12:10 +0200
Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 13:10 +0200
Re: staging: ks7010: Replace three printk() calls by pr_err() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 11:30 +0200
[PATCH v2 09/10] staging: ks7010: Delete a variable in write_to_device() SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 08:00 +0200
[PATCH v2 10/10] staging: ks7010: Delete three unnecessary variable initialisations SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-11 08:10 +0200
Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver SF Markus Elfring <elfring@users.sourceforge.net> - 2016-08-14 12:20 +0200
Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver Wolfram Sang <wsa@the-dreams.de> - 2016-08-14 14:10 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:20 +0200 |
| Subject | [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver |
| Message-ID | <s4Qzn-70w-1@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (10): Delete unnecessary checks before the function call "kfree" Delete unnecessary assignments for buffer variables Return directly after a failed kmalloc() Rename jump labels Delete unnecessary uses of the variable "retval" Delete unnecessary braces Add the macro "pr_fmt" Replace three printk() calls by pr_err() Delete a variable in write_to_device() Delete three unnecessary variable initialisations drivers/staging/ks7010/ks7010_sdio.c | 184 ++++++++++++++--------------------- 1 file changed, 73 insertions(+), 111 deletions(-) -- 2.9.2
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:30 +0200 |
| Subject | [PATCH v2 02/10] staging: ks7010: Delete unnecessary assignments for buffer variables |
| Message-ID | <s4QJ3-75c-1@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 17:26:01 +0200
A few variables were assigned a null pointer despite of the detail
that they were immediately reassigned by the following statement.
Thus remove such unnecessary assignments.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
v2: Rebased on the source files from Linux next-20160809.
drivers/staging/ks7010/ks7010_sdio.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 7da6c84..3622fba 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -711,7 +711,6 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
int rc = 0;
int retval;
unsigned char *data_buf;
- data_buf = NULL;
data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
if (!data_buf) {
@@ -743,7 +742,7 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
int rc = 0;
int retval;
unsigned char *read_buf;
- read_buf = NULL;
+
read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
if (!read_buf) {
rc = 1;
@@ -776,8 +775,6 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
int length;
const struct firmware *fw_entry = NULL;
- rom_buf = NULL;
-
/* buffer allocate */
rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
if (!rom_buf) {
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:30 +0200 |
| Subject | [PATCH v2 01/10] staging: ks7010: Delete unnecessary checks before the function call "kfree" |
| Message-ID | <s4QJ3-75c-11@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 17:15:15 +0200
The kfree() function tests whether its argument is NULL and then
returns immediately. Thus the test around the calls is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/staging/ks7010/ks7010_sdio.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index b7337fd..7da6c84 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -732,8 +732,7 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
goto error_out;
}
error_out:
- if (data_buf)
- kfree(data_buf);
+ kfree(data_buf);
return rc;
}
@@ -763,8 +762,7 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
goto error_out;
}
error_out:
- if (read_buf)
- kfree(read_buf);
+ kfree(read_buf);
return rc;
}
@@ -879,8 +877,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
release_firmware(fw_entry);
error_out0:
sdio_release_host(card->func);
- if (rom_buf)
- kfree(rom_buf);
+ kfree(rom_buf);
return rc;
}
@@ -1199,9 +1196,7 @@ static void ks7010_sdio_remove(struct sdio_func *func)
unregister_netdev(netdev);
trx_device_exit(priv);
- if (priv->ks_wlan_hw.read_buf) {
- kfree(priv->ks_wlan_hw.read_buf);
- }
+ kfree(priv->ks_wlan_hw.read_buf);
free_netdev(priv->net_dev);
card->priv = NULL;
}
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:40 +0200 |
| Subject | [PATCH v2 04/10] staging: ks7010: Rename jump labels |
| Message-ID | <s4QSJ-78i-9@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 17:57:50 +0200
Adjust jump targets according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
v2: Rebased on the source files from Linux next-20160809.
Touched four source code places less.
drivers/staging/ks7010/ks7010_sdio.c | 73 +++++++++++++++++-------------------
1 file changed, 34 insertions(+), 39 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 9b954cb..53df8f7 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -523,18 +523,18 @@ static void ks7010_rw_function(struct work_struct *work)
queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
&priv->ks_wlan_hw.rw_wq, 1);
}
- goto err_out;
+ goto release_host;
}
/* sleep mode doze */
if (atomic_read(&priv->sleepstatus.doze_request) == 1) {
ks_wlan_hw_sleep_doze_request(priv);
- goto err_out;
+ goto release_host;
}
/* sleep mode wakeup */
if (atomic_read(&priv->sleepstatus.wakeup_request) == 1) {
ks_wlan_hw_sleep_wakeup_request(priv);
- goto err_out;
+ goto release_host;
}
/* read (WriteStatus/ReadDataSize FN1:00_0014) */
@@ -543,7 +543,7 @@ static void ks7010_rw_function(struct work_struct *work)
if (retval) {
DPRINTK(1, " error : WSTATUS_RSIZE=%02X psstatus=%d\n", rw_data,
atomic_read(&priv->psstatus.status));
- goto err_out;
+ goto release_host;
}
DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
@@ -555,8 +555,7 @@ static void ks7010_rw_function(struct work_struct *work)
tx_device_task((void *)priv);
}
_ks_wlan_hw_power_save(priv);
-
- err_out:
+ release_host:
sdio_release_host(priv->ks_wlan_hw.sdio_card->func);
return;
@@ -720,15 +719,13 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
retval = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
if (retval) {
rc = 2;
- goto error_out;
+ goto free_buf;
}
retval = ks7010_sdio_write(priv, READ_INDEX, data_buf, sizeof(index));
- if (retval) {
+ if (retval)
rc = 3;
- goto error_out;
- }
- error_out:
+ free_buf:
kfree(data_buf);
return rc;
}
@@ -748,16 +745,15 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
retval = ks7010_sdio_read(priv, address, read_buf, size);
if (retval) {
rc = 2;
- goto error_out;
+ goto free_buf;
}
retval = memcmp(data, read_buf, size);
if (retval) {
DPRINTK(0, "data compare error (%d) \n", retval);
rc = 3;
- goto error_out;
}
- error_out:
+ free_buf:
kfree(read_buf);
return rc;
}
@@ -784,7 +780,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
if (rw_data == GCR_A_RUN) {
DPRINTK(0, "MAC firmware running ...\n");
rc = 0;
- goto error_out0;
+ goto release_host;
}
retval = request_firmware(&fw_entry, ROM_FILE, &priv->ks_wlan_hw.sdio_card->func->dev);
@@ -814,14 +810,14 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
KS7010_IRAM_ADDRESS + offset);
if (retval) {
rc = 6;
- goto error_out1;
+ goto release_fw;
}
/* Write data */
retval = ks7010_sdio_write(priv, DATA_WINDOW, rom_buf, size);
if (retval) {
rc = 8;
- goto error_out1;
+ goto release_fw;
}
/* compare */
@@ -829,7 +825,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
ks7010_sdio_data_compare(priv, DATA_WINDOW, rom_buf, size);
if (retval) {
rc = 9;
- goto error_out1;
+ goto release_fw;
}
n += size;
@@ -840,7 +836,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
retval = ks7010_sdio_write(priv, GCR_A, &rw_data, sizeof(rw_data));
if (retval) {
rc = 11;
- goto error_out1;
+ goto release_fw;
}
DPRINTK(4, " REMAP Request : GCR_A=%02X\n", rw_data);
@@ -851,7 +847,7 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
ks7010_sdio_read(priv, GCR_A, &rw_data, sizeof(rw_data));
if (retval) {
rc = 11;
- goto error_out1;
+ goto release_fw;
}
if (rw_data == GCR_A_RUN)
break;
@@ -860,14 +856,13 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
if ((50) <= n) {
DPRINTK(1, "firmware can't start\n");
rc = 12;
- goto error_out1;
+ goto release_fw;
}
rc = 0;
-
- error_out1:
+ release_fw:
release_firmware(fw_entry);
- error_out0:
+ release_host:
sdio_release_host(card->func);
kfree(rom_buf);
return rc;
@@ -994,20 +989,20 @@ static int ks7010_sdio_probe(struct sdio_func *func,
ret = sdio_enable_func(func);
DPRINTK(5, "sdio_enable_func() %d\n", ret);
if (ret)
- goto error_free_card;
+ goto free_card;
/* interrupt disable */
sdio_writeb(func, 0, INT_ENABLE, &ret);
if (ret)
- goto error_free_card;
+ goto free_card;
sdio_writeb(func, 0xff, INT_PENDING, &ret);
if (ret)
- goto error_disable_func;
+ goto disable_func;
/* setup interrupt handler */
ret = sdio_claim_irq(func, ks_sdio_interrupt);
if (ret)
- goto error_disable_func;
+ goto disable_func;
sdio_release_host(func);
@@ -1020,11 +1015,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
netdev = alloc_etherdev(sizeof(*priv));
if (netdev == NULL) {
printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
- goto error_release_irq;
+ goto release_irq;
}
if (dev_alloc_name(netdev, "wlan%d") < 0) {
printk(KERN_ERR "ks7010 : Couldn't get name!\n");
- goto error_free_netdev;
+ goto free_dev;
}
priv = netdev_priv(netdev);
@@ -1038,7 +1033,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
priv->ks_wlan_hw.read_buf = NULL;
priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
if (!priv->ks_wlan_hw.read_buf) {
- goto error_free_netdev;
+ goto free_dev;
}
priv->dev_state = DEVICE_STATE_PREBOOT;
priv->net_dev = netdev;
@@ -1066,7 +1061,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
printk(KERN_ERR
"ks7010: firmware load failed !! retern code = %d\n",
ret);
- goto error_free_read_buf;
+ goto free_buf;
}
/* interrupt setting */
@@ -1094,7 +1089,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
priv->ks_wlan_hw.ks7010sdio_wq = create_workqueue("ks7010sdio_wq");
if (!priv->ks_wlan_hw.ks7010sdio_wq) {
DPRINTK(1, "create_workqueue failed !!\n");
- goto error_free_read_buf;
+ goto free_buf;
}
INIT_DELAYED_WORK(&priv->ks_wlan_hw.rw_wq, ks7010_rw_function);
@@ -1102,22 +1097,22 @@ static int ks7010_sdio_probe(struct sdio_func *func,
ret = register_netdev(priv->net_dev);
if (ret)
- goto error_free_read_buf;
+ goto free_buf;
return 0;
- error_free_read_buf:
+ free_buf:
kfree(priv->ks_wlan_hw.read_buf);
priv->ks_wlan_hw.read_buf = NULL;
- error_free_netdev:
+ free_dev:
free_netdev(priv->net_dev);
card->priv = NULL;
- error_release_irq:
+ release_irq:
sdio_claim_host(func);
sdio_release_irq(func);
- error_disable_func:
+ disable_func:
sdio_disable_func(func);
- error_free_card:
+ free_card:
sdio_release_host(func);
sdio_set_drvdata(func, NULL);
kfree(card);
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:40 +0200 |
| Subject | [PATCH v2 03/10] staging: ks7010: Return directly after a failed kmalloc() |
| Message-ID | <s4QSJ-78i-11@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 17:34:12 +0200
Return directly after a memory allocation failed at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
v2: Rebased on the source files from Linux next-20160809.
drivers/staging/ks7010/ks7010_sdio.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 3622fba..9b954cb 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -713,10 +713,8 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
unsigned char *data_buf;
data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
- if (!data_buf) {
- rc = 1;
- goto error_out;
- }
+ if (!data_buf)
+ return 1;
memcpy(data_buf, &index, sizeof(index));
retval = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
@@ -744,10 +742,9 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
unsigned char *read_buf;
read_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
- if (!read_buf) {
- rc = 1;
- goto error_out;
- }
+ if (!read_buf)
+ return 1;
+
retval = ks7010_sdio_read(priv, address, read_buf, size);
if (retval) {
rc = 2;
@@ -777,10 +774,8 @@ static int ks7010_upload_firmware(struct ks_wlan_private *priv,
/* buffer allocate */
rom_buf = kmalloc(ROM_BUFF_SIZE, GFP_KERNEL);
- if (!rom_buf) {
- rc = 3;
- goto error_out0;
- }
+ if (!rom_buf)
+ return 3;
sdio_claim_host(card->func);
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:40 +0200 |
| Subject | [PATCH v2 05/10] staging: ks7010: Delete unnecessary uses of the variable "retval" |
| Message-ID | <s4QSK-78i-13@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 18:56:31 +0200
A few return values can also be directly used for condition checks.
Thus remove a local variable for intermediate assignments.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
v2: Rebased on the source files from Linux next-20160809.
Touched less source code places.
drivers/staging/ks7010/ks7010_sdio.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 53df8f7..0f7ea76 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -489,7 +489,6 @@ static void ks7010_rw_function(struct work_struct *work)
struct hw_info_t *hw;
struct ks_wlan_private *priv;
unsigned char rw_data;
- int retval;
hw = container_of(work, struct hw_info_t, rw_wq.work);
priv = container_of(hw, struct ks_wlan_private, ks_wlan_hw);
@@ -538,9 +537,7 @@ static void ks7010_rw_function(struct work_struct *work)
}
/* read (WriteStatus/ReadDataSize FN1:00_0014) */
- retval =
- ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data, sizeof(rw_data));
- if (retval) {
+ if (ks7010_sdio_read(priv, WSTATUS_RSIZE, &rw_data, sizeof(rw_data))) {
DPRINTK(1, " error : WSTATUS_RSIZE=%02X psstatus=%d\n", rw_data,
atomic_read(&priv->psstatus.status));
goto release_host;
@@ -708,7 +705,6 @@ static void trx_device_exit(struct ks_wlan_private *priv)
static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
{
int rc = 0;
- int retval;
unsigned char *data_buf;
data_buf = kmalloc(sizeof(u32), GFP_KERNEL);
@@ -716,14 +712,12 @@ static int ks7010_sdio_update_index(struct ks_wlan_private *priv, u32 index)
return 1;
memcpy(data_buf, &index, sizeof(index));
- retval = ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index));
- if (retval) {
+ if (ks7010_sdio_write(priv, WRITE_INDEX, data_buf, sizeof(index))) {
rc = 2;
goto free_buf;
}
- retval = ks7010_sdio_write(priv, READ_INDEX, data_buf, sizeof(index));
- if (retval)
+ if (ks7010_sdio_write(priv, READ_INDEX, data_buf, sizeof(index)))
rc = 3;
free_buf:
kfree(data_buf);
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:50 +0200 |
| Subject | [PATCH v2 06/10] staging: ks7010: Delete unnecessary braces |
| Message-ID | <s4R2p-7bt-1@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 19:57:01 +0200
Do not use curly brackets at some source code places
where a single statement should be sufficient.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
v2: Rebased on the source files from Linux next-20160809.
Touched less source code places.
drivers/staging/ks7010/ks7010_sdio.c | 46 +++++++++++++-----------------------
1 file changed, 16 insertions(+), 30 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 0f7ea76..2094a07 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -383,10 +383,9 @@ int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
result = enqueue_txdev(priv, p, size, complete_handler, arg1, arg2);
spin_unlock(&priv->tx_dev.tx_dev_lock);
- if (cnt_txqbody(priv) > 0) {
+ if (cnt_txqbody(priv) > 0)
queue_delayed_work(priv->ks_wlan_hw.ks7010sdio_wq,
&priv->ks_wlan_hw.rw_wq, 0);
- }
return result;
}
@@ -402,9 +401,8 @@ static void rx_event_task(unsigned long dev)
hostif_receive(priv, rp->data, rp->size);
inc_rxqhead(priv);
- if (cnt_rxqbody(priv) > 0) {
+ if (cnt_rxqbody(priv) > 0)
tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
- }
}
return;
@@ -432,9 +430,8 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
retval =
ks7010_sdio_read(priv, DATA_WINDOW, &rx_buffer->data[0],
hif_align_size(size));
- if (retval) {
+ if (retval)
goto error_out;
- }
/* length check */
if (size > 2046 || size == 0) {
@@ -449,9 +446,8 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
retval =
ks7010_sdio_write(priv, READ_STATUS, &read_status,
sizeof(read_status));
- if (retval) {
+ if (retval)
DPRINTK(1, " error : READ_STATUS=%02X\n", read_status);
- }
goto error_out;
}
@@ -470,12 +466,11 @@ static void ks_wlan_hw_rx(void *dev, uint16_t size)
}
DPRINTK(4, "READ_STATUS=%02X\n", read_status);
- if (atomic_read(&priv->psstatus.confirm_wait)) {
+ if (atomic_read(&priv->psstatus.confirm_wait))
if (IS_HIF_CONF(event)) {
DPRINTK(4, "IS_HIF_CONF true !!\n");
atomic_dec(&priv->psstatus.confirm_wait);
}
- }
/* rx_event_task((void *)priv); */
tasklet_schedule(&priv->ks_wlan_hw.rx_bh_task);
@@ -544,13 +539,11 @@ static void ks7010_rw_function(struct work_struct *work)
}
DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
- if (rw_data & RSIZE_MASK) { /* Read schedule */
+ if (rw_data & RSIZE_MASK) /* Read schedule */
ks_wlan_hw_rx((void *)priv,
(uint16_t) (((rw_data & RSIZE_MASK) << 4)));
- }
- if ((rw_data & WSTATUS_MASK)) {
+ if (rw_data & WSTATUS_MASK)
tx_device_task((void *)priv);
- }
_ks_wlan_hw_power_save(priv);
release_host:
sdio_release_host(priv->ks_wlan_hw.sdio_card->func);
@@ -618,10 +611,9 @@ static void ks_sdio_interrupt(struct sdio_func *func)
}
DPRINTK(4, "WSTATUS_RSIZE=%02X\n", rw_data);
rsize = rw_data & RSIZE_MASK;
- if (rsize) { /* Read schedule */
+ if (rsize) /* Read schedule */
ks_wlan_hw_rx((void *)priv,
(uint16_t) (((rsize) << 4)));
- }
if (rw_data & WSTATUS_MASK) {
#if 0
if (status & INT_WRITE_STATUS
@@ -632,11 +624,10 @@ static void ks_sdio_interrupt(struct sdio_func *func)
ks7010_sdio_write(priv, DATA_WINDOW,
&rw_data,
sizeof(rw_data));
- if (retval) {
+ if (retval)
DPRINTK(1,
"write DATA_WINDOW Failed!!(%d)\n",
retval);
- }
status &= ~INT_WRITE_STATUS;
} else {
#endif
@@ -877,13 +868,11 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
DPRINTK(5, "hostif_sme_enqueu()\n");
if (!wait_for_completion_interruptible_timeout
- (&priv->confirm_wait, 5 * HZ)) {
+ (&priv->confirm_wait, 5 * HZ))
DPRINTK(1, "wait time out!! SME_START\n");
- }
- if (priv->mac_address_valid && priv->version_size) {
+ if (priv->mac_address_valid && priv->version_size)
priv->dev_state = DEVICE_STATE_PREINIT;
- }
hostif_sme_enqueue(priv, SME_GET_EEPROM_CKSUM);
@@ -905,9 +894,8 @@ static void ks7010_card_init(struct ks_wlan_private *priv)
hostif_sme_enqueue(priv, SME_START_REQUEST);
if (!wait_for_completion_interruptible_timeout
- (&priv->confirm_wait, 5 * HZ)) {
+ (&priv->confirm_wait, 5 * HZ))
DPRINTK(1, "wait time out!! wireless parameter set\n");
- }
if (priv->dev_state >= DEVICE_STATE_PREINIT) {
DPRINTK(1, "DEVICE READY!!\n");
@@ -1026,9 +1014,9 @@ static int ks7010_sdio_probe(struct sdio_func *func,
init_completion(&priv->ks_wlan_hw.ks7010_sdio_wait);
priv->ks_wlan_hw.read_buf = NULL;
priv->ks_wlan_hw.read_buf = kmalloc(RX_DATA_SIZE, GFP_KERNEL);
- if (!priv->ks_wlan_hw.read_buf) {
+ if (!priv->ks_wlan_hw.read_buf)
goto free_dev;
- }
+
priv->dev_state = DEVICE_STATE_PREBOOT;
priv->net_dev = netdev;
priv->firmware_version[0] = '\0';
@@ -1064,9 +1052,8 @@ static int ks7010_sdio_probe(struct sdio_func *func,
sdio_claim_host(func);
ret = ks7010_sdio_write(priv, INT_PENDING, &rw_data, sizeof(rw_data));
sdio_release_host(func);
- if (ret) {
+ if (ret)
DPRINTK(1, " error : INT_PENDING=%02X\n", rw_data);
- }
DPRINTK(4, " clear Interrupt : INT_PENDING=%02X\n", rw_data);
/* enable ks7010sdio interrupt (INT_GCR_B|INT_READ_STATUS|INT_WRITE_STATUS) */
@@ -1074,9 +1061,8 @@ static int ks7010_sdio_probe(struct sdio_func *func,
sdio_claim_host(func);
ret = ks7010_sdio_write(priv, INT_ENABLE, &rw_data, sizeof(rw_data));
sdio_release_host(func);
- if (ret) {
+ if (ret)
DPRINTK(1, " error : INT_ENABLE=%02X\n", rw_data);
- }
DPRINTK(4, " enable Interrupt : INT_ENABLE=%02X\n", rw_data);
priv->dev_state = DEVICE_STATE_BOOT;
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:50 +0200 |
| Subject | [PATCH v2 07/10] staging: ks7010: Add the macro "pr_fmt" |
| Message-ID | <s4R2p-7bt-3@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 10 Aug 2016 20:45:11 +0200 Add a definition for the macro "pr_fmt" so that its information can be used for consistent message output. Suggested-by: Joe Perches <joe@perches.com> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- v2: Addition from source code review drivers/staging/ks7010/ks7010_sdio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c index 2094a07..634ef42 100644 --- a/drivers/staging/ks7010/ks7010_sdio.c +++ b/drivers/staging/ks7010/ks7010_sdio.c @@ -10,6 +10,8 @@ * published by the Free Software Foundation. */ +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt + #include <linux/firmware.h> #include <linux/mmc/card.h> #include <linux/mmc/sdio_func.h> -- 2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 07:50 +0200 |
| Subject | [PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s4R2p-7bt-17@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 21:56:15 +0200
Prefer usage of the macro "pr_err" over the interface "printk".
Fix a typo in an error message.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
v2: Rebased on the source files from Linux next-20160809.
drivers/staging/ks7010/ks7010_sdio.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 634ef42..bfca6a7 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -998,11 +998,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
/* private memory allocate */
netdev = alloc_etherdev(sizeof(*priv));
if (netdev == NULL) {
- printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
+ pr_err(pr_fmt("Unable to alloc new net device\n"));
goto release_irq;
}
if (dev_alloc_name(netdev, "wlan%d") < 0) {
- printk(KERN_ERR "ks7010 : Couldn't get name!\n");
+ pr_err(pr_fmt("Couldn't get name!\n"));
goto free_dev;
}
@@ -1042,8 +1042,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
/* Upload firmware */
ret = ks7010_upload_firmware(priv, card); /* firmware load */
if (ret) {
- printk(KERN_ERR
- "ks7010: firmware load failed !! retern code = %d\n",
+ pr_err(pr_fmt("firmware load failed! return code = %d\n"),
ret);
goto free_buf;
}
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-08-12 21:50 +0200 |
| Subject | Re: [PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s5qCR-632-13@gated-at.bofh.it> |
| In reply to | #1460189 |
On Thu, 2016-08-11 at 07:48 +0200, SF Markus Elfring wrote:
> Prefer usage of the macro "pr_err" over the interface "printk".
Not correct
> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
[]
> @@ -998,11 +998,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> /* private memory allocate */
> netdev = alloc_etherdev(sizeof(*priv));
> if (netdev == NULL) {
> - printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
> + pr_err(pr_fmt("Unable to alloc new net device\n"));
All of these pr_fmt uses are redundant as pr_err already does pr_fmt
alloc_etherdev already does a dump_stack so the OOM isn't useful.
> goto release_irq;
> }
> if (dev_alloc_name(netdev, "wlan%d") < 0) {
> - printk(KERN_ERR "ks7010 : Couldn't get name!\n");
> + pr_err(pr_fmt("Couldn't get name!\n"));
> goto free_dev;
> }
>
> @@ -1042,8 +1042,7 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> /* Upload firmware */
> ret = ks7010_upload_firmware(priv, card); /* firmware load */
> if (ret) {
> - printk(KERN_ERR
> - "ks7010: firmware load failed !! retern code = %d\n",
> + pr_err(pr_fmt("firmware load failed! return code = %d\n"),
> ret);
> goto free_buf;
> }
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-13 13:20 +0200 |
| Subject | Re: staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s5F8R-8N-3@gated-at.bofh.it> |
| In reply to | #1461440 |
>> Prefer usage of the macro "pr_err" over the interface "printk".
> Not correct
A checkpatch warning like "PREFER_PR_LEVEL" can point additional possibilities out
for this use case.
Would you like to introduce any of the higher level logging functions instead?
>> diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> []
>> @@ -998,11 +998,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
>> /* private memory allocate */
>> netdev = alloc_etherdev(sizeof(*priv));
>> if (netdev == NULL) {
>> - printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
>> + pr_err(pr_fmt("Unable to alloc new net device\n"));
>
> All of these pr_fmt uses are redundant as pr_err already does pr_fmt
Thanks for your reminder.
Would you accept that another update will be appended to the discussed patch series?
> alloc_etherdev already does a dump_stack so the OOM isn't useful.
Does this information indicate that this printk() (or pr_err()) call
should be deleted?
Regards,
Markus
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-08-13 19:40 +0200 |
| Subject | Re: staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s5L4B-4kc-1@gated-at.bofh.it> |
| In reply to | #1461614 |
On Sat, 2016-08-13 at 13:10 +0200, SF Markus Elfring wrote:
> > > Prefer usage of the macro "pr_err" over the interface "printk".
> > Not correct
> A checkpatch warning like "PREFER_PR_LEVEL" can point additional possibilities out
> for this use case.
> Would you like to introduce any of the higher level logging functions instead?
I think pr_<level> is OK if reworking the code
to support dev_<level> is not easy.
> > > diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
> > []
> > >
> > > @@ -998,11 +998,11 @@ static int ks7010_sdio_probe(struct sdio_func *func,
> > > /* private memory allocate */
> > > netdev = alloc_etherdev(sizeof(*priv));
> > > if (netdev == NULL) {
> > > - printk(KERN_ERR "ks7010 : Unable to alloc new net device\n");
> > > + pr_err(pr_fmt("Unable to alloc new net device\n"));
> > All of these pr_fmt uses are redundant as pr_err already does pr_fmt
> Thanks for your reminder.
>
> Would you accept that another update will be appended to the discussed patch series?
No. Patches should not knowingly introduce defects
that are corrected in follow-on patches.
> > alloc_etherdev already does a dump_stack so the OOM isn't useful.
> Does this information indicate that this printk() (or pr_err()) call
> should be deleted?
Markus, I don't know if it's your lack of English
comprehension or not, but it's fairly obvious from
my reply that this line should be deleted, either
in this patch or a follow-on.
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2016-08-14 11:00 +0200 |
| Subject | Re: staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s5ZqW-5AD-43@gated-at.bofh.it> |
| In reply to | #1461663 |
On Sat, 2016-08-13 at 21:30 +0200, SF Markus Elfring wrote: > > > > I think pr_ is OK if reworking the code > > to support dev_ is not easy. > Thanks for this explanation. - It sounds more constructive than the previous short > feedback "Not correct". <frustration> How do you need your food prepared? Do others need to cut it for you to bite sized pieces? </frustration> You might have noticed I also wrote in the same reply: "All of these pr_fmt uses are redundant as pr_err already does pr_fmt" > > > Would you accept that another update will be appended to the discussed patch series? > > No. Patches should not knowingly introduce defects > > that are corrected in follow-on patches. > This view is fine in principle. It is not just principle. It is a fundamental for kernel patch submission. > I am just curious on the preferred sequence to fix the affected implementation details. > > 1. I imagine that my questionable update suggestion "[PATCH v2 08/10] staging: ks7010: > Replace three printk() calls by pr_err()" can be skipped and the remaining logging > calls will be improved somehow a bit later. > > Or: > > 2. Do you want a resend of this whole patch series? I am not an upstream path. Greg KH generally serves that function here. My suggestion would be to resend the entire patchset as V(n+1). > It might be that I can occasionally become picky to check if other contributors > insist on the usage of a specific error message. You can be prone to understatement.
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-14 12:10 +0200 |
| Subject | Re: staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s60wF-6z9-1@gated-at.bofh.it> |
| In reply to | #1461730 |
> You might have noticed I also wrote in the same reply: > > "All of these pr_fmt uses are redundant as pr_err already does pr_fmt" I admit that I made another software development mistake there. - It might not matter much when a final fix could be to get rid of the three affected logging calls for example. > It is not just principle. > It is a fundamental for kernel patch submission. I hope that this view supports still the reordering for update steps after some discussion. > I am not an upstream path. > Greg KH generally serves that function here. > My suggestion would be to resend the entire patchset as V(n+1). I am curious if it would make sense to reduce the mail traffic a bit by finding out which software changes can be accepted already. Regards, Markus
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-14 13:10 +0200 |
| Subject | Re: staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s61sL-7d0-85@gated-at.bofh.it> |
| In reply to | #1461760 |
> Really now, this is basic fixes and cleanups, I agree to this view to some degree. > you have been asked many times in the past to move on beyond these, It is more useful when more severe bugs or bigger software improvements can be found. Which source code clean-ups are picked better up by other contributors? > as you often times seem to end up wasting lots of people's times > as they attempt to help you. It can take a bit more time occasionally to achieve the desired consensus. > Personally, I'm long past wishing to help you out here, sorry. Other contributors will eventually continue the clarification of remaining open issues in the source file "ks7010_sdio.c". > I'll take "correct" patches, but that's it. No discussion of them, no > arguing over theoreticals, and no telling you what I might, or might > not, want to see done in the future, sorry. I became aware about software development possibilities which can also matter here. Yesterday Julia Lawall informed me about a presentation on the topic "Refactor strings – make everyone happy" by Wolfram Sang on 2016-07-14. Is such a software evolution also interesting and acceptable for you? > And really, your patch quality stinks, I strongly suggest getting a lot > more experience with C first before doing more kernel work please. Can you accept any specific update steps while other software changes will evolve after a bit of discussion as usual? Regards, Markus
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-14 11:30 +0200 |
| Subject | Re: staging: ks7010: Replace three printk() calls by pr_err() |
| Message-ID | <s5ZqW-5AD-45@gated-at.bofh.it> |
| In reply to | #1461663 |
> I think pr_<level> is OK if reworking the code > to support dev_<level> is not easy. Thanks for this explanation. - It sounds more constructive than the previous short feedback "Not correct". >> Would you accept that another update will be appended to the discussed patch series? > > No. Patches should not knowingly introduce defects > that are corrected in follow-on patches. This view is fine in principle. I am just curious on the preferred sequence to fix the affected implementation details. 1. I imagine that my questionable update suggestion "[PATCH v2 08/10] staging: ks7010: Replace three printk() calls by pr_err()" can be skipped and the remaining logging calls will be improved somehow a bit later. Or: 2. Do you want a resend of this whole patch series? >>> alloc_etherdev already does a dump_stack so the OOM isn't useful. >> Does this information indicate that this printk() (or pr_err()) call >> should be deleted? > > Markus, I don't know if it's your lack of English > comprehension or not, but it's fairly obvious from > my reply that this line should be deleted, I was unsure if this view fits to a consensus also by other developers. It might be that I can occasionally become picky to check if other contributors insist on the usage of a specific error message. > either in this patch or a follow-on. I would prefer another addition (or source code clean-up) later. Could it happen that so many error messages are update candidates (for deletion) so that no places remain where a pr_err() call would make sense in this software module? Regards, Markus
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 08:00 +0200 |
| Subject | [PATCH v2 09/10] staging: ks7010: Delete a variable in write_to_device() |
| Message-ID | <s4Rc5-7ey-9@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 22:10:20 +0200
The local variable "rc" was assigned a zero at one place.
But it was not read within this function. Thus delete it.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Wolfram Sang <wsa@the-dreams.de>
---
v2: Rebased on the source files from Linux next-20160809.
drivers/staging/ks7010/ks7010_sdio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index bfca6a7..1729f57 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -299,11 +299,10 @@ static int enqueue_txdev(struct ks_wlan_private *priv, unsigned char *p,
static int write_to_device(struct ks_wlan_private *priv, unsigned char *buffer,
unsigned long size)
{
- int rc, retval;
+ int retval;
unsigned char rw_data;
struct hostif_hdr *hdr;
hdr = (struct hostif_hdr *)buffer;
- rc = 0;
DPRINTK(4, "size=%d\n", hdr->size);
if (hdr->event < HIF_DATA_REQ || HIF_REQ_MAX < hdr->event) {
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-11 08:10 +0200 |
| Subject | [PATCH v2 10/10] staging: ks7010: Delete three unnecessary variable initialisations |
| Message-ID | <s4RlL-7Uz-1@gated-at.bofh.it> |
| In reply to | #1460173 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 10 Aug 2016 22:33:52 +0200
Three variables will be set to an appropriate value a bit later.
Thus omit the explicit initialisation at the beginning.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
v2: Rebased on the source files from Linux next-20160809.
It was omitted to reduce the scope for the variable "rc"
in the function "tx_device_task".
drivers/staging/ks7010/ks7010_sdio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/ks7010/ks7010_sdio.c b/drivers/staging/ks7010/ks7010_sdio.c
index 1729f57..bb6294c 100644
--- a/drivers/staging/ks7010/ks7010_sdio.c
+++ b/drivers/staging/ks7010/ks7010_sdio.c
@@ -331,7 +331,7 @@ static void tx_device_task(void *dev)
{
struct ks_wlan_private *priv = (struct ks_wlan_private *)dev;
struct tx_device_buffer *sp;
- int rc = 0;
+ int rc;
DPRINTK(4, "\n");
if (cnt_txqbody(priv) > 0
@@ -366,7 +366,7 @@ int ks_wlan_hw_tx(struct ks_wlan_private *priv, void *p, unsigned long size,
void (*complete_handler) (void *arg1, void *arg2),
void *arg1, void *arg2)
{
- int result = 0;
+ int result;
struct hostif_hdr *hdr;
hdr = (struct hostif_hdr *)p;
@@ -747,7 +747,7 @@ static int ks7010_sdio_data_compare(struct ks_wlan_private *priv, u32 address,
static int ks7010_upload_firmware(struct ks_wlan_private *priv,
struct ks_sdio_card *card)
{
- unsigned int size, offset, n = 0;
+ unsigned int size, offset, n;
unsigned char *rom_buf;
unsigned char rw_data = 0;
int retval, rc = 0;
--
2.9.2
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2016-08-14 12:20 +0200 |
| Subject | Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver |
| Message-ID | <s60Gl-6CJ-7@gated-at.bofh.it> |
| In reply to | #1460173 |
> I added some Acked- and Reviewed-by tags last time. I noticed this of course. > Did the patches change Yes. - The amount of source code which I touched in this software module is different for the second series. > or why didn't you add them? I imagined that your acknowledgements to the previous approach might not fit to the current software development situation any more. Regards, Markus
[toc] | [prev] | [next] | [standalone]
| From | Wolfram Sang <wsa@the-dreams.de> |
|---|---|
| Date | 2016-08-14 14:10 +0200 |
| Subject | Re: [PATCH v2 00/10] staging: ks7010: Fine-tuning for a SDIO card driver |
| Message-ID | <s60Gl-6CJ-9@gated-at.bofh.it> |
| In reply to | #1460173 |
[Multipart message — attachments visible in raw view] — view raw
On Thu, Aug 11, 2016 at 07:17:12AM +0200, SF Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > > Further update suggestions were taken into account Which ones? Please describe them to ease review. > after a patch was applied from static source code analysis. I added some Acked- and Reviewed-by tags last time. Did the patches change or why didn't you add them?
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web