Re: [PATCH] staging: comedi: use meaningful variable name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15/06/15 15:01, Gujulan Elango, Hari Prasath (H.) wrote:
From: Hari Prasath Gujulan Elango <hgujulan@xxxxxxxxxxx>

This patch renames the very generic variable name 'todo' to
num_samples_to_read.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@xxxxxxxxxxx>
---
  drivers/staging/comedi/drivers/amplc_pci230.c | 9 +++++----
  1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c
index 20d5920..b19ab12 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -2011,17 +2011,18 @@ static void pci230_handle_ai(struct comedi_device *dev,
  	struct comedi_cmd *cmd = &async->cmd;
  	unsigned int status_fifo;
  	unsigned int i;
-	unsigned int todo;
+	unsigned int num_samples_to_read;
  	unsigned int fifoamount;
  	unsigned short val;

  	/* Determine number of samples to read. */
-	todo = comedi_nsamples_left(s, PCI230_ADC_FIFOLEVEL_HALFFULL);
-	if (todo == 0)
+	num_samples_to_read = comedi_nsamples_left(s,
+					PCI230_ADC_FIFOLEVEL_HALFFULL);
+	if (num_samples_to_read == 0)
  		return;

  	fifoamount = 0;
-	for (i = 0; i < todo; i++) {
+	for (i = 0; i < num_samples_to_read; i++) {
  		if (fifoamount == 0) {
  			/* Read FIFO state. */
  			status_fifo = inw(devpriv->daqio + PCI230_ADCCON);


I don't see anything particularly wrong with the old name, but the new name is a bit long. Most of the comedi drivers seem to use the name 'nsamples' for this.

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux