staging: pi433: Rename struct pi433_device buffer field to tx_buffer.
authorShahar Avidar <ikobh7@gmail.com>
Fri, 5 Apr 2024 07:39:54 +0000 (10:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 9 Apr 2024 15:52:13 +0000 (17:52 +0200)
Driver holds buffers in different structs, as does the HW.
Using explicit names for buffers increases readability.

Signed-off-by: Shahar Avidar <ikobh7@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20240405074000.3481217-2-ikobh7@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/pi433/pi433_if.c

index e08cb18b912903d8ea2c11d031f32a8e83309b2e..f64884b3a65a0c89e3798a7caa5d504923b3b456 100644 (file)
@@ -89,7 +89,7 @@ struct pi433_device {
        struct task_struct      *tx_task_struct;
        wait_queue_head_t       tx_wait_queue;
        u8                      free_in_fifo;
-       char                    buffer[MAX_MSG_SIZE];
+       char                    tx_buffer[MAX_MSG_SIZE];
 
        /* rx related values */
        struct pi433_rx_cfg     rx_cfg;
@@ -612,8 +612,8 @@ static int pi433_tx_thread(void *data)
                if (tx_cfg.enable_address_byte == OPTION_ON)
                        size++;
 
-               /* prime buffer */
-               memset(device->buffer, 0, size);
+               /* prime tx_buffer */
+               memset(device->tx_buffer, 0, size);
                position = 0;
 
                /* add length byte, if requested */
@@ -622,15 +622,15 @@ static int pi433_tx_thread(void *data)
                         * according to spec, length byte itself must be
                         * excluded from the length calculation
                         */
-                       device->buffer[position++] = size - 1;
+                       device->tx_buffer[position++] = size - 1;
 
                /* add adr byte, if requested */
                if (tx_cfg.enable_address_byte == OPTION_ON)
-                       device->buffer[position++] = tx_cfg.address_byte;
+                       device->tx_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);
+               retval = kfifo_out(&device->tx_fifo, &device->tx_buffer[position],
+                                  sizeof(device->tx_buffer) - position);
                dev_dbg(device->dev,
                        "read %d message byte(s) from fifo queue.\n", retval);
 
@@ -714,7 +714,7 @@ static int pi433_tx_thread(void *data)
 
                                device->free_in_fifo = 0;
                                rf69_write_fifo(spi,
-                                               &device->buffer[position],
+                                               &device->tx_buffer[position],
                                                write_size);
                                position += write_size;
                        } else {
@@ -722,7 +722,7 @@ static int pi433_tx_thread(void *data)
                                device->free_in_fifo -= size;
                                repetitions--;
                                rf69_write_fifo(spi,
-                                               &device->buffer[position],
+                                               &device->tx_buffer[position],
                                                (size - position));
                                position = 0; /* reset for next repetition */
                        }