[PATCH] Revert "Staging: panel: usleep_range is preferred over udelay"

2016-01-23 Thread Sudip Mukherjee
This reverts commit ebd43516d3879f882a403836bba8bc5791f26a28.

We should not be sleeping inside spin_lock.

Fixes: ebd43516d387 ("Staging: panel: usleep_range is preferred over udelay")
Cc: Sirnam Swetha 
Signed-off-by: Sudip Mukherjee 
---
 drivers/staging/panel/panel.c | 34 +++---
 1 file changed, 15 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 79ac192..70b8f4f 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -825,8 +825,7 @@ static void lcd_write_cmd_s(int cmd)
lcd_send_serial(0x1F);  /* R/W=W, RS=0 */
lcd_send_serial(cmd & 0x0F);
lcd_send_serial((cmd >> 4) & 0x0F);
-   /* the shortest command takes at least 40 us */
-   usleep_range(40, 100);
+   udelay(40); /* the shortest command takes at least 40 us */
spin_unlock_irq(&pprt_lock);
 }
 
@@ -837,8 +836,7 @@ static void lcd_write_data_s(int data)
lcd_send_serial(0x5F);  /* R/W=W, RS=1 */
lcd_send_serial(data & 0x0F);
lcd_send_serial((data >> 4) & 0x0F);
-   /* the shortest data takes at least 40 us */
-   usleep_range(40, 100);
+   udelay(40); /* the shortest data takes at least 40 us */
spin_unlock_irq(&pprt_lock);
 }
 
@@ -848,20 +846,19 @@ static void lcd_write_cmd_p8(int cmd)
spin_lock_irq(&pprt_lock);
/* present the data to the data port */
w_dtr(pprt, cmd);
-   /* maintain the data during 20 us before the strobe */
-   usleep_range(20, 100);
+   udelay(20); /* maintain the data during 20 us before the strobe */
 
bits.e = BIT_SET;
bits.rs = BIT_CLR;
bits.rw = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(40, 100);  /* maintain the strobe during 40 us */
+   udelay(40); /* maintain the strobe during 40 us */
 
bits.e = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(120, 500); /* the shortest command takes at least 120 us */
+   udelay(120);/* the shortest command takes at least 120 us */
spin_unlock_irq(&pprt_lock);
 }
 
@@ -871,20 +868,19 @@ static void lcd_write_data_p8(int data)
spin_lock_irq(&pprt_lock);
/* present the data to the data port */
w_dtr(pprt, data);
-   /* maintain the data during 20 us before the strobe */
-   usleep_range(20, 100);
+   udelay(20); /* maintain the data during 20 us before the strobe */
 
bits.e = BIT_SET;
bits.rs = BIT_SET;
bits.rw = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(40, 100);  /* maintain the strobe during 40 us */
+   udelay(40); /* maintain the strobe during 40 us */
 
bits.e = BIT_CLR;
set_ctrl_bits();
 
-   usleep_range(45, 100);  /* the shortest data takes at least 45 us */
+   udelay(45); /* the shortest data takes at least 45 us */
spin_unlock_irq(&pprt_lock);
 }
 
@@ -894,7 +890,7 @@ static void lcd_write_cmd_tilcd(int cmd)
spin_lock_irq(&pprt_lock);
/* present the data to the control port */
w_ctr(pprt, cmd);
-   usleep_range(60, 120);
+   udelay(60);
spin_unlock_irq(&pprt_lock);
 }
 
@@ -904,7 +900,7 @@ static void lcd_write_data_tilcd(int data)
spin_lock_irq(&pprt_lock);
/* present the data to the data port */
w_dtr(pprt, data);
-   usleep_range(60, 120);
+   udelay(60);
spin_unlock_irq(&pprt_lock);
 }
 
@@ -947,7 +943,7 @@ static void lcd_clear_fast_s(void)
lcd_send_serial(0x5F);  /* R/W=W, RS=1 */
lcd_send_serial(' ' & 0x0F);
lcd_send_serial((' ' >> 4) & 0x0F);
-   usleep_range(40, 100);  /* the shortest data takes at least 40 
us */
+   udelay(40); /* the shortest data takes at least 40 us */
}
spin_unlock_irq(&pprt_lock);
 
@@ -971,7 +967,7 @@ static void lcd_clear_fast_p8(void)
w_dtr(pprt, ' ');
 
/* maintain the data during 20 us before the strobe */
-   usleep_range(20, 100);
+   udelay(20);
 
bits.e = BIT_SET;
bits.rs = BIT_SET;
@@ -979,13 +975,13 @@ static void lcd_clear_fast_p8(void)
set_ctrl_bits();
 
/* maintain the strobe during 40 us */
-   usleep_range(40, 100);
+   udelay(40);
 
bits.e = BIT_CLR;
set_ctrl_bits();
 
/* the shortest data takes at least 45 us */
-   usleep_range(45, 100);
+   udelay(45);
}
spin_unlock_irq(&pprt_lock);
 
@@ -1007,7 +1003,7 @@ static void lcd_clear_fast_tilcd(void)
for (pos = 0; pos < lcd.height * lcd.hwidth; pos++) {
/* present the data to the data port */
w_dtr(pprt, ' ');
-   usleep_range(60, 120);
+   udelay(60);
 

[PATCH] Staging:lustre:lustre:llite:Remove explicit NULL comparision

2016-01-23 Thread Bhumika Goyal
Replaced explicit NULL comparision with its simplier form.
Found using coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Bhumika Goyal 
---
 drivers/staging/lustre/lustre/llite/dcache.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/dcache.c 
b/drivers/staging/lustre/lustre/llite/dcache.c
index 3d6745e..bc179e5 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -62,7 +62,7 @@ static void ll_release(struct dentry *de)
 
LASSERT(de != NULL);
lld = ll_d2d(de);
-   if (lld == NULL) /* NFS copies the de->d_op methods (bug 4655) */
+   if (!lld) /* NFS copies the de->d_op methods (bug 4655) */
return;
 
if (lld->lld_it) {
@@ -131,7 +131,7 @@ static int find_cbdata(struct inode *inode)
return rc;
 
lsm = ccc_inode_lsm_get(inode);
-   if (lsm == NULL)
+   if (!lsm)
return rc;
 
rc = obd_find_cbdata(sbi->ll_dt_exp, lsm, return_if_equal, NULL);
@@ -184,13 +184,13 @@ int ll_d_init(struct dentry *de)
de, de, de->d_parent, d_inode(de),
d_count(de));
 
-   if (de->d_fsdata == NULL) {
+   if (!de->d_fsdata) {
struct ll_dentry_data *lld;
 
lld = kzalloc(sizeof(*lld), GFP_NOFS);
if (likely(lld)) {
spin_lock(&de->d_lock);
-   if (likely(de->d_fsdata == NULL)) {
+   if (likely(!de->d_fsdata)) {
de->d_fsdata = lld;
__d_lustre_invalidate(de);
} else {
@@ -328,7 +328,7 @@ static int ll_revalidate_dentry(struct dentry *dentry,
if (lookup_flags & LOOKUP_RCU)
return -ECHILD;
 
-   do_statahead_enter(dir, &dentry, d_inode(dentry) == NULL);
+   do_statahead_enter(dir, &dentry, !d_inode(dentry));
ll_statahead_mark(dir, dentry);
return 1;
 }
-- 
1.9.1

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


[PATCH] Staging: iio: adc: fix indent on break statement

2016-01-23 Thread Colin King
From: Colin Ian King 

Fix indent warning when building with gcc 6:
drivers/staging/iio/adc/ad7192.c:239:4: warning: statement is indented
  as if it were guarded by... [-Wmisleading-indentation]

Signed-off-by: Colin Ian King 
---
 drivers/staging/iio/adc/ad7192.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c
index 9221103..92f2b72 100644
--- a/drivers/staging/iio/adc/ad7192.c
+++ b/drivers/staging/iio/adc/ad7192.c
@@ -236,7 +236,7 @@ static int ad7192_setup(struct ad7192_state *st,
st->mclk = pdata->ext_clk_hz;
else
st->mclk = AD7192_INT_FREQ_MHZ;
-   break;
+   break;
default:
ret = -EINVAL;
goto out;
-- 
2.7.0.rc3

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


[PATCH] staging: lustre: fix comment style

2016-01-23 Thread Sushuruth Sadagopan
Fix style of several comments.

Signed-off-by: Sushuruth Sadagopan 
---
 drivers/staging/lustre/lnet/lnet/config.c | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lnet/lnet/config.c 
b/drivers/staging/lustre/lnet/lnet/config.c
index 284a3c2..74d644d 100644
--- a/drivers/staging/lustre/lnet/lnet/config.c
+++ b/drivers/staging/lustre/lnet/lnet/config.c
@@ -217,12 +217,16 @@ lnet_parse_networks(struct list_head *nilist, char 
*networks)
int niface;
int rc;
 
-   /* NB we don't check interface conflicts here; it's the LNDs
-* responsibility (if it cares at all) */
+   /*
+* NB we don't check interface conflicts here; it's the LNDs
+* responsibility (if it cares at all)
+*/
 
if (square != NULL && (comma == NULL || square < comma)) {
-   /* i.e: o2ib0(ib0)[1,2], number between square
-* brackets are CPTs this NI needs to be bond */
+   /*
+* i.e: o2ib0(ib0)[1,2], number between square
+* brackets are CPTs this NI needs to be bond
+*/
if (bracket != NULL && bracket > square) {
tmp = square;
goto failed_syntax;
@@ -609,8 +613,10 @@ lnet_parse_priority(char *str, unsigned int *priority, 
char **token)
len = strlen(sep + 1);
 
if ((sscanf((sep+1), "%u%n", priority, &nob) < 1) || (len != nob)) {
-   /* Update the caller's token pointer so it treats the found
-  priority as the token to report in the error message. */
+   /*
+* Update the caller's token pointer so it treats the found
+* priority as the token to report in the error message.
+*/
*token += sep - str + 1;
return -1;
}
-- 
2.5.0

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