All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] staging: iio: light: fix multiple checkpatch issues
@ 2016-02-18  7:35 Eva Rachel Retuya
  2016-02-18  7:35 ` [PATCH 1/5] staging: iio: light: indent to match open parenthesis Eva Rachel Retuya
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Eva Rachel Retuya @ 2016-02-18  7:35 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Eva Rachel Retuya

Eliminate checkpatch checks and warnings in iio/light.

Eva Rachel Retuya (5):
  staging: iio: light: properly indent to match open parenthesis
  staging: iio: light: omit space after a cast
  staging: iio: light: fix block comments according to kernel coding
    style
  staging: iio: light: add space around '*"
  staging: iio: light: fix multiple assignments in a single line

 drivers/staging/iio/light/isl29018.c | 39 ++++++++-------
 drivers/staging/iio/light/isl29028.c | 27 ++++++-----
 drivers/staging/iio/light/tsl2583.c  | 92 ++++++++++++++++++++++--------------
 3 files changed, 96 insertions(+), 62 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/5] staging: iio: light: indent to match open parenthesis
  2016-02-18  7:35 [PATCH 0/5] staging: iio: light: fix multiple checkpatch issues Eva Rachel Retuya
@ 2016-02-18  7:35 ` Eva Rachel Retuya
  2016-02-28 13:28   ` [Outreachy kernel] " Tejun Heo
  2016-02-18  7:35 ` [PATCH 2/5] staging: iio: light: omit space after a cast Eva Rachel Retuya
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Eva Rachel Retuya @ 2016-02-18  7:35 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Eva Rachel Retuya

Indent the parameters to match open parenthesis as suggested by checkpatch.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
---
 drivers/staging/iio/light/isl29018.c | 25 +++++++++++---------
 drivers/staging/iio/light/isl29028.c | 27 ++++++++++++---------
 drivers/staging/iio/light/tsl2583.c  | 46 ++++++++++++++++++++++--------------
 3 files changed, 58 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 756057c..98038d7 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -183,7 +183,7 @@ static int isl29018_read_sensor_input(struct isl29018_chip *chip, int mode)
 
 	/* Set mode */
 	status = regmap_write(chip->regmap, ISL29018_REG_ADD_COMMAND1,
-			mode << COMMMAND1_OPMODE_SHIFT);
+			      mode << COMMMAND1_OPMODE_SHIFT);
 	if (status) {
 		dev_err(chip->dev,
 			"Error in setting operating mode err %d\n", status);
@@ -241,7 +241,7 @@ static int isl29018_read_ir(struct isl29018_chip *chip, int *ir)
 }
 
 static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme,
-		int *near_ir)
+				      int *near_ir)
 {
 	int status;
 	int prox_data = -1;
@@ -249,15 +249,15 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme,
 
 	/* Do proximity sensing with required scheme */
 	status = regmap_update_bits(chip->regmap, ISL29018_REG_ADD_COMMANDII,
-			COMMANDII_SCHEME_MASK,
-			scheme << COMMANDII_SCHEME_SHIFT);
+				    COMMANDII_SCHEME_MASK,
+				    scheme << COMMANDII_SCHEME_SHIFT);
 	if (status) {
 		dev_err(chip->dev, "Error in setting operating mode\n");
 		return status;
 	}
 
 	prox_data = isl29018_read_sensor_input(chip,
-					COMMMAND1_OPMODE_PROX_ONCE);
+					       COMMMAND1_OPMODE_PROX_ONCE);
 	if (prox_data < 0)
 		return prox_data;
 
@@ -280,7 +280,7 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme,
 }
 
 static ssize_t show_scale_available(struct device *dev,
-			struct device_attribute *attr, char *buf)
+				    struct device_attribute *attr, char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct isl29018_chip *chip = iio_priv(indio_dev);
@@ -297,7 +297,7 @@ static ssize_t show_scale_available(struct device *dev,
 }
 
 static ssize_t show_int_time_available(struct device *dev,
-			struct device_attribute *attr, char *buf)
+				       struct device_attribute *attr, char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct isl29018_chip *chip = iio_priv(indio_dev);
@@ -314,7 +314,8 @@ static ssize_t show_int_time_available(struct device *dev,
 
 /* proximity scheme */
 static ssize_t show_prox_infrared_suppression(struct device *dev,
-			struct device_attribute *attr, char *buf)
+					      struct device_attribute *attr,
+					      char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct isl29018_chip *chip = iio_priv(indio_dev);
@@ -325,7 +326,8 @@ static ssize_t show_prox_infrared_suppression(struct device *dev,
 }
 
 static ssize_t store_prox_infrared_suppression(struct device *dev,
-		struct device_attribute *attr, const char *buf, size_t count)
+					       struct device_attribute *attr,
+					       const char *buf, size_t count)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct isl29018_chip *chip = iio_priv(indio_dev);
@@ -413,7 +415,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
 			break;
 		case IIO_PROXIMITY:
 			ret = isl29018_read_proximity_ir(chip,
-					chip->prox_scheme, val);
+							 chip->prox_scheme,
+							 val);
 			break;
 		default:
 			break;
@@ -705,7 +708,7 @@ static const char *isl29018_match_acpi_device(struct device *dev, int *data)
 }
 
 static int isl29018_probe(struct i2c_client *client,
-			 const struct i2c_device_id *id)
+			  const struct i2c_device_id *id)
 {
 	struct isl29018_chip *chip;
 	struct iio_dev *indio_dev;
diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
index e1bca9c..6e2ba45 100644
--- a/drivers/staging/iio/light/isl29028.c
+++ b/drivers/staging/iio/light/isl29028.c
@@ -81,7 +81,7 @@ struct isl29028_chip {
 };
 
 static int isl29028_set_proxim_sampling(struct isl29028_chip *chip,
-			unsigned int sampling)
+					unsigned int sampling)
 {
 	static unsigned int prox_period[] = {800, 400, 200, 100, 75, 50, 12, 0};
 	int sel;
@@ -103,7 +103,7 @@ static int isl29028_enable_proximity(struct isl29028_chip *chip, bool enable)
 	if (enable)
 		val = CONFIGURE_PROX_EN;
 	ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
-			CONFIGURE_PROX_EN_MASK, val);
+				 CONFIGURE_PROX_EN_MASK, val);
 	if (ret < 0)
 		return ret;
 
@@ -122,24 +122,27 @@ static int isl29028_set_als_scale(struct isl29028_chip *chip, int lux_scale)
 }
 
 static int isl29028_set_als_ir_mode(struct isl29028_chip *chip,
-	enum als_ir_mode mode)
+				    enum als_ir_mode mode)
 {
 	int ret = 0;
 
 	switch (mode) {
 	case MODE_ALS:
 		ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
-			CONFIGURE_ALS_IR_MODE_MASK, CONFIGURE_ALS_IR_MODE_ALS);
+					 CONFIGURE_ALS_IR_MODE_MASK,
+					 CONFIGURE_ALS_IR_MODE_ALS);
 		if (ret < 0)
 			return ret;
 
 		ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
-			CONFIGURE_ALS_RANGE_MASK, CONFIGURE_ALS_RANGE_HIGH_LUX);
+					 CONFIGURE_ALS_RANGE_MASK,
+					 CONFIGURE_ALS_RANGE_HIGH_LUX);
 		break;
 
 	case MODE_IR:
 		ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
-			CONFIGURE_ALS_IR_MODE_MASK, CONFIGURE_ALS_IR_MODE_IR);
+					 CONFIGURE_ALS_IR_MODE_MASK,
+					 CONFIGURE_ALS_IR_MODE_IR);
 		break;
 
 	case MODE_NONE:
@@ -152,7 +155,7 @@ static int isl29028_set_als_ir_mode(struct isl29028_chip *chip,
 
 	/* Enable the ALS/IR */
 	ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
-			CONFIGURE_ALS_EN_MASK, CONFIGURE_ALS_EN);
+				 CONFIGURE_ALS_EN_MASK, CONFIGURE_ALS_EN);
 	if (ret < 0)
 		return ret;
 
@@ -193,7 +196,7 @@ static int isl29028_read_proxim(struct isl29028_chip *chip, int *prox)
 	ret = regmap_read(chip->regmap, ISL29028_REG_PROX_DATA, &data);
 	if (ret < 0) {
 		dev_err(chip->dev, "Error in reading register %d, error %d\n",
-				ISL29028_REG_PROX_DATA, ret);
+			ISL29028_REG_PROX_DATA, ret);
 		return ret;
 	}
 	*prox = data;
@@ -264,7 +267,8 @@ static int isl29028_ir_get(struct isl29028_chip *chip, int *ir_data)
 
 /* Channel IO */
 static int isl29028_write_raw(struct iio_dev *indio_dev,
-	     struct iio_chan_spec const *chan, int val, int val2, long mask)
+			      struct iio_chan_spec const *chan,
+			      int val, int val2, long mask)
 {
 	struct isl29028_chip *chip = iio_priv(indio_dev);
 	int ret = -EINVAL;
@@ -323,7 +327,8 @@ static int isl29028_write_raw(struct iio_dev *indio_dev,
 }
 
 static int isl29028_read_raw(struct iio_dev *indio_dev,
-	     struct iio_chan_spec const *chan, int *val, int *val2, long mask)
+			     struct iio_chan_spec const *chan,
+			     int *val, int *val2, long mask)
 {
 	struct isl29028_chip *chip = iio_priv(indio_dev);
 	int ret = -EINVAL;
@@ -476,7 +481,7 @@ static const struct regmap_config isl29028_regmap_config = {
 };
 
 static int isl29028_probe(struct i2c_client *client,
-	const struct i2c_device_id *id)
+			  const struct i2c_device_id *id)
 {
 	struct isl29028_chip *chip;
 	struct iio_dev *indio_dev;
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 3100d96..1aae05a 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -482,7 +482,7 @@ static int taos_chip_off(struct iio_dev *indio_dev)
 /* Sysfs Interface Functions */
 
 static ssize_t taos_power_state_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+				     struct device_attribute *attr, char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -491,7 +491,8 @@ static ssize_t taos_power_state_show(struct device *dev,
 }
 
 static ssize_t taos_power_state_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t len)
+				      struct device_attribute *attr,
+				      const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	int value;
@@ -508,7 +509,7 @@ static ssize_t taos_power_state_store(struct device *dev,
 }
 
 static ssize_t taos_gain_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+			      struct device_attribute *attr, char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -533,7 +534,8 @@ static ssize_t taos_gain_show(struct device *dev,
 }
 
 static ssize_t taos_gain_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t len)
+			       struct device_attribute *attr,
+			       const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -564,13 +566,14 @@ static ssize_t taos_gain_store(struct device *dev,
 }
 
 static ssize_t taos_gain_available_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+					struct device_attribute *attr,
+					char *buf)
 {
 	return sprintf(buf, "%s\n", "1 8 16 111");
 }
 
 static ssize_t taos_als_time_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+				  struct device_attribute *attr, char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -579,7 +582,8 @@ static ssize_t taos_als_time_show(struct device *dev,
 }
 
 static ssize_t taos_als_time_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t len)
+				   struct device_attribute *attr,
+				   const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -600,14 +604,15 @@ static ssize_t taos_als_time_store(struct device *dev,
 }
 
 static ssize_t taos_als_time_available_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+					    struct device_attribute *attr,
+					    char *buf)
 {
 	return sprintf(buf, "%s\n",
 		"50 100 150 200 250 300 350 400 450 500 550 600 650");
 }
 
 static ssize_t taos_als_trim_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+				  struct device_attribute *attr, char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -616,7 +621,8 @@ static ssize_t taos_als_trim_show(struct device *dev,
 }
 
 static ssize_t taos_als_trim_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t len)
+				   struct device_attribute *attr,
+				   const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -632,7 +638,8 @@ static ssize_t taos_als_trim_store(struct device *dev,
 }
 
 static ssize_t taos_als_cal_target_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+					struct device_attribute *attr,
+					char *buf)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -641,7 +648,8 @@ static ssize_t taos_als_cal_target_show(struct device *dev,
 }
 
 static ssize_t taos_als_cal_target_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t len)
+					 struct device_attribute *attr,
+					 const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -657,7 +665,7 @@ static ssize_t taos_als_cal_target_store(struct device *dev,
 }
 
 static ssize_t taos_lux_show(struct device *dev, struct device_attribute *attr,
-	char *buf)
+			     char *buf)
 {
 	int ret;
 
@@ -669,7 +677,8 @@ static ssize_t taos_lux_show(struct device *dev, struct device_attribute *attr,
 }
 
 static ssize_t taos_do_calibrate(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t len)
+				 struct device_attribute *attr,
+				 const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	int value;
@@ -684,7 +693,7 @@ static ssize_t taos_do_calibrate(struct device *dev,
 }
 
 static ssize_t taos_luxtable_show(struct device *dev,
-	struct device_attribute *attr, char *buf)
+				  struct device_attribute *attr, char *buf)
 {
 	int i;
 	int offset = 0;
@@ -707,7 +716,8 @@ static ssize_t taos_luxtable_show(struct device *dev,
 }
 
 static ssize_t taos_luxtable_store(struct device *dev,
-	struct device_attribute *attr, const char *buf, size_t len)
+				   struct device_attribute *attr,
+				   const char *buf, size_t len)
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
@@ -809,7 +819,7 @@ static int taos_probe(struct i2c_client *clientp,
 	struct iio_dev *indio_dev;
 
 	if (!i2c_check_functionality(clientp->adapter,
-		I2C_FUNC_SMBUS_BYTE_DATA)) {
+				     I2C_FUNC_SMBUS_BYTE_DATA)) {
 		dev_err(&clientp->dev, "taos_probe() - i2c smbus byte data func unsupported\n");
 		return -EOPNOTSUPP;
 	}
@@ -846,7 +856,7 @@ static int taos_probe(struct i2c_client *clientp,
 
 	if (!taos_tsl258x_device(buf)) {
 		dev_info(&clientp->dev,
-			"i2c device found but does not match expected id in taos_probe()\n");
+			 "i2c device found but does not match expected id in taos_probe()\n");
 		return -EINVAL;
 	}
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/5] staging: iio: light: omit space after a cast
  2016-02-18  7:35 [PATCH 0/5] staging: iio: light: fix multiple checkpatch issues Eva Rachel Retuya
  2016-02-18  7:35 ` [PATCH 1/5] staging: iio: light: indent to match open parenthesis Eva Rachel Retuya
@ 2016-02-18  7:35 ` Eva Rachel Retuya
  2016-02-28 13:29   ` [Outreachy kernel] " Tejun Heo
  2016-02-18  7:35 ` [PATCH 3/5] staging: iio: light: fix block comments according to kernel coding style Eva Rachel Retuya
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Eva Rachel Retuya @ 2016-02-18  7:35 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Eva Rachel Retuya

Remove the unneeded space as pointed out by checkpatch:
CHECK: No space is necessary after a cast

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
---
 drivers/staging/iio/light/isl29018.c | 2 +-
 drivers/staging/iio/light/tsl2583.c  | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 98038d7..6c9d943 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -702,7 +702,7 @@ static const char *isl29018_match_acpi_device(struct device *dev, int *data)
 	if (!id)
 		return NULL;
 
-	*data = (int) id->driver_data;
+	*data = (int)id->driver_data;
 
 	return dev_name(dev);
 }
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 1aae05a..625a11c 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -271,7 +271,7 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 	/* calculate ratio */
 	ratio = (ch1 << 15) / ch0;
 	/* convert to unscaled lux using the pointer to the table */
-	for (p = (struct taos_lux *) taos_device_lux;
+	for (p = (struct taos_lux *)taos_device_lux;
 	     p->ratio != 0 && p->ratio < ratio; p++)
 		;
 
@@ -378,7 +378,7 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
 		dev_err(&chip->client->dev, "taos_als_calibrate failed to get lux\n");
 		return lux_val;
 	}
-	gain_trim_val = (unsigned int) (((chip->taos_settings.als_cal_target)
+	gain_trim_val = (unsigned int)(((chip->taos_settings.als_cal_target)
 			* chip->taos_settings.als_gain_trim) / lux_val);
 
 	if ((gain_trim_val < 250) || (gain_trim_val > 4000)) {
@@ -387,9 +387,9 @@ static int taos_als_calibrate(struct iio_dev *indio_dev)
 			gain_trim_val);
 		return -ENODATA;
 	}
-	chip->taos_settings.als_gain_trim = (int) gain_trim_val;
+	chip->taos_settings.als_gain_trim = (int)gain_trim_val;
 
-	return (int) gain_trim_val;
+	return (int)gain_trim_val;
 }
 
 /*
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/5] staging: iio: light: fix block comments according to kernel coding style
  2016-02-18  7:35 [PATCH 0/5] staging: iio: light: fix multiple checkpatch issues Eva Rachel Retuya
  2016-02-18  7:35 ` [PATCH 1/5] staging: iio: light: indent to match open parenthesis Eva Rachel Retuya
  2016-02-18  7:35 ` [PATCH 2/5] staging: iio: light: omit space after a cast Eva Rachel Retuya
@ 2016-02-18  7:35 ` Eva Rachel Retuya
  2016-02-28 13:32   ` [Outreachy kernel] " Tejun Heo
  2016-02-18  7:35 ` [PATCH 4/5] staging: iio: light: add space around '*" Eva Rachel Retuya
  2016-02-18  7:35 ` [PATCH 5/5] staging: iio: light: fix multiple assignments in a single line Eva Rachel Retuya
  4 siblings, 1 reply; 11+ messages in thread
From: Eva Rachel Retuya @ 2016-02-18  7:35 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Eva Rachel Retuya

Add the trailing */ accordingly to suit the preferred way of placing
block comments.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
---
 drivers/staging/iio/light/isl29018.c | 12 ++++++++----
 drivers/staging/iio/light/tsl2583.c  | 30 ++++++++++++++++++++----------
 2 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
index 6c9d943..03dbfb6 100644
--- a/drivers/staging/iio/light/isl29018.c
+++ b/drivers/staging/iio/light/isl29018.c
@@ -320,8 +320,10 @@ static ssize_t show_prox_infrared_suppression(struct device *dev,
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct isl29018_chip *chip = iio_priv(indio_dev);
 
-	/* return the "proximity scheme" i.e. if the chip does on chip
-	infrared suppression (1 means perform on chip suppression) */
+	/*
+	 * return the "proximity scheme" i.e. if the chip does on chip
+	 * infrared suppression (1 means perform on chip suppression)
+	 */
 	return sprintf(buf, "%d\n", chip->prox_scheme);
 }
 
@@ -340,8 +342,10 @@ static ssize_t store_prox_infrared_suppression(struct device *dev,
 		return -EINVAL;
 	}
 
-	/* get the  "proximity scheme" i.e. if the chip does on chip
-	infrared suppression (1 means perform on chip suppression) */
+	/*
+	 * get the  "proximity scheme" i.e. if the chip does on chip
+	 * infrared suppression (1 means perform on chip suppression)
+	 */
 	mutex_lock(&chip->lock);
 	chip->prox_scheme = val;
 	mutex_unlock(&chip->lock);
diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 625a11c..5fc4110 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -240,8 +240,10 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 		}
 	}
 
-	/* clear status, really interrupt status (interrupts are off), but
-	 * we use the bit anyway - don't forget 0x80 - this is a command*/
+	/*
+	 * clear status, really interrupt status (interrupts are off), but
+	 * we use the bit anyway - don't forget 0x80 - this is a command
+	 */
 	ret = i2c_smbus_write_byte(chip->client,
 				   (TSL258X_CMD_REG | TSL258X_CMD_SPL_FN |
 				    TSL258X_CMD_ALS_INT_CLR));
@@ -429,8 +431,10 @@ static int taos_chip_on(struct iio_dev *indio_dev)
 	chip->als_saturation = als_count * 922; /* 90% of full scale */
 	chip->als_time_scale = (als_time + 25) / 50;
 
-	/* TSL258x Specific power-on / adc enable sequence
-	 * Power on the device 1st. */
+	/*
+	 * TSL258x Specific power-on / adc enable sequence
+	 * Power on the device 1st.
+	 */
 	utmp = TSL258X_CNTL_PWR_ON;
 	ret = i2c_smbus_write_byte_data(chip->client,
 					TSL258X_CMD_REG | TSL258X_CNTRL, utmp);
@@ -439,8 +443,10 @@ static int taos_chip_on(struct iio_dev *indio_dev)
 		return ret;
 	}
 
-	/* Use the following shadow copy for our delay before enabling ADC.
-	 * Write all the registers. */
+	/*
+	 * Use the following shadow copy for our delay before enabling ADC.
+	 * Write all the registers.
+	 */
 	for (i = 0, uP = chip->taos_config; i < TSL258X_REG_MAX; i++) {
 		ret = i2c_smbus_write_byte_data(chip->client,
 						TSL258X_CMD_REG + i,
@@ -453,8 +459,10 @@ static int taos_chip_on(struct iio_dev *indio_dev)
 	}
 
 	usleep_range(3000, 3500);
-	/* NOW enable the ADC
-	 * initialize the desired mode of operation */
+	/*
+	 * NOW enable the ADC
+	 * initialize the desired mode of operation
+	 */
 	utmp = TSL258X_CNTL_PWR_ON | TSL258X_CNTL_ADC_ENBL;
 	ret = i2c_smbus_write_byte_data(chip->client,
 					TSL258X_CMD_REG | TSL258X_CNTRL,
@@ -704,8 +712,10 @@ static ssize_t taos_luxtable_show(struct device *dev,
 				  taos_device_lux[i].ch0,
 				  taos_device_lux[i].ch1);
 		if (taos_device_lux[i].ratio == 0) {
-			/* We just printed the first "0" entry.
-			 * Now get rid of the extra "," and break. */
+			/*
+			 * We just printed the first "0" entry.
+			 * Now get rid of the extra "," and break.
+			 */
 			offset--;
 			break;
 		}
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/5] staging: iio: light: add space around '*"
  2016-02-18  7:35 [PATCH 0/5] staging: iio: light: fix multiple checkpatch issues Eva Rachel Retuya
                   ` (2 preceding siblings ...)
  2016-02-18  7:35 ` [PATCH 3/5] staging: iio: light: fix block comments according to kernel coding style Eva Rachel Retuya
@ 2016-02-18  7:35 ` Eva Rachel Retuya
  2016-02-28 13:33   ` [Outreachy kernel] " Tejun Heo
  2016-02-18  7:35 ` [PATCH 5/5] staging: iio: light: fix multiple assignments in a single line Eva Rachel Retuya
  4 siblings, 1 reply; 11+ messages in thread
From: Eva Rachel Retuya @ 2016-02-18  7:35 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Eva Rachel Retuya

Address checkpatch check pointing out the lack of space around the
operator '*'.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
---
 drivers/staging/iio/light/tsl2583.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index 5fc4110..e970b3f 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -731,7 +731,7 @@ static ssize_t taos_luxtable_store(struct device *dev,
 {
 	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 	struct tsl2583_chip *chip = iio_priv(indio_dev);
-	int value[ARRAY_SIZE(taos_device_lux)*3 + 1];
+	int value[ARRAY_SIZE(taos_device_lux) * 3 + 1];
 	int n;
 
 	get_options(buf, ARRAY_SIZE(value), value);
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 5/5] staging: iio: light: fix multiple assignments in a single line
  2016-02-18  7:35 [PATCH 0/5] staging: iio: light: fix multiple checkpatch issues Eva Rachel Retuya
                   ` (3 preceding siblings ...)
  2016-02-18  7:35 ` [PATCH 4/5] staging: iio: light: add space around '*" Eva Rachel Retuya
@ 2016-02-18  7:35 ` Eva Rachel Retuya
  2016-02-28 13:33   ` [Outreachy kernel] " Tejun Heo
  4 siblings, 1 reply; 11+ messages in thread
From: Eva Rachel Retuya @ 2016-02-18  7:35 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: Eva Rachel Retuya

Rewrite the multiple assignments to clear checkpatch check:

CHECK: multiple assignments should be avoided

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
---
 drivers/staging/iio/light/tsl2583.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/light/tsl2583.c b/drivers/staging/iio/light/tsl2583.c
index e970b3f..05b4ad4 100644
--- a/drivers/staging/iio/light/tsl2583.c
+++ b/drivers/staging/iio/light/tsl2583.c
@@ -267,7 +267,8 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 
 	if (!ch0) {
 		/* have no data, so return LAST VALUE */
-		ret = chip->als_cur_info.lux = 0;
+		ret = 0;
+		chip->als_cur_info.lux = 0;
 		goto out_unlock;
 	}
 	/* calculate ratio */
@@ -292,7 +293,8 @@ static int taos_get_lux(struct iio_dev *indio_dev)
 	/* note: lux is 31 bit max at this point */
 	if (ch1lux > ch0lux) {
 		dev_dbg(&chip->client->dev, "No Data - Return last value\n");
-		ret = chip->als_cur_info.lux = 0;
+		ret = 0;
+		chip->als_cur_info.lux = 0;
 		goto out_unlock;
 	}
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Outreachy kernel] [PATCH 1/5] staging: iio: light: indent to match open parenthesis
  2016-02-18  7:35 ` [PATCH 1/5] staging: iio: light: indent to match open parenthesis Eva Rachel Retuya
@ 2016-02-28 13:28   ` Tejun Heo
  0 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2016-02-28 13:28 UTC (permalink / raw)
  To: Eva Rachel Retuya; +Cc: outreachy-kernel

Hello,

On Thu, Feb 18, 2016 at 03:35:36PM +0800, Eva Rachel Retuya wrote:
> Indent the parameters to match open parenthesis as suggested by checkpatch.
> 
> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Outreachy kernel] [PATCH 2/5] staging: iio: light: omit space after a cast
  2016-02-18  7:35 ` [PATCH 2/5] staging: iio: light: omit space after a cast Eva Rachel Retuya
@ 2016-02-28 13:29   ` Tejun Heo
  0 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2016-02-28 13:29 UTC (permalink / raw)
  To: Eva Rachel Retuya; +Cc: outreachy-kernel

On Thu, Feb 18, 2016 at 03:35:37PM +0800, Eva Rachel Retuya wrote:
> Remove the unneeded space as pointed out by checkpatch:
> CHECK: No space is necessary after a cast
> 
> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Outreachy kernel] [PATCH 3/5] staging: iio: light: fix block comments according to kernel coding style
  2016-02-18  7:35 ` [PATCH 3/5] staging: iio: light: fix block comments according to kernel coding style Eva Rachel Retuya
@ 2016-02-28 13:32   ` Tejun Heo
  0 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2016-02-28 13:32 UTC (permalink / raw)
  To: Eva Rachel Retuya; +Cc: outreachy-kernel

Hello,

On Thu, Feb 18, 2016 at 03:35:38PM +0800, Eva Rachel Retuya wrote:
> diff --git a/drivers/staging/iio/light/isl29018.c b/drivers/staging/iio/light/isl29018.c
> index 6c9d943..03dbfb6 100644
> --- a/drivers/staging/iio/light/isl29018.c
> +++ b/drivers/staging/iio/light/isl29018.c
> @@ -320,8 +320,10 @@ static ssize_t show_prox_infrared_suppression(struct device *dev,
>  	struct iio_dev *indio_dev = dev_to_iio_dev(dev);
>  	struct isl29018_chip *chip = iio_priv(indio_dev);
>  
> -	/* return the "proximity scheme" i.e. if the chip does on chip
> -	infrared suppression (1 means perform on chip suppression) */
> +	/*
> +	 * return the "proximity scheme" i.e. if the chip does on chip
> +	 * infrared suppression (1 means perform on chip suppression)
> +	 */

Can you please make these proper sentences by capitalizing the first
character and adding a period at the end?  Also, it often is nice to
reflow the comments so that it fits to, say, 75 column.

Thanks.

-- 
tejun


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Outreachy kernel] [PATCH 4/5] staging: iio: light: add space around '*"
  2016-02-18  7:35 ` [PATCH 4/5] staging: iio: light: add space around '*" Eva Rachel Retuya
@ 2016-02-28 13:33   ` Tejun Heo
  0 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2016-02-28 13:33 UTC (permalink / raw)
  To: Eva Rachel Retuya; +Cc: outreachy-kernel

On Thu, Feb 18, 2016 at 03:35:39PM +0800, Eva Rachel Retuya wrote:
> Address checkpatch check pointing out the lack of space around the
> operator '*'.
> 
> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Outreachy kernel] [PATCH 5/5] staging: iio: light: fix multiple assignments in a single line
  2016-02-18  7:35 ` [PATCH 5/5] staging: iio: light: fix multiple assignments in a single line Eva Rachel Retuya
@ 2016-02-28 13:33   ` Tejun Heo
  0 siblings, 0 replies; 11+ messages in thread
From: Tejun Heo @ 2016-02-28 13:33 UTC (permalink / raw)
  To: Eva Rachel Retuya; +Cc: outreachy-kernel

On Thu, Feb 18, 2016 at 03:35:40PM +0800, Eva Rachel Retuya wrote:
> Rewrite the multiple assignments to clear checkpatch check:
> 
> CHECK: multiple assignments should be avoided
> 
> Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-02-28 13:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-18  7:35 [PATCH 0/5] staging: iio: light: fix multiple checkpatch issues Eva Rachel Retuya
2016-02-18  7:35 ` [PATCH 1/5] staging: iio: light: indent to match open parenthesis Eva Rachel Retuya
2016-02-28 13:28   ` [Outreachy kernel] " Tejun Heo
2016-02-18  7:35 ` [PATCH 2/5] staging: iio: light: omit space after a cast Eva Rachel Retuya
2016-02-28 13:29   ` [Outreachy kernel] " Tejun Heo
2016-02-18  7:35 ` [PATCH 3/5] staging: iio: light: fix block comments according to kernel coding style Eva Rachel Retuya
2016-02-28 13:32   ` [Outreachy kernel] " Tejun Heo
2016-02-18  7:35 ` [PATCH 4/5] staging: iio: light: add space around '*" Eva Rachel Retuya
2016-02-28 13:33   ` [Outreachy kernel] " Tejun Heo
2016-02-18  7:35 ` [PATCH 5/5] staging: iio: light: fix multiple assignments in a single line Eva Rachel Retuya
2016-02-28 13:33   ` [Outreachy kernel] " Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.