[PATCH v2] staging: lustre: fixed shadowed variable in socklnd_cb.c

2016-11-03 Thread Andrew Kanner
Removed redundant declaration of variable 'tx' in local scope
Fixed: sparse warning:
socklnd_cb.c:2476:41: warning: symbol 'tx' shadows an earlier one
socklnd_cb.c:2435:25: originally declared here

Signed-off-by: Andrew Kanner <andrew.kan...@gmail.com>
---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c 
b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index c1c6f60..f31f4a1 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -2473,8 +2473,8 @@ ksocknal_check_peer_timeouts(int idx)
 * holding only shared lock
 */
if (!list_empty(>ksnp_tx_queue)) {
-   struct ksock_tx *tx = 
list_entry(peer->ksnp_tx_queue.next,
-   struct ksock_tx, tx_list);
+   tx = list_entry(peer->ksnp_tx_queue.next,
+   struct ksock_tx, tx_list);
 
if (cfs_time_aftereq(cfs_time_current(),
 tx->tx_deadline)) {
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c

2016-11-03 Thread Andrew Kanner
2016-11-04 1:12 GMT+03:00 Dilger, Andreas <andreas.dil...@intel.com>:
> On Nov 3, 2016, at 15:54, Andrew Kanner <andrew.kan...@gmail.com> wrote:
>>
>> Changed variable 'tx' name in local scope
>> Fixed: sparse warning:
>> socklnd_cb.c:2476:41: warning: symbol 'tx' shadows an earlier one
>> socklnd_cb.c:2435:25: originally declared here
>
> Looking at this more closely (or from a greater distance, hard to say),
> the outer-scope "tx" is used only after this inner-scope "tx", so in
> fact there is no benefit to having the inner-scope declaration at all.
>
> Removing it may save a stack variable (depending on how the compiler
> optimizes), and shouldn't affect functionality.
>
> Cheers, Andreas

I see, I'll correct it and resend as PATCH v2. Thank you.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: lustre: fixed shadowed variable in socklnd_cb.c

2016-11-03 Thread Andrew Kanner
Changed variable 'tx' name in local scope
Fixed: sparse warning:
socklnd_cb.c:2476:41: warning: symbol 'tx' shadows an earlier one
socklnd_cb.c:2435:25: originally declared here

Signed-off-by: Andrew Kanner <andrew.kan...@gmail.com>
---
 drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c 
b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index c1c6f60..03fe4e5 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -2473,11 +2473,11 @@ ksocknal_check_peer_timeouts(int idx)
 * holding only shared lock
 */
if (!list_empty(>ksnp_tx_queue)) {
-   struct ksock_tx *tx = 
list_entry(peer->ksnp_tx_queue.next,
+   struct ksock_tx *_tx = 
list_entry(peer->ksnp_tx_queue.next,
struct ksock_tx, tx_list);
 
if (cfs_time_aftereq(cfs_time_current(),
-tx->tx_deadline)) {
+_tx->tx_deadline)) {
ksocknal_peer_addref(peer);
read_unlock(_data.ksnd_global_lock);
 
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] drivers: staging: vme: convert to octal notation for permission bits

2016-09-16 Thread Andrew Kanner
Ran checkpatch.pl -f vme_pio2_core.c
Fixed: WARNING: Symbolic permissions are not preferred. Consider using
octal permissions (0444)

Signed-off-by: Andrew Kanner <andrew.kan...@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c 
b/drivers/staging/vme/devices/vme_pio2_core.c
index 28a4568..8e66a52 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -466,23 +466,23 @@ static void __exit pio2_exit(void)
 
 /* These are required for each board */
 MODULE_PARM_DESC(bus, "Enumeration of VMEbus to which the board is connected");
-module_param_array(bus, int, _num, S_IRUGO);
+module_param_array(bus, int, _num, 0444);
 
 MODULE_PARM_DESC(base, "Base VME address for PIO2 Registers");
-module_param_array(base, long, _num, S_IRUGO);
+module_param_array(base, long, _num, 0444);
 
 MODULE_PARM_DESC(vector, "VME IRQ Vector (Lower 4 bits masked)");
-module_param_array(vector, int, _num, S_IRUGO);
+module_param_array(vector, int, _num, 0444);
 
 MODULE_PARM_DESC(level, "VME IRQ Level");
-module_param_array(level, int, _num, S_IRUGO);
+module_param_array(level, int, _num, 0444);
 
 MODULE_PARM_DESC(variant, "Last 4 characters of PIO2 board variant");
-module_param_array(variant, charp, _num, S_IRUGO);
+module_param_array(variant, charp, _num, 0444);
 
 /* This is for debugging */
 MODULE_PARM_DESC(loopback, "Enable loopback mode on all cards");
-module_param(loopback, bool, S_IRUGO);
+module_param(loopback, bool, 0444);
 
 MODULE_DESCRIPTION("GE PIO2 6U VME I/O Driver");
 MODULE_AUTHOR("Martyn Welch <martyn.we...@ge.com");
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: drivers: staging: vme: Fixed some code style warnings

2016-09-14 Thread Andrew Kanner
‎Thanks, I understood my fault, but haven't done this changes yet. I can't 
understand if I should reply to original message with v2 patch or send a new 
email with it?


  Исходное сообщение  
От: Markus Böhme
Отправлено: среда, 14 сентября 2016 г., 15:56
Кому: Andrew Kanner; gre...@linuxfoundation.org
Копия: de...@driverdev.osuosl.org; manohar.va...@gmail.com; 
egor.ulieis...@gmail.com; linux-ker...@vger.kernel.org
Тема: Re: drivers: staging: vme: Fixed some code style warnings

On 09/13/2016 12:31 AM, Andrew Kanner wrote:
> Signed-off-by: Andrew Kanner <andrew.kan...@gmail.com>
> ---
> drivers/staging/vme/devices/vme_pio2_core.c | 12 ++--
> drivers/staging/vme/devices/vme_user.c | 2 +-
> 2 files changed, 7 insertions(+), 7 deletions(-)
> (snip)

Hello Andrew,

please be more specific in your subject line, e.g.
"drivers: staging: vme: Convert to octal notation for permission bits".

Also don't forget to add a commit message to your patch with a short
description what you are fixing and why. In your case it would be good
to mention that you are fixing a checkpatch warning, and to include the
warning message in your description. Then resend as V2.

Thanks,
Markus
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


drivers: staging: vme: Fixed some code style warnings

2016-09-12 Thread Andrew Kanner
Signed-off-by: Andrew Kanner <andrew.kan...@gmail.com>
---
 drivers/staging/vme/devices/vme_pio2_core.c | 12 ++--
 drivers/staging/vme/devices/vme_user.c  |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/vme/devices/vme_pio2_core.c 
b/drivers/staging/vme/devices/vme_pio2_core.c
index 28a4568..8e66a52 100644
--- a/drivers/staging/vme/devices/vme_pio2_core.c
+++ b/drivers/staging/vme/devices/vme_pio2_core.c
@@ -466,23 +466,23 @@ static void __exit pio2_exit(void)
 
 /* These are required for each board */
 MODULE_PARM_DESC(bus, "Enumeration of VMEbus to which the board is connected");
-module_param_array(bus, int, _num, S_IRUGO);
+module_param_array(bus, int, _num, 0444);
 
 MODULE_PARM_DESC(base, "Base VME address for PIO2 Registers");
-module_param_array(base, long, _num, S_IRUGO);
+module_param_array(base, long, _num, 0444);
 
 MODULE_PARM_DESC(vector, "VME IRQ Vector (Lower 4 bits masked)");
-module_param_array(vector, int, _num, S_IRUGO);
+module_param_array(vector, int, _num, 0444);
 
 MODULE_PARM_DESC(level, "VME IRQ Level");
-module_param_array(level, int, _num, S_IRUGO);
+module_param_array(level, int, _num, 0444);
 
 MODULE_PARM_DESC(variant, "Last 4 characters of PIO2 board variant");
-module_param_array(variant, charp, _num, S_IRUGO);
+module_param_array(variant, charp, _num, 0444);
 
 /* This is for debugging */
 MODULE_PARM_DESC(loopback, "Enable loopback mode on all cards");
-module_param(loopback, bool, S_IRUGO);
+module_param(loopback, bool, 0444);
 
 MODULE_DESCRIPTION("GE PIO2 6U VME I/O Driver");
 MODULE_AUTHOR("Martyn Welch <martyn.we...@ge.com");
diff --git a/drivers/staging/vme/devices/vme_user.c 
b/drivers/staging/vme/devices/vme_user.c
index b95883b..5dd430f 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -773,7 +773,7 @@ static void __exit vme_user_exit(void)
 }
 
 MODULE_PARM_DESC(bus, "Enumeration of VMEbus to which the driver is 
connected");
-module_param_array(bus, int, _num, 0);
+module_param_array(bus, int, _num, );
 
 MODULE_DESCRIPTION("VME User Space Access Driver");
 MODULE_AUTHOR("Martyn Welch <martyn.we...@ge.com");
-- 
2.1.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel