[PATCH] staging: wlan-ng: Fix sparse warning: cast to restricted __le16.

2017-08-09 Thread AbdAllah-MEZITI
The same structure is used in both side, so we dont need to cast.
This will fix the following sparse warnings:
drivers/staging/wlan-ng/prism2sta.c:1139:13: warning: cast to restricted __le16
drivers/staging/wlan-ng/prism2sta.c:1150:24: warning: cast to restricted __le16
drivers/staging/wlan-ng/prism2sta.c:1157:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/prism2sta.c:1158:37: warning: cast to restricted __le16
drivers/staging/wlan-ng/prism2sta.c:1159:40: warning: cast to restricted __le16
drivers/staging/wlan-ng/prism2sta.c:1450:31: warning: cast to restricted __le16

Signed-off-by: AbdAllah MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/wlan-ng/prism2sta.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wlan-ng/prism2sta.c 
b/drivers/staging/wlan-ng/prism2sta.c
index 8c34712..c9df450 100644
--- a/drivers/staging/wlan-ng/prism2sta.c
+++ b/drivers/staging/wlan-ng/prism2sta.c
@@ -1136,7 +1136,7 @@ static void prism2sta_inf_chinforesults(struct wlandevice 
*wlandev,
unsigned int i, n;
 
hw->channel_info.results.scanchannels =
-   le16_to_cpu(inf->info.chinforesult.scanchannels);
+   inf->info.chinforesult.scanchannels;
 
for (i = 0, n = 0; i < HFA384x_CHINFORESULT_MAX; i++) {
struct hfa384x_ch_info_result_sub *result;
@@ -1147,16 +1147,16 @@ static void prism2sta_inf_chinforesults(struct 
wlandevice *wlandev,
continue;
 
result = >info.chinforesult.result[n];
-   chan = le16_to_cpu(result->chid) - 1;
+   chan = result->chid - 1;
 
if (chan < 0 || chan >= HFA384x_CHINFORESULT_MAX)
continue;
 
chinforesult = >channel_info.results.result[chan];
chinforesult->chid = chan;
-   chinforesult->anl = le16_to_cpu(result->anl);
-   chinforesult->pnl = le16_to_cpu(result->pnl);
-   chinforesult->active = le16_to_cpu(result->active);
+   chinforesult->anl = result->anl;
+   chinforesult->pnl = result->pnl;
+   chinforesult->active = result->active;
 
pr_debug("chinfo: channel %d, %s level (avg/peak)=%d/%d dB, pcf 
%d\n",
 chan + 1,
@@ -1447,7 +1447,7 @@ static void prism2sta_inf_linkstatus(struct wlandevice 
*wlandev,
 {
struct hfa384x *hw = wlandev->priv;
 
-   hw->link_status_new = le16_to_cpu(inf->info.linkstatus.linkstatus);
+   hw->link_status_new = inf->info.linkstatus.linkstatus;
 
schedule_work(>link_bh);
 }
-- 
2.7.4

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


[PATCH v2] staging: sm750fb: always take the lock

2017-06-26 Thread AbdAllah-MEZITI
This patch
- Always take the lock:
The current code only takes the lock if multiple instances are in use.
This is error-prone, and confuses static analyzers.
As taking the lock in case of a single instance is harmless and cheap,
change the code to always take the lock.
- That also fix the sparse warning:
drivers/staging/sm750fb/sm750.c:159:13: warning: context imbalance in 
'lynxfb_ops_fillrect' - different lock contexts for basic block
drivers/staging/sm750fb/sm750.c:231:9: warning: context imbalance in 
'lynxfb_ops_copyarea' - different lock contexts for basic block
drivers/staging/sm750fb/sm750.c:235:13: warning: context imbalance in 
'lynxfb_ops_imageblit' - different lock contexts for basic block

Signed-off-by: AbdAllah MEZITI <abdallah.meziti@gmail.com>

v2:
 - add and fix the changelog text.
---
 drivers/staging/sm750fb/sm750.c | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 386d4ad..4a22190 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -186,16 +186,14 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
 * If not use spin_lock,system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_fillrect(_dev->accel,
 base, pitch, Bpp,
 region->dx, region->dy,
 region->width, region->height,
 color, rop);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static void lynxfb_ops_copyarea(struct fb_info *info,
@@ -220,16 +218,14 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_copyarea(_dev->accel,
 base, pitch, region->sx, region->sy,
 base, pitch, Bpp, region->dx, region->dy,
 region->width, region->height,
 HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static void lynxfb_ops_imageblit(struct fb_info *info,
@@ -269,8 +265,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_imageblit(_dev->accel,
  image->data, image->width >> 3, 0,
@@ -278,8 +273,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
  image->dx, image->dy,
  image->width, image->height,
  fgcol, bgcol, HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
-- 
2.7.4

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


[PATCH] staging: sm750fb: always take the lock

2017-06-25 Thread AbdAllah-MEZITI
This patch
- will always take the lock
- fix the sparse warning:
drivers/staging/sm750fb/sm750.c:159:13: warning: context imbalance in 
'lynxfb_ops_fillrect' - different lock contexts for basic block
drivers/staging/sm750fb/sm750.c:231:9: warning: context imbalance in 
'lynxfb_ops_copyarea' - different lock contexts for basic block
drivers/staging/sm750fb/sm750.c:235:13: warning: context imbalance in 
'lynxfb_ops_imageblit' - different lock contexts for basic block

Signed-off-by: AbdAllah MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 386d4ad..4a22190 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -186,16 +186,14 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
 * If not use spin_lock,system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_fillrect(_dev->accel,
 base, pitch, Bpp,
 region->dx, region->dy,
 region->width, region->height,
 color, rop);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static void lynxfb_ops_copyarea(struct fb_info *info,
@@ -220,16 +218,14 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_copyarea(_dev->accel,
 base, pitch, region->sx, region->sy,
 base, pitch, Bpp, region->dx, region->dy,
 region->width, region->height,
 HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static void lynxfb_ops_imageblit(struct fb_info *info,
@@ -269,8 +265,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_imageblit(_dev->accel,
  image->data, image->width >> 3, 0,
@@ -278,8 +273,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
  image->dx, image->dy,
  image->width, image->height,
  fgcol, bgcol, HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
-- 
2.7.4

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


[PATCH] staging: sm750fb: always take the lock

2017-06-25 Thread AbdAllah-MEZITI
Signed-off-by: AbdAllah MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 18 ++
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 386d4ad..4a22190 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -186,16 +186,14 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
 * If not use spin_lock,system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_fillrect(_dev->accel,
 base, pitch, Bpp,
 region->dx, region->dy,
 region->width, region->height,
 color, rop);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static void lynxfb_ops_copyarea(struct fb_info *info,
@@ -220,16 +218,14 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_copyarea(_dev->accel,
 base, pitch, region->sx, region->sy,
 base, pitch, Bpp, region->dx, region->dy,
 region->width, region->height,
 HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static void lynxfb_ops_imageblit(struct fb_info *info,
@@ -269,8 +265,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
-   spin_lock(_dev->slock);
+   spin_lock(_dev->slock);
 
sm750_dev->accel.de_imageblit(_dev->accel,
  image->data, image->width >> 3, 0,
@@ -278,8 +273,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
  image->dx, image->dy,
  image->width, image->height,
  fgcol, bgcol, HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
-   spin_unlock(_dev->slock);
+   spin_unlock(_dev->slock);
 }
 
 static int lynxfb_ops_pan_display(struct fb_var_screeninfo *var,
-- 
2.7.4

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


[PATCH] staging: sm750fb: fix sparce warning.

2017-06-25 Thread AbdAllah-MEZITI
This patch fixes the following sparce warnings: different lock contexts for 
basic block.

drivers/staging/sm750fb//sm750.c:159:13: warning: context imbalance in 
'lynxfb_ops_fillrect' - different lock contexts for basic block
drivers/staging/sm750fb//sm750.c:231:9: warning: context imbalance in 
'lynxfb_ops_copyarea' - different lock contexts for basic block
drivers/staging/sm750fb//sm750.c:235:13: warning: context imbalance in 
'lynxfb_ops_imageblit' - different lock contexts for basic block

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/sm750fb/sm750.c | 69 -
 1 file changed, 47 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 664c220..5494a29 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -186,16 +186,24 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
 * If not use spin_lock,system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
+   if (sm750_dev->fb_count > 1) {
spin_lock(_dev->slock);
 
-   sm750_dev->accel.de_fillrect(_dev->accel,
-base, pitch, Bpp,
-region->dx, region->dy,
-region->width, region->height,
-color, rop);
-   if (sm750_dev->fb_count > 1)
+   sm750_dev->accel.de_fillrect(_dev->accel,
+base, pitch, Bpp,
+region->dx, region->dy,
+region->width, region->height,
+color, rop);
+
spin_unlock(_dev->slock);
+   } else {
+   sm750_dev->accel.de_fillrect(_dev->accel,
+base, pitch, Bpp,
+region->dx, region->dy,
+region->width, region->height,
+color, rop);
+   }
+
 }
 
 static void lynxfb_ops_copyarea(struct fb_info *info,
@@ -220,16 +228,24 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
+   if (sm750_dev->fb_count > 1) {
spin_lock(_dev->slock);
 
-   sm750_dev->accel.de_copyarea(_dev->accel,
-base, pitch, region->sx, region->sy,
-base, pitch, Bpp, region->dx, region->dy,
-region->width, region->height,
-HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
+   sm750_dev->accel.de_copyarea(_dev->accel,
+base, pitch, region->sx, 
region->sy,
+base, pitch, Bpp, region->dx, 
region->dy,
+region->width, region->height,
+HW_ROP2_COPY);
+
spin_unlock(_dev->slock);
+   } else {
+   sm750_dev->accel.de_copyarea(_dev->accel,
+base, pitch, region->sx, 
region->sy,
+base, pitch, Bpp, region->dx, 
region->dy,
+region->width, region->height,
+HW_ROP2_COPY);
+   }
+
 }
 
 static void lynxfb_ops_imageblit(struct fb_info *info,
@@ -269,17 +285,26 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
 * If not use spin_lock, system will die if user load driver
 * and immediately unload driver frequently (dual)
 */
-   if (sm750_dev->fb_count > 1)
+   if (sm750_dev->fb_count > 1) {
spin_lock(_dev->slock);
 
-   sm750_dev->accel.de_imageblit(_dev->accel,
- image->data, image->width >> 3, 0,
- base, pitch, Bpp,
- image->dx, image->dy,
- image->width, image->height,
- fgcol, bgcol, HW_ROP2_COPY);
-   if (sm750_dev->fb_count > 1)
+   sm750_dev->accel.de_imageblit(_dev->accel,
+ ima

[PATCH] staging: wlan-ng: Fix sparse warning: incorrect type in assignment This patch fixes the following sparse warning

2017-06-22 Thread AbdAllah-MEZITI
drivers/staging/wlan-ng/prism2mgmt.c:188:25: warning: incorrect type in 
assignment (different base types)
drivers/staging/wlan-ng/prism2mgmt.c:188:25:expected unsigned short 
[unsigned] [addressable] [usertype] tx_rate
drivers/staging/wlan-ng/prism2mgmt.c:188:25:got restricted __le16 
[usertype] 
drivers/staging/wlan-ng/prism2mgmt.c:200:30: warning: incorrect type in 
assignment (different base types)
drivers/staging/wlan-ng/prism2mgmt.c:200:30:expected unsigned short 
[unsigned] [addressable] [usertype] channel_list
drivers/staging/wlan-ng/prism2mgmt.c:200:30:got restricted __le16 
[usertype] 
drivers/staging/wlan-ng/prism2mgmt.c:203:26: warning: incorrect type in 
assignment (different base types)
drivers/staging/wlan-ng/prism2mgmt.c:203:26:expected unsigned short 
[unsigned] [addressable] [usertype] len
drivers/staging/wlan-ng/prism2mgmt.c:203:26:got restricted __le16 
[usertype] 
drivers/staging/wlan-ng/prism2mgmt.c:232:28: warning: incorrect type in 
assignment (different base types)
drivers/staging/wlan-ng/prism2mgmt.c:232:28:expected unsigned short 
[unsigned] [short] 
drivers/staging/wlan-ng/prism2mgmt.c:232:28:got restricted __le16 
[usertype] 

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/wlan-ng/hfa384x.h| 6 +++---
 drivers/staging/wlan-ng/prism2mgmt.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wlan-ng/hfa384x.h 
b/drivers/staging/wlan-ng/hfa384x.h
index 60110b4..1dc6ed8 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -358,7 +358,7 @@ struct hfa384x_bytestr {
 } __packed;
 
 struct hfa384x_bytestr32 {
-   u16 len;
+   __le16 len;
u8 data[32];
 } __packed;
 
@@ -399,8 +399,8 @@ struct hfa384x_caplevel {
 
 /*-- Configuration Record: HostScanRequest (data portion only) --*/
 struct hfa384x_host_scan_request_data {
-   u16 channel_list;
-   u16 tx_rate;
+   __le16 channel_list;
+   __le16 tx_rate;
struct hfa384x_bytestr32 ssid;
 } __packed;
 
diff --git a/drivers/staging/wlan-ng/prism2mgmt.c 
b/drivers/staging/wlan-ng/prism2mgmt.c
index f4d6e48..c4aa9e7 100644
--- a/drivers/staging/wlan-ng/prism2mgmt.c
+++ b/drivers/staging/wlan-ng/prism2mgmt.c
@@ -213,7 +213,7 @@ int prism2mgmt_scan(struct wlandevice *wlandev, void *msgp)
goto exit;
}
if (word == HFA384x_PORTSTATUS_DISABLED) {
-   u16 wordbuf[17];
+   __le16 wordbuf[17];
 
result = hfa384x_drvr_setconfig16(hw,
HFA384x_RID_CNFROAMINGMODE,
-- 
2.7.4

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


[PATCH] staging: fbtft: fbtft-io.c: Fix sparse warning

2017-04-29 Thread AbdAllah-MEZITI
This patch fixes the following sparse warning in fbtft/fbtft-io.c

  CHECK   drivers/staging/fbtft/fbtft-io.c
drivers/staging/fbtft/fbtft-io.c:74:29: warning: incorrect type in assignment 
(different base types)
drivers/staging/fbtft/fbtft-io.c:74:29:expected unsigned long long 
[unsigned] [long] [long long] [usertype] 
drivers/staging/fbtft/fbtft-io.c:74:29:got restricted __be64 [usertype] 


Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/fbtft/fbtft-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft-io.c b/drivers/staging/fbtft/fbtft-io.c
index d868405..8d436f9 100644
--- a/drivers/staging/fbtft/fbtft-io.c
+++ b/drivers/staging/fbtft/fbtft-io.c
@@ -71,7 +71,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void 
*buf, size_t len)
src++;
}
tmp |= ((*src & 0x0100) ? 1 : 0);
-   *(u64 *)dst = cpu_to_be64(tmp);
+   *(u64 *)dst = tmp;
dst += 8;
*dst++ = (u8)(*src++ & 0x00FF);
added++;
-- 
2.7.4

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


[PATCH v2] staging: bcm2835-audio: fix trailing statements

2017-02-10 Thread AbdAllah-MEZITI
Trailing statements should be on next line.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>

v2:braces {} should be used on all arms of this statement
---
 drivers/staging/bcm2835-audio/bcm2835-vchiq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-vchiq.c 
b/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
index 6578246..fc9f153 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
@@ -563,7 +563,9 @@ int bcm2835_audio_set_ctls(struct bcm2835_chip *chip)
} else if 
(bcm2835_audio_set_ctls_chan(chip->alsa_stream[i], chip) != 0) {
LOG_ERR("Couldn't set the controls for stream 
%d\n", i);
ret = -1;
-   } else LOG_DBG(" Controls set for stream %d\n", i);
+   } else {
+   LOG_DBG(" Controls set for stream %d\n", i);
+   }
}
}
LOG_DBG(" .. OUT ret=%d\n", ret);
-- 
2.9.3

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


[PATCH v2] staging: bcm2835-audio: fix trailing statements

2017-02-10 Thread AbdAllah-MEZITI
Trailing statements should be on next line.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>

v2:braces {} should be used on all arms of this statement
---
 drivers/staging/bcm2835-audio/bcm2835-vchiq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-vchiq.c 
b/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
index 6578246..fc9f153 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
@@ -563,7 +563,9 @@ int bcm2835_audio_set_ctls(struct bcm2835_chip *chip)
} else if 
(bcm2835_audio_set_ctls_chan(chip->alsa_stream[i], chip) != 0) {
LOG_ERR("Couldn't set the controls for stream 
%d\n", i);
ret = -1;
-   } else LOG_DBG(" Controls set for stream %d\n", i);
+   } else {
+   LOG_DBG(" Controls set for stream %d\n", i);
+   }
}
}
LOG_DBG(" .. OUT ret=%d\n", ret);
-- 
2.9.3

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


[PATCH] staging: bcm2835-audio: fix trailing statements

2017-02-10 Thread AbdAllah-MEZITI
Trailing statements should be on next line.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/bcm2835-audio/bcm2835-vchiq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835-vchiq.c 
b/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
index 6578246..95ad58c 100644
--- a/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
+++ b/drivers/staging/bcm2835-audio/bcm2835-vchiq.c
@@ -563,7 +563,8 @@ int bcm2835_audio_set_ctls(struct bcm2835_chip *chip)
} else if 
(bcm2835_audio_set_ctls_chan(chip->alsa_stream[i], chip) != 0) {
LOG_ERR("Couldn't set the controls for stream 
%d\n", i);
ret = -1;
-   } else LOG_DBG(" Controls set for stream %d\n", i);
+   } else
+   LOG_DBG(" Controls set for stream %d\n", i);
}
}
LOG_DBG(" .. OUT ret=%d\n", ret);
-- 
2.9.3

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


[PATCH v3] staging: bcm2835-audio: Remove the initialization of static pointers.

2017-02-07 Thread AbdAllah-MEZITI
In C a static pointer will be initialized to NULL.
The §6.7.8 of the ISO/IEC 9899:1999 (E) document says that:
If an object that has static storage duration is not initialized
explicitly, then:
 __ if it has pointer type, it is initialized to a null pointer.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>

v2: -fix the line-wrapping of the changelog.
-fix the ref. documentation: C99 standards release,
and not the draft.
-this patch is the Task 10 Eudyptula Challenge
that only fix one code style problem.
v3: -fix the subject prefix: must be based on the previous submissions.
---
 drivers/staging/bcm2835-audio/bcm2835.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835.c 
b/drivers/staging/bcm2835-audio/bcm2835.c
index a84d74d..265fe55 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/bcm2835-audio/bcm2835.c
@@ -28,8 +28,8 @@
  * to debug if we run into issues
  */
 
-static struct snd_card *g_card = NULL;
-static struct bcm2835_chip *g_chip = NULL;
+static struct snd_card *g_card;
+static struct bcm2835_chip *g_chip;
 
 static int snd_bcm2835_free(struct bcm2835_chip *chip)
 {
-- 
2.7.4

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


[PATCH v2] somedriver: remove the initialization of static pointers.

2017-02-07 Thread AbdAllah-MEZITI
In C a static pointer will be initialized to NULL.
The §6.7.8 of the ISO/IEC 9899:1999 (E) document says that:
If an object that has static storage duration is not initialized
explicitly, then:
 __ if it has pointer type, it is initialized to a null pointer.

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>

v2: -fix the line-wrapping of the changelog.
-fix the ref. documentation: C99 standards release,
and not the draft.
-this patch is the Task 10 Eudyptula Challenge
that only fix one code style problem.
---
 drivers/staging/bcm2835-audio/bcm2835.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835.c 
b/drivers/staging/bcm2835-audio/bcm2835.c
index a84d74d..265fe55 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/bcm2835-audio/bcm2835.c
@@ -28,8 +28,8 @@
  * to debug if we run into issues
  */
 
-static struct snd_card *g_card = NULL;
-static struct bcm2835_chip *g_chip = NULL;
+static struct snd_card *g_card;
+static struct bcm2835_chip *g_chip;
 
 static int snd_bcm2835_free(struct bcm2835_chip *chip)
 {
-- 
2.7.4

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


Re: [PATCH] somedriver: remove the initialization of static pointers.

2017-02-04 Thread AbdAllah MEZITI
On Sun, 5 Feb 2017 01:29:43 +0100
Greg Kroah-Hartman <gre...@linuxfoundation.org> wrote:

> On Sat, Feb 04, 2017 at 08:39:21PM +0100, AbdAllah-MEZITI wrote:
> > In C a static pointer will be initialized to NULL (e.g: draft C99
> > standard $6.7.8): "If an object that has static storage duration is
> > not initialized explicitly, then:
> >  __ if it has pointer type, it is initialized to a null pointer;"
> > 
> > Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>  
> 
> Your subject is very odd :(
> 
> And is that the correct spelling of your name that you use for legal
> documents?  If not, please fix up when you resend this.
> 
> Also, fix the line-wrapping of your changelog, and the C99 standard is
> not a "draft" anymore, it was released in 1999 :)
> 
> thanks,
> 
> greg k-h


Do not worry, this is just an answer to the Task 10 of the Eudyptula Challenge.

yes, this is the correct spelling of my name that i use for legal documents.

OK.

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


[PATCH] somedriver: remove the initialization of static pointers.

2017-02-04 Thread AbdAllah-MEZITI
In C a static pointer will be initialized to NULL (e.g: draft C99 standard 
$6.7.8):
"If an object that has static storage duration is not initialized
explicitly, then:
 __ if it has pointer type, it is initialized to a null pointer;"

Signed-off-by: AbdAllah-MEZITI <abdallah.meziti@gmail.com>
---
 drivers/staging/bcm2835-audio/bcm2835.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/bcm2835-audio/bcm2835.c 
b/drivers/staging/bcm2835-audio/bcm2835.c
index a84d74d..265fe55 100644
--- a/drivers/staging/bcm2835-audio/bcm2835.c
+++ b/drivers/staging/bcm2835-audio/bcm2835.c
@@ -28,8 +28,8 @@
  * to debug if we run into issues
  */
 
-static struct snd_card *g_card = NULL;
-static struct bcm2835_chip *g_chip = NULL;
+static struct snd_card *g_card;
+static struct bcm2835_chip *g_chip;
 
 static int snd_bcm2835_free(struct bcm2835_chip *chip)
 {
-- 
2.7.4

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