Helene Gsaenger | 22 Dec 02:23 2014
Picon

[PATCH] staging/iio/accel: checkpatch: fixed long lines by moving comments

Signed-off-by: Helene Gsaenger <helene.gsaenger <at> studium.fau.de>
Signed-off-by: Simone Weiss <simone.weiss <at> fau.de>
---
 drivers/staging/iio/accel/adis16203.h | 41 ++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/iio/accel/adis16203.h b/drivers/staging/iio/accel/adis16203.h
index acc688d..fefe2f9 100644
--- a/drivers/staging/iio/accel/adis16203.h
+++ b/drivers/staging/iio/accel/adis16203.h
 <at>  <at>  -16,26 +16,47  <at>  <at> 
 #define ADIS16203_ALM_SMPL2      0x26 /* Alarm 2, sample period */
 #define ADIS16203_ALM_CTRL       0x28 /* Alarm control */
 #define ADIS16203_AUX_DAC        0x30 /* Auxiliary DAC data */
-#define ADIS16203_GPIO_CTRL      0x32 /* General-purpose digital input/output control */
+#define ADIS16203_GPIO_CTRL      0x32 /* General-purpose digital input/output
+				       * control */
 #define ADIS16203_MSC_CTRL       0x34 /* Miscellaneous control */
-#define ADIS16203_SMPL_PRD       0x36 /* Internal sample period (rate) control */
+#define ADIS16203_SMPL_PRD       0x36 /* Internal sample period (rate)
+				       * control */
 #define ADIS16203_AVG_CNT        0x38 /* Operation, filter configuration */
 #define ADIS16203_SLP_CNT        0x3A /* Operation, sleep mode control */
 #define ADIS16203_DIAG_STAT      0x3C /* Diagnostics, system status register */
 #define ADIS16203_GLOB_CMD       0x3E /* Operation, system command register */

 /* MSC_CTRL */
-#define ADIS16203_MSC_CTRL_PWRUP_SELF_TEST	(1 << 10) /* Self-test at power-on: 1 = disabled, 0 =
enabled */
-#define ADIS16203_MSC_CTRL_REVERSE_ROT_EN	(1 << 9)  /* Reverses rotation of both inclination outputs */
(Continue reading)

Simone Weiss | 22 Dec 02:17 2014
Picon

[PATCH 0/6] dgnc: patches that fix checkpatch issues


We fixed some coding style issues in staging/dgnc.
Mostly it fixes lines over 80 characters (dgnc_neo.c, dgnc_cls.h, dgnc_compact.h,
dgnc_driver.h)
In dgnc_sysfs.c we replaced printk by pr_err.
In dpacompat.h we also set complex macros into enclosed parantheses 

Signed-off-by: Simone Weiss <simone.weiss <at> fau.de>
Signed-off-by: Helene Gsaenger <helene.gsaenger <at> studium.fau.de>

Simone Weiss (6):
  dgnc/dgnc_cls.h: checkpatch: fixed long lines by moving comments
  dgnc/dgnc_sysfc.c: checkpatch: Use of pr_err insted of printk
  dgnc/dpacompat.h: checkpatch: fixed long lines by moving comments
  dgnc/dpacompat.h: checkpatch: Changend complex Macros (enclosed
    parantheses)
  dgnc/dgnc_neo.c: checkpatch: fixed long lines
  dgnc/dgnc_driver.h: checkpatch: fixed lines  over 80 characters

 drivers/staging/dgnc/dgnc_cls.h    |  13 ++-
 drivers/staging/dgnc/dgnc_driver.h |  71 +++++++-----
 drivers/staging/dgnc/dgnc_neo.c    | 214 ++++++++++++++++++++++++++-----------
 drivers/staging/dgnc/dgnc_sysfs.c  |   4 +-
 drivers/staging/dgnc/dpacompat.h   |  15 +--
 5 files changed, 212 insertions(+), 105 deletions(-)

--

-- 
1.9.1
mathieu.poirier | 22 Dec 01:09 2014

[PATCH] staging: skein: Fixing various coding style problems

From: Mathieu Poirier <mathieu.poirier <at> linaro.org>

Fixing errors related to the usage of do {} while (0) loop
in single statement macros, trailing semicolon in macros and
trailing whitespace.

Signed-off-by: Mathieu Poirier <mathieu.poirier <at> linaro.org>
---
 drivers/staging/skein/skein_block.c   | 17 ++++-------------
 drivers/staging/skein/skein_generic.c |  1 -
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/skein/skein_block.c b/drivers/staging/skein/skein_block.c
index 66261ab25c88..43a342372633 100644
--- a/drivers/staging/skein/skein_block.c
+++ b/drivers/staging/skein/skein_block.c
 <at>  <at>  -82,10 +82,7  <at>  <at>  do {                                                                      \
 } while (0)
 #else
 /* looping version */
-#define R256(p0, p1, p2, p3, ROT, r_num) \
-do { \
-	ROUND256(p0, p1, p2, p3, ROT, r_num); \
-} while (0)
+#define R256(p0, p1, p2, p3, ROT, r_num) ROUND256(p0, p1, p2, p3, ROT, r_num)

 #define I256(R) \
 do { \
 <at>  <at>  -174,9 +171,7  <at>  <at>  do {                                                                      \

(Continue reading)

Rickard Strandqvist | 21 Dec 23:43 2014
Picon

[PATCH] staging: lustre: lustre: include: lustre_update.h: Fix for possible null pointer dereference

The NULL check was done to late, and there it was a risk
of a possible null pointer dereference.

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist <at> spectrumdigital.se>
---
 drivers/staging/lustre/lustre/include/lustre_update.h |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_update.h b/drivers/staging/lustre/lustre/include/lustre_update.h
index 84defce..00e1361 100644
--- a/drivers/staging/lustre/lustre/include/lustre_update.h
+++ b/drivers/staging/lustre/lustre/include/lustre_update.h
 <at>  <at>  -165,12 +165,14  <at>  <at>  static inline int update_get_reply_buf(struct update_reply *reply, void **buf,
 	int  result;

 	ptr = update_get_buf_internal(reply, index, &size);
+
+	LASSERT((ptr != NULL && size >= sizeof(int)));
+
 	result = *(int *)ptr;

 	if (result < 0)
 		return result;

-	LASSERT((ptr != NULL && size >= sizeof(int)));
 	*buf = ptr + sizeof(int);
 	return size - sizeof(int);
 }
(Continue reading)

Rickard Strandqvist | 21 Dec 23:43 2014
Picon

[PATCH] staging: line6: toneport.c: Fix for possible null pointer dereference

The NULL check was done to late, and there it was a risk
of a possible null pointer dereference.

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist <at> spectrumdigital.se>
---
 drivers/staging/line6/toneport.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c
index 6943715..660dc3f 100644
--- a/drivers/staging/line6/toneport.c
+++ b/drivers/staging/line6/toneport.c
 <at>  <at>  -433,12 +433,16  <at>  <at>  void line6_toneport_reset_resume(struct usb_line6_toneport *toneport)
 void line6_toneport_disconnect(struct usb_interface *interface)
 {
 	struct usb_line6_toneport *toneport;
+	struct snd_line6_pcm *line6pcm;
 	u16 idProduct;

 	if (interface == NULL)
 		return;

 	toneport = usb_get_intfdata(interface);
+	if (NULL == toneport)
+		return;
+
 	del_timer_sync(&toneport->timer);
 	idProduct = le16_to_cpu(toneport->line6.usbdev->descriptor.idProduct);
(Continue reading)

Rickard Strandqvist | 21 Dec 23:08 2014
Picon

[PATCH] staging: lustre: lustre: llite: llite_lib.c: Removes unnecessary NULL check

Removes same unnecessary NULL check.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist <at> spectrumdigital.se>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c |   12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 7b6b9e2..435e1ad 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
 <at>  <at>  -591,10 +591,8  <at>  <at>  static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
 		get_uuid2fsid(uuid->uuid, strlen(uuid->uuid), &sbi->ll_fsid);
 	}

-	if (data != NULL)
-		OBD_FREE_PTR(data);
-	if (osfs != NULL)
-		OBD_FREE_PTR(osfs);
+	OBD_FREE_PTR(data);
+	OBD_FREE_PTR(osfs);

 	return err;
 out_root:
 <at>  <at>  -612,10 +610,8  <at>  <at>  out_md:
 	obd_disconnect(sbi->ll_md_exp);
 	sbi->ll_md_exp = NULL;
 out:
-	if (data != NULL)
-		OBD_FREE_PTR(data);
(Continue reading)

Rickard Strandqvist | 21 Dec 19:42 2014
Picon

[PATCH] staging: lustre: lustre: obdclass: lprocfs_status.c: Tidied up some code in a case statement

Tidied up some code in a case statement after a discussion.

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist <at> spectrumdigital.se>
---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 61e04af..fd98ac0 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
 <at>  <at>  -45,6 +45,7  <at>  <at> 
 #include "../include/lprocfs_status.h"
 #include "../include/lustre/lustre_idl.h"
 #include <linux/seq_file.h>
+#include <linux/ctype.h>

 static const char * const obd_connect_names[] = {
 	"read_only",
 <at>  <at>  -1897,16 +1898,16  <at>  <at>  int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
 	}

 	units = 1;
-	switch (*end) {
-	case 'p': case 'P':
+	switch (tolower(*end)) {
+	case 'p':
 		units <<= 10;
(Continue reading)

Rickard Strandqvist | 21 Dec 19:30 2014
Picon

[PATCH] staging: lustre: lustre: obdclass: lprocfs_status.c: Removed an unnecessary NULL check

Removed an unnecessary NULL check.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist <at> spectrumdigital.se>
---
 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 61e04af..637b576 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
 <at>  <at>  -1882,7 +1882,7  <at>  <at>  int lprocfs_write_frac_u64_helper(const char *buffer, unsigned long count,
 	if (pbuf == end)
 		return -EINVAL;

-	if (end != NULL && *end == '.') {
+	if (*end == '.') {
 		int i;
 		pbuf = end + 1;

--

-- 
1.7.10.4
Rickard Strandqvist | 21 Dec 19:03 2014
Picon

[PATCH] staging: vt6655: srom.c: Remove some unused functions

Removes some functions that are not used anywhere:
SROMbAutoLoad() SROMvReadSubSysVenId() SROMvWriteEtherAddress()
SROMvWriteAllContents() SROMbIsRegBitsOff() SROMbIsRegBitsOn()
SROMvRegBitsOff() SROMvRegBitsOn()

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist <at> spectrumdigital.se>
---
 drivers/staging/vt6655/srom.c |  206 -----------------------------------------
 drivers/staging/vt6655/srom.h |   11 ---
 2 files changed, 217 deletions(-)

diff --git a/drivers/staging/vt6655/srom.c b/drivers/staging/vt6655/srom.c
index 5396e58..ba2a2d4 100644
--- a/drivers/staging/vt6655/srom.c
+++ b/drivers/staging/vt6655/srom.c
 <at>  <at>  -27,16 +27,8  <at>  <at> 
  * Functions:
  *      SROMbyReadEmbedded - Embedded read eeprom via MAC
  *      SROMbWriteEmbedded - Embedded write eeprom via MAC
- *      SROMvRegBitsOn - Set Bits On in eeprom
- *      SROMvRegBitsOff - Clear Bits Off in eeprom
- *      SROMbIsRegBitsOn - Test if Bits On in eeprom
- *      SROMbIsRegBitsOff - Test if Bits Off in eeprom
  *      SROMvReadAllContents - Read all contents in eeprom
- *      SROMvWriteAllContents - Write all contents in eeprom
  *      SROMvReadEtherAddress - Read Ethernet Address in eeprom
- *      SROMvWriteEtherAddress - Write Ethernet Address in eeprom
- *      SROMvReadSubSysVenId - Read Sub_VID and Sub_SysId in eeprom
(Continue reading)

Rickard Strandqvist | 21 Dec 18:53 2014
Picon

[PATCH] staging: rtl8192e: rtllib_rx.c: Remove some unused functions

Removes some functions that are not used anywhere:
update_ibss_network() rtllib_SignalStrengthTranslate()

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

Signed-off-by: Rickard Strandqvist <rickard_strandqvist <at> spectrumdigital.se>
---
 drivers/staging/rtl8192e/rtllib_rx.c |   35 ----------------------------------
 1 file changed, 35 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 1c2014f..418ef13 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
 <at>  <at>  -2211,34 +2211,6  <at>  <at>  int rtllib_parse_info_param(struct rtllib_device *ieee,
 	return 0;
 }

-static inline u8 rtllib_SignalStrengthTranslate(u8  CurrSS)
-{
-	u8 RetSS;
-
-	if (CurrSS >= 71 && CurrSS <= 100)
-		RetSS = 90 + ((CurrSS - 70) / 3);
-	else if (CurrSS >= 41 && CurrSS <= 70)
-		RetSS = 78 + ((CurrSS - 40) / 3);
-	else if (CurrSS >= 31 && CurrSS <= 40)
-		RetSS = 66 + (CurrSS - 30);
-	else if (CurrSS >= 21 && CurrSS <= 30)
-		RetSS = 54 + (CurrSS - 20);
(Continue reading)

Chris Rorvick | 21 Dec 18:04 2014

[PATCH v3 0/2] lprocfs_write_frac_u64_helper cleanup

Added Andreas as reviewer (thanks!)

v2:

Added a second patch to address Dan Carpenter's concern with the
complexity of passing the sign through `mult'.  Compile tested only.

Chris Rorvick (2):
  drivers: staging: lustre: Use mult if units not specified
  drivers: staging: lustre: Track sign separately

 drivers/staging/lustre/lustre/obdclass/lprocfs_status.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

--

-- 
2.1.0

Gmane