All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Cleanup in staging pi433 driver
@ 2018-02-20  0:47 Eisha Chen-yen-su
  2018-02-20  0:47 ` [PATCH 1/2] staging: pi433: Split some function calls Eisha Chen-yen-su
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eisha Chen-yen-su @ 2018-02-20  0:47 UTC (permalink / raw)
  To: outreachy-kernel, gregkh; +Cc: Eisha Chen-yen-su

Do some code cleanup in order to reduce the quantity of lines
exceeding 80 columns. Problem found with checkpatch.

Eisha Chen-yen-su (2):
  staging: pi433: Split some function calls
  staging: pi433: Split subtraction across 2 lines

 drivers/staging/pi433/pi433_if.c | 48 ++++++++++++++++++++++++++--------------
 1 file changed, 32 insertions(+), 16 deletions(-)

--
2.14.3


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

* [PATCH 1/2] staging: pi433: Split some function calls
  2018-02-20  0:47 [PATCH 0/2] Cleanup in staging pi433 driver Eisha Chen-yen-su
@ 2018-02-20  0:47 ` Eisha Chen-yen-su
  2018-02-20  0:47 ` [PATCH 2/2] staging: pi433: Split subtraction across 2 lines Eisha Chen-yen-su
  2018-02-20  6:39 ` [Outreachy kernel] [PATCH 0/2] Cleanup in staging pi433 driver Julia Lawall
  2 siblings, 0 replies; 4+ messages in thread
From: Eisha Chen-yen-su @ 2018-02-20  0:47 UTC (permalink / raw)
  To: outreachy-kernel, gregkh; +Cc: Eisha Chen-yen-su

Split some function calls on several lines in order to make these
lines no longer than 80 columns. Problem found with checkpatch.

Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com>
---
 drivers/staging/pi433/pi433_if.c | 45 ++++++++++++++++++++++++++--------------
 1 file changed, 30 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 14712e1bd5eb..4a8e633a0a1d 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -187,10 +187,12 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)
 	ret = rf69_set_ook_threshold_dec(dev->spi, rx_cfg->threshold_decrement);
 	if (ret < 0)
 		return ret;
-	ret = rf69_set_bandwidth(dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent);
+	ret = rf69_set_bandwidth(dev->spi, rx_cfg->bw_mantisse,
+				 rx_cfg->bw_exponent);
 	if (ret < 0)
 		return ret;
-	ret = rf69_set_bandwidth_during_afc(dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent);
+	ret = rf69_set_bandwidth_during_afc(dev->spi, rx_cfg->bw_mantisse,
+					    rx_cfg->bw_exponent);
 	if (ret < 0)
 		return ret;
 	ret = rf69_set_dagc(dev->spi, rx_cfg->dagc);
@@ -206,7 +208,8 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)
 		if (ret < 0)
 			return ret;
 
-		ret = rf69_set_fifo_fill_condition(dev->spi, afterSyncInterrupt);
+		ret = rf69_set_fifo_fill_condition(dev->spi,
+						   afterSyncInterrupt);
 		if (ret < 0)
 			return ret;
 	} else {
@@ -227,7 +230,8 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)
 		if (ret < 0)
 			return ret;
 	}
-	ret = rf69_set_adressFiltering(dev->spi, rx_cfg->enable_address_filtering);
+	ret = rf69_set_adressFiltering(dev->spi,
+				       rx_cfg->enable_address_filtering);
 	if (ret < 0)
 		return ret;
 
@@ -274,7 +278,8 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)
 		ret = rf69_set_node_address(dev->spi, rx_cfg->node_address);
 		if (ret < 0)
 			return ret;
-		ret = rf69_set_broadcast_address(dev->spi, rx_cfg->broadcast_address);
+		ret = rf69_set_broadcast_address(dev->spi,
+						 rx_cfg->broadcast_address);
 		if (ret < 0)
 			return ret;
 	}
@@ -311,7 +316,8 @@ rf69_set_tx_cfg(struct pi433_device *dev, struct pi433_tx_cfg *tx_cfg)
 
 	/* packet format enable */
 	if (tx_cfg->enable_preamble == OPTION_ON) {
-		ret = rf69_set_preamble_length(dev->spi, tx_cfg->preamble_length);
+		ret = rf69_set_preamble_length(dev->spi,
+					       tx_cfg->preamble_length);
 		if (ret < 0)
 			return ret;
 	} else {
@@ -470,10 +476,12 @@ pi433_receive(void *data)
 			goto abort;
 		}
 		bytes_total = dev->rx_cfg.fixed_message_length;
-		dev_dbg(dev->dev, "rx: msg len set to %d by fixed length", bytes_total);
+		dev_dbg(dev->dev, "rx: msg len set to %d by fixed length",
+			bytes_total);
 	} else {
 		bytes_total = dev->rx_buffer_size;
-		dev_dbg(dev->dev, "rx: msg len set to %d as requested by read", bytes_total);
+		dev_dbg(dev->dev, "rx: msg len set to %d as requested by read",
+			bytes_total);
 	}
 
 	/* length byte enabled? */
@@ -489,7 +497,8 @@ pi433_receive(void *data)
 			goto abort;
 		}
 		dev->free_in_fifo++;
-		dev_dbg(dev->dev, "rx: msg len reset to %d due to length byte", bytes_total);
+		dev_dbg(dev->dev, "rx: msg len reset to %d due to length byte",
+			bytes_total);
 	}
 
 	/* address byte enabled? */
@@ -620,8 +629,10 @@ pi433_tx_thread(void *data)
 			device->buffer[position++] = tx_cfg.address_byte;
 
 		/* finally get message data from fifo */
-		retval = kfifo_out(&device->tx_fifo, &device->buffer[position], sizeof(device->buffer) - position);
-		dev_dbg(device->dev, "read %d message byte(s) from fifo queue.", retval);
+		retval = kfifo_out(&device->tx_fifo, &device->buffer[position],
+				   sizeof(device->buffer) - position);
+		dev_dbg(device->dev,
+			"read %d message byte(s) from fifo queue.", retval);
 		mutex_unlock(&device->tx_fifo_lock);
 
 		/* if rx is active, we need to interrupt the waiting for
@@ -724,7 +735,8 @@ pi433_tx_thread(void *data)
 		}
 
 		/* we are done. Wait for packet to get sent */
-		dev_dbg(device->dev, "thread: wait for packet to get sent/fifo to be empty");
+		dev_dbg(device->dev,
+			"thread: wait for packet to get sent/fifo to be empty");
 		wait_event_interruptible(device->fifo_wait_queue,
 					 device->free_in_fifo == FIFO_SIZE ||
 					 kthread_should_stop());
@@ -819,7 +831,8 @@ pi433_write(struct file *filp, const char __user *buf,
 	 * - message
 	 */
 	mutex_lock(&device->tx_fifo_lock);
-	retval = kfifo_in(&device->tx_fifo, &instance->tx_cfg, sizeof(instance->tx_cfg));
+	retval = kfifo_in(&device->tx_fifo, &instance->tx_cfg,
+			  sizeof(instance->tx_cfg));
 	if (retval != sizeof(instance->tx_cfg))
 		goto abort;
 
@@ -996,10 +1009,12 @@ static int setup_GPIOs(struct pi433_device *device)
 	for (i = 0; i < NUM_DIO; i++) {
 		/* "construct" name and get the gpio descriptor */
 		snprintf(name, sizeof(name), "DIO%d", i);
-		device->gpiod[i] = gpiod_get(&device->spi->dev, name, 0 /*GPIOD_IN*/);
+		device->gpiod[i] = gpiod_get(&device->spi->dev, name,
+					     0 /*GPIOD_IN*/);
 
 		if (device->gpiod[i] == ERR_PTR(-ENOENT)) {
-			dev_dbg(&device->spi->dev, "Could not find entry for %s. Ignoring.", name);
+			dev_dbg(&device->spi->dev,
+				"Could not find entry for %s. Ignoring.", name);
 			continue;
 		}
 
-- 
2.14.3



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

* [PATCH 2/2] staging: pi433: Split subtraction across 2 lines
  2018-02-20  0:47 [PATCH 0/2] Cleanup in staging pi433 driver Eisha Chen-yen-su
  2018-02-20  0:47 ` [PATCH 1/2] staging: pi433: Split some function calls Eisha Chen-yen-su
@ 2018-02-20  0:47 ` Eisha Chen-yen-su
  2018-02-20  6:39 ` [Outreachy kernel] [PATCH 0/2] Cleanup in staging pi433 driver Julia Lawall
  2 siblings, 0 replies; 4+ messages in thread
From: Eisha Chen-yen-su @ 2018-02-20  0:47 UTC (permalink / raw)
  To: outreachy-kernel, gregkh; +Cc: Eisha Chen-yen-su

Split a subtraction across 2 lines in order to make these lines
no longer than 80 columns. Problem found with checkpatch.

Signed-off-by: Eisha Chen-yen-su <chenyensu0@gmail.com>
---
 drivers/staging/pi433/pi433_if.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 4a8e633a0a1d..e8ddc924bb04 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -528,7 +528,8 @@ pi433_receive(void *data)
 
 		/* need to drop bytes or acquire? */
 		if (dev->rx_bytes_to_drop > dev->rx_bytes_dropped)
-			bytes_to_read = dev->rx_bytes_to_drop - dev->rx_bytes_dropped;
+			bytes_to_read = dev->rx_bytes_to_drop -
+					dev->rx_bytes_dropped;
 		else
 			bytes_to_read = bytes_total - dev->rx_position;
 
-- 
2.14.3



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

* Re: [Outreachy kernel] [PATCH 0/2] Cleanup in staging pi433 driver
  2018-02-20  0:47 [PATCH 0/2] Cleanup in staging pi433 driver Eisha Chen-yen-su
  2018-02-20  0:47 ` [PATCH 1/2] staging: pi433: Split some function calls Eisha Chen-yen-su
  2018-02-20  0:47 ` [PATCH 2/2] staging: pi433: Split subtraction across 2 lines Eisha Chen-yen-su
@ 2018-02-20  6:39 ` Julia Lawall
  2 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2018-02-20  6:39 UTC (permalink / raw)
  To: Eisha Chen-yen-su; +Cc: outreachy-kernel, gregkh



On Tue, 20 Feb 2018, Eisha Chen-yen-su wrote:

> Do some code cleanup in order to reduce the quantity of lines
> exceeding 80 columns. Problem found with checkpatch.

Acked-by: Julia Lawall <julia.lawall@lip6.fr>

The series looks good.  Try to find some issues involving code rather than
just whitespace, now that you have figured out the patch submission
process.

julia


>
> Eisha Chen-yen-su (2):
>   staging: pi433: Split some function calls
>   staging: pi433: Split subtraction across 2 lines
>
>  drivers/staging/pi433/pi433_if.c | 48 ++++++++++++++++++++++++++--------------
>  1 file changed, 32 insertions(+), 16 deletions(-)
>
> --
> 2.14.3
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20180220004726.9662-1-chenyensu0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


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

end of thread, other threads:[~2018-02-20  6:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-20  0:47 [PATCH 0/2] Cleanup in staging pi433 driver Eisha Chen-yen-su
2018-02-20  0:47 ` [PATCH 1/2] staging: pi433: Split some function calls Eisha Chen-yen-su
2018-02-20  0:47 ` [PATCH 2/2] staging: pi433: Split subtraction across 2 lines Eisha Chen-yen-su
2018-02-20  6:39 ` [Outreachy kernel] [PATCH 0/2] Cleanup in staging pi433 driver Julia Lawall

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.