staging: pi433: fixed coding style issues
PATCH 1/1 staging: pi433: fixed coding style issues
Fixed braces, double empty lines, tabs and spaces
and a macro with checkpatch.
--- drivers/staging/pi433/pi433_if.c | 242 +++++++++++-------------- drivers/staging/pi433/pi433_if.h | 13 +- drivers/staging/pi433/rf69.c | 66 ++++--- drivers/staging/pi433/rf69.h | 5 +- drivers/staging/pi433/rf69_enum.h | 314 +++++++++++++++------------------ drivers/staging/pi433/rf69_registers.h | 4 - 6 files changed, 286 insertions(+), 358 deletions(-)
drivers/staging/pi433/pi433_if.c +102 -140
@@ -48,13 +48,12 @@#include <linux/wait.h> #include <linux/spi/spi.h> #ifdef CONFIG_COMPAT -#include <asm/compat.h> +#include <linux/compat.h> #endif #include "pi433_if.h" #include "rf69.h" -#define N_PI433_MINORS (1U << MINORBITS)/*32*/ /* ... up to 256 */ #define MAX_MSG_SIZE 900/* min: FIFO_SIZE! */ #define MSG_FIFO_SIZE 65536/* 65536 = 2^16 */
@@ -79,7 +78,7 @@ struct pi433_device {struct device *dev;struct cdev *cdev;struct spi_device *spi; -unsigned users; +unsigned int users;/* irq related values */ struct gpio_desc *gpiod[NUM_DIO ];
@@ -122,9 +121,9 @@ struct pi433_instance {/*-------------------------------------------------------------------------*/ /* macro for checked access of registers of radio module */ -#define SET_CHECKED (retval) \ +#define (do { SET_CHECKED(retval) \ if (retval < 0) \ - return retval; + return retval; } while (0))/*-------------------------------------------------------------------------*/
@@ -133,19 +132,14 @@ static irqreturn_t DIO0_irq_handler(int irq, void *dev_id) {struct pi433_device *device = dev_id; -if (device->irq_state[DIO0 ] == DIO_PacketSent) - { +if (device->irq_state[DIO0 ] == DIO_PacketSent) { device->free_in_fifo =FIFO_SIZE ;dev_dbg (device->dev,"DIO0 irq: Packet sent\n" );wake_up_interruptible (&device->fifo_wait_queue); - } -else if (device->irq_state[DIO0 ] == DIO_Rssi_DIO0) - { + }else if (device->irq_state[DIO0 ] == DIO_Rssi_DIO0) {dev_dbg (device->dev,"DIO0 irq: RSSI level over threshold\n" );wake_up_interruptible (&device->rx_wait_queue); - } -else if (device->irq_state[DIO0 ] == DIO_PayloadReady) - { + }else if (device->irq_state[DIO0 ] == DIO_PayloadReady) {dev_dbg (device->dev,"DIO0 irq: PayloadReady\n" ); device->free_in_fifo =0 ;wake_up_interruptible (&device->fifo_wait_queue);
@@ -158,14 +152,13 @@ static irqreturn_t DIO1_irq_handler(int irq, void *dev_id) {struct pi433_device *device = dev_id; -if (device->irq_state[DIO1 ] == DIO_FifoNotEmpty_DIO1) - { +if (device->irq_state[DIO1 ] == DIO_FifoNotEmpty_DIO1) { device->free_in_fifo =FIFO_SIZE ; - } -else if (device->irq_state[DIO1 ] == DIO_FifoLevel) - { -if (device->rx_active) device->free_in_fifo =FIFO_THRESHOLD -1 ; -else device->free_in_fifo =FIFO_SIZE -FIFO_THRESHOLD -1 ; + }else if (device->irq_state[DIO1 ] == DIO_FifoLevel) { +if (device->rx_active) + device->free_in_fifo =FIFO_THRESHOLD -1 ; +else + device->free_in_fifo =FIFO_SIZE -FIFO_THRESHOLD -1 ; }dev_dbg (device->dev,"DIO1 irq: %d bytes free in fifo\n" , device->free_in_fifo);
@@ -189,9 +182,9 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)SET_CHECKED (rf69_set_antenna_impedance (dev->spi, rx_cfg->antenna_impedance));SET_CHECKED (rf69_set_rssi_threshold (dev->spi, rx_cfg->rssi_threshold));SET_CHECKED (rf69_set_ook_threshold_dec (dev->spi, rx_cfg->thresholdDecrement)); -SET_CHECKED (rf69_set_bandwidth (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent)); +SET_CHECKED (rf69_set_bandwidth (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent));SET_CHECKED (rf69_set_bandwidth_during_afc (dev->spi, rx_cfg->bw_mantisse, rx_cfg->bw_exponent)); -SET_CHECKED (rf69_set_dagc (dev->spi, rx_cfg->dagc)); +SET_CHECKED (rf69_set_dagc (dev->spi, rx_cfg->dagc)); dev->rx_bytes_to_drop = rx_cfg->bytes_to_drop;
@@ -199,13 +192,10 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)/* enable */ SET_CHECKED (rf69_set_sync_enable (dev->spi, rx_cfg->enable_sync));if (rx_cfg->enable_sync == optionOn) - {SET_CHECKED (rf69_set_fifo_fill_condition (dev->spi, afterSyncInterrupt)); - }else - {SET_CHECKED (rf69_set_fifo_fill_condition (dev->spi, always)); - } +if (rx_cfg->enable_length_byte == optionOn) { ret =rf69_set_packet_format (dev->spi, packetLengthVar);if (ret <0 )
@@ -220,29 +210,24 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg)/* lengths */ SET_CHECKED (rf69_set_sync_size (dev->spi, rx_cfg->sync_length)); -if (rx_cfg->enable_length_byte == optionOn) - { +if (rx_cfg->enable_length_byte == optionOn) {SET_CHECKED (rf69_set_payload_length (dev->spi,0xff )); - } -else if (rx_cfg->fixed_message_length !=0 ) - { + }else if (rx_cfg->fixed_message_length !=0 ) { payload_length = rx_cfg->fixed_message_length; -if (rx_cfg->enable_length_byte == optionOn) payload_length++; -if (rx_cfg->enable_address_filtering != filteringOff) payload_length++; +if (rx_cfg->enable_length_byte == optionOn) + payload_length++; +if (rx_cfg->enable_address_filtering != filteringOff) + payload_length++;SET_CHECKED (rf69_set_payload_length (dev->spi, payload_length)); - } -else - { + }else {SET_CHECKED (rf69_set_payload_length (dev->spi,0 )); }/* values */ if (rx_cfg->enable_sync == optionOn) - {SET_CHECKED (rf69_set_sync_values (dev->spi, rx_cfg->sync_pattern)); - } -if (rx_cfg->enable_address_filtering != filteringOff) - { + +if (rx_cfg->enable_address_filtering != filteringOff) {SET_CHECKED (rf69_set_node_address (dev->spi, rx_cfg->node_address));SET_CHECKED (rf69_set_broadcast_address (dev->spi, rx_cfg->broadcast_address)); }
@@ -265,13 +250,10 @@ rf69_set_tx_cfg(struct pi433_device *dev, struct pi433_tx_cfg *tx_cfg)/* packet format enable */ if (tx_cfg->enable_preamble == optionOn) - {SET_CHECKED (rf69_set_preamble_length (dev->spi, tx_cfg->preamble_length)); - }else - {SET_CHECKED (rf69_set_preamble_length (dev->spi,0 )); - } +SET_CHECKED (rf69_set_sync_enable (dev->spi, tx_cfg->enable_sync));if (tx_cfg->enable_length_byte == optionOn) { ret =rf69_set_packet_format (dev->spi, packetLengthVar);
@@ -306,7 +288,8 @@ pi433_start_rx(struct pi433_device *dev)/* setup for receiving */ retval =rf69_set_rx_cfg (dev, &dev->rx_cfg); -if (retval)return retval; +if (retval) +return retval;/* setup rssi irq */ SET_CHECKED (rf69_set_dio_mapping (dev->spi,DIO0 , DIO_Rssi_DIO0));
@@ -325,7 +308,6 @@ pi433_start_rx(struct pi433_device *dev)return 0 ; } -/*-------------------------------------------------------------------------*/ static int
@@ -339,10 +321,10 @@ pi433_receive(void *data) dev->interrupt_rx_allowed = false;/* wait for any tx to finish */ -dev_dbg (dev->dev,"rx: going to wait for any tx to finish" ); +dev_dbg (dev->dev,"rx: going to wait for any tx to finish" ); retval =wait_event_interruptible (dev->rx_wait_queue, !dev->tx_active); -if (retval)/* wait was interrupted */ - { +/* wait was interrupted */ +if (retval) { dev->interrupt_rx_allowed = true;wake_up_interruptible (&dev->tx_wait_queue);return retval;
@@ -359,8 +341,7 @@ pi433_receive(void *data)return retval;/* now check RSSI, if low wait for getting high (RSSI interrupt) */ -while ( !rf69_get_flag (dev->spi, rssiExceededThreshold) ) - { +while (!rf69_get_flag (dev->spi, rssiExceededThreshold)) {/* allow tx to interrupt us while waiting for high RSSI */ dev->interrupt_rx_allowed = true;wake_up_interruptible (&dev->tx_wait_queue);
@@ -368,13 +349,16 @@ pi433_receive(void *data)/* wait for RSSI level to become high */ dev_dbg (dev->dev,"rx: going to wait for high RSSI level" ); retval =wait_event_interruptible (dev->rx_wait_queue, -rf69_get_flag (dev->spi, - rssiExceededThreshold)); -if (retval) goto abort;/* wait was interrupted */ +rf69_get_flag (dev->spi, + rssiExceededThreshold)); +/* wait was interrupted */ +if (retval) + goto abort; dev->interrupt_rx_allowed = false;/* cross check for ongoing tx */ -if (!dev->tx_active)break ; +if (!dev->tx_active) +break ; }/* configure payload ready irq */
@@ -383,28 +367,25 @@ pi433_receive(void *data)irq_set_irq_type (dev->irq_num[DIO0 ],IRQ_TYPE_EDGE_RISING );/* fixed or unlimited length? */ -if (dev->rx_cfg.fixed_message_length !=0 ) - { -if (dev->rx_cfg.fixed_message_length > dev->rx_buffer_size) - { +if (dev->rx_cfg.fixed_message_length !=0 ) { +if (dev->rx_cfg.fixed_message_length > dev->rx_buffer_size) { retval =-1 ; 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); - } -else - { +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); }/* length byte enabled? */ -if (dev->rx_cfg.enable_length_byte == optionOn) - { +if (dev->rx_cfg.enable_length_byte == optionOn) { retval =wait_event_interruptible (dev->fifo_wait_queue, dev->free_in_fifo <FIFO_SIZE ); -if (retval) goto abort;/* wait was interrupted */ +/* wait was interrupted */ +if (retval) + goto abort;rf69_read_fifo (spi, (u8 *)&bytes_total,1 );if (bytes_total > dev->rx_buffer_size) {
@@ -416,15 +397,16 @@ pi433_receive(void *data) }/* address byte enabled? */ -if (dev->rx_cfg.enable_address_filtering != filteringOff) - { +if (dev->rx_cfg.enable_address_filtering != filteringOff) {u8 dummy; bytes_total--; retval =wait_event_interruptible (dev->fifo_wait_queue, dev->free_in_fifo <FIFO_SIZE ); -if (retval) goto abort;/* wait was interrupted */ +/* wait was interrupted */ +if (retval) + goto abort;rf69_read_fifo (spi, &dummy,1 ); dev->free_in_fifo++;
@@ -432,13 +414,13 @@ pi433_receive(void *data) }/* get payload */ -while (dev->rx_position < bytes_total) - { -if ( !rf69_get_flag (dev->spi, payloadReady) ) - { +while (dev->rx_position < bytes_total) { +if (!rf69_get_flag (dev->spi, payloadReady)) { retval =wait_event_interruptible (dev->fifo_wait_queue, dev->free_in_fifo <FIFO_SIZE ); -if (retval) goto abort;/* wait was interrupted */ +/* wait was interrupted */ +if (retval) + goto abort; }/* need to drop bytes or acquire? */
@@ -447,14 +429,15 @@ pi433_receive(void *data)else bytes_to_read = bytes_total - dev->rx_position; -/* access the fifo */ if (bytes_to_read >FIFO_SIZE - dev->free_in_fifo) bytes_to_read =FIFO_SIZE - dev->free_in_fifo; retval =rf69_read_fifo (spi, &dev->rx_buffer[dev->rx_position], bytes_to_read); -if (retval) goto abort;/* read failed */ +/* read failed */ +if (retval) + goto abort; dev->free_in_fifo += bytes_to_read;/* adjust status vars */
@@ -464,7 +447,6 @@ pi433_receive(void *data) dev->rx_position += bytes_to_read; } -/* rx done, wait was interrupted or error occurred */ abort: dev->interrupt_rx_allowed = true;
@@ -489,14 +471,13 @@ pi433_tx_thread(void *data)int position, repetitions;int retval; -while (1 ) - { +while (1 ) {/* wait for fifo to be populated or for request to terminate*/ dev_dbg (device->dev,"thread: going to wait for new messages" );wait_event_interruptible (device->tx_wait_queue, - ( !kfifo_is_empty (&device->tx_fifo) || -kthread_should_stop () )); -if (kthread_should_stop () ) + (!kfifo_is_empty (&device->tx_fifo) || +kthread_should_stop ())); +if (kthread_should_stop ())return 0 ;/* get data from fifo in the following order:
@@ -508,14 +489,14 @@ pi433_tx_thread(void *data) retval =kfifo_out (&device->tx_fifo, &tx_cfg,sizeof (tx_cfg));if (retval !=sizeof (tx_cfg)) { -dev_dbg (device->dev,"reading tx_cfg from fifo failed: got %d byte(s), expected %d" , retval, (unsigned int )sizeof (tx_cfg) ); +dev_dbg (device->dev,"reading tx_cfg from fifo failed: got %d byte(s), expected %d" , retval, (unsigned int )sizeof (tx_cfg));mutex_unlock (&device->tx_fifo_lock);continue ; } retval =kfifo_out (&device->tx_fifo, &size,sizeof (size_t ));if (retval !=sizeof (size_t )) { -dev_dbg (device->dev,"reading msg size from fifo failed: got %d, expected %d" , retval, (unsigned int )sizeof (size_t ) ); +dev_dbg (device->dev,"reading msg size from fifo failed: got %d, expected %d" , retval, (unsigned int )sizeof (size_t ));mutex_unlock (&device->tx_fifo_lock);continue ; }
@@ -538,14 +519,14 @@ pi433_tx_thread(void *data)/* add length byte, if requested */ if (tx_cfg.enable_length_byte == optionOn) - buffer[position++] = size-1 ;/* according to spec length byte itself must be excluded from the length calculation */ + buffer[position++] = size -1 ;/* according to spec length byte itself must be excluded from the length calculation */ /* add adr byte, if requested */ if (tx_cfg.enable_address_byte == optionOn) buffer[position++] = tx_cfg.address_byte;/* finally get message data from fifo */ - retval =kfifo_out (&device->tx_fifo, &buffer[position],sizeof (buffer)-position ); + retval =kfifo_out (&device->tx_fifo, &buffer[position],sizeof (buffer) - position);dev_dbg (device->dev,"read %d message byte(s) from fifo queue." , retval);mutex_unlock (&device->tx_fifo_lock);
@@ -565,8 +546,7 @@ pi433_tx_thread(void *data)disable_irq (device->irq_num[DIO0 ]); device->tx_active = true; -if (device->rx_active && rx_interrupted == false) - { +if (device->rx_active && rx_interrupted == false) {/* rx is currently waiting for a telegram; * we need to set the radio module to standby */
@@ -578,13 +558,9 @@ pi433_tx_thread(void *data)SET_CHECKED (rf69_set_mode (spi, standby));/* this clears the fifo */ SET_CHECKED (rf69_set_fifo_threshold (spi,FIFO_THRESHOLD ));if (tx_cfg.enable_length_byte == optionOn) - {SET_CHECKED (rf69_set_payload_length (spi, size * tx_cfg.repetitions)); - }else - {SET_CHECKED (rf69_set_payload_length (spi,0 )); - }/* configure the rf chip */ rf69_set_tx_cfg (device, &tx_cfg);
@@ -607,39 +583,40 @@ pi433_tx_thread(void *data) device->free_in_fifo =FIFO_SIZE ; position =0 ; repetitions = tx_cfg.repetitions; -while ( (repetitions >0 ) && (size > position) ) - { -if ( (size - position) > device->free_in_fifo) - {/* msg to big for fifo - take a part */ +while ((repetitions >0 ) && (size > position)) { +if ((size - position) > device->free_in_fifo) { +/* msg to big for fifo - take a part */ int temp = device->free_in_fifo; + device->free_in_fifo =0 ;rf69_write_fifo (spi, - &buffer[position], - temp); - position +=temp; - } -else - {/* msg fits into fifo - take all */ + &buffer[position], + temp); + position += temp; + }else {/* msg fits into fifo - take all */ device->free_in_fifo -= size; repetitions--;rf69_write_fifo (spi, &buffer[position], - (size - position) ); + (size - position)); position =0 ;/* reset for next repetition */ } retval =wait_event_interruptible (device->fifo_wait_queue, device->free_in_fifo >0 ); -if (retval) {printk ("ABORT\n" ); goto abort; } +if (retval) { +dev_info (device,"ABORT\n" ); + goto abort; + } }/* we are done. Wait for packet to get sent */ 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 () ); -if (kthread_should_stop () )printk ("ABORT\n" ); - +kthread_should_stop ()); +if (kthread_should_stop ()) +dev_info (device,"ABORT\n" );/* STOP_TRANSMISSION */ dev_dbg (device->dev,"thread: Packet sent. Set mode to stby." );
@@ -648,8 +625,7 @@ pi433_tx_thread(void *data)/* everything sent? */ if (kfifo_is_empty (&device->tx_fifo)) { abort: -if (rx_interrupted) - { +if (rx_interrupted) { rx_interrupted = false;pi433_start_rx (device); }
@@ -678,13 +654,10 @@ pi433_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos)/* just one read request at a time */ mutex_lock (&device->rx_lock); -if (device->rx_active) - { +if (device->rx_active) {mutex_unlock (&device->rx_lock);return -EAGAIN ; - } -else - { + }else { device->rx_active = true;mutex_unlock (&device->rx_lock); }
@@ -709,7 +682,6 @@ pi433_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos)return bytes_received; } -static ssize_t pi433_write (struct file *filp,const char __user *buf,size_t count,loff_t *f_pos)
@@ -732,11 +704,11 @@ pi433_write(struct file *filp, const char __user *buf,*/ mutex_lock (&device->tx_fifo_lock); retval =kfifo_in (&device->tx_fifo, &instance->tx_cfg,sizeof (instance->tx_cfg)); -if ( retval !=sizeof (instance->tx_cfg) ) +if (retval !=sizeof (instance->tx_cfg)) goto abort; - retval =kfifo_in (&device->tx_fifo, &count,sizeof (size_t )); -if ( retval !=sizeof (size_t ) ) + retval =kfifo_in (&device->tx_fifo, &count,sizeof (size_t )); +if (retval !=sizeof (size_t )) goto abort; retval =kfifo_from_user (&device->tx_fifo, buf, count, &copied);
@@ -758,7 +730,6 @@ pi433_write(struct file *filp, const char __user *buf,return -EAGAIN ; } -static long pi433_ioctl (struct file *filp,unsigned int cmd,unsigned long arg) {
@@ -896,12 +867,11 @@ static int pi433_release(struct inode *inode, struct file *filp)return 0 ; } -/*-------------------------------------------------------------------------*/ static int setup_GPIOs (struct pi433_device *device) { -char name[5 ]; +char name[5 ];int retval;int i;const irq_handler_t DIO_irq_handler[NUM_DIO ] = {
@@ -909,8 +879,7 @@ static int setup_GPIOs(struct pi433_device *device) DIO1_irq_handler }; -for (i=0 ; i<NUM_DIO ; i++) - { +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*/ );
@@ -923,24 +892,21 @@ static int setup_GPIOs(struct pi433_device *device)if (device->gpiod[i] ==ERR_PTR (-EBUSY ))dev_dbg (&device->spi->dev,"%s is busy." , name); -if (IS_ERR (device->gpiod[i]) ) - { +if (IS_ERR (device->gpiod[i])) { retval =PTR_ERR (device->gpiod[i]);/* release already allocated gpios */ -for (i--; i>=0 ; i--) - { +for (i--; i >=0 ; i--) {free_irq (device->irq_num[i], device);gpiod_put (device->gpiod[i]); }return retval; } -/* configure the pin */ gpiod_unexport (device->gpiod[i]); retval =gpiod_direction_input (device->gpiod[i]); -if (retval)return retval; - +if (retval) +return retval;/* configure irq */ device->irq_num[i] =gpiod_to_irq (device->gpiod[i]);
@@ -967,10 +933,9 @@ static void free_GPIOs(struct pi433_device *device) {int i; -for (i=0 ; i<NUM_DIO ; i++) - { +for (i =0 ; i <NUM_DIO ; i++) {/* check if gpiod is valid */ -if (IS_ERR (device->gpiod[i]) ) +if (IS_ERR (device->gpiod[i]))continue ;free_irq (device->irq_num[i], device);
@@ -1002,6 +967,7 @@ static void pi433_free_minor(struct pi433_device *dev)idr_remove (&pi433_idr, dev->minor);mutex_unlock (&minor_lock); } +/*-------------------------------------------------------------------------*/ static const struct file_operations pi433_fops = {
@@ -1032,13 +998,10 @@ static int pi433_probe(struct spi_device *spi)/* spi->max_speed_hz = 10000000; 1MHz already set by device tree overlay */ retval =spi_setup (spi); -if (retval) - { +if (retval) {dev_dbg (&spi->dev,"configuration of SPI interface failed!\n" );return retval; - } -else - { + }else {dev_dbg (&spi->dev,"spi interface setup: mode 0x%2x, %d bits per word, %dhz max speed" , spi->mode, spi->bits_per_word, spi->max_speed_hz);
@@ -1124,8 +1087,7 @@ static int pi433_probe(struct spi_device *spi)pr_err ("pi433: device register failed\n" ); retval =PTR_ERR (device->dev); goto device_create_failed; - } -else { + }else { dev_dbg(device->dev, "created device for major %d, minor %d\n", MAJOR(pi433_dev),
drivers/staging/pi433/pi433_if.h +3 -10
@@ -34,7 +34,6 @@/*---------------------------------------------------------------------------*/ -/*---------------------------------------------------------------------------*/ /* IOCTL structs and commands */
@@ -57,9 +56,8 @@* * NOTE: struct layout is the same in 64bit and 32bit userspace. */ -#define PI433_TX_CFG_IOCTL_NR 0 -struct pi433_tx_cfg -{ +#define PI433_TX_CFG_IOCTL_NR 0 +struct pi433_tx_cfg {__u32 frequency;__u16 bit_rate;__u32 dev_frequency;
@@ -72,7 +70,6 @@ struct pi433_tx_cfg__u16 repetitions; -/* packet format */ enum optionOnOff enable_preamble;enum optionOnOff enable_sync;
@@ -88,7 +85,6 @@ struct pi433_tx_cfg__u8 address_byte; }; -/** * struct pi433_rx_config - describes the configuration of the radio module for sending * @frequency:
@@ -107,7 +103,7 @@ struct pi433_tx_cfg* * NOTE: struct layout is the same in 64bit and 32bit userspace. */ -#define PI433_RX_CFG_IOCTL_NR 1 +#define PI433_RX_CFG_IOCTL_NR 1struct pi433_rx_cfg {__u32 frequency;__u16 bit_rate;
@@ -123,8 +119,6 @@ struct pi433_rx_cfg {__u8 bw_exponent;/* during AFC: 0x8b */ enum dagc dagc; - -/* packet format */ enum optionOnOff enable_sync;enum optionOnOff enable_length_byte;/* should be used in combination with sync, only */
@@ -140,7 +134,6 @@ struct pi433_rx_cfg {__u8 broadcast_address; }; -#define PI433_IOC_MAGIC 'r'#define PI433_IOC_RD_TX_CFG _IOR(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR, char[sizeof(struct pi433_tx_cfg)])
drivers/staging/pi433/rf69.c +32 -34
191 lines not on this page · raw message
drivers/staging/pi433/rf69.h +2 -3
@@ -72,11 +72,10 @@ int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition txint rf69_set_fifo_threshold (struct spi_device *spi,u8 threshold);int rf69_set_dagc (struct spi_device *spi,enum dagc dagc); -int rf69_read_fifo (struct spi_device *spi,u8 *buffer,unsigned int size); +int rf69_read_fifo (struct spi_device *spi,u8 *buffer,unsigned int size);int rf69_write_fifo (struct spi_device *spi,u8 *buffer,unsigned int size); -u8 rf69_read_reg (struct spi_device *spi,u8 addr); +u8 rf69_read_reg (struct spi_device *spi,u8 addr);int rf69_write_reg (struct spi_device *spi,u8 addr,u8 value); -#endif
drivers/staging/pi433/rf69_enum.h +147 -167
331 lines not on this page · raw message
drivers/staging/pi433/rf69_registers.h +0 -4
@@ -188,8 +188,6 @@#define MASK_PALEVEL_PA2 0x20#define MASK_PALEVEL_OUTPUT_POWER 0x1F - -// RegPaRamp #define PARAMP_3400 0x00#define PARAMP_2000 0x01
@@ -246,7 +244,6 @@#define LNA_GAIN_MAX_MINUS_36 0x05#define LNA_GAIN_MAX_MINUS_48 0x06 -/* RegRxBw (0x19) and RegAfcBw (0x1A) */ #define MASK_BW_DCC_FREQ 0xE0#define MASK_BW_MANTISSE 0x18
@@ -265,7 +262,6 @@#define BW_MANT_20 0x08#define BW_MANT_24 0x10/* default */ -/* RegOokPeak (0x1B) */ #define MASK_OOKPEAK_THRESTYPE 0xc0#define MASK_OOKPEAK_THRESSTEP 0x38
Signature · 1 line
2.15.1
Greg KH
maintainerQuoted 4 lines · Peter Johennecken
Fixed braces, double empty lines, tabs and spaces
and a macro with checkpatch.Signed-off-by Peter Johennecken <[email protected]>
Quoted 8 lines
--- drivers/staging/pi433/pi433_if.c | 242 +++++++++++-------------- drivers/staging/pi433/pi433_if.h | 13 +- drivers/staging/pi433/rf69.c | 66 ++++--- drivers/staging/pi433/rf69.h | 5 +- drivers/staging/pi433/rf69_enum.h | 314 +++++++++++++++------------------ drivers/staging/pi433/rf69_registers.h | 4 - 6 files changed, 286 insertions(+), 358 deletions(-)
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- Your patch did many different things all at once, making it difficult to review. All Linux kernel patches need to only do one thing at a time. If you need to do multiple things (such as clean up all coding style issues in a file/driver), do it in a sequence of patches, each one doing only one thing. This will make it easier to review the patches to ensure that they are correct, and to help alleviate any merge issues that larger patches can cause.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot