[PATCH] staging: lustre: use linux headers

2015-02-09 Thread Asaf Vertz
WARNING: Use #include  instead of 
WARNING: Use #include  instead of 
WARNING: Use #include  instead of 

Signed-off-by: Asaf Vertz 
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|2 +-
 .../lustre/lnet/klnds/socklnd/socklnd_lib-linux.h  |2 +-
 .../lustre/lustre/libcfs/linux/linux-debug.c   |2 +-
 .../lustre/lustre/libcfs/linux/linux-prim.c|2 +-
 .../lustre/lustre/libcfs/linux/linux-proc.c|2 +-
 drivers/staging/lustre/lustre/llite/dir.c  |2 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |2 +-
 drivers/staging/lustre/lustre/llite/lloop.c|3 +--
 drivers/staging/lustre/lustre/llite/rw.c   |2 +-
 drivers/staging/lustre/lustre/llite/rw26.c |2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c  |2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c  |2 +-
 13 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
index ab128de..cd664d0 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
@@ -46,8 +46,8 @@
 #include 
 #include 
 #include 
+#include 
 
-#include 
 #include 
 
 #include 
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h 
b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h
index 7a793d2..f556388 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h
@@ -50,8 +50,8 @@
 #include 
 #include 
 #include 
+#include 
 
-#include 
 #include 
 
 #include 
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
index 12005a7..4545d54 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
@@ -50,7 +50,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 # define DEBUG_SUBSYSTEM S_LNET
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
index 19f405e..fde2819 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
@@ -43,7 +43,7 @@
 #include "../../../include/linux/libcfs/libcfs.h"
 
 #if defined(CONFIG_KGDB)
-#include 
+#include 
 #endif
 
 /**
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
index c539e37..0f65929 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
@@ -50,7 +50,7 @@
 #include 
 #include 
 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index babba60..e70d5bd 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -41,7 +41,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include/* for wait_on_buffer */
 #include 
 #include 
diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c 
b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index 479bf42..ab07959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -40,7 +40,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/staging/lustre/lustre/llite/lloop.c 
b/drivers/staging/lustre/lustre/llite/lloop.c
index 0312488..cec9254 100644
--- a/drivers/staging/lustre/lustre/llite/lloop.c
+++ b/drivers/staging/lustre/lustre/llite/lloop.c
@@ -100,8 +100,7 @@
 #include 
 #include 
 #include 
-
-#include 
+#include 
 
 #include "../include/lustre_lib.h"
 #include "../include/lustre_lite.h"
diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index 10a0421..8884a43 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -45,7 +45,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 2f21304..91442fa 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -44,7 +44,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c 
b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index b779f47..403e9f5 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -43,7 +43,7 @@
 #include 
 

[PATCH] staging: lustre: use linux headers

2015-02-09 Thread Asaf Vertz
WARNING: Use #include linux/uaccess.h instead of asm/uaccess.h
WARNING: Use #include linux/statfs.h instead of asm/statfs.h
WARNING: Use #include linux/kgdb.h instead of asm/kgdb.h

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h|2 +-
 .../lustre/lnet/klnds/socklnd/socklnd_lib-linux.h  |2 +-
 .../lustre/lustre/libcfs/linux/linux-debug.c   |2 +-
 .../lustre/lustre/libcfs/linux/linux-prim.c|2 +-
 .../lustre/lustre/libcfs/linux/linux-proc.c|2 +-
 drivers/staging/lustre/lustre/llite/dir.c  |2 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |2 +-
 drivers/staging/lustre/lustre/llite/lloop.c|3 +--
 drivers/staging/lustre/lustre/llite/rw.c   |2 +-
 drivers/staging/lustre/lustre/llite/rw26.c |2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c|2 +-
 drivers/staging/lustre/lustre/lov/lproc_lov.c  |2 +-
 drivers/staging/lustre/lustre/osc/lproc_osc.c  |2 +-
 13 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h 
b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
index ab128de..cd664d0 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h
@@ -46,8 +46,8 @@
 #include linux/errno.h
 #include linux/unistd.h
 #include linux/uio.h
+#include linux/uaccess.h
 
-#include asm/uaccess.h
 #include asm/io.h
 
 #include linux/fs.h
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h 
b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h
index 7a793d2..f556388 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib-linux.h
@@ -50,8 +50,8 @@
 #include net/tcp.h
 #include linux/uio.h
 #include linux/if.h
+#include linux/uaccess.h
 
-#include asm/uaccess.h
 #include asm/irq.h
 
 #include linux/fs.h
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
index 12005a7..4545d54 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c
@@ -50,7 +50,7 @@
 #include linux/interrupt.h
 #include linux/completion.h
 #include linux/fs.h
-#include asm/uaccess.h
+#include linux/uaccess.h
 #include linux/miscdevice.h
 
 # define DEBUG_SUBSYSTEM S_LNET
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
index 19f405e..fde2819 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-prim.c
@@ -43,7 +43,7 @@
 #include ../../../include/linux/libcfs/libcfs.h
 
 #if defined(CONFIG_KGDB)
-#include asm/kgdb.h
+#include linux/kgdb.h
 #endif
 
 /**
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c 
b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
index c539e37..0f65929 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-proc.c
@@ -50,7 +50,7 @@
 #include net/sock.h
 #include linux/uio.h
 
-#include asm/uaccess.h
+#include linux/uaccess.h
 
 #include linux/fs.h
 #include linux/file.h
diff --git a/drivers/staging/lustre/lustre/llite/dir.c 
b/drivers/staging/lustre/lustre/llite/dir.c
index babba60..e70d5bd 100644
--- a/drivers/staging/lustre/lustre/llite/dir.c
+++ b/drivers/staging/lustre/lustre/llite/dir.c
@@ -41,7 +41,7 @@
 #include linux/fs.h
 #include linux/pagemap.h
 #include linux/mm.h
-#include asm/uaccess.h
+#include linux/uaccess.h
 #include linux/buffer_head.h   /* for wait_on_buffer */
 #include linux/pagevec.h
 #include linux/prefetch.h
diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c 
b/drivers/staging/lustre/lustre/llite/llite_mmap.c
index 479bf42..ab07959 100644
--- a/drivers/staging/lustre/lustre/llite/llite_mmap.c
+++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c
@@ -40,7 +40,7 @@
 #include linux/stat.h
 #include linux/errno.h
 #include linux/unistd.h
-#include asm/uaccess.h
+#include linux/uaccess.h
 
 #include linux/fs.h
 #include linux/pagemap.h
diff --git a/drivers/staging/lustre/lustre/llite/lloop.c 
b/drivers/staging/lustre/lustre/llite/lloop.c
index 0312488..cec9254 100644
--- a/drivers/staging/lustre/lustre/llite/lloop.c
+++ b/drivers/staging/lustre/lustre/llite/lloop.c
@@ -100,8 +100,7 @@
 #include linux/highmem.h
 #include linux/gfp.h
 #include linux/pagevec.h
-
-#include asm/uaccess.h
+#include linux/uaccess.h
 
 #include ../include/lustre_lib.h
 #include ../include/lustre_lite.h
diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index 10a0421..8884a43 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -45,7

[PATCH] staging: lustre: lnet: fix space prohibited before that '++'

2015-02-01 Thread Asaf Vertz
Fixed a coding style error, space prohibited before that '++'

Signed-off-by: Asaf Vertz 
---
 drivers/staging/lustre/lnet/selftest/console.c |   28 
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/console.c 
b/drivers/staging/lustre/lnet/selftest/console.c
index 3bb47fa..1e0afc2 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -46,17 +46,17 @@
 #include "console.h"
 #include "conrpc.h"
 
-#define LST_NODE_STATE_COUNTER(nd, p) \
-do {   \
-   if ((nd)->nd_state == LST_NODE_ACTIVE)\
-   (p)->nle_nactive ++;\
+#define LST_NODE_STATE_COUNTER(nd, p)  \
+do {   \
+   if ((nd)->nd_state == LST_NODE_ACTIVE)  \
+   (p)->nle_nactive++; \
else if ((nd)->nd_state == LST_NODE_BUSY)   \
-   (p)->nle_nbusy ++;\
+   (p)->nle_nbusy++;   \
else if ((nd)->nd_state == LST_NODE_DOWN)   \
-   (p)->nle_ndown ++;\
-   else\
-   (p)->nle_nunknown ++;  \
-   (p)->nle_nnode ++;\
+   (p)->nle_ndown++;   \
+   else\
+   (p)->nle_nunknown++;\
+   (p)->nle_nnode++;   \
 } while (0)
 
 lstcon_session_t   console_session;
@@ -223,7 +223,7 @@ lstcon_group_alloc(char *name, lstcon_group_t **grpp)
 static void
 lstcon_group_addref(lstcon_group_t *grp)
 {
-   grp->grp_ref ++;
+   grp->grp_ref++;
 }
 
 static void lstcon_group_ndlink_release(lstcon_group_t *, lstcon_ndlink_t *);
@@ -298,7 +298,7 @@ lstcon_group_ndlink_find(lstcon_group_t *grp, 
lnet_process_id_t id,
return 0;
 
list_add_tail(&(*ndlpp)->ndl_link, >grp_ndl_list);
-   grp->grp_nnode ++;
+   grp->grp_nnode++;
 
return 0;
 }
@@ -324,7 +324,7 @@ lstcon_group_ndlink_move(lstcon_group_t *old,
 
list_add_tail(>ndl_hlink, >grp_ndl_hash[idx]);
list_add_tail(>ndl_link, >grp_ndl_list);
-   new->grp_nnode ++;
+   new->grp_nnode++;
 
return;
 }
@@ -767,7 +767,7 @@ lstcon_nodes_getent(struct list_head *head, int *index_p,
 >nd_state, sizeof(nd->nd_state)))
return -EFAULT;
 
-   count ++;
+   count++;
}
 
if (index <= *index_p)
@@ -1343,7 +1343,7 @@ lstcon_test_add(char *batch_name, int type, int loop,
/* add to test list anyway, so user can check what's going on */
list_add_tail(>tes_link, >bat_test_list);
 
-   batch->bat_ntest ++;
+   batch->bat_ntest++;
test->tes_hdr.tsb_index = batch->bat_ntest;
 
/*  hold groups so nobody can change them */
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: lustre: osc: fix space prohibited after that '!'

2015-02-01 Thread Asaf Vertz
Fixed a coding style error, space prohibited after that '!'

Signed-off-by: Asaf Vertz 
---
 drivers/staging/lustre/lustre/osc/osc_lock.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c 
b/drivers/staging/lustre/lustre/osc/osc_lock.c
index a7f08bc..4456557 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -100,14 +100,14 @@ static int osc_lock_invariant(struct osc_lock *ols)
/*
 * If all the following "ergo"s are true, return 1, otherwise 0
 */
-   if (! ergo(olock != NULL, handle_used))
+   if (!ergo(olock != NULL, handle_used))
return 0;
 
-   if (! ergo(olock != NULL,
+   if (!ergo(olock != NULL,
   olock->l_handle.h_cookie == ols->ols_handle.cookie))
return 0;
 
-   if (! ergo(handle_used,
+   if (!ergo(handle_used,
   ergo(lock != NULL && olock != NULL, lock == olock) &&
   ergo(lock == NULL, olock == NULL)))
return 0;
@@ -115,18 +115,18 @@ static int osc_lock_invariant(struct osc_lock *ols)
 * Check that ->ols_handle and ->ols_lock are consistent, but
 * take into account that they are set at the different time.
 */
-   if (! ergo(ols->ols_state == OLS_CANCELLED,
+   if (!ergo(ols->ols_state == OLS_CANCELLED,
   olock == NULL && !handle_used))
return 0;
/*
 * DLM lock is destroyed only after we have seen cancellation
 * ast.
 */
-   if (! ergo(olock != NULL && ols->ols_state < OLS_CANCELLED,
+   if (!ergo(olock != NULL && ols->ols_state < OLS_CANCELLED,
   ((olock->l_flags & LDLM_FL_DESTROYED) == 0)))
return 0;
 
-   if (! ergo(ols->ols_state == OLS_GRANTED,
+   if (!ergo(ols->ols_state == OLS_GRANTED,
   olock != NULL &&
   olock->l_req_mode == olock->l_granted_mode &&
   ols->ols_hold))
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: lustre: lnet: fix space prohibited before that '++'

2015-02-01 Thread Asaf Vertz
Fixed a coding style error, space prohibited before that '++'

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/staging/lustre/lnet/selftest/console.c |   28 
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/lustre/lnet/selftest/console.c 
b/drivers/staging/lustre/lnet/selftest/console.c
index 3bb47fa..1e0afc2 100644
--- a/drivers/staging/lustre/lnet/selftest/console.c
+++ b/drivers/staging/lustre/lnet/selftest/console.c
@@ -46,17 +46,17 @@
 #include console.h
 #include conrpc.h
 
-#define LST_NODE_STATE_COUNTER(nd, p) \
-do {   \
-   if ((nd)-nd_state == LST_NODE_ACTIVE)\
-   (p)-nle_nactive ++;\
+#define LST_NODE_STATE_COUNTER(nd, p)  \
+do {   \
+   if ((nd)-nd_state == LST_NODE_ACTIVE)  \
+   (p)-nle_nactive++; \
else if ((nd)-nd_state == LST_NODE_BUSY)   \
-   (p)-nle_nbusy ++;\
+   (p)-nle_nbusy++;   \
else if ((nd)-nd_state == LST_NODE_DOWN)   \
-   (p)-nle_ndown ++;\
-   else\
-   (p)-nle_nunknown ++;  \
-   (p)-nle_nnode ++;\
+   (p)-nle_ndown++;   \
+   else\
+   (p)-nle_nunknown++;\
+   (p)-nle_nnode++;   \
 } while (0)
 
 lstcon_session_t   console_session;
@@ -223,7 +223,7 @@ lstcon_group_alloc(char *name, lstcon_group_t **grpp)
 static void
 lstcon_group_addref(lstcon_group_t *grp)
 {
-   grp-grp_ref ++;
+   grp-grp_ref++;
 }
 
 static void lstcon_group_ndlink_release(lstcon_group_t *, lstcon_ndlink_t *);
@@ -298,7 +298,7 @@ lstcon_group_ndlink_find(lstcon_group_t *grp, 
lnet_process_id_t id,
return 0;
 
list_add_tail((*ndlpp)-ndl_link, grp-grp_ndl_list);
-   grp-grp_nnode ++;
+   grp-grp_nnode++;
 
return 0;
 }
@@ -324,7 +324,7 @@ lstcon_group_ndlink_move(lstcon_group_t *old,
 
list_add_tail(ndl-ndl_hlink, new-grp_ndl_hash[idx]);
list_add_tail(ndl-ndl_link, new-grp_ndl_list);
-   new-grp_nnode ++;
+   new-grp_nnode++;
 
return;
 }
@@ -767,7 +767,7 @@ lstcon_nodes_getent(struct list_head *head, int *index_p,
 nd-nd_state, sizeof(nd-nd_state)))
return -EFAULT;
 
-   count ++;
+   count++;
}
 
if (index = *index_p)
@@ -1343,7 +1343,7 @@ lstcon_test_add(char *batch_name, int type, int loop,
/* add to test list anyway, so user can check what's going on */
list_add_tail(test-tes_link, batch-bat_test_list);
 
-   batch-bat_ntest ++;
+   batch-bat_ntest++;
test-tes_hdr.tsb_index = batch-bat_ntest;
 
/*  hold groups so nobody can change them */
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: lustre: osc: fix space prohibited after that '!'

2015-02-01 Thread Asaf Vertz
Fixed a coding style error, space prohibited after that '!'

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/staging/lustre/lustre/osc/osc_lock.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c 
b/drivers/staging/lustre/lustre/osc/osc_lock.c
index a7f08bc..4456557 100644
--- a/drivers/staging/lustre/lustre/osc/osc_lock.c
+++ b/drivers/staging/lustre/lustre/osc/osc_lock.c
@@ -100,14 +100,14 @@ static int osc_lock_invariant(struct osc_lock *ols)
/*
 * If all the following ergos are true, return 1, otherwise 0
 */
-   if (! ergo(olock != NULL, handle_used))
+   if (!ergo(olock != NULL, handle_used))
return 0;
 
-   if (! ergo(olock != NULL,
+   if (!ergo(olock != NULL,
   olock-l_handle.h_cookie == ols-ols_handle.cookie))
return 0;
 
-   if (! ergo(handle_used,
+   if (!ergo(handle_used,
   ergo(lock != NULL  olock != NULL, lock == olock) 
   ergo(lock == NULL, olock == NULL)))
return 0;
@@ -115,18 +115,18 @@ static int osc_lock_invariant(struct osc_lock *ols)
 * Check that -ols_handle and -ols_lock are consistent, but
 * take into account that they are set at the different time.
 */
-   if (! ergo(ols-ols_state == OLS_CANCELLED,
+   if (!ergo(ols-ols_state == OLS_CANCELLED,
   olock == NULL  !handle_used))
return 0;
/*
 * DLM lock is destroyed only after we have seen cancellation
 * ast.
 */
-   if (! ergo(olock != NULL  ols-ols_state  OLS_CANCELLED,
+   if (!ergo(olock != NULL  ols-ols_state  OLS_CANCELLED,
   ((olock-l_flags  LDLM_FL_DESTROYED) == 0)))
return 0;
 
-   if (! ergo(ols-ols_state == OLS_GRANTED,
+   if (!ergo(ols-ols_state == OLS_GRANTED,
   olock != NULL 
   olock-l_req_mode == olock-l_granted_mode 
   ols-ols_hold))
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] scsi: 3w-9xxx: fix format string warnings

2015-01-21 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 3)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 4)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 5)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 6)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 7)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 8)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 9)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 10)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 11)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz 
---
 drivers/scsi/3w-9xxx.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 7600639..123eba5 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -164,16 +164,16 @@ static ssize_t twa_show_stats(struct device *dev,
 
spin_lock_irqsave(tw_dev->host->host_lock, flags);
len = snprintf(buf, PAGE_SIZE, "3w-9xxx Driver version: %s\n"
-  "Current commands posted:   %4d\n"
-  "Max commands posted:   %4d\n"
-  "Current pending commands:  %4d\n"
-  "Max pending commands:  %4d\n"
-  "Last sgl length:   %4d\n"
-  "Max sgl length:%4d\n"
-  "Last sector count: %4d\n"
-  "Max sector count:  %4d\n"
-  "SCSI Host Resets:  %4d\n"
-  "AEN's: %4d\n", 
+  "Current commands posted:   %4u\n"
+  "Max commands posted:   %4u\n"
+  "Current pending commands:  %4u\n"
+  "Max pending commands:  %4u\n"
+  "Last sgl length:   %4u\n"
+  "Max sgl length:%4u\n"
+  "Last sector count: %4u\n"
+  "Max sector count:  %4u\n"
+  "SCSI Host Resets:  %4u\n"
+  "AEN's: %4u\n",
   TW_DRIVER_VERSION,
   tw_dev->posted_request_count,
   tw_dev->max_posted_request_count,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] usb: gadget: zero: fix format string warnings

2015-01-21 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/usb/gadget/function/f_sourcesink.c:1217]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1261]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1305]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1349]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1393]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1437]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1476]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1520]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1564]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1608]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'

Signed-off-by: Asaf Vertz 
---
 drivers/usb/gadget/function/f_sourcesink.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/function/f_sourcesink.c 
b/drivers/usb/gadget/function/f_sourcesink.c
index 80be25b..e07c50c 100644
--- a/drivers/usb/gadget/function/f_sourcesink.c
+++ b/drivers/usb/gadget/function/f_sourcesink.c
@@ -1214,7 +1214,7 @@ static ssize_t f_ss_opts_pattern_show(struct f_ss_opts 
*opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->pattern);
+   result = sprintf(page, "%u", opts->pattern);
mutex_unlock(>lock);
 
return result;
@@ -1258,7 +1258,7 @@ static ssize_t f_ss_opts_isoc_interval_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->isoc_interval);
+   result = sprintf(page, "%u", opts->isoc_interval);
mutex_unlock(>lock);
 
return result;
@@ -1302,7 +1302,7 @@ static ssize_t f_ss_opts_isoc_maxpacket_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->isoc_maxpacket);
+   result = sprintf(page, "%u", opts->isoc_maxpacket);
mutex_unlock(>lock);
 
return result;
@@ -1346,7 +1346,7 @@ static ssize_t f_ss_opts_isoc_mult_show(struct f_ss_opts 
*opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->isoc_mult);
+   result = sprintf(page, "%u", opts->isoc_mult);
mutex_unlock(>lock);
 
return result;
@@ -1390,7 +1390,7 @@ static ssize_t f_ss_opts_isoc_maxburst_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->isoc_maxburst);
+   result = sprintf(page, "%u", opts->isoc_maxburst);
mutex_unlock(>lock);
 
return result;
@@ -1434,7 +1434,7 @@ static ssize_t f_ss_opts_bulk_buflen_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->bulk_buflen);
+   result = sprintf(page, "%u", opts->bulk_buflen);
mutex_unlock(>lock);
 
return result;
@@ -1473,7 +1473,7 @@ static ssize_t f_ss_opts_int_interval_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->int_interval);
+   result = sprintf(page, "%u", opts->int_interval);
mutex_unlock(>lock);
 
return result;
@@ -1517,7 +1517,7 @@ static ssize_t f_ss_opts_int_maxpacket_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->int_maxpacket);
+   result = sprintf(page, "%u", opts->int_maxpacket);
mutex_unlock(>lock);
 
return result;
@@ -1561,7 +1561,7 @@ static ssize_t f_ss_opts_int_mult_show(struct f_ss_opts 
*opts, char *page)
int result;
 
mutex_lock(>lock);
-   result = sprintf(page, "%d", opts->int_mult);
+   result = sprintf(page, "%u", opts->int_mult);
  

[PATCH] hwmon: abx500: fix format string warnings

2015-01-21 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/hwmon/abx500.c:224]: (warning) %ld in format string (no. 1)
requires 'long' but the argument type is 'unsigned long'.
[drivers/hwmon/abx500.c:233]: (warning) %ld in format string (no. 1)
requires 'long' but the argument type is 'unsigned long'.
[drivers/hwmon/abx500.c:242]: (warning) %ld in format string (no. 1)
requires 'long' but the argument type is 'unsigned long'.

Signed-off-by: Asaf Vertz 
---
 drivers/hwmon/abx500.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/abx500.c b/drivers/hwmon/abx500.c
index 1387596..6cb89c0 100644
--- a/drivers/hwmon/abx500.c
+++ b/drivers/hwmon/abx500.c
@@ -221,7 +221,7 @@ static ssize_t show_min(struct device *dev,
struct abx500_temp *data = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-   return sprintf(buf, "%ld\n", data->min[attr->index]);
+   return sprintf(buf, "%lu\n", data->min[attr->index]);
 }
 
 static ssize_t show_max(struct device *dev,
@@ -230,7 +230,7 @@ static ssize_t show_max(struct device *dev,
struct abx500_temp *data = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-   return sprintf(buf, "%ld\n", data->max[attr->index]);
+   return sprintf(buf, "%lu\n", data->max[attr->index]);
 }
 
 static ssize_t show_max_hyst(struct device *dev,
@@ -239,7 +239,7 @@ static ssize_t show_max_hyst(struct device *dev,
struct abx500_temp *data = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-   return sprintf(buf, "%ld\n", data->max_hyst[attr->index]);
+   return sprintf(buf, "%lu\n", data->max_hyst[attr->index]);
 }
 
 static ssize_t show_min_alarm(struct device *dev,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] usb: gadget: zero: fix format string warnings

2015-01-21 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/usb/gadget/function/f_sourcesink.c:1217]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1261]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1305]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1349]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1393]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1437]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1476]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1520]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1564]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/usb/gadget/function/f_sourcesink.c:1608]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/usb/gadget/function/f_sourcesink.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/gadget/function/f_sourcesink.c 
b/drivers/usb/gadget/function/f_sourcesink.c
index 80be25b..e07c50c 100644
--- a/drivers/usb/gadget/function/f_sourcesink.c
+++ b/drivers/usb/gadget/function/f_sourcesink.c
@@ -1214,7 +1214,7 @@ static ssize_t f_ss_opts_pattern_show(struct f_ss_opts 
*opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-pattern);
+   result = sprintf(page, %u, opts-pattern);
mutex_unlock(opts-lock);
 
return result;
@@ -1258,7 +1258,7 @@ static ssize_t f_ss_opts_isoc_interval_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-isoc_interval);
+   result = sprintf(page, %u, opts-isoc_interval);
mutex_unlock(opts-lock);
 
return result;
@@ -1302,7 +1302,7 @@ static ssize_t f_ss_opts_isoc_maxpacket_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-isoc_maxpacket);
+   result = sprintf(page, %u, opts-isoc_maxpacket);
mutex_unlock(opts-lock);
 
return result;
@@ -1346,7 +1346,7 @@ static ssize_t f_ss_opts_isoc_mult_show(struct f_ss_opts 
*opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-isoc_mult);
+   result = sprintf(page, %u, opts-isoc_mult);
mutex_unlock(opts-lock);
 
return result;
@@ -1390,7 +1390,7 @@ static ssize_t f_ss_opts_isoc_maxburst_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-isoc_maxburst);
+   result = sprintf(page, %u, opts-isoc_maxburst);
mutex_unlock(opts-lock);
 
return result;
@@ -1434,7 +1434,7 @@ static ssize_t f_ss_opts_bulk_buflen_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-bulk_buflen);
+   result = sprintf(page, %u, opts-bulk_buflen);
mutex_unlock(opts-lock);
 
return result;
@@ -1473,7 +1473,7 @@ static ssize_t f_ss_opts_int_interval_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-int_interval);
+   result = sprintf(page, %u, opts-int_interval);
mutex_unlock(opts-lock);
 
return result;
@@ -1517,7 +1517,7 @@ static ssize_t f_ss_opts_int_maxpacket_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-int_maxpacket);
+   result = sprintf(page, %u, opts-int_maxpacket);
mutex_unlock(opts-lock);
 
return result;
@@ -1561,7 +1561,7 @@ static ssize_t f_ss_opts_int_mult_show(struct f_ss_opts 
*opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts-int_mult);
+   result = sprintf(page, %u, opts-int_mult);
mutex_unlock(opts-lock);
 
return result;
@@ -1605,7 +1605,7 @@ static ssize_t f_ss_opts_int_maxburst_show(struct 
f_ss_opts *opts, char *page)
int result;
 
mutex_lock(opts-lock);
-   result = sprintf(page, %d, opts

[PATCH] hwmon: abx500: fix format string warnings

2015-01-21 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/hwmon/abx500.c:224]: (warning) %ld in format string (no. 1)
requires 'long' but the argument type is 'unsigned long'.
[drivers/hwmon/abx500.c:233]: (warning) %ld in format string (no. 1)
requires 'long' but the argument type is 'unsigned long'.
[drivers/hwmon/abx500.c:242]: (warning) %ld in format string (no. 1)
requires 'long' but the argument type is 'unsigned long'.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/hwmon/abx500.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/hwmon/abx500.c b/drivers/hwmon/abx500.c
index 1387596..6cb89c0 100644
--- a/drivers/hwmon/abx500.c
+++ b/drivers/hwmon/abx500.c
@@ -221,7 +221,7 @@ static ssize_t show_min(struct device *dev,
struct abx500_temp *data = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-   return sprintf(buf, %ld\n, data-min[attr-index]);
+   return sprintf(buf, %lu\n, data-min[attr-index]);
 }
 
 static ssize_t show_max(struct device *dev,
@@ -230,7 +230,7 @@ static ssize_t show_max(struct device *dev,
struct abx500_temp *data = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-   return sprintf(buf, %ld\n, data-max[attr-index]);
+   return sprintf(buf, %lu\n, data-max[attr-index]);
 }
 
 static ssize_t show_max_hyst(struct device *dev,
@@ -239,7 +239,7 @@ static ssize_t show_max_hyst(struct device *dev,
struct abx500_temp *data = dev_get_drvdata(dev);
struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
 
-   return sprintf(buf, %ld\n, data-max_hyst[attr-index]);
+   return sprintf(buf, %lu\n, data-max_hyst[attr-index]);
 }
 
 static ssize_t show_min_alarm(struct device *dev,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] scsi: 3w-9xxx: fix format string warnings

2015-01-21 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 3)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 4)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 5)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 6)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 7)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 8)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 9)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 10)
requires 'int' but the argument type is 'unsigned int'.
[drivers/scsi/3w-9xxx.c:166]: (warning) %d in format string (no. 11)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/scsi/3w-9xxx.c |   20 ++--
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c
index 7600639..123eba5 100644
--- a/drivers/scsi/3w-9xxx.c
+++ b/drivers/scsi/3w-9xxx.c
@@ -164,16 +164,16 @@ static ssize_t twa_show_stats(struct device *dev,
 
spin_lock_irqsave(tw_dev-host-host_lock, flags);
len = snprintf(buf, PAGE_SIZE, 3w-9xxx Driver version: %s\n
-  Current commands posted:   %4d\n
-  Max commands posted:   %4d\n
-  Current pending commands:  %4d\n
-  Max pending commands:  %4d\n
-  Last sgl length:   %4d\n
-  Max sgl length:%4d\n
-  Last sector count: %4d\n
-  Max sector count:  %4d\n
-  SCSI Host Resets:  %4d\n
-  AEN's: %4d\n, 
+  Current commands posted:   %4u\n
+  Max commands posted:   %4u\n
+  Current pending commands:  %4u\n
+  Max pending commands:  %4u\n
+  Last sgl length:   %4u\n
+  Max sgl length:%4u\n
+  Last sector count: %4u\n
+  Max sector count:  %4u\n
+  SCSI Host Resets:  %4u\n
+  AEN's: %4u\n,
   TW_DRIVER_VERSION,
   tw_dev-posted_request_count,
   tw_dev-max_posted_request_count,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mmc: block: fix format string warning

2015-01-20 Thread Asaf Vertz
Fixed the following warning (reported by cppcheck):
[drivers/mmc/card/block.c:2149]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz 
---
 drivers/mmc/card/block.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 4409d79..8e1a60e 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -2147,7 +2147,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct 
mmc_card *card,
 */
 
snprintf(md->disk->disk_name, sizeof(md->disk->disk_name),
-"mmcblk%d%s", md->name_idx, subname ? subname : "");
+"mmcblk%u%s", md->name_idx, subname ? subname : "");
 
if (mmc_card_mmc(card))
blk_queue_logical_block_size(md->queue.queue,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: iio: tsl2583: fix format string warnings

2015-01-20 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 3)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz 
---
 drivers/staging/iio/light/tsl2583.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c 
b/drivers/staging/iio/light/tsl2583.c
index cc4ddcc..8afae8e 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -692,7 +692,7 @@ static ssize_t taos_luxtable_show(struct device *dev,
int offset = 0;
 
for (i = 0; i < ARRAY_SIZE(taos_device_lux); i++) {
-   offset += sprintf(buf + offset, "%d,%d,%d,",
+   offset += sprintf(buf + offset, "%u,%u,%u,",
  taos_device_lux[i].ratio,
  taos_device_lux[i].ch0,
  taos_device_lux[i].ch1);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: iio: tsl2x7x_core: fix format string warnings

2015-01-20 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string 
(no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string 
(no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string 
(no. 3)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz 
---
 drivers/staging/iio/light/tsl2x7x_core.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
b/drivers/staging/iio/light/tsl2x7x_core.c
index 423f96b..4a5dc26 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -1147,7 +1147,7 @@ static ssize_t tsl2x7x_luxtable_show(struct device *dev,
int offset = 0;
 
while (i < (TSL2X7X_MAX_LUX_TABLE_SIZE * 3)) {
-   offset += snprintf(buf + offset, PAGE_SIZE, "%d,%d,%d,",
+   offset += snprintf(buf + offset, PAGE_SIZE, "%u,%u,%u,",
chip->tsl2x7x_device_lux[i].ratio,
chip->tsl2x7x_device_lux[i].ch0,
chip->tsl2x7x_device_lux[i].ch1);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: iio: tsl2x7x_core: fix format string warnings

2015-01-20 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string 
(no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string 
(no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2x7x_core.c:1150]: (warning) %d in format string 
(no. 3)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/staging/iio/light/tsl2x7x_core.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2x7x_core.c 
b/drivers/staging/iio/light/tsl2x7x_core.c
index 423f96b..4a5dc26 100644
--- a/drivers/staging/iio/light/tsl2x7x_core.c
+++ b/drivers/staging/iio/light/tsl2x7x_core.c
@@ -1147,7 +1147,7 @@ static ssize_t tsl2x7x_luxtable_show(struct device *dev,
int offset = 0;
 
while (i  (TSL2X7X_MAX_LUX_TABLE_SIZE * 3)) {
-   offset += snprintf(buf + offset, PAGE_SIZE, %d,%d,%d,,
+   offset += snprintf(buf + offset, PAGE_SIZE, %u,%u,%u,,
chip-tsl2x7x_device_lux[i].ratio,
chip-tsl2x7x_device_lux[i].ch0,
chip-tsl2x7x_device_lux[i].ch1);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: iio: tsl2583: fix format string warnings

2015-01-20 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/light/tsl2583.c:695]: (warning) %d in format string (no. 3)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/staging/iio/light/tsl2583.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c 
b/drivers/staging/iio/light/tsl2583.c
index cc4ddcc..8afae8e 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -692,7 +692,7 @@ static ssize_t taos_luxtable_show(struct device *dev,
int offset = 0;
 
for (i = 0; i  ARRAY_SIZE(taos_device_lux); i++) {
-   offset += sprintf(buf + offset, %d,%d,%d,,
+   offset += sprintf(buf + offset, %u,%u,%u,,
  taos_device_lux[i].ratio,
  taos_device_lux[i].ch0,
  taos_device_lux[i].ch1);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] mmc: block: fix format string warning

2015-01-20 Thread Asaf Vertz
Fixed the following warning (reported by cppcheck):
[drivers/mmc/card/block.c:2149]: (warning) %d in format string (no. 1)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/mmc/card/block.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 4409d79..8e1a60e 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -2147,7 +2147,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct 
mmc_card *card,
 */
 
snprintf(md-disk-disk_name, sizeof(md-disk-disk_name),
-mmcblk%d%s, md-name_idx, subname ? subname : );
+mmcblk%u%s, md-name_idx, subname ? subname : );
 
if (mmc_card_mmc(card))
blk_queue_logical_block_size(md-queue.queue,
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: iio: ad5933: fix format string warnings

2015-01-19 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/impedance-analyzer/ad5933.c:363]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 3)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 4)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz 
---
 drivers/staging/iio/impedance-analyzer/ad5933.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c 
b/drivers/staging/iio/impedance-analyzer/ad5933.c
index b6bd609..4230a43 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -360,11 +360,11 @@ static ssize_t ad5933_show(struct device *dev,
mutex_lock(_dev->mlock);
switch ((u32) this_attr->address) {
case AD5933_OUT_RANGE:
-   len = sprintf(buf, "%d\n",
+   len = sprintf(buf, "%u\n",
  st->range_avail[(st->ctrl_hb >> 1) & 0x3]);
break;
case AD5933_OUT_RANGE_AVAIL:
-   len = sprintf(buf, "%d %d %d %d\n", st->range_avail[0],
+   len = sprintf(buf, "%u %u %u %u\n", st->range_avail[0],
  st->range_avail[3], st->range_avail[2],
  st->range_avail[1]);
break;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: iio: ad5933: fix format string warnings

2015-01-19 Thread Asaf Vertz
Fixed the following warnings (reported by cppcheck):
[drivers/staging/iio/impedance-analyzer/ad5933.c:363]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 1)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 2)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 3)
requires 'int' but the argument type is 'unsigned int'.
[drivers/staging/iio/impedance-analyzer/ad5933.c:367]: (warning) %d in format 
string (no. 4)
requires 'int' but the argument type is 'unsigned int'.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/staging/iio/impedance-analyzer/ad5933.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c 
b/drivers/staging/iio/impedance-analyzer/ad5933.c
index b6bd609..4230a43 100644
--- a/drivers/staging/iio/impedance-analyzer/ad5933.c
+++ b/drivers/staging/iio/impedance-analyzer/ad5933.c
@@ -360,11 +360,11 @@ static ssize_t ad5933_show(struct device *dev,
mutex_lock(indio_dev-mlock);
switch ((u32) this_attr-address) {
case AD5933_OUT_RANGE:
-   len = sprintf(buf, %d\n,
+   len = sprintf(buf, %u\n,
  st-range_avail[(st-ctrl_hb  1)  0x3]);
break;
case AD5933_OUT_RANGE_AVAIL:
-   len = sprintf(buf, %d %d %d %d\n, st-range_avail[0],
+   len = sprintf(buf, %u %u %u %u\n, st-range_avail[0],
  st-range_avail[3], st-range_avail[2],
  st-range_avail[1]);
break;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings

2015-01-17 Thread Asaf Vertz
Fixed the following warnings (reported by sparse):
drivers/staging/wlan-ng/hfa384x_usb.c:3828:36: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3229:16: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3430:18: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3349:51: warning: restricted __le16 
degrades to integer
drivers/staging/wlan-ng/hfa384x_usb.c:3357:37: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3358:37: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3393:36: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3102:28: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3004:28: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:1308:37: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: warning: incorrect type in 
assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25:expected unsigned short 
[unsigned] [usertype] type
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25:got restricted __le16 
[usertype] 

Signed-off-by: Asaf Vertz 
---
 drivers/staging/wlan-ng/hfa384x.h |4 ++--
 drivers/staging/wlan-ng/hfa384x_usb.c |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x.h 
b/drivers/staging/wlan-ng/hfa384x.h
index 20d146b..964a662 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -879,7 +879,7 @@ typedef struct hfa384x_usb_error {
 /* Unions for packaging all the known packet types together */
 
 typedef union hfa384x_usbout {
-   u16 type;
+   __le16 type;
hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_cmdreq_t cmdreq;
hfa384x_usb_wridreq_t wridreq;
@@ -889,7 +889,7 @@ typedef union hfa384x_usbout {
 } __packed hfa384x_usbout_t;
 
 typedef union hfa384x_usbin {
-   u16 type;
+   __le16 type;
hfa384x_usb_rxfrm_t rxfrm;
hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_infofrm_t infofrm;
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 55d2f56..e84ebb9 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3346,7 +3346,7 @@ retry:
if (unlocked_usbctlx_cancel_async(hw, ctlx) == 0)
run_queue = 1;
} else {
-   const u16 intype = (usbin->type & ~cpu_to_le16(0x8000));
+   const __le16 intype = (usbin->type & ~cpu_to_le16(0x8000));
 
/*
 * Check that our message is what we're expecting ...
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: wlan-ng: hfa384x_usb: fix sparse endianness warnings

2015-01-17 Thread Asaf Vertz
Fixed the following warnings (reported by sparse):
drivers/staging/wlan-ng/hfa384x_usb.c:3828:36: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3229:16: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3430:18: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3349:51: warning: restricted __le16 
degrades to integer
drivers/staging/wlan-ng/hfa384x_usb.c:3357:37: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3358:37: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3393:36: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3102:28: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:3004:28: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:1308:37: warning: cast to restricted 
__le16
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25: warning: incorrect type in 
assignment (different base types)
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25:expected unsigned short 
[unsigned] [usertype] type
drivers/staging/wlan-ng/hfa384x_usb.c:2713:25:got restricted __le16 
[usertype] noident

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/staging/wlan-ng/hfa384x.h |4 ++--
 drivers/staging/wlan-ng/hfa384x_usb.c |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x.h 
b/drivers/staging/wlan-ng/hfa384x.h
index 20d146b..964a662 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -879,7 +879,7 @@ typedef struct hfa384x_usb_error {
 /* Unions for packaging all the known packet types together */
 
 typedef union hfa384x_usbout {
-   u16 type;
+   __le16 type;
hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_cmdreq_t cmdreq;
hfa384x_usb_wridreq_t wridreq;
@@ -889,7 +889,7 @@ typedef union hfa384x_usbout {
 } __packed hfa384x_usbout_t;
 
 typedef union hfa384x_usbin {
-   u16 type;
+   __le16 type;
hfa384x_usb_rxfrm_t rxfrm;
hfa384x_usb_txfrm_t txfrm;
hfa384x_usb_infofrm_t infofrm;
diff --git a/drivers/staging/wlan-ng/hfa384x_usb.c 
b/drivers/staging/wlan-ng/hfa384x_usb.c
index 55d2f56..e84ebb9 100644
--- a/drivers/staging/wlan-ng/hfa384x_usb.c
+++ b/drivers/staging/wlan-ng/hfa384x_usb.c
@@ -3346,7 +3346,7 @@ retry:
if (unlocked_usbctlx_cancel_async(hw, ctlx) == 0)
run_queue = 1;
} else {
-   const u16 intype = (usbin-type  ~cpu_to_le16(0x8000));
+   const __le16 intype = (usbin-type  ~cpu_to_le16(0x8000));
 
/*
 * Check that our message is what we're expecting ...
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] e1000: fix time comparison

2015-01-07 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_after_eq() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz 
---
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c 
b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
index b691eb4..4270ad2 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
@@ -24,6 +24,7 @@
 /* ethtool support for e1000 */
 
 #include "e1000.h"
+#include 
 #include 
 
 enum {NETDEV_STATS, E1000_STATS};
@@ -1460,7 +1461,7 @@ static int e1000_run_loopback_test(struct e1000_adapter 
*adapter)
ret_val = 13; /* ret_val is the same as mis-compare */
break;
}
-   if (jiffies >= (time + 2)) {
+   if (time_after_eq(jiffies, time + 2)) {
ret_val = 14; /* error code for time out error */
break;
}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] e1000: fix time comparison

2015-01-07 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_after_eq() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/net/ethernet/intel/e1000/e1000_ethtool.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c 
b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
index b691eb4..4270ad2 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_ethtool.c
@@ -24,6 +24,7 @@
 /* ethtool support for e1000 */
 
 #include e1000.h
+#include linux/jiffies.h
 #include linux/uaccess.h
 
 enum {NETDEV_STATS, E1000_STATS};
@@ -1460,7 +1461,7 @@ static int e1000_run_loopback_test(struct e1000_adapter 
*adapter)
ret_val = 13; /* ret_val is the same as mis-compare */
break;
}
-   if (jiffies = (time + 2)) {
+   if (time_after_eq(jiffies, time + 2)) {
ret_val = 14; /* error code for time out error */
break;
}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rsxx: fix time comparison

2015-01-06 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_before() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz 
---
 drivers/block/rsxx/core.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index d8b2488..ea527e8 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -25,6 +25,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -513,8 +514,8 @@ static void card_event_handler(struct work_struct *work)
 static int card_shutdown(struct rsxx_cardinfo *card)
 {
unsigned int state;
-   signed long start;
-   const int timeout = msecs_to_jiffies(12);
+   unsigned long start;
+   const unsigned long timeout = msecs_to_jiffies(12);
int st;
 
/* We can't issue a shutdown if the card is in a transition state */
@@ -524,7 +525,7 @@ static int card_shutdown(struct rsxx_cardinfo *card)
if (st)
return st;
} while (state == CARD_STATE_STARTING &&
-(jiffies - start < timeout));
+time_before(jiffies, start + timeout));
 
if (state == CARD_STATE_STARTING)
return -ETIMEDOUT;
@@ -543,7 +544,7 @@ static int card_shutdown(struct rsxx_cardinfo *card)
if (st)
return st;
} while (state != CARD_STATE_SHUTDOWN &&
-(jiffies - start < timeout));
+time_before(jiffies, start + timeout));
 
if (state != CARD_STATE_SHUTDOWN)
return -ETIMEDOUT;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] dm bufio: fix time comparison

2015-01-06 Thread Asaf Vertz
To be future-proof and for better readability the time comparison
modified to use time_after_eq() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz 
---
 drivers/md/dm-bufio.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index c33b497..86dbbc7 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1739,7 +1740,7 @@ static unsigned get_max_age_hz(void)
 
 static bool older_than(struct dm_buffer *b, unsigned long age_hz)
 {
-   return (jiffies - b->last_accessed) >= age_hz;
+   return time_after_eq(jiffies, b->last_accessed + age_hz);
 }
 
 static void __evict_old_buffers(struct dm_bufio_client *c, unsigned long 
age_hz)
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] dm bufio: fix time comparison

2015-01-06 Thread Asaf Vertz
To be future-proof and for better readability the time comparison
modified to use time_after_eq() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/md/dm-bufio.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-bufio.c b/drivers/md/dm-bufio.c
index c33b497..86dbbc7 100644
--- a/drivers/md/dm-bufio.c
+++ b/drivers/md/dm-bufio.c
@@ -11,6 +11,7 @@
 #include linux/device-mapper.h
 #include linux/dm-io.h
 #include linux/slab.h
+#include linux/jiffies.h
 #include linux/vmalloc.h
 #include linux/shrinker.h
 #include linux/module.h
@@ -1739,7 +1740,7 @@ static unsigned get_max_age_hz(void)
 
 static bool older_than(struct dm_buffer *b, unsigned long age_hz)
 {
-   return (jiffies - b-last_accessed) = age_hz;
+   return time_after_eq(jiffies, b-last_accessed + age_hz);
 }
 
 static void __evict_old_buffers(struct dm_bufio_client *c, unsigned long 
age_hz)
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] rsxx: fix time comparison

2015-01-06 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_before() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/block/rsxx/core.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/block/rsxx/core.c b/drivers/block/rsxx/core.c
index d8b2488..ea527e8 100644
--- a/drivers/block/rsxx/core.c
+++ b/drivers/block/rsxx/core.c
@@ -25,6 +25,7 @@
 #include linux/kernel.h
 #include linux/init.h
 #include linux/interrupt.h
+#include linux/jiffies.h
 #include linux/module.h
 #include linux/pci.h
 #include linux/reboot.h
@@ -513,8 +514,8 @@ static void card_event_handler(struct work_struct *work)
 static int card_shutdown(struct rsxx_cardinfo *card)
 {
unsigned int state;
-   signed long start;
-   const int timeout = msecs_to_jiffies(12);
+   unsigned long start;
+   const unsigned long timeout = msecs_to_jiffies(12);
int st;
 
/* We can't issue a shutdown if the card is in a transition state */
@@ -524,7 +525,7 @@ static int card_shutdown(struct rsxx_cardinfo *card)
if (st)
return st;
} while (state == CARD_STATE_STARTING 
-(jiffies - start  timeout));
+time_before(jiffies, start + timeout));
 
if (state == CARD_STATE_STARTING)
return -ETIMEDOUT;
@@ -543,7 +544,7 @@ static int card_shutdown(struct rsxx_cardinfo *card)
if (st)
return st;
} while (state != CARD_STATE_SHUTDOWN 
-(jiffies - start  timeout));
+time_before(jiffies, start + timeout));
 
if (state != CARD_STATE_SHUTDOWN)
return -ETIMEDOUT;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] crypto: omap-des: fix BUG_ON condition

2015-01-05 Thread Asaf Vertz
dd->total is unsigned so it won't do any good to check for negative value after 
subtracting
instead of that we should check if the subtracted value is bigger than him

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Asaf Vertz 
---
 drivers/crypto/omap-des.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index e350f5b..0b8dcf5 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -965,9 +965,9 @@ static irqreturn_t omap_des_irq(int irq, void *dev_id)
}
}
 
-   dd->total -= DES_BLOCK_SIZE;
+   BUG_ON(dd->total < DES_BLOCK_SIZE);
 
-   BUG_ON(dd->total < 0);
+   dd->total -= DES_BLOCK_SIZE;
 
/* Clear IRQ status */
status &= ~DES_REG_IRQ_DATA_OUT;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] crypto: omap-des: fix BUG_ON condition

2015-01-05 Thread Asaf Vertz
dd-total is unsigned so it won't do any good to check for negative value after 
subtracting
instead of that we should check if the subtracted value is bigger than him

This was partially found by using a static code analysis program called 
cppcheck.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/crypto/omap-des.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index e350f5b..0b8dcf5 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -965,9 +965,9 @@ static irqreturn_t omap_des_irq(int irq, void *dev_id)
}
}
 
-   dd-total -= DES_BLOCK_SIZE;
+   BUG_ON(dd-total  DES_BLOCK_SIZE);
 
-   BUG_ON(dd-total  0);
+   dd-total -= DES_BLOCK_SIZE;
 
/* Clear IRQ status */
status = ~DES_REG_IRQ_DATA_OUT;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] staging: rtl8723au: core: fixing "foo * bar" should be "foo *bar"

2014-12-16 Thread Asaf Vertz
Fixed a coding style error, "foo * bar" should be "foo *bar"

Signed-off-by: Asaf Vertz 
---
Changes in v2:
  - fix ugly multiline arguments to the functions

 drivers/staging/rtl8723au/core/rtw_efuse.c |   32 ++-
 1 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c 
b/drivers/staging/rtl8723au/core/rtw_efuse.c
index 81960e7..a6deddc 100644
--- a/drivers/staging/rtl8723au/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
@@ -327,15 +327,9 @@ EFUSE_Read1Byte23a(struct rtw_adapter *Adapter, u16 
Address)
  *---*/
 
 void
-EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
-   u16 Address,
-   u8  Value);
+EFUSE_Write1Byte(struct rtw_adapter *Adapter, u16 Address, u8 Value);
 void
-EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
-   u16 Address,
-   u8  Value)
+EFUSE_Write1Byte(struct rtw_adapter *Adapter, u16 Address, u8 Value)
 {
u8  Bytetemp = {0x00};
u8  temp = {0x00};
@@ -635,10 +629,7 @@ Efuse_ReadAllMap(struct rtw_adapter *pAdapter, u8 
efuseType, u8 *Efuse)
  *
  *---*/
 static void
-efuse_ShadowRead1Byte(
-   struct rtw_adapter *pAdapter,
-   u16 Offset,
-   u8  *Value)
+efuse_ShadowRead1Byte(struct rtw_adapter *pAdapter, u16 Offset, u8 *Value)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
 
@@ -647,10 +638,7 @@ efuse_ShadowRead1Byte(
 
 /* Read Two Bytes */
 static void
-efuse_ShadowRead2Byte(
-   struct rtw_adapter *pAdapter,
-   u16 Offset,
-   u16 *Value)
+efuse_ShadowRead2Byte(struct rtw_adapter *pAdapter, u16 Offset, u16 *Value)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
 
@@ -660,10 +648,7 @@ efuse_ShadowRead2Byte(
 
 /* Read Four Bytes */
 static void
-efuse_ShadowRead4Byte(
-   struct rtw_adapter *pAdapter,
-   u16 Offset,
-   u32 *Value)
+efuse_ShadowRead4Byte(struct rtw_adapter *pAdapter, u16 Offset, u32 *Value)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
 
@@ -722,11 +707,8 @@ void EFUSE_ShadowMapUpdate23a(struct rtw_adapter 
*pAdapter, u8 efuseType)
  *
  *---*/
 void
-EFUSE_ShadowRead23a(
-   struct rtw_adapter *pAdapter,
-   u8  Type,
-   u16 Offset,
-   u32 *Value)
+EFUSE_ShadowRead23a(struct rtw_adapter *pAdapter,
+   u8 Type, u16 Offset, u32 *Value)
 {
if (Type == 1)
efuse_ShadowRead1Byte(pAdapter, Offset, (u8 *)Value);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: rtl8723au: core: fixing "foo * bar" should be "foo *bar"

2014-12-16 Thread Asaf Vertz
Fixed a coding style error, "foo * bar" should be "foo *bar"

Signed-off-by: Asaf Vertz 
---
 drivers/staging/rtl8723au/core/rtw_efuse.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c 
b/drivers/staging/rtl8723au/core/rtw_efuse.c
index 81960e7..0e64d12 100644
--- a/drivers/staging/rtl8723au/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
@@ -328,12 +328,12 @@ EFUSE_Read1Byte23a(struct rtw_adapter *Adapter, u16 
Address)
 
 void
 EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
+   struct rtw_adapter *Adapter,
u16 Address,
u8  Value);
 void
 EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
+   struct rtw_adapter *Adapter,
u16 Address,
u8  Value)
 {
@@ -636,7 +636,7 @@ Efuse_ReadAllMap(struct rtw_adapter *pAdapter, u8 
efuseType, u8 *Efuse)
  *---*/
 static void
 efuse_ShadowRead1Byte(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u16 Offset,
u8  *Value)
 {
@@ -648,7 +648,7 @@ efuse_ShadowRead1Byte(
 /* Read Two Bytes */
 static void
 efuse_ShadowRead2Byte(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u16 Offset,
u16 *Value)
 {
@@ -661,7 +661,7 @@ efuse_ShadowRead2Byte(
 /* Read Four Bytes */
 static void
 efuse_ShadowRead4Byte(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u16 Offset,
u32 *Value)
 {
@@ -723,7 +723,7 @@ void EFUSE_ShadowMapUpdate23a(struct rtw_adapter *pAdapter, 
u8 efuseType)
  *---*/
 void
 EFUSE_ShadowRead23a(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u8  Type,
u16 Offset,
u32 *Value)
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: rtl8723au: core: fixing foo * bar should be foo *bar

2014-12-16 Thread Asaf Vertz
Fixed a coding style error, foo * bar should be foo *bar

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/staging/rtl8723au/core/rtw_efuse.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c 
b/drivers/staging/rtl8723au/core/rtw_efuse.c
index 81960e7..0e64d12 100644
--- a/drivers/staging/rtl8723au/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
@@ -328,12 +328,12 @@ EFUSE_Read1Byte23a(struct rtw_adapter *Adapter, u16 
Address)
 
 void
 EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
+   struct rtw_adapter *Adapter,
u16 Address,
u8  Value);
 void
 EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
+   struct rtw_adapter *Adapter,
u16 Address,
u8  Value)
 {
@@ -636,7 +636,7 @@ Efuse_ReadAllMap(struct rtw_adapter *pAdapter, u8 
efuseType, u8 *Efuse)
  *---*/
 static void
 efuse_ShadowRead1Byte(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u16 Offset,
u8  *Value)
 {
@@ -648,7 +648,7 @@ efuse_ShadowRead1Byte(
 /* Read Two Bytes */
 static void
 efuse_ShadowRead2Byte(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u16 Offset,
u16 *Value)
 {
@@ -661,7 +661,7 @@ efuse_ShadowRead2Byte(
 /* Read Four Bytes */
 static void
 efuse_ShadowRead4Byte(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u16 Offset,
u32 *Value)
 {
@@ -723,7 +723,7 @@ void EFUSE_ShadowMapUpdate23a(struct rtw_adapter *pAdapter, 
u8 efuseType)
  *---*/
 void
 EFUSE_ShadowRead23a(
-   struct rtw_adapter *pAdapter,
+   struct rtw_adapter *pAdapter,
u8  Type,
u16 Offset,
u32 *Value)
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] staging: rtl8723au: core: fixing foo * bar should be foo *bar

2014-12-16 Thread Asaf Vertz
Fixed a coding style error, foo * bar should be foo *bar

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
Changes in v2:
  - fix ugly multiline arguments to the functions

 drivers/staging/rtl8723au/core/rtw_efuse.c |   32 ++-
 1 files changed, 7 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_efuse.c 
b/drivers/staging/rtl8723au/core/rtw_efuse.c
index 81960e7..a6deddc 100644
--- a/drivers/staging/rtl8723au/core/rtw_efuse.c
+++ b/drivers/staging/rtl8723au/core/rtw_efuse.c
@@ -327,15 +327,9 @@ EFUSE_Read1Byte23a(struct rtw_adapter *Adapter, u16 
Address)
  *---*/
 
 void
-EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
-   u16 Address,
-   u8  Value);
+EFUSE_Write1Byte(struct rtw_adapter *Adapter, u16 Address, u8 Value);
 void
-EFUSE_Write1Byte(
-   struct rtw_adapter *Adapter,
-   u16 Address,
-   u8  Value)
+EFUSE_Write1Byte(struct rtw_adapter *Adapter, u16 Address, u8 Value)
 {
u8  Bytetemp = {0x00};
u8  temp = {0x00};
@@ -635,10 +629,7 @@ Efuse_ReadAllMap(struct rtw_adapter *pAdapter, u8 
efuseType, u8 *Efuse)
  *
  *---*/
 static void
-efuse_ShadowRead1Byte(
-   struct rtw_adapter *pAdapter,
-   u16 Offset,
-   u8  *Value)
+efuse_ShadowRead1Byte(struct rtw_adapter *pAdapter, u16 Offset, u8 *Value)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
 
@@ -647,10 +638,7 @@ efuse_ShadowRead1Byte(
 
 /* Read Two Bytes */
 static void
-efuse_ShadowRead2Byte(
-   struct rtw_adapter *pAdapter,
-   u16 Offset,
-   u16 *Value)
+efuse_ShadowRead2Byte(struct rtw_adapter *pAdapter, u16 Offset, u16 *Value)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
 
@@ -660,10 +648,7 @@ efuse_ShadowRead2Byte(
 
 /* Read Four Bytes */
 static void
-efuse_ShadowRead4Byte(
-   struct rtw_adapter *pAdapter,
-   u16 Offset,
-   u32 *Value)
+efuse_ShadowRead4Byte(struct rtw_adapter *pAdapter, u16 Offset, u32 *Value)
 {
struct eeprom_priv *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
 
@@ -722,11 +707,8 @@ void EFUSE_ShadowMapUpdate23a(struct rtw_adapter 
*pAdapter, u8 efuseType)
  *
  *---*/
 void
-EFUSE_ShadowRead23a(
-   struct rtw_adapter *pAdapter,
-   u8  Type,
-   u16 Offset,
-   u32 *Value)
+EFUSE_ShadowRead23a(struct rtw_adapter *pAdapter,
+   u8 Type, u16 Offset, u32 *Value)
 {
if (Type == 1)
efuse_ShadowRead1Byte(pAdapter, Offset, (u8 *)Value);
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] usb: host: max3421-hcd: use time_after()

2014-12-14 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_after() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz 
---
 drivers/usb/host/max3421-hcd.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 6234c75..aaaff94 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -55,6 +55,7 @@
  * single thread (max3421_spi_thread).
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -1291,7 +1292,7 @@ max3421_handle_irqs(struct usb_hcd *hcd)
char sbuf[16 * 16], *dp, *end;
int i;
 
-   if (jiffies - last_time > 5*HZ) {
+   if (time_after(jiffies, last_time + 5*HZ)) {
dp = sbuf;
end = sbuf + sizeof(sbuf);
*dp = '\0';
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] cirrus: cs89x0: fix time comparison

2014-12-14 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_before, time_after, and time_after_eq instead of
plain, error-prone math.

Signed-off-by: Asaf Vertz 
---
 drivers/net/ethernet/cirrus/cs89x0.c |   27 ++-
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/cirrus/cs89x0.c 
b/drivers/net/ethernet/cirrus/cs89x0.c
index 9823a0e..965331f 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -60,6 +60,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -238,13 +239,13 @@ writereg(struct net_device *dev, u16 regno, u16 value)
 static int __init
 wait_eeprom_ready(struct net_device *dev)
 {
-   int timeout = jiffies;
+   unsigned long timeout = jiffies;
/* check to see if the EEPROM is ready,
 * a timeout is used just in case EEPROM is ready when
 * SI_BUSY in the PP_SelfST is clear
 */
while (readreg(dev, PP_SelfST) & SI_BUSY)
-   if (jiffies - timeout >= 40)
+   if (time_after_eq(jiffies, timeout + 40))
return -1;
return 0;
 }
@@ -485,7 +486,7 @@ control_dc_dc(struct net_device *dev, int on_not_off)
 {
struct net_local *lp = netdev_priv(dev);
unsigned int selfcontrol;
-   int timenow = jiffies;
+   unsigned long timenow = jiffies;
/* control the DC to DC convertor in the SelfControl register.
 * Note: This is hooked up to a general purpose pin, might not
 * always be a DC to DC convertor.
@@ -499,7 +500,7 @@ control_dc_dc(struct net_device *dev, int on_not_off)
writereg(dev, PP_SelfCTL, selfcontrol);
 
/* Wait for the DC/DC converter to power up - 500ms */
-   while (jiffies - timenow < HZ)
+   while (time_before(jiffies, timenow + HZ))
;
 }
 
@@ -514,7 +515,7 @@ send_test_pkt(struct net_device *dev)
0, 0,   /* DSAP=0 & SSAP=0 fields */
0xf3, 0 /* Control (Test Req + P bit set) */
};
-   long timenow = jiffies;
+   unsigned long timenow = jiffies;
 
writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) | SERIAL_TX_ON);
 
@@ -525,10 +526,10 @@ send_test_pkt(struct net_device *dev)
iowrite16(ETH_ZLEN, lp->virt_addr + TX_LEN_PORT);
 
/* Test to see if the chip has allocated memory for the packet */
-   while (jiffies - timenow < 5)
+   while (time_before(jiffies, timenow + 5))
if (readreg(dev, PP_BusST) & READY_FOR_TX_NOW)
break;
-   if (jiffies - timenow >= 5)
+   if (time_after_eq(jiffies, timenow + 5))
return 0;   /* this shouldn't happen */
 
/* Write the contents of the packet */
@@ -536,7 +537,7 @@ send_test_pkt(struct net_device *dev)
 
cs89_dbg(1, debug, "Sending test packet ");
/* wait a couple of jiffies for packet to be received */
-   for (timenow = jiffies; jiffies - timenow < 3;)
+   for (timenow = jiffies; time_before(jiffies, timenow + 3);)
;
if ((readreg(dev, PP_TxEvent) & TX_SEND_OK_BITS) == TX_OK) {
cs89_dbg(1, cont, "succeeded\n");
@@ -556,7 +557,7 @@ static int
 detect_tp(struct net_device *dev)
 {
struct net_local *lp = netdev_priv(dev);
-   int timenow = jiffies;
+   unsigned long timenow = jiffies;
int fdx;
 
cs89_dbg(1, debug, "%s: Attempting TP\n", dev->name);
@@ -574,7 +575,7 @@ detect_tp(struct net_device *dev)
/* Delay for the hardware to work out if the TP cable is present
 * - 150ms
 */
-   for (timenow = jiffies; jiffies - timenow < 15;)
+   for (timenow = jiffies; time_before(jiffies, timenow + 15);)
;
if ((readreg(dev, PP_LineST) & LINK_OK) == 0)
return DETECTED_NONE;
@@ -618,7 +619,7 @@ detect_tp(struct net_device *dev)
if ((lp->auto_neg_cnf & AUTO_NEG_BITS) == AUTO_NEG_ENABLE) {
pr_info("%s: negotiating duplex...\n", dev->name);
while (readreg(dev, PP_AutoNegST) & AUTO_NEG_BUSY) {
-   if (jiffies - timenow > 4000) {
+   if (time_after(jiffies, timenow + 4000)) {
pr_err(" Full / half duplex 
auto-negotiation timed out \n");
break;
}
@@ -1271,7 +1272,7 @@ static void __init reset_chip(struct net_device *dev)
 {
 #if !defined(CONFIG_MACH_MX31ADS)
struct net_local *lp = netdev_priv(dev);
-   int reset_start_time;
+   unsigned long reset_start_time;
 
writereg(dev, PP_SelfCTL, readreg(dev, PP_SelfCTL) | POWER_ON_RESET

[PATCH] cirrus: cs89x0: fix time comparison

2014-12-14 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_before, time_after, and time_after_eq instead of
plain, error-prone math.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/net/ethernet/cirrus/cs89x0.c |   27 ++-
 1 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/cirrus/cs89x0.c 
b/drivers/net/ethernet/cirrus/cs89x0.c
index 9823a0e..965331f 100644
--- a/drivers/net/ethernet/cirrus/cs89x0.c
+++ b/drivers/net/ethernet/cirrus/cs89x0.c
@@ -60,6 +60,7 @@
 #include linux/interrupt.h
 #include linux/ioport.h
 #include linux/in.h
+#include linux/jiffies.h
 #include linux/skbuff.h
 #include linux/spinlock.h
 #include linux/string.h
@@ -238,13 +239,13 @@ writereg(struct net_device *dev, u16 regno, u16 value)
 static int __init
 wait_eeprom_ready(struct net_device *dev)
 {
-   int timeout = jiffies;
+   unsigned long timeout = jiffies;
/* check to see if the EEPROM is ready,
 * a timeout is used just in case EEPROM is ready when
 * SI_BUSY in the PP_SelfST is clear
 */
while (readreg(dev, PP_SelfST)  SI_BUSY)
-   if (jiffies - timeout = 40)
+   if (time_after_eq(jiffies, timeout + 40))
return -1;
return 0;
 }
@@ -485,7 +486,7 @@ control_dc_dc(struct net_device *dev, int on_not_off)
 {
struct net_local *lp = netdev_priv(dev);
unsigned int selfcontrol;
-   int timenow = jiffies;
+   unsigned long timenow = jiffies;
/* control the DC to DC convertor in the SelfControl register.
 * Note: This is hooked up to a general purpose pin, might not
 * always be a DC to DC convertor.
@@ -499,7 +500,7 @@ control_dc_dc(struct net_device *dev, int on_not_off)
writereg(dev, PP_SelfCTL, selfcontrol);
 
/* Wait for the DC/DC converter to power up - 500ms */
-   while (jiffies - timenow  HZ)
+   while (time_before(jiffies, timenow + HZ))
;
 }
 
@@ -514,7 +515,7 @@ send_test_pkt(struct net_device *dev)
0, 0,   /* DSAP=0  SSAP=0 fields */
0xf3, 0 /* Control (Test Req + P bit set) */
};
-   long timenow = jiffies;
+   unsigned long timenow = jiffies;
 
writereg(dev, PP_LineCTL, readreg(dev, PP_LineCTL) | SERIAL_TX_ON);
 
@@ -525,10 +526,10 @@ send_test_pkt(struct net_device *dev)
iowrite16(ETH_ZLEN, lp-virt_addr + TX_LEN_PORT);
 
/* Test to see if the chip has allocated memory for the packet */
-   while (jiffies - timenow  5)
+   while (time_before(jiffies, timenow + 5))
if (readreg(dev, PP_BusST)  READY_FOR_TX_NOW)
break;
-   if (jiffies - timenow = 5)
+   if (time_after_eq(jiffies, timenow + 5))
return 0;   /* this shouldn't happen */
 
/* Write the contents of the packet */
@@ -536,7 +537,7 @@ send_test_pkt(struct net_device *dev)
 
cs89_dbg(1, debug, Sending test packet );
/* wait a couple of jiffies for packet to be received */
-   for (timenow = jiffies; jiffies - timenow  3;)
+   for (timenow = jiffies; time_before(jiffies, timenow + 3);)
;
if ((readreg(dev, PP_TxEvent)  TX_SEND_OK_BITS) == TX_OK) {
cs89_dbg(1, cont, succeeded\n);
@@ -556,7 +557,7 @@ static int
 detect_tp(struct net_device *dev)
 {
struct net_local *lp = netdev_priv(dev);
-   int timenow = jiffies;
+   unsigned long timenow = jiffies;
int fdx;
 
cs89_dbg(1, debug, %s: Attempting TP\n, dev-name);
@@ -574,7 +575,7 @@ detect_tp(struct net_device *dev)
/* Delay for the hardware to work out if the TP cable is present
 * - 150ms
 */
-   for (timenow = jiffies; jiffies - timenow  15;)
+   for (timenow = jiffies; time_before(jiffies, timenow + 15);)
;
if ((readreg(dev, PP_LineST)  LINK_OK) == 0)
return DETECTED_NONE;
@@ -618,7 +619,7 @@ detect_tp(struct net_device *dev)
if ((lp-auto_neg_cnf  AUTO_NEG_BITS) == AUTO_NEG_ENABLE) {
pr_info(%s: negotiating duplex...\n, dev-name);
while (readreg(dev, PP_AutoNegST)  AUTO_NEG_BUSY) {
-   if (jiffies - timenow  4000) {
+   if (time_after(jiffies, timenow + 4000)) {
pr_err( Full / half duplex 
auto-negotiation timed out \n);
break;
}
@@ -1271,7 +1272,7 @@ static void __init reset_chip(struct net_device *dev)
 {
 #if !defined(CONFIG_MACH_MX31ADS)
struct net_local *lp = netdev_priv(dev);
-   int reset_start_time;
+   unsigned long reset_start_time;
 
writereg(dev, PP_SelfCTL, readreg(dev, PP_SelfCTL) | POWER_ON_RESET);
 
@@ -1294,7 +1295,7

[PATCH] usb: host: max3421-hcd: use time_after()

2014-12-14 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_after() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/usb/host/max3421-hcd.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c
index 6234c75..aaaff94 100644
--- a/drivers/usb/host/max3421-hcd.c
+++ b/drivers/usb/host/max3421-hcd.c
@@ -55,6 +55,7 @@
  * single thread (max3421_spi_thread).
  */
 
+#include linux/jiffies.h
 #include linux/module.h
 #include linux/spi/spi.h
 #include linux/usb.h
@@ -1291,7 +1292,7 @@ max3421_handle_irqs(struct usb_hcd *hcd)
char sbuf[16 * 16], *dp, *end;
int i;
 
-   if (jiffies - last_time  5*HZ) {
+   if (time_after(jiffies, last_time + 5*HZ)) {
dp = sbuf;
end = sbuf + sizeof(sbuf);
*dp = '\0';
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] media: stb0899_drv: use time_after()

2014-12-13 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_after() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz 
---
 drivers/media/dvb-frontends/stb0899_drv.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/stb0899_drv.c 
b/drivers/media/dvb-frontends/stb0899_drv.c
index 07cd5ea..cb024af 100644
--- a/drivers/media/dvb-frontends/stb0899_drv.c
+++ b/drivers/media/dvb-frontends/stb0899_drv.c
@@ -20,6 +20,7 @@
 */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -691,7 +692,7 @@ static int stb0899_wait_diseqc_fifo_empty(struct 
stb0899_state *state, int timeo
reg = stb0899_read_reg(state, STB0899_DISSTATUS);
if (!STB0899_GETFIELD(FIFOFULL, reg))
break;
-   if ((jiffies - start) > timeout) {
+   if (time_after(jiffies, start + timeout)) {
dprintk(state->verbose, FE_ERROR, 1, "timed out !!");
return -ETIMEDOUT;
}
@@ -733,7 +734,7 @@ static int stb0899_wait_diseqc_rxidle(struct stb0899_state 
*state, int timeout)
 
while (!STB0899_GETFIELD(RXEND, reg)) {
reg = stb0899_read_reg(state, STB0899_DISRX_ST0);
-   if (jiffies - start > timeout) {
+   if (time_after(jiffies, start + timeout)) {
dprintk(state->verbose, FE_ERROR, 1, "timed out!!");
return -ETIMEDOUT;
}
@@ -782,7 +783,7 @@ static int stb0899_wait_diseqc_txidle(struct stb0899_state 
*state, int timeout)
 
while (!STB0899_GETFIELD(TXIDLE, reg)) {
reg = stb0899_read_reg(state, STB0899_DISSTATUS);
-   if (jiffies - start > timeout) {
+   if (time_after(jiffies, start + timeout)) {
dprintk(state->verbose, FE_ERROR, 1, "timed out!!");
return -ETIMEDOUT;
}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] media: stb0899_drv: use time_after()

2014-12-13 Thread Asaf Vertz
To be future-proof and for better readability the time comparisons are
modified to use time_after() instead of plain, error-prone math.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/media/dvb-frontends/stb0899_drv.c |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-frontends/stb0899_drv.c 
b/drivers/media/dvb-frontends/stb0899_drv.c
index 07cd5ea..cb024af 100644
--- a/drivers/media/dvb-frontends/stb0899_drv.c
+++ b/drivers/media/dvb-frontends/stb0899_drv.c
@@ -20,6 +20,7 @@
 */
 
 #include linux/init.h
+#include linux/jiffies.h
 #include linux/kernel.h
 #include linux/module.h
 #include linux/slab.h
@@ -691,7 +692,7 @@ static int stb0899_wait_diseqc_fifo_empty(struct 
stb0899_state *state, int timeo
reg = stb0899_read_reg(state, STB0899_DISSTATUS);
if (!STB0899_GETFIELD(FIFOFULL, reg))
break;
-   if ((jiffies - start)  timeout) {
+   if (time_after(jiffies, start + timeout)) {
dprintk(state-verbose, FE_ERROR, 1, timed out !!);
return -ETIMEDOUT;
}
@@ -733,7 +734,7 @@ static int stb0899_wait_diseqc_rxidle(struct stb0899_state 
*state, int timeout)
 
while (!STB0899_GETFIELD(RXEND, reg)) {
reg = stb0899_read_reg(state, STB0899_DISRX_ST0);
-   if (jiffies - start  timeout) {
+   if (time_after(jiffies, start + timeout)) {
dprintk(state-verbose, FE_ERROR, 1, timed out!!);
return -ETIMEDOUT;
}
@@ -782,7 +783,7 @@ static int stb0899_wait_diseqc_txidle(struct stb0899_state 
*state, int timeout)
 
while (!STB0899_GETFIELD(TXIDLE, reg)) {
reg = stb0899_read_reg(state, STB0899_DISSTATUS);
-   if (jiffies - start  timeout) {
+   if (time_after(jiffies, start + timeout)) {
dprintk(state-verbose, FE_ERROR, 1, timed out!!);
return -ETIMEDOUT;
}
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] fbdev: vgastate: remove trailing whitespaces

2014-12-11 Thread Asaf Vertz
Fixed a coding style error, trailing whitespace.

Signed-off-by: Asaf Vertz 
---
 drivers/video/vgastate.c |   82 +++---
 1 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c
index b91c466..548c751 100644
--- a/drivers/video/vgastate.c
+++ b/drivers/video/vgastate.c
@@ -2,7 +2,7 @@
  * linux/drivers/video/vgastate.c -- VGA state save/restore
  *
  * Copyright 2002 James Simmons
- * 
+ *
  * Copyright history from vga16fb.c:
  * Copyright 1999 Ben Pfaff and Petr Vandrovec
  * Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm
@@ -10,7 +10,7 @@
  *
  * This file is subject to the terms and conditions of the GNU General
  * Public License.  See the file COPYING in the main directory of this
- * archive for more details.  
+ * archive for more details.
  *
  */
 #include 
@@ -29,16 +29,16 @@ struct regstate {
__u8 *gfx;
__u8 *seq;
__u8 misc;
-}; 
+};
 
-static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short 
iobase, 
+static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short 
iobase,
   unsigned char reg)
 {
vga_w(regbase, iobase + 0x4, reg);
return vga_r(regbase, iobase + 0x5);
 }
 
-static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase, 
+static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase,
  unsigned char reg, unsigned char val)
 {
vga_w(regbase, iobase + 0x4, reg);
@@ -71,7 +71,7 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
gr6 = vga_rgfx(state->vgabase, VGA_GFX_MISC);
seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE);
seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE);
-   
+
/* blank screen */
seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE);
vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
@@ -85,7 +85,7 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x2);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i < 4 * 8192; i++) 
+   for (i = 0; i < 4 * 8192; i++)
saved->vga_font0[i] = vga_r(fbbase, i);
}
 
@@ -96,10 +96,10 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x3);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i < state->memsize; i++) 
+   for (i = 0; i < state->memsize; i++)
saved->vga_font1[i] = vga_r(fbbase, i);
}
-   
+
/* save font at plane 0/1 */
if (state->flags & VGA_SAVE_TEXT) {
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x1);
@@ -107,7 +107,7 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i < 8192; i++) 
+   for (i = 0; i < 8192; i++)
saved->vga_text[i] = vga_r(fbbase, i);
 
vga_wseq(state->vgabase, VGA_SEQ_PLANE_WRITE, 0x2);
@@ -115,8 +115,8 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_PLANE_READ, 0x1);
vga_wgfx(state->vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state->vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i < 8192; i++) 
-   saved->vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i); 
+   for (i = 0; i < 8192; i++)
+   saved->vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i);
}
 
/* restore regs */
@@ -151,7 +151,7 @@ static void restore_vga_text(struct vgastate *state, void 
__iomem *fbbase)
gr8 = vga_rgfx(state->vgabase, VGA_GFX_BIT_MASK);
seq2 = vga_rseq(state->vgabase, VGA_SEQ_PLANE_WRITE);
seq4 = vga_rseq(state->vgabase, VGA_SEQ_MEMORY_MODE);
-   
+
/* blank screen */
seq1 = vga_rseq(state->vgabase, VGA_SEQ_CLOCK_MODE);
vga_wseq(state->vgabase, VGA_SEQ_RESET, 0x1);
@@ -163,7 +163,7 @@ static void restore_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state->vgabase, VGA_GFX_BIT_MASK, 0xff);
vga_wgfx(state->vgabase, VGA_GFX_SR_ENABLE, 0x00);
}
-  

[PATCH] fbdev: vgastate: remove trailing whitespaces

2014-12-11 Thread Asaf Vertz
Fixed a coding style error, trailing whitespace.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/video/vgastate.c |   82 +++---
 1 files changed, 41 insertions(+), 41 deletions(-)

diff --git a/drivers/video/vgastate.c b/drivers/video/vgastate.c
index b91c466..548c751 100644
--- a/drivers/video/vgastate.c
+++ b/drivers/video/vgastate.c
@@ -2,7 +2,7 @@
  * linux/drivers/video/vgastate.c -- VGA state save/restore
  *
  * Copyright 2002 James Simmons
- * 
+ *
  * Copyright history from vga16fb.c:
  * Copyright 1999 Ben Pfaff and Petr Vandrovec
  * Based on VGA info at http://www.goodnet.com/~tinara/FreeVGA/home.htm
@@ -10,7 +10,7 @@
  *
  * This file is subject to the terms and conditions of the GNU General
  * Public License.  See the file COPYING in the main directory of this
- * archive for more details.  
+ * archive for more details.
  *
  */
 #include linux/module.h
@@ -29,16 +29,16 @@ struct regstate {
__u8 *gfx;
__u8 *seq;
__u8 misc;
-}; 
+};
 
-static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short 
iobase, 
+static inline unsigned char vga_rcrtcs(void __iomem *regbase, unsigned short 
iobase,
   unsigned char reg)
 {
vga_w(regbase, iobase + 0x4, reg);
return vga_r(regbase, iobase + 0x5);
 }
 
-static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase, 
+static inline void vga_wcrtcs(void __iomem *regbase, unsigned short iobase,
  unsigned char reg, unsigned char val)
 {
vga_w(regbase, iobase + 0x4, reg);
@@ -71,7 +71,7 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
gr6 = vga_rgfx(state-vgabase, VGA_GFX_MISC);
seq2 = vga_rseq(state-vgabase, VGA_SEQ_PLANE_WRITE);
seq4 = vga_rseq(state-vgabase, VGA_SEQ_MEMORY_MODE);
-   
+
/* blank screen */
seq1 = vga_rseq(state-vgabase, VGA_SEQ_CLOCK_MODE);
vga_wseq(state-vgabase, VGA_SEQ_RESET, 0x1);
@@ -85,7 +85,7 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state-vgabase, VGA_GFX_PLANE_READ, 0x2);
vga_wgfx(state-vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state-vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i  4 * 8192; i++) 
+   for (i = 0; i  4 * 8192; i++)
saved-vga_font0[i] = vga_r(fbbase, i);
}
 
@@ -96,10 +96,10 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state-vgabase, VGA_GFX_PLANE_READ, 0x3);
vga_wgfx(state-vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state-vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i  state-memsize; i++) 
+   for (i = 0; i  state-memsize; i++)
saved-vga_font1[i] = vga_r(fbbase, i);
}
-   
+
/* save font at plane 0/1 */
if (state-flags  VGA_SAVE_TEXT) {
vga_wseq(state-vgabase, VGA_SEQ_PLANE_WRITE, 0x1);
@@ -107,7 +107,7 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state-vgabase, VGA_GFX_PLANE_READ, 0x0);
vga_wgfx(state-vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state-vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i  8192; i++) 
+   for (i = 0; i  8192; i++)
saved-vga_text[i] = vga_r(fbbase, i);
 
vga_wseq(state-vgabase, VGA_SEQ_PLANE_WRITE, 0x2);
@@ -115,8 +115,8 @@ static void save_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state-vgabase, VGA_GFX_PLANE_READ, 0x1);
vga_wgfx(state-vgabase, VGA_GFX_MODE, 0x0);
vga_wgfx(state-vgabase, VGA_GFX_MISC, 0x5);
-   for (i = 0; i  8192; i++) 
-   saved-vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i); 
+   for (i = 0; i  8192; i++)
+   saved-vga_text[8192+i] = vga_r(fbbase + 2 * 8192, i);
}
 
/* restore regs */
@@ -151,7 +151,7 @@ static void restore_vga_text(struct vgastate *state, void 
__iomem *fbbase)
gr8 = vga_rgfx(state-vgabase, VGA_GFX_BIT_MASK);
seq2 = vga_rseq(state-vgabase, VGA_SEQ_PLANE_WRITE);
seq4 = vga_rseq(state-vgabase, VGA_SEQ_MEMORY_MODE);
-   
+
/* blank screen */
seq1 = vga_rseq(state-vgabase, VGA_SEQ_CLOCK_MODE);
vga_wseq(state-vgabase, VGA_SEQ_RESET, 0x1);
@@ -163,7 +163,7 @@ static void restore_vga_text(struct vgastate *state, void 
__iomem *fbbase)
vga_wgfx(state-vgabase, VGA_GFX_BIT_MASK, 0xff);
vga_wgfx(state-vgabase, VGA_GFX_SR_ENABLE, 0x00);
}
-   
+
/* restore font at plane 2 */
if (state-flags  VGA_SAVE_FONT0) {
vga_wseq(state-vgabase, VGA_SEQ_PLANE_WRITE

Re: [PATCH] dma: imx-sdma: fix indentation

2014-12-10 Thread Asaf Vertz
On 12/11/2014 06:50 AM, Vinod Koul wrote:
> On Wed, Dec 10, 2014 at 10:00:36AM +0200, Asaf Vertz wrote:
>> Fixed a coding style error, switch and case should be at the same indent
> Please use the right subsystem name for the patches

what subsystem name I should have used?
I used the one from the last patches in the log

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/dma/imx-sdma.c

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] crypto: ux500: fix checkpatch errors

2014-12-10 Thread Asaf Vertz
Fixed a coding style error, code indent should use tabs where possible 

Signed-off-by: Asaf Vertz 
---
 drivers/crypto/ux500/cryp/cryp_core.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/ux500/cryp/cryp_core.c 
b/drivers/crypto/ux500/cryp/cryp_core.c
index 92105f3..b189e1d 100644
--- a/drivers/crypto/ux500/cryp/cryp_core.c
+++ b/drivers/crypto/ux500/cryp/cryp_core.c
@@ -479,13 +479,13 @@ static void cryp_dma_setup_channel(struct 
cryp_device_data *device_data,
.dst_addr = device_data->phybase + CRYP_DMA_TX_FIFO,
.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.dst_maxburst = 4,
-};
+   };
struct dma_slave_config cryp2mem = {
.direction = DMA_DEV_TO_MEM,
.src_addr = device_data->phybase + CRYP_DMA_RX_FIFO,
.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.src_maxburst = 4,
-};
+   };
 
dma_cap_zero(device_data->dma.mask);
dma_cap_set(DMA_SLAVE, device_data->dma.mask);
@@ -1772,8 +1772,8 @@ static int ux500_cryp_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(ux500_cryp_pm, ux500_cryp_suspend, ux500_cryp_resume);
 
 static const struct of_device_id ux500_cryp_match[] = {
-{ .compatible = "stericsson,ux500-cryp" },
-{ },
+   { .compatible = "stericsson,ux500-cryp" },
+   { },
 };
 
 static struct platform_driver cryp_driver = {
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] dma: imx-sdma: fix indentation

2014-12-10 Thread Asaf Vertz
Fixed a coding style error, switch and case should be at the same indent

Signed-off-by: Asaf Vertz 
---
 drivers/dma/imx-sdma.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 88afc48..8729877 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1301,15 +1301,15 @@ static void sdma_load_firmware(const struct firmware 
*fw, void *context)
if (header->ram_code_start + header->ram_code_size > fw->size)
goto err_firmware;
switch (header->version_major) {
-   case 1:
-   sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1;
-   break;
-   case 2:
-   sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2;
-   break;
-   default:
-   dev_err(sdma->dev, "unknown firmware version\n");
-   goto err_firmware;
+   case 1:
+   sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1;
+   break;
+   case 2:
+   sdma->script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2;
+   break;
+   default:
+   dev_err(sdma->dev, "unknown firmware version\n");
+   goto err_firmware;
}
 
addr = (void *)header + header->script_addrs_start;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] dma: imx-sdma: fix indentation

2014-12-10 Thread Asaf Vertz
On 12/11/2014 06:50 AM, Vinod Koul wrote:
 On Wed, Dec 10, 2014 at 10:00:36AM +0200, Asaf Vertz wrote:
 Fixed a coding style error, switch and case should be at the same indent
 Please use the right subsystem name for the patches

what subsystem name I should have used?
I used the one from the last patches in the log

http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/log/drivers/dma/imx-sdma.c

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] dma: imx-sdma: fix indentation

2014-12-10 Thread Asaf Vertz
Fixed a coding style error, switch and case should be at the same indent

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/dma/imx-sdma.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 88afc48..8729877 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1301,15 +1301,15 @@ static void sdma_load_firmware(const struct firmware 
*fw, void *context)
if (header-ram_code_start + header-ram_code_size  fw-size)
goto err_firmware;
switch (header-version_major) {
-   case 1:
-   sdma-script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1;
-   break;
-   case 2:
-   sdma-script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2;
-   break;
-   default:
-   dev_err(sdma-dev, unknown firmware version\n);
-   goto err_firmware;
+   case 1:
+   sdma-script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1;
+   break;
+   case 2:
+   sdma-script_number = SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V2;
+   break;
+   default:
+   dev_err(sdma-dev, unknown firmware version\n);
+   goto err_firmware;
}
 
addr = (void *)header + header-script_addrs_start;
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] crypto: ux500: fix checkpatch errors

2014-12-10 Thread Asaf Vertz
Fixed a coding style error, code indent should use tabs where possible 

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/crypto/ux500/cryp/cryp_core.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/ux500/cryp/cryp_core.c 
b/drivers/crypto/ux500/cryp/cryp_core.c
index 92105f3..b189e1d 100644
--- a/drivers/crypto/ux500/cryp/cryp_core.c
+++ b/drivers/crypto/ux500/cryp/cryp_core.c
@@ -479,13 +479,13 @@ static void cryp_dma_setup_channel(struct 
cryp_device_data *device_data,
.dst_addr = device_data-phybase + CRYP_DMA_TX_FIFO,
.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.dst_maxburst = 4,
-};
+   };
struct dma_slave_config cryp2mem = {
.direction = DMA_DEV_TO_MEM,
.src_addr = device_data-phybase + CRYP_DMA_RX_FIFO,
.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
.src_maxburst = 4,
-};
+   };
 
dma_cap_zero(device_data-dma.mask);
dma_cap_set(DMA_SLAVE, device_data-dma.mask);
@@ -1772,8 +1772,8 @@ static int ux500_cryp_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(ux500_cryp_pm, ux500_cryp_suspend, ux500_cryp_resume);
 
 static const struct of_device_id ux500_cryp_match[] = {
-{ .compatible = stericsson,ux500-cryp },
-{ },
+   { .compatible = stericsson,ux500-cryp },
+   { },
 };
 
 static struct platform_driver cryp_driver = {
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] input: edt-ft5x06: fixed a macro coding style issue

2014-12-09 Thread Asaf Vertz
Fixed a coding style error, macros with complex values should be
enclosed in parentheses.

Signed-off-by: Asaf Vertz 
---
Changes in v2:
  - use do {...} while (0)  instead of {...}

 drivers/input/touchscreen/edt-ft5x06.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c 
b/drivers/input/touchscreen/edt-ft5x06.c
index ee3434f..d22ed56 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -850,9 +850,11 @@ static int edt_ft5x06_ts_identify(struct i2c_client 
*client,
 }
 
 #define EDT_ATTR_CHECKSET(name, reg) \
+do {   \
if (pdata->name >= edt_ft5x06_attr_##name.limit_low &&  \
pdata->name <= edt_ft5x06_attr_##name.limit_high)   \
-   edt_ft5x06_register_write(tsdata, reg, pdata->name)
+   edt_ft5x06_register_write(tsdata, reg, pdata->name);\
+} while (0)
 
 #define EDT_GET_PROP(name, reg) {  \
u32 val;\
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH v2] input: edt-ft5x06: fixed a macro coding style issue

2014-12-09 Thread Asaf Vertz
Fixed a coding style error, macros with complex values should be
enclosed in parentheses.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
Changes in v2:
  - use do {...} while (0)  instead of {...}

 drivers/input/touchscreen/edt-ft5x06.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c 
b/drivers/input/touchscreen/edt-ft5x06.c
index ee3434f..d22ed56 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -850,9 +850,11 @@ static int edt_ft5x06_ts_identify(struct i2c_client 
*client,
 }
 
 #define EDT_ATTR_CHECKSET(name, reg) \
+do {   \
if (pdata-name = edt_ft5x06_attr_##name.limit_low   \
pdata-name = edt_ft5x06_attr_##name.limit_high)   \
-   edt_ft5x06_register_write(tsdata, reg, pdata-name)
+   edt_ft5x06_register_write(tsdata, reg, pdata-name);\
+} while (0)
 
 #define EDT_GET_PROP(name, reg) {  \
u32 val;\
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] input: edt-ft5x06: fixed a macro coding style issue

2014-12-08 Thread Asaf Vertz
On 12/09/2014 08:44 AM, Joe Perches wrote:
> On Tue, 2014-12-09 at 08:34 +0200, Asaf Vertz wrote:
>> Fixed a coding style error, macros with complex values should be
>> enclosed in parentheses.
>>  
>> -#define EDT_ATTR_CHECKSET(name, reg) \
>> +#define EDT_ATTR_CHECKSET(name, reg) { \
>>  if (pdata->name >= edt_ft5x06_attr_##name.limit_low &&  \
>>  pdata->name <= edt_ft5x06_attr_##name.limit_high)   \
>> -edt_ft5x06_register_write(tsdata, reg, pdata->name)
>> +edt_ft5x06_register_write(tsdata, reg, pdata->name);\
>> +}
> 
> Any time you see a naked if (foo) bar in a macro
> prefer to use a do while (0) like;
> 
> #define EDT_ATTR_CHECKSET(name, reg)  \
> do {  \
>   if (pdata->name >= edt_ft5x06_attr_##name.limit_low &&  \
>   pdata->name <= edt_ft5x06_attr_##name.limit_high)   \
>   edt_ft5x06_register_write(tsdata, reg, pdata->name);\
> while (0)
> 

thanks for the input, I will update and resend it

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] input: edt-ft5x06: fixed a macro coding style issue

2014-12-08 Thread Asaf Vertz
Fixed a coding style error, macros with complex values should be
enclosed in parentheses.

Signed-off-by: Asaf Vertz 
---
 drivers/input/touchscreen/edt-ft5x06.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c 
b/drivers/input/touchscreen/edt-ft5x06.c
index ee3434f..6db9253 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -849,10 +849,11 @@ static int edt_ft5x06_ts_identify(struct i2c_client 
*client,
return 0;
 }
 
-#define EDT_ATTR_CHECKSET(name, reg) \
+#define EDT_ATTR_CHECKSET(name, reg) { \
if (pdata->name >= edt_ft5x06_attr_##name.limit_low &&  \
pdata->name <= edt_ft5x06_attr_##name.limit_high)   \
-   edt_ft5x06_register_write(tsdata, reg, pdata->name)
+   edt_ft5x06_register_write(tsdata, reg, pdata->name);\
+}
 
 #define EDT_GET_PROP(name, reg) {  \
u32 val;\
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] input: edt-ft5x06: fixed a macro coding style issue

2014-12-08 Thread Asaf Vertz
Fixed a coding style error, macros with complex values should be
enclosed in parentheses.

Signed-off-by: Asaf Vertz asaf.ve...@tandemg.com
---
 drivers/input/touchscreen/edt-ft5x06.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/edt-ft5x06.c 
b/drivers/input/touchscreen/edt-ft5x06.c
index ee3434f..6db9253 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -849,10 +849,11 @@ static int edt_ft5x06_ts_identify(struct i2c_client 
*client,
return 0;
 }
 
-#define EDT_ATTR_CHECKSET(name, reg) \
+#define EDT_ATTR_CHECKSET(name, reg) { \
if (pdata-name = edt_ft5x06_attr_##name.limit_low   \
pdata-name = edt_ft5x06_attr_##name.limit_high)   \
-   edt_ft5x06_register_write(tsdata, reg, pdata-name)
+   edt_ft5x06_register_write(tsdata, reg, pdata-name);\
+}
 
 #define EDT_GET_PROP(name, reg) {  \
u32 val;\
-- 
1.7.0.4

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] input: edt-ft5x06: fixed a macro coding style issue

2014-12-08 Thread Asaf Vertz
On 12/09/2014 08:44 AM, Joe Perches wrote:
 On Tue, 2014-12-09 at 08:34 +0200, Asaf Vertz wrote:
 Fixed a coding style error, macros with complex values should be
 enclosed in parentheses.
  
 -#define EDT_ATTR_CHECKSET(name, reg) \
 +#define EDT_ATTR_CHECKSET(name, reg) { \
  if (pdata-name = edt_ft5x06_attr_##name.limit_low   \
  pdata-name = edt_ft5x06_attr_##name.limit_high)   \
 -edt_ft5x06_register_write(tsdata, reg, pdata-name)
 +edt_ft5x06_register_write(tsdata, reg, pdata-name);\
 +}
 
 Any time you see a naked if (foo) bar in a macro
 prefer to use a do while (0) like;
 
 #define EDT_ATTR_CHECKSET(name, reg)  \
 do {  \
   if (pdata-name = edt_ft5x06_attr_##name.limit_low   \
   pdata-name = edt_ft5x06_attr_##name.limit_high)   \
   edt_ft5x06_register_write(tsdata, reg, pdata-name);\
 while (0)
 

thanks for the input, I will update and resend it

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/