[PATCH 6/6] staging: pi433: pi433_if.c: use tabs instead of spaces
Replace spaces with tabs where possible to comply with the kernel coding style. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ad99f6527bd6..ad625a7cc76e 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -350,8 +350,8 @@ 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)); + rf69_get_flag(dev->spi, + rssiExceededThreshold)); if (retval) /* wait was interrupted */ goto abort; dev->interrupt_rx_allowed = false; @@ -588,8 +588,8 @@ pi433_tx_thread(void *data) int temp = device->free_in_fifo; device->free_in_fifo = 0; rf69_write_fifo(spi, - [position], - temp); + [position], + temp); position += temp; } else { /* msg fits into fifo - take all */ -- 2.11.0
[PATCH 6/6] staging: pi433: pi433_if.c: use tabs instead of spaces
Replace spaces with tabs where possible to comply with the kernel coding style. Signed-off-by: Chase Metzger --- drivers/staging/pi433/pi433_if.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ad99f6527bd6..ad625a7cc76e 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -350,8 +350,8 @@ 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)); + rf69_get_flag(dev->spi, + rssiExceededThreshold)); if (retval) /* wait was interrupted */ goto abort; dev->interrupt_rx_allowed = false; @@ -588,8 +588,8 @@ pi433_tx_thread(void *data) int temp = device->free_in_fifo; device->free_in_fifo = 0; rf69_write_fifo(spi, - [position], - temp); + [position], + temp); position += temp; } else { /* msg fits into fifo - take all */ -- 2.11.0
[PATCH 5/6] staging: pi433: pi433_if.c: fix space(s) required coding style issues
Put space(s) in required spots to comply with the kernel coding style. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ad89504655af..ad99f6527bd6 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -323,9 +323,9 @@ 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 */ + if (retval) { /* wait was interrupted */ dev->interrupt_rx_allowed = true; wake_up_interruptible(>tx_wait_queue); return retval; @@ -373,7 +373,7 @@ 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); @@ -582,7 +582,7 @@ pi433_tx_thread(void *data) device->free_in_fifo = FIFO_SIZE; position = 0; repetitions = tx_cfg.repetitions; - while((repetitions > 0) && (size > position)) { + 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; @@ -590,7 +590,7 @@ pi433_tx_thread(void *data) rf69_write_fifo(spi, [position], temp); - position +=temp; + position += temp; } else { /* msg fits into fifo - take all */ device->free_in_fifo -= size; @@ -882,7 +882,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(>spi->dev, name, 0 /*GPIOD_IN*/); @@ -898,7 +898,7 @@ static int setup_GPIOs(struct pi433_device *device) 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]); } @@ -938,7 +938,7 @@ 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])) continue; -- 2.11.0
[PATCH 2/6] staging: pi433: pi433_if.c: fix else if/else statements coding style issues
Put else if/else statements on same line as if/else if statements closing curly brace to comply with the kernel coding style. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 76d70345229a..cd1430a04928 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -155,8 +155,7 @@ static irqreturn_t DIO1_irq_handler(int irq, void *dev_id) if (device->irq_state[DIO1] == DIO_FifoNotEmpty_DIO1) { device->free_in_fifo = FIFO_SIZE; - } - else if (device->irq_state[DIO1] == DIO_FifoLevel) { + } else if (device->irq_state[DIO1] == DIO_FifoLevel) { if (device->rx_active) device->free_in_fifo = FIFO_THRESHOLD - 1; elsedevice->free_in_fifo = FIFO_SIZE - FIFO_THRESHOLD - 1; } @@ -193,8 +192,7 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) 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 { + } else { SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, always)); } if (rx_cfg->enable_length_byte == optionOn) { @@ -213,14 +211,12 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) SET_CHECKED(rf69_set_sync_size(dev->spi, rx_cfg->sync_length)); 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++; SET_CHECKED(rf69_set_payload_length(dev->spi, payload_length)); - } - else { + } else { SET_CHECKED(rf69_set_payload_length(dev->spi, 0)); } @@ -252,8 +248,7 @@ 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 { + } else { SET_CHECKED(rf69_set_preamble_length(dev->spi, 0)); } SET_CHECKED(rf69_set_sync_enable (dev->spi, tx_cfg->enable_sync)); @@ -372,8 +367,7 @@ pi433_receive(void *data) } bytes_total = dev->rx_cfg.fixed_message_length; dev_dbg(dev->dev,"rx: msg len set to %d by fixed length", bytes_total); - } - else { + } else { bytes_total = dev->rx_buffer_size; dev_dbg(dev->dev, "rx: msg len set to %d as requested by read", bytes_total); } @@ -552,8 +546,7 @@ pi433_tx_thread(void *data) 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 { + } else { SET_CHECKED(rf69_set_payload_length(spi, 0)); } @@ -587,8 +580,7 @@ pi433_tx_thread(void *data) [position], temp); position +=temp; - } - else { + } else { /* msg fits into fifo - take all */ device->free_in_fifo -= size; repetitions--; @@ -650,8 +642,7 @@ pi433_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos) if (device->rx_active) { mutex_unlock(>rx_lock); return -EAGAIN; - } - else { + } else { device->rx_active = true; mutex_unlock(>rx_lock); } @@ -998,8 +989,7 @@ static int pi433_probe(struct spi_device *spi) if (retval) { dev_dbg(>dev, "configuration of SPI interface failed!\n"); return retval; - } - else { + } else { dev_dbg(>dev, "spi interface setup: mode 0x%2x, %d bits per wo
[PATCH 5/6] staging: pi433: pi433_if.c: fix space(s) required coding style issues
Put space(s) in required spots to comply with the kernel coding style. Signed-off-by: Chase Metzger --- drivers/staging/pi433/pi433_if.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ad89504655af..ad99f6527bd6 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -323,9 +323,9 @@ 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 */ + if (retval) { /* wait was interrupted */ dev->interrupt_rx_allowed = true; wake_up_interruptible(>tx_wait_queue); return retval; @@ -373,7 +373,7 @@ 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); @@ -582,7 +582,7 @@ pi433_tx_thread(void *data) device->free_in_fifo = FIFO_SIZE; position = 0; repetitions = tx_cfg.repetitions; - while((repetitions > 0) && (size > position)) { + 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; @@ -590,7 +590,7 @@ pi433_tx_thread(void *data) rf69_write_fifo(spi, [position], temp); - position +=temp; + position += temp; } else { /* msg fits into fifo - take all */ device->free_in_fifo -= size; @@ -882,7 +882,7 @@ static int setup_GPIOs(struct pi433_device *device) DIO1_irq_handler }; - for (i=0; igpiod[i] = gpiod_get(>spi->dev, name, 0 /*GPIOD_IN*/); @@ -898,7 +898,7 @@ static int setup_GPIOs(struct pi433_device *device) 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]); } @@ -938,7 +938,7 @@ static void free_GPIOs(struct pi433_device *device) { int i; - for (i=0; igpiod[i])) continue; -- 2.11.0
[PATCH 2/6] staging: pi433: pi433_if.c: fix else if/else statements coding style issues
Put else if/else statements on same line as if/else if statements closing curly brace to comply with the kernel coding style. Signed-off-by: Chase Metzger --- drivers/staging/pi433/pi433_if.c | 33 +++-- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 76d70345229a..cd1430a04928 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -155,8 +155,7 @@ static irqreturn_t DIO1_irq_handler(int irq, void *dev_id) if (device->irq_state[DIO1] == DIO_FifoNotEmpty_DIO1) { device->free_in_fifo = FIFO_SIZE; - } - else if (device->irq_state[DIO1] == DIO_FifoLevel) { + } else if (device->irq_state[DIO1] == DIO_FifoLevel) { if (device->rx_active) device->free_in_fifo = FIFO_THRESHOLD - 1; elsedevice->free_in_fifo = FIFO_SIZE - FIFO_THRESHOLD - 1; } @@ -193,8 +192,7 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) 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 { + } else { SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, always)); } if (rx_cfg->enable_length_byte == optionOn) { @@ -213,14 +211,12 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) SET_CHECKED(rf69_set_sync_size(dev->spi, rx_cfg->sync_length)); 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++; SET_CHECKED(rf69_set_payload_length(dev->spi, payload_length)); - } - else { + } else { SET_CHECKED(rf69_set_payload_length(dev->spi, 0)); } @@ -252,8 +248,7 @@ 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 { + } else { SET_CHECKED(rf69_set_preamble_length(dev->spi, 0)); } SET_CHECKED(rf69_set_sync_enable (dev->spi, tx_cfg->enable_sync)); @@ -372,8 +367,7 @@ pi433_receive(void *data) } bytes_total = dev->rx_cfg.fixed_message_length; dev_dbg(dev->dev,"rx: msg len set to %d by fixed length", bytes_total); - } - else { + } else { bytes_total = dev->rx_buffer_size; dev_dbg(dev->dev, "rx: msg len set to %d as requested by read", bytes_total); } @@ -552,8 +546,7 @@ pi433_tx_thread(void *data) 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 { + } else { SET_CHECKED(rf69_set_payload_length(spi, 0)); } @@ -587,8 +580,7 @@ pi433_tx_thread(void *data) [position], temp); position +=temp; - } - else { + } else { /* msg fits into fifo - take all */ device->free_in_fifo -= size; repetitions--; @@ -650,8 +642,7 @@ pi433_read(struct file *filp, char __user *buf, size_t size, loff_t *f_pos) if (device->rx_active) { mutex_unlock(>rx_lock); return -EAGAIN; - } - else { + } else { device->rx_active = true; mutex_unlock(>rx_lock); } @@ -998,8 +989,7 @@ static int pi433_probe(struct spi_device *spi) if (retval) { dev_dbg(>dev, "configuration of SPI interface failed!\n"); return retval; - } - else { + } else { dev_dbg(>dev, "spi interface setup: mode 0x%2x, %d bits per word, %dhz max speed",
[PATCH 3/6] staging: pi433: pi433_if.c: fix trailing statement coding style issues
Put trailing statement after if/else statements on new line to comply with the kernel coding style. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 44 +++- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index cd1430a04928..3c5d8a05e976 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -156,8 +156,10 @@ static irqreturn_t DIO1_irq_handler(int irq, void *dev_id) 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; - elsedevice->free_in_fifo = FIFO_SIZE - FIFO_THRESHOLD - 1; + 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); @@ -213,8 +215,10 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) SET_CHECKED(rf69_set_payload_length(dev->spi, 0xff)); } 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 { SET_CHECKED(rf69_set_payload_length(dev->spi, 0)); @@ -285,7 +289,8 @@ pi433_start_rx(struct pi433_device *dev) /* setup for receiving */ retval = rf69_set_rx_cfg(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)); @@ -347,11 +352,13 @@ pi433_receive(void *data) retval = wait_event_interruptible(dev->rx_wait_queue, rf69_get_flag(dev->spi, rssiExceededThreshold)); - if (retval) goto abort; /* wait was interrupted */ + if (retval) /* wait was interrupted */ + 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 */ @@ -376,7 +383,8 @@ pi433_receive(void *data) 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 */ + if (retval) /* wait was interrupted */ + goto abort; rf69_read_fifo(spi, (u8 *)_total, 1); if (bytes_total > dev->rx_buffer_size) { @@ -395,7 +403,8 @@ pi433_receive(void *data) retval = wait_event_interruptible(dev->fifo_wait_queue, dev->free_in_fifo < FIFO_SIZE); - if (retval) goto abort; /* wait was interrupted */ + if (retval) /* wait was interrupted */ + goto abort; rf69_read_fifo(spi, , 1); dev->free_in_fifo++; @@ -407,7 +416,8 @@ pi433_receive(void *data) 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 */ + if (retval) /* wait was interrupted */ + goto abort; } /* need to drop bytes or acquire? */ @@ -423,7 +433,8 @@ pi433_receive(void *data) retval = rf69_read_fifo(spi, >rx_buffer[dev->rx_position], bytes_to_
[PATCH 1/6] staging: pi433: pi433_if.c: fix opening curly brace coding style issues
Put opening curly braces for if/else/else if statements and for/while loops on the same line as the statements or loops to comply with the kernel coding style. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 110 ++- 1 file changed, 38 insertions(+), 72 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ff86db1c6cbd..76d70345229a 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -153,12 +153,10 @@ 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) - { + else if (device->irq_state[DIO1] == DIO_FifoLevel) { if (device->rx_active) device->free_in_fifo = FIFO_THRESHOLD - 1; elsedevice->free_in_fifo = FIFO_SIZE - FIFO_THRESHOLD - 1; } @@ -193,12 +191,10 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) /* packet config */ /* enable */ SET_CHECKED(rf69_set_sync_enable(dev->spi, rx_cfg->enable_sync)); - if (rx_cfg->enable_sync == optionOn) - { + if (rx_cfg->enable_sync == optionOn) { SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, afterSyncInterrupt)); } - else - { + else { SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, always)); } if (rx_cfg->enable_length_byte == optionOn) { @@ -215,29 +211,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++; 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) - { + 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)); } @@ -259,12 +250,10 @@ rf69_set_tx_cfg(struct pi433_device *dev, struct pi433_tx_cfg *tx_cfg) SET_CHECKED(rf69_set_tx_start_condition(dev->spi, tx_cfg->tx_start_condition)); /* packet format enable */ - if (tx_cfg->enable_preamble == optionOn) - { + if (tx_cfg->enable_preamble == optionOn) { SET_CHECKED(rf69_set_preamble_length(dev->spi, tx_cfg->preamble_length)); } - else - { + else { SET_CHECKED(rf69_set_preamble_length(dev->spi, 0)); } SET_CHECKED(rf69_set_sync_enable (dev->spi, tx_cfg->enable_sync)); @@ -336,8 +325,7 @@ pi433_receive(void *data) /* 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 */ - { + if(retval) { /* wait was interrupted */ dev->interrupt_rx_allowed = true; wake_up_interruptible(>tx_wait_queue); return retval; @@ -354,8 +342,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_allowe
[PATCH 4/6] staging: pi433: pi433_if.c: fix space prohibited coding style issues
Remove unnecessary spaces before and after parenthesis' to comply with the kernel coding style. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 3c5d8a05e976..ad89504655af 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -342,7 +342,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(>tx_wait_queue); @@ -413,7 +413,7 @@ pi433_receive(void *data) /* get payload */ while (dev->rx_position < bytes_total) { - if ( !rf69_get_flag(dev->spi, payloadReady) ) { + if (!rf69_get_flag(dev->spi, payloadReady)) { retval = wait_event_interruptible(dev->fifo_wait_queue, dev->free_in_fifo < FIFO_SIZE); if (retval) /* wait was interrupted */ @@ -473,9 +473,9 @@ pi433_tx_thread(void *data) /* 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(>tx_fifo) || - kthread_should_stop() )); - if ( kthread_should_stop() ) +(!kfifo_is_empty(>tx_fifo) || + kthread_should_stop())); + if (kthread_should_stop()) return 0; /* get data from fifo in the following order: @@ -487,14 +487,14 @@ pi433_tx_thread(void *data) retval = kfifo_out(>tx_fifo, _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(>tx_fifo_lock); continue; } retval = kfifo_out(>tx_fifo, , 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(>tx_fifo_lock); continue; } @@ -524,7 +524,7 @@ pi433_tx_thread(void *data) buffer[position++] = tx_cfg.address_byte; /* finally get message data from fifo */ - retval = kfifo_out(>tx_fifo, [position], sizeof(buffer)-position ); + retval = kfifo_out(>tx_fifo, [position], sizeof(buffer)-position); dev_dbg(device->dev, "read %d message byte(s) from fifo queue.", retval); mutex_unlock(>tx_fifo_lock); @@ -582,8 +582,8 @@ 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) { + 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; @@ -597,7 +597,7 @@ pi433_tx_thread(void *data) repetitions--; rf69_write_fifo(spi, [position], - (size - position) ); + (size - position)); position = 0; /*
[PATCH 4/6] staging: pi433: pi433_if.c: fix space prohibited coding style issues
Remove unnecessary spaces before and after parenthesis' to comply with the kernel coding style. Signed-off-by: Chase Metzger --- drivers/staging/pi433/pi433_if.c | 34 +- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 3c5d8a05e976..ad89504655af 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -342,7 +342,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(>tx_wait_queue); @@ -413,7 +413,7 @@ pi433_receive(void *data) /* get payload */ while (dev->rx_position < bytes_total) { - if ( !rf69_get_flag(dev->spi, payloadReady) ) { + if (!rf69_get_flag(dev->spi, payloadReady)) { retval = wait_event_interruptible(dev->fifo_wait_queue, dev->free_in_fifo < FIFO_SIZE); if (retval) /* wait was interrupted */ @@ -473,9 +473,9 @@ pi433_tx_thread(void *data) /* 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(>tx_fifo) || - kthread_should_stop() )); - if ( kthread_should_stop() ) +(!kfifo_is_empty(>tx_fifo) || + kthread_should_stop())); + if (kthread_should_stop()) return 0; /* get data from fifo in the following order: @@ -487,14 +487,14 @@ pi433_tx_thread(void *data) retval = kfifo_out(>tx_fifo, _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(>tx_fifo_lock); continue; } retval = kfifo_out(>tx_fifo, , 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(>tx_fifo_lock); continue; } @@ -524,7 +524,7 @@ pi433_tx_thread(void *data) buffer[position++] = tx_cfg.address_byte; /* finally get message data from fifo */ - retval = kfifo_out(>tx_fifo, [position], sizeof(buffer)-position ); + retval = kfifo_out(>tx_fifo, [position], sizeof(buffer)-position); dev_dbg(device->dev, "read %d message byte(s) from fifo queue.", retval); mutex_unlock(>tx_fifo_lock); @@ -582,8 +582,8 @@ 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) { + 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; @@ -597,7 +597,7 @@ pi433_tx_thread(void *data) repetitions--; rf69_write_fifo(spi, [position], - (size - position) ); + (size - position)); position = 0; /* reset for next repetition */ }
[PATCH 3/6] staging: pi433: pi433_if.c: fix trailing statement coding style issues
Put trailing statement after if/else statements on new line to comply with the kernel coding style. Signed-off-by: Chase Metzger --- drivers/staging/pi433/pi433_if.c | 44 +++- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index cd1430a04928..3c5d8a05e976 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -156,8 +156,10 @@ static irqreturn_t DIO1_irq_handler(int irq, void *dev_id) 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; - elsedevice->free_in_fifo = FIFO_SIZE - FIFO_THRESHOLD - 1; + 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); @@ -213,8 +215,10 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) SET_CHECKED(rf69_set_payload_length(dev->spi, 0xff)); } 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 { SET_CHECKED(rf69_set_payload_length(dev->spi, 0)); @@ -285,7 +289,8 @@ pi433_start_rx(struct pi433_device *dev) /* setup for receiving */ retval = rf69_set_rx_cfg(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)); @@ -347,11 +352,13 @@ pi433_receive(void *data) retval = wait_event_interruptible(dev->rx_wait_queue, rf69_get_flag(dev->spi, rssiExceededThreshold)); - if (retval) goto abort; /* wait was interrupted */ + if (retval) /* wait was interrupted */ + 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 */ @@ -376,7 +383,8 @@ pi433_receive(void *data) 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 */ + if (retval) /* wait was interrupted */ + goto abort; rf69_read_fifo(spi, (u8 *)_total, 1); if (bytes_total > dev->rx_buffer_size) { @@ -395,7 +403,8 @@ pi433_receive(void *data) retval = wait_event_interruptible(dev->fifo_wait_queue, dev->free_in_fifo < FIFO_SIZE); - if (retval) goto abort; /* wait was interrupted */ + if (retval) /* wait was interrupted */ + goto abort; rf69_read_fifo(spi, , 1); dev->free_in_fifo++; @@ -407,7 +416,8 @@ pi433_receive(void *data) 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 */ + if (retval) /* wait was interrupted */ + goto abort; } /* need to drop bytes or acquire? */ @@ -423,7 +433,8 @@ pi433_receive(void *data) retval = rf69_read_fifo(spi, >rx_buffer[dev->rx_position], bytes_to_read); - if (
[PATCH 1/6] staging: pi433: pi433_if.c: fix opening curly brace coding style issues
Put opening curly braces for if/else/else if statements and for/while loops on the same line as the statements or loops to comply with the kernel coding style. Signed-off-by: Chase Metzger --- drivers/staging/pi433/pi433_if.c | 110 ++- 1 file changed, 38 insertions(+), 72 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index ff86db1c6cbd..76d70345229a 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -153,12 +153,10 @@ 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) - { + else if (device->irq_state[DIO1] == DIO_FifoLevel) { if (device->rx_active) device->free_in_fifo = FIFO_THRESHOLD - 1; elsedevice->free_in_fifo = FIFO_SIZE - FIFO_THRESHOLD - 1; } @@ -193,12 +191,10 @@ rf69_set_rx_cfg(struct pi433_device *dev, struct pi433_rx_cfg *rx_cfg) /* packet config */ /* enable */ SET_CHECKED(rf69_set_sync_enable(dev->spi, rx_cfg->enable_sync)); - if (rx_cfg->enable_sync == optionOn) - { + if (rx_cfg->enable_sync == optionOn) { SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, afterSyncInterrupt)); } - else - { + else { SET_CHECKED(rf69_set_fifo_fill_condition(dev->spi, always)); } if (rx_cfg->enable_length_byte == optionOn) { @@ -215,29 +211,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++; 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) - { + 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)); } @@ -259,12 +250,10 @@ rf69_set_tx_cfg(struct pi433_device *dev, struct pi433_tx_cfg *tx_cfg) SET_CHECKED(rf69_set_tx_start_condition(dev->spi, tx_cfg->tx_start_condition)); /* packet format enable */ - if (tx_cfg->enable_preamble == optionOn) - { + if (tx_cfg->enable_preamble == optionOn) { SET_CHECKED(rf69_set_preamble_length(dev->spi, tx_cfg->preamble_length)); } - else - { + else { SET_CHECKED(rf69_set_preamble_length(dev->spi, 0)); } SET_CHECKED(rf69_set_sync_enable (dev->spi, tx_cfg->enable_sync)); @@ -336,8 +325,7 @@ pi433_receive(void *data) /* 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 */ - { + if(retval) { /* wait was interrupted */ dev->interrupt_rx_allowed = true; wake_up_interruptible(>tx_wait_queue); return retval; @@ -354,8 +342,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_interr
[PATCH 0/6] staging: pi433: pi433_if.c: coding style fixes
Fixes some of the coding style violations to comply with the kernel coding style. Chase Metzger (6): staging: pi433: pi433_if.c: fix opening curly brace coding style issues staging: pi433: pi433_if.c: fix else if/else statements coding style issues staging: pi433: pi433_if.c: fix trailing statement coding style issues staging: pi433: pi433_if.c: fix space prohibited coding style issues staging: pi433: pi433_if.c: fix space(s) required coding style issues staging: pi433: pi433_if.c: use tabs instead of spaces drivers/staging/pi433/pi433_if.c | 203 +-- 1 file changed, 87 insertions(+), 116 deletions(-) -- 2.11.0
[PATCH 0/6] staging: pi433: pi433_if.c: coding style fixes
Fixes some of the coding style violations to comply with the kernel coding style. Chase Metzger (6): staging: pi433: pi433_if.c: fix opening curly brace coding style issues staging: pi433: pi433_if.c: fix else if/else statements coding style issues staging: pi433: pi433_if.c: fix trailing statement coding style issues staging: pi433: pi433_if.c: fix space prohibited coding style issues staging: pi433: pi433_if.c: fix space(s) required coding style issues staging: pi433: pi433_if.c: use tabs instead of spaces drivers/staging/pi433/pi433_if.c | 203 +-- 1 file changed, 87 insertions(+), 116 deletions(-) -- 2.11.0
[PATCH] staging: pi433: pi433_if.c: fix if/else if and brace coding style issues
Fix if/else if and braces in function DIO0_irq_handler to comply with the kernel coding style. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/pi433/pi433_if.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index d946838450d4..dee70c47629c 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -133,19 +133,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(>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(>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(>fifo_wait_queue); -- 2.11.0
[PATCH] staging: pi433: pi433_if.c: fix if/else if and brace coding style issues
Fix if/else if and braces in function DIO0_irq_handler to comply with the kernel coding style. Signed-off-by: Chase Metzger --- drivers/staging/pi433/pi433_if.c | 11 +++ 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index d946838450d4..dee70c47629c 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -133,19 +133,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(>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(>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(>fifo_wait_queue); -- 2.11.0
[PATCH] staging: greybus: timesync.c: Fixed WARNING for brace issue
Removed a checkpatch warning for braces on single argument if and else statement. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/greybus/timesync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/greybus/timesync.c b/drivers/staging/greybus/timesync.c index 2e68af7..e586627 100644 --- a/drivers/staging/greybus/timesync.c +++ b/drivers/staging/greybus/timesync.c @@ -807,11 +807,11 @@ static int gb_timesync_schedule(struct gb_timesync_svc *timesync_svc, int state) return -EINVAL; mutex_lock(_svc->mutex); - if (timesync_svc->state != GB_TIMESYNC_STATE_INVALID) { + if (timesync_svc->state != GB_TIMESYNC_STATE_INVALID) gb_timesync_set_state_atomic(timesync_svc, state); - } else { + else ret = -ENODEV; - } + mutex_unlock(_svc->mutex); return ret; } -- 2.1.4
[PATCH] staging: greybus: timesync.c: Fixed WARNING for brace issue
Removed a checkpatch warning for braces on single argument if and else statement. Signed-off-by: Chase Metzger --- drivers/staging/greybus/timesync.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/greybus/timesync.c b/drivers/staging/greybus/timesync.c index 2e68af7..e586627 100644 --- a/drivers/staging/greybus/timesync.c +++ b/drivers/staging/greybus/timesync.c @@ -807,11 +807,11 @@ static int gb_timesync_schedule(struct gb_timesync_svc *timesync_svc, int state) return -EINVAL; mutex_lock(_svc->mutex); - if (timesync_svc->state != GB_TIMESYNC_STATE_INVALID) { + if (timesync_svc->state != GB_TIMESYNC_STATE_INVALID) gb_timesync_set_state_atomic(timesync_svc, state); - } else { + else ret = -ENODEV; - } + mutex_unlock(_svc->mutex); return ret; } -- 2.1.4
[PATCH] drivers: staging: greybus: audio_topology.c: Fixed CHECKS for brace issues
Added braces for else and else if statements where checkpatch complained. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/greybus/audio_topology.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index b625169..3a2678e 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -1044,8 +1044,10 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } + *w_size += csize; curr = (void *)curr + csize; list_add(>list, >widget_ctl_list); @@ -1190,8 +1192,9 @@ static int gbaudio_tplg_process_kcontrols(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } list_add(>list, >ctl_list); dev_dbg(module->dev, "%d:%s created of type %d\n", curr->id, -- 2.1.4
[PATCH] drivers: staging: greybus: audio_topology.c: Fixed CHECKS for brace issues
Added braces for else and else if statements where checkpatch complained. Signed-off-by: Chase Metzger --- drivers/staging/greybus/audio_topology.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index b625169..3a2678e 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -1044,8 +1044,10 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } + *w_size += csize; curr = (void *)curr + csize; list_add(>list, >widget_ctl_list); @@ -1190,8 +1192,9 @@ static int gbaudio_tplg_process_kcontrols(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } list_add(>list, >ctl_list); dev_dbg(module->dev, "%d:%s created of type %d\n", curr->id, -- 2.1.4
[PATCH] drivers: staging: greybus: audio_manager_sysfs.c: Fixed CHECK for brace issue
Added braces to else and else if statements where checkpatch complained. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/greybus/audio_manager_sysfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c index d8bf859..376e17c 100644 --- a/drivers/staging/greybus/audio_manager_sysfs.c +++ b/drivers/staging/greybus/audio_manager_sysfs.c @@ -71,10 +71,11 @@ static ssize_t manager_sysfs_dump_store( num = gb_audio_manager_dump_module(id); if (num) return num; - } else if (!strncmp("all", buf, 3)) + } else if (!strncmp("all", buf, 3)) { gb_audio_manager_dump_all(); - else + } else { return -EINVAL; + } return count; } -- 2.1.4
[PATCH] drivers: staging: greybus: audio_manager_sysfs.c: Fixed CHECK for brace issue
Added braces to else and else if statements where checkpatch complained. Signed-off-by: Chase Metzger --- drivers/staging/greybus/audio_manager_sysfs.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c index d8bf859..376e17c 100644 --- a/drivers/staging/greybus/audio_manager_sysfs.c +++ b/drivers/staging/greybus/audio_manager_sysfs.c @@ -71,10 +71,11 @@ static ssize_t manager_sysfs_dump_store( num = gb_audio_manager_dump_module(id); if (num) return num; - } else if (!strncmp("all", buf, 3)) + } else if (!strncmp("all", buf, 3)) { gb_audio_manager_dump_all(); - else + } else { return -EINVAL; + } return count; } -- 2.1.4
[PATCH] drivers: staging: greybus: audio_codec.c: Fixed CHECKS for brace issues
Added braces to else statement where checkpatch complained. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/greybus/audio_codec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 8a0744b..1bdf849 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -655,8 +655,10 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream) ret = gb_audio_apbridgea_shutdown_rx(data->connection, 0); params->state = GBAUDIO_CODEC_STOP; - } else + } else { ret = -EINVAL; + } + if (ret) dev_err_ratelimited(dai->dev, "%s:Error during %s %s stream:%d\n", -- 2.1.4
[PATCH] drivers: staging: greybus: audio_codec.c: Fixed CHECKS for brace issues
Added braces to else statement where checkpatch complained. Signed-off-by: Chase Metzger --- drivers/staging/greybus/audio_codec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 8a0744b..1bdf849 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -655,8 +655,10 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream) ret = gb_audio_apbridgea_shutdown_rx(data->connection, 0); params->state = GBAUDIO_CODEC_STOP; - } else + } else { ret = -EINVAL; + } + if (ret) dev_err_ratelimited(dai->dev, "%s:Error during %s %s stream:%d\n", -- 2.1.4
[PATCH] drivers: staging: greybus: Fixed CHECKS for brace issues
Added braces to else statements where checkpatch complained. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/greybus/audio_codec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 8a0744b..1bdf849 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -655,8 +655,10 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream) ret = gb_audio_apbridgea_shutdown_rx(data->connection, 0); params->state = GBAUDIO_CODEC_STOP; - } else + } else { ret = -EINVAL; + } + if (ret) dev_err_ratelimited(dai->dev, "%s:Error during %s %s stream:%d\n", -- 2.1.4
[PATCH] drivers: staging: greybus: Fixed CHECKS for brace issues
Added braces to else statements where checkpatch complained. Signed-off-by: Chase Metzger --- drivers/staging/greybus/audio_codec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 8a0744b..1bdf849 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -655,8 +655,10 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream) ret = gb_audio_apbridgea_shutdown_rx(data->connection, 0); params->state = GBAUDIO_CODEC_STOP; - } else + } else { ret = -EINVAL; + } + if (ret) dev_err_ratelimited(dai->dev, "%s:Error during %s %s stream:%d\n", -- 2.1.4
[PATCH] drivers: staging: greybus: Fixed CHECKS for brace issues
Added braces to else statements where checkpatch complained. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/greybus/audio_topology.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index b625169..3a2678e 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -1044,8 +1044,10 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } + *w_size += csize; curr = (void *)curr + csize; list_add(>list, >widget_ctl_list); @@ -1190,8 +1192,9 @@ static int gbaudio_tplg_process_kcontrols(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } list_add(>list, >ctl_list); dev_dbg(module->dev, "%d:%s created of type %d\n", curr->id, -- 2.1.4
[PATCH] drivers: staging: greybus: Fixed CHECKS for brace issues
Added braces to else statements where checkpatch complained. Signed-off-by: Chase Metzger --- drivers/staging/greybus/audio_topology.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index b625169..3a2678e 100644 --- a/drivers/staging/greybus/audio_topology.c +++ b/drivers/staging/greybus/audio_topology.c @@ -1044,8 +1044,10 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } + *w_size += csize; curr = (void *)curr + csize; list_add(>list, >widget_ctl_list); @@ -1190,8 +1192,9 @@ static int gbaudio_tplg_process_kcontrols(struct gbaudio_module_info *module, control->texts = (const char * const *) gb_generate_enum_strings(module, gbenum); control->items = gbenum->items; - } else + } else { csize = sizeof(struct gb_audio_control); + } list_add(>list, >ctl_list); dev_dbg(module->dev, "%d:%s created of type %d\n", curr->id, -- 2.1.4
[PATCH] drivers/staging/greybus: gpio.c - Fixed a checkpatch generated warning
Removed braces for single line if statement. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/greybus/gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index ea8234a..5e06e42 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -561,9 +561,8 @@ static void gb_gpio_irqchip_remove(struct gb_gpio_controller *ggc) irq_domain_remove(ggc->irqdomain); } - if (ggc->irqchip) { + if (ggc->irqchip) ggc->irqchip = NULL; - } } /** -- 2.1.4
[PATCH] drivers/staging/greybus: gpio.c - Fixed a checkpatch generated warning
Removed braces for single line if statement. Signed-off-by: Chase Metzger --- drivers/staging/greybus/gpio.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index ea8234a..5e06e42 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -561,9 +561,8 @@ static void gb_gpio_irqchip_remove(struct gb_gpio_controller *ggc) irq_domain_remove(ggc->irqdomain); } - if (ggc->irqchip) { + if (ggc->irqchip) ggc->irqchip = NULL; - } } /** -- 2.1.4
[PATCH] staging: android: sync.c: Changed the ways nullptrs were being checked
Removed all checkpatch.pl CHECKs that suggested to check NULL by !obj instead of obj == NULL. Signed-off-by: Chase Metzger --- drivers/staging/android/sync.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..5413f28 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, return NULL; obj = kzalloc(size, GFP_KERNEL); - if (obj == NULL) + if (!obj) return NULL; kref_init(>kref); @@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size) return NULL; pt = kzalloc(size, GFP_KERNEL); - if (pt == NULL) + if (!pt) return NULL; spin_lock_irqsave(>child_list_lock, flags); @@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name) struct sync_fence *fence; fence = kzalloc(size, GFP_KERNEL); - if (fence == NULL) + if (!fence) return NULL; fence->file = anon_inode_getfile("sync_fence", _fence_fops, @@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) struct sync_fence *fence; fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name); - if (fence == NULL) + if (!fence) return NULL; fence->num_fences = 1; @@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd) { struct file *file = fget(fd); - if (file == NULL) + if (!file) return NULL; if (file->f_op != _fence_fops) @@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name, unsigned long size = offsetof(struct sync_fence, cbs[num_fences]); fence = sync_fence_alloc(size, name); - if (fence == NULL) + if (!fence) return NULL; atomic_set(>status, num_fences); @@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg) } fence2 = sync_fence_fdget(data.fd2); - if (fence2 == NULL) { + if (!fence2) { err = -ENOENT; goto err_put_fd; } data.name[sizeof(data.name) - 1] = '\0'; fence3 = sync_fence_merge(data.name, fence, fence2); - if (fence3 == NULL) { + if (!fence3) { err = -ENOMEM; goto err_put_fence2; } @@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence, size = 4096; data = kzalloc(size, GFP_KERNEL); - if (data == NULL) + if (!data) return -ENOMEM; strlcpy(data->name, fence->name, sizeof(data->name)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: devio.c: Removed unnecessary space
Removed an unnecessary space between a function name and arguments. Signed-off-by: Chase Metzger --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 38ae877c..0bcd45e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1910,7 +1910,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) ret = releaseintf(ps, ifnum); if (ret < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: android: sync.c: Changed the ways nullptrs were being checked
Removed all checkpatch.pl CHECKs that suggested to check NULL by !obj instead of obj == NULL. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/android/sync.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..5413f28 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, return NULL; obj = kzalloc(size, GFP_KERNEL); - if (obj == NULL) + if (!obj) return NULL; kref_init(>kref); @@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size) return NULL; pt = kzalloc(size, GFP_KERNEL); - if (pt == NULL) + if (!pt) return NULL; spin_lock_irqsave(>child_list_lock, flags); @@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name) struct sync_fence *fence; fence = kzalloc(size, GFP_KERNEL); - if (fence == NULL) + if (!fence) return NULL; fence->file = anon_inode_getfile("sync_fence", _fence_fops, @@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) struct sync_fence *fence; fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name); - if (fence == NULL) + if (!fence) return NULL; fence->num_fences = 1; @@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd) { struct file *file = fget(fd); - if (file == NULL) + if (!file) return NULL; if (file->f_op != _fence_fops) @@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name, unsigned long size = offsetof(struct sync_fence, cbs[num_fences]); fence = sync_fence_alloc(size, name); - if (fence == NULL) + if (!fence) return NULL; atomic_set(>status, num_fences); @@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg) } fence2 = sync_fence_fdget(data.fd2); - if (fence2 == NULL) { + if (!fence2) { err = -ENOENT; goto err_put_fd; } data.name[sizeof(data.name) - 1] = '\0'; fence3 = sync_fence_merge(data.name, fence, fence2); - if (fence3 == NULL) { + if (!fence3) { err = -ENOMEM; goto err_put_fence2; } @@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence, size = 4096; data = kzalloc(size, GFP_KERNEL); - if (data == NULL) + if (!data) return -ENOMEM; strlcpy(data->name, fence->name, sizeof(data->name)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: devio.c: Removed unnecessary space
Removed an unnecessary space between a function name and arguments. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 38ae877c..0bcd45e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1910,7 +1910,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) ret = releaseintf(ps, ifnum); if (ret < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: android: sync.c: Changed the ways nullptrs were being checked
Removed all checkpatch.pl CHECKs that suggested to check NULL by !obj instead of obj == NULL. Signed-off-by: Chase Metzger --- drivers/staging/android/sync.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..5413f28 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, return NULL; obj = kzalloc(size, GFP_KERNEL); - if (obj == NULL) + if (!obj) return NULL; kref_init(>kref); @@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size) return NULL; pt = kzalloc(size, GFP_KERNEL); - if (pt == NULL) + if (!pt) return NULL; spin_lock_irqsave(>child_list_lock, flags); @@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name) struct sync_fence *fence; fence = kzalloc(size, GFP_KERNEL); - if (fence == NULL) + if (!fence) return NULL; fence->file = anon_inode_getfile("sync_fence", _fence_fops, @@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) struct sync_fence *fence; fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name); - if (fence == NULL) + if (!fence) return NULL; fence->num_fences = 1; @@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd) { struct file *file = fget(fd); - if (file == NULL) + if (!file) return NULL; if (file->f_op != _fence_fops) @@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name, unsigned long size = offsetof(struct sync_fence, cbs[num_fences]); fence = sync_fence_alloc(size, name); - if (fence == NULL) + if (!fence) return NULL; atomic_set(>status, num_fences); @@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg) } fence2 = sync_fence_fdget(data.fd2); - if (fence2 == NULL) { + if (!fence2) { err = -ENOENT; goto err_put_fd; } data.name[sizeof(data.name) - 1] = '\0'; fence3 = sync_fence_merge(data.name, fence, fence2); - if (fence3 == NULL) { + if (!fence3) { err = -ENOMEM; goto err_put_fence2; } @@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence, size = 4096; data = kzalloc(size, GFP_KERNEL); - if (data == NULL) + if (!data) return -ENOMEM; strlcpy(data->name, fence->name, sizeof(data->name)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] staging: android: sync.c: Changed the ways nullptrs were being checked
Removed all checkpatch.pl CHECKs that suggested to check NULL by !obj instead of obj == NULL. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/staging/android/sync.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c index f83e00c..5413f28 100644 --- a/drivers/staging/android/sync.c +++ b/drivers/staging/android/sync.c @@ -43,7 +43,7 @@ struct sync_timeline *sync_timeline_create(const struct sync_timeline_ops *ops, return NULL; obj = kzalloc(size, GFP_KERNEL); - if (obj == NULL) + if (!obj) return NULL; kref_init(>kref); @@ -130,7 +130,7 @@ struct sync_pt *sync_pt_create(struct sync_timeline *obj, int size) return NULL; pt = kzalloc(size, GFP_KERNEL); - if (pt == NULL) + if (!pt) return NULL; spin_lock_irqsave(>child_list_lock, flags); @@ -155,7 +155,7 @@ static struct sync_fence *sync_fence_alloc(int size, const char *name) struct sync_fence *fence; fence = kzalloc(size, GFP_KERNEL); - if (fence == NULL) + if (!fence) return NULL; fence->file = anon_inode_getfile("sync_fence", _fence_fops, @@ -193,7 +193,7 @@ struct sync_fence *sync_fence_create(const char *name, struct sync_pt *pt) struct sync_fence *fence; fence = sync_fence_alloc(offsetof(struct sync_fence, cbs[1]), name); - if (fence == NULL) + if (!fence) return NULL; fence->num_fences = 1; @@ -215,7 +215,7 @@ struct sync_fence *sync_fence_fdget(int fd) { struct file *file = fget(fd); - if (file == NULL) + if (!file) return NULL; if (file->f_op != _fence_fops) @@ -262,7 +262,7 @@ struct sync_fence *sync_fence_merge(const char *name, unsigned long size = offsetof(struct sync_fence, cbs[num_fences]); fence = sync_fence_alloc(size, name); - if (fence == NULL) + if (!fence) return NULL; atomic_set(>status, num_fences); @@ -583,14 +583,14 @@ static long sync_fence_ioctl_merge(struct sync_fence *fence, unsigned long arg) } fence2 = sync_fence_fdget(data.fd2); - if (fence2 == NULL) { + if (!fence2) { err = -ENOENT; goto err_put_fd; } data.name[sizeof(data.name) - 1] = '\0'; fence3 = sync_fence_merge(data.name, fence, fence2); - if (fence3 == NULL) { + if (!fence3) { err = -ENOMEM; goto err_put_fence2; } @@ -666,7 +666,7 @@ static long sync_fence_ioctl_fence_info(struct sync_fence *fence, size = 4096; data = kzalloc(size, GFP_KERNEL); - if (data == NULL) + if (!data) return -ENOMEM; strlcpy(data->name, fence->name, sizeof(data->name)); -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: devio.c: Removed unnecessary space
Removed an unnecessary space between a function name and arguments. Signed-off-by: Chase Metzger --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 38ae877c..0bcd45e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1910,7 +1910,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) ret = releaseintf(ps, ifnum); if (ret < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: devio.c: Removed unnecessary space
Removed an unnecessary space between a function name and arguments. Signed-off-by: Chase Metzger <chasemetzge...@gmail.com> --- drivers/usb/core/devio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 38ae877c..0bcd45e 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1910,7 +1910,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) ret = releaseintf(ps, ifnum); if (ret < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger --- drivers/usb/core/hub.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 431839b..169e3d8 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4222,7 +4222,7 @@ static int hub_enable_device(struct usb_device *udev) * but it is still necessary to lock the port. */ static int -hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, +hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, int retry_counter) { struct usb_device *hdev = hub->hdev; @@ -4526,7 +4526,7 @@ fail: } static void -check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) +check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) { struct usb_qualifier_descriptor *qual; int status; @@ -4534,11 +4534,11 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) if (udev->quirks & USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc (sizeof *qual, GFP_KERNEL); + qual = kmalloc(sizeof *qual, GFP_KERNEL); if (qual == NULL) return; - status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0, + status = usb_get_descriptor(udev, USB_DT_DEVICE_QUALIFIER, 0, qual, sizeof *qual); if (status == sizeof *qual) { dev_info(>dev, "not running at top speed; " @@ -4554,7 +4554,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) } static unsigned -hub_power_remaining (struct usb_hub *hub) +hub_power_remaining(struct usb_hub *hub) { struct usb_device *hdev = hub->hdev; int remaining; @@ -4741,7 +4741,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0200 && udev->speed == USB_SPEED_FULL && highspeed_hubs != 0) - check_highspeed (hub, udev, port1); + check_highspeed(hub, udev, port1); /* Store the parent's children[] pointer. At this point * udev becomes globally accessible, although presumably @@ -5115,7 +5115,7 @@ static const struct usb_device_id hub_id_table[] = { { }/* Terminating entry */ }; -MODULE_DEVICE_TABLE (usb, hub_id_table); +MODULE_DEVICE_TABLE(usb, hub_id_table); static struct usb_driver hub_driver = { .name = "hub", @@ -5227,7 +5227,7 @@ static int descriptors_changed(struct usb_device *udev, changed = 1; break; } - if (memcmp (buf, udev->rawdescriptors[index], old_length) + if (memcmp(buf, udev->rawdescriptors[index], old_length) != 0) { dev_dbg(>dev, "config index %d changed (#%d)\n", index, -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 431839b..169e3d8 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4222,7 +4222,7 @@ static int hub_enable_device(struct usb_device *udev) * but it is still necessary to lock the port. */ static int -hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, +hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, int retry_counter) { struct usb_device *hdev = hub-hdev; @@ -4526,7 +4526,7 @@ fail: } static void -check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) +check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) { struct usb_qualifier_descriptor *qual; int status; @@ -4534,11 +4534,11 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) if (udev-quirks USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc (sizeof *qual, GFP_KERNEL); + qual = kmalloc(sizeof *qual, GFP_KERNEL); if (qual == NULL) return; - status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0, + status = usb_get_descriptor(udev, USB_DT_DEVICE_QUALIFIER, 0, qual, sizeof *qual); if (status == sizeof *qual) { dev_info(udev-dev, not running at top speed; @@ -4554,7 +4554,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) } static unsigned -hub_power_remaining (struct usb_hub *hub) +hub_power_remaining(struct usb_hub *hub) { struct usb_device *hdev = hub-hdev; int remaining; @@ -4741,7 +4741,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, if (le16_to_cpu(udev-descriptor.bcdUSB) = 0x0200 udev-speed == USB_SPEED_FULL highspeed_hubs != 0) - check_highspeed (hub, udev, port1); + check_highspeed(hub, udev, port1); /* Store the parent's children[] pointer. At this point * udev becomes globally accessible, although presumably @@ -5115,7 +5115,7 @@ static const struct usb_device_id hub_id_table[] = { { }/* Terminating entry */ }; -MODULE_DEVICE_TABLE (usb, hub_id_table); +MODULE_DEVICE_TABLE(usb, hub_id_table); static struct usb_driver hub_driver = { .name = hub, @@ -5227,7 +5227,7 @@ static int descriptors_changed(struct usb_device *udev, changed = 1; break; } - if (memcmp (buf, udev-rawdescriptors[index], old_length) + if (memcmp(buf, udev-rawdescriptors[index], old_length) != 0) { dev_dbg(udev-dev, config index %d changed (#%d)\n, index, -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger --- drivers/usb/core/hub.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 38cb6d3..b9cab51 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4218,7 +4218,7 @@ static int hub_enable_device(struct usb_device *udev) * but it is still necessary to lock the port. */ static int -hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, +hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, int retry_counter) { struct usb_device *hdev = hub->hdev; @@ -4522,7 +4522,7 @@ fail: } static void -check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) +check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) { struct usb_qualifier_descriptor *qual; int status; @@ -4530,11 +4530,11 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) if (udev->quirks & USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc (sizeof *qual, GFP_KERNEL); + qual = kmalloc(sizeof *qual, GFP_KERNEL); if (qual == NULL) return; - status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0, + status = usb_get_descriptor udev, USB_DT_DEVICE_QUALIFIER, 0, qual, sizeof *qual); if (status == sizeof *qual) { dev_info(>dev, "not running at top speed; " @@ -4550,7 +4550,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) } static unsigned -hub_power_remaining (struct usb_hub *hub) +hub_power_remaining(struct usb_hub *hub) { struct usb_device *hdev = hub->hdev; int remaining; @@ -4737,7 +4737,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, if (le16_to_cpu(udev->descriptor.bcdUSB) >= 0x0200 && udev->speed == USB_SPEED_FULL && highspeed_hubs != 0) - check_highspeed (hub, udev, port1); + check_highspeed(hub, udev, port1); /* Store the parent's children[] pointer. At this point * udev becomes globally accessible, although presumably @@ -5111,7 +5111,7 @@ static const struct usb_device_id hub_id_table[] = { { }/* Terminating entry */ }; -MODULE_DEVICE_TABLE (usb, hub_id_table); +MODULE_DEVICE_TABLE(usb, hub_id_table); static struct usb_driver hub_driver = { .name = "hub", @@ -5223,7 +5223,7 @@ static int descriptors_changed(struct usb_device *udev, changed = 1; break; } - if (memcmp (buf, udev->rawdescriptors[index], old_length) + if (memcmp(buf, udev->rawdescriptors[index], old_length) != 0) { dev_dbg(>dev, "config index %d changed (#%d)\n", index, -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 38cb6d3..b9cab51 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -4218,7 +4218,7 @@ static int hub_enable_device(struct usb_device *udev) * but it is still necessary to lock the port. */ static int -hub_port_init (struct usb_hub *hub, struct usb_device *udev, int port1, +hub_port_init(struct usb_hub *hub, struct usb_device *udev, int port1, int retry_counter) { struct usb_device *hdev = hub-hdev; @@ -4522,7 +4522,7 @@ fail: } static void -check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) +check_highspeed(struct usb_hub *hub, struct usb_device *udev, int port1) { struct usb_qualifier_descriptor *qual; int status; @@ -4530,11 +4530,11 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) if (udev-quirks USB_QUIRK_DEVICE_QUALIFIER) return; - qual = kmalloc (sizeof *qual, GFP_KERNEL); + qual = kmalloc(sizeof *qual, GFP_KERNEL); if (qual == NULL) return; - status = usb_get_descriptor (udev, USB_DT_DEVICE_QUALIFIER, 0, + status = usb_get_descriptor udev, USB_DT_DEVICE_QUALIFIER, 0, qual, sizeof *qual); if (status == sizeof *qual) { dev_info(udev-dev, not running at top speed; @@ -4550,7 +4550,7 @@ check_highspeed (struct usb_hub *hub, struct usb_device *udev, int port1) } static unsigned -hub_power_remaining (struct usb_hub *hub) +hub_power_remaining(struct usb_hub *hub) { struct usb_device *hdev = hub-hdev; int remaining; @@ -4737,7 +4737,7 @@ static void hub_port_connect(struct usb_hub *hub, int port1, u16 portstatus, if (le16_to_cpu(udev-descriptor.bcdUSB) = 0x0200 udev-speed == USB_SPEED_FULL highspeed_hubs != 0) - check_highspeed (hub, udev, port1); + check_highspeed(hub, udev, port1); /* Store the parent's children[] pointer. At this point * udev becomes globally accessible, although presumably @@ -5111,7 +5111,7 @@ static const struct usb_device_id hub_id_table[] = { { }/* Terminating entry */ }; -MODULE_DEVICE_TABLE (usb, hub_id_table); +MODULE_DEVICE_TABLE(usb, hub_id_table); static struct usb_driver hub_driver = { .name = hub, @@ -5223,7 +5223,7 @@ static int descriptors_changed(struct usb_device *udev, changed = 1; break; } - if (memcmp (buf, udev-rawdescriptors[index], old_length) + if (memcmp(buf, udev-rawdescriptors[index], old_length) != 0) { dev_dbg(udev-dev, config index %d changed (#%d)\n, index, -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger --- drivers/usb/core/hub.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 9387cc20..38cb6d3 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1442,8 +1442,8 @@ static int hub_configure(struct usb_hub *hub, break; } - spin_lock_init (>tt.lock); - INIT_LIST_HEAD (>tt.clear_list); + spin_lock_init(>tt.lock); + INIT_LIST_HEAD(>tt.clear_list); INIT_WORK(>tt.clear_work, hub_tt_work); switch (hdev->descriptor.bDeviceProtocol) { case USB_HUB_PR_FS: @@ -1632,7 +1632,7 @@ static int hub_configure(struct usb_hub *hub, return 0; fail: - dev_err (hub_dev, "config failed, %s (err %d)\n", + dev_err(hub_dev, "config failed, %s (err %d)\n", message, ret); /* hub_disconnect() frees urb and descriptor */ return ret; @@ -1775,7 +1775,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) if ((desc->desc.bInterfaceSubClass != 0) && (desc->desc.bInterfaceSubClass != 1)) { descriptor_error: - dev_err (>dev, "bad descriptor, ignoring hub\n"); + dev_err(>dev, "bad descriptor, ignoring hub\n"); return -EIO; } @@ -1790,11 +1790,11 @@ descriptor_error: goto descriptor_error; /* We found a hub */ - dev_info (>dev, "USB hub found\n"); + dev_info(>dev, "USB hub found\n"); hub = kzalloc(sizeof(*hub), GFP_KERNEL); if (!hub) { - dev_dbg (>dev, "couldn't kmalloc hub struct\n"); + dev_dbg(>dev, "couldn't kmalloc hub struct\n"); return -ENOMEM; } @@ -1807,7 +1807,7 @@ descriptor_error: usb_get_intf(intf); usb_get_dev(hdev); - usb_set_intfdata (intf, hub); + usb_set_intfdata(intf, hub); intf->needs_remote_wakeup = 1; pm_suspend_ignore_children(>dev, true); @@ -1820,14 +1820,14 @@ descriptor_error: if (hub_configure(hub, endpoint) >= 0) return 0; - hub_disconnect (intf); + hub_disconnect(intf); return -ENODEV; } static int hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data) { - struct usb_device *hdev = interface_to_usbdev (intf); + struct usb_device *hdev = interface_to_usbdev(intf); struct usb_hub *hub = usb_hub_to_struct_hub(hdev); /* assert ifno == 0 (part of hub spec) */ @@ -2143,7 +2143,7 @@ void usb_disconnect(struct usb_device **pdev) * cleaning up all state associated with the current configuration * so that the hardware is now fully quiesced. */ - dev_dbg (>dev, "unregistering device\n"); + dev_dbg(>dev, "unregistering device\n"); usb_disable_device(udev, 0); usb_hcd_synchronize_unlinks(udev); @@ -2242,7 +2242,7 @@ static int usb_enumerate_device_otg(struct usb_device *udev) struct usb_bus *bus = udev->bus; /* descriptor may appear anywhere in config */ - if (__usb_get_extra_descriptor (udev->rawdescriptors[0], + if (__usb_get_extra_descriptor(udev->rawdescriptors[0], le16_to_cpu(udev->config[0].desc.wTotalLength), USB_DT_OTG, (void **) ) == 0) { if (desc->bmAttributes & USB_OTG_HNP) { @@ -3526,7 +3526,7 @@ static int check_ports_changed(struct usb_hub *hub) static int hub_suspend(struct usb_interface *intf, pm_message_t msg) { - struct usb_hub *hub = usb_get_intfdata (intf); + struct usb_hub *hub = usb_get_intfdata(intf); struct usb_device *hdev = hub->hdev; unsignedport1; int status; -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: hub: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 9387cc20..38cb6d3 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -1442,8 +1442,8 @@ static int hub_configure(struct usb_hub *hub, break; } - spin_lock_init (hub-tt.lock); - INIT_LIST_HEAD (hub-tt.clear_list); + spin_lock_init(hub-tt.lock); + INIT_LIST_HEAD(hub-tt.clear_list); INIT_WORK(hub-tt.clear_work, hub_tt_work); switch (hdev-descriptor.bDeviceProtocol) { case USB_HUB_PR_FS: @@ -1632,7 +1632,7 @@ static int hub_configure(struct usb_hub *hub, return 0; fail: - dev_err (hub_dev, config failed, %s (err %d)\n, + dev_err(hub_dev, config failed, %s (err %d)\n, message, ret); /* hub_disconnect() frees urb and descriptor */ return ret; @@ -1775,7 +1775,7 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id) if ((desc-desc.bInterfaceSubClass != 0) (desc-desc.bInterfaceSubClass != 1)) { descriptor_error: - dev_err (intf-dev, bad descriptor, ignoring hub\n); + dev_err(intf-dev, bad descriptor, ignoring hub\n); return -EIO; } @@ -1790,11 +1790,11 @@ descriptor_error: goto descriptor_error; /* We found a hub */ - dev_info (intf-dev, USB hub found\n); + dev_info(intf-dev, USB hub found\n); hub = kzalloc(sizeof(*hub), GFP_KERNEL); if (!hub) { - dev_dbg (intf-dev, couldn't kmalloc hub struct\n); + dev_dbg(intf-dev, couldn't kmalloc hub struct\n); return -ENOMEM; } @@ -1807,7 +1807,7 @@ descriptor_error: usb_get_intf(intf); usb_get_dev(hdev); - usb_set_intfdata (intf, hub); + usb_set_intfdata(intf, hub); intf-needs_remote_wakeup = 1; pm_suspend_ignore_children(intf-dev, true); @@ -1820,14 +1820,14 @@ descriptor_error: if (hub_configure(hub, endpoint) = 0) return 0; - hub_disconnect (intf); + hub_disconnect(intf); return -ENODEV; } static int hub_ioctl(struct usb_interface *intf, unsigned int code, void *user_data) { - struct usb_device *hdev = interface_to_usbdev (intf); + struct usb_device *hdev = interface_to_usbdev(intf); struct usb_hub *hub = usb_hub_to_struct_hub(hdev); /* assert ifno == 0 (part of hub spec) */ @@ -2143,7 +2143,7 @@ void usb_disconnect(struct usb_device **pdev) * cleaning up all state associated with the current configuration * so that the hardware is now fully quiesced. */ - dev_dbg (udev-dev, unregistering device\n); + dev_dbg(udev-dev, unregistering device\n); usb_disable_device(udev, 0); usb_hcd_synchronize_unlinks(udev); @@ -2242,7 +2242,7 @@ static int usb_enumerate_device_otg(struct usb_device *udev) struct usb_bus *bus = udev-bus; /* descriptor may appear anywhere in config */ - if (__usb_get_extra_descriptor (udev-rawdescriptors[0], + if (__usb_get_extra_descriptor(udev-rawdescriptors[0], le16_to_cpu(udev-config[0].desc.wTotalLength), USB_DT_OTG, (void **) desc) == 0) { if (desc-bmAttributes USB_OTG_HNP) { @@ -3526,7 +3526,7 @@ static int check_ports_changed(struct usb_hub *hub) static int hub_suspend(struct usb_interface *intf, pm_message_t msg) { - struct usb_hub *hub = usb_get_intfdata (intf); + struct usb_hub *hub = usb_get_intfdata(intf); struct usb_device *hdev = hub-hdev; unsignedport1; int status; -- 2.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] usb: core: hub.c: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger --- drivers/usb/core/hub.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 73dfa19..9387cc20 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -50,8 +50,8 @@ DEFINE_MUTEX(usb_port_peer_mutex); /* cycle leds on hubs that aren't blinking for attention */ static bool blinkenlights = 0; -module_param (blinkenlights, bool, S_IRUGO); -MODULE_PARM_DESC (blinkenlights, "true to cycle leds on hubs"); +module_param(blinkenlights, bool, S_IRUGO); +MODULE_PARM_DESC(blinkenlights, "true to cycle leds on hubs"); /* * Device SATA8000 FW1.0 from DATAST0R Technology Corp requires about @@ -439,7 +439,7 @@ static void set_port_led(struct usb_hub *hub, int port1, int selector) #defineLED_CYCLE_PERIOD((2*HZ)/3) -static void led_work (struct work_struct *work) +static void led_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, leds.work); @@ -646,7 +646,7 @@ static void hub_irq(struct urb *urb) default:/* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ - dev_dbg (hub->intfdev, "transfer --> %d\n", status); + dev_dbg(hub->intfdev, "transfer --> %d\n", status); if ((++hub->nerrors < 10) || hub->error) goto resubmit; hub->error = status; @@ -671,14 +671,14 @@ resubmit: if (hub->quiescing) return; - if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0 + if ((status = usb_submit_urb(hub->urb, GFP_ATOMIC)) != 0 && status != -ENODEV && status != -EPERM) - dev_err (hub->intfdev, "resubmit --> %d\n", status); + dev_err(hub->intfdev, "resubmit --> %d\n", status); } /* USB 2.0 spec Section 11.24.2.3 */ static inline int -hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) +hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt) { /* Need to clear both directions for control ep */ if (((devinfo >> 11) & USB_ENDPOINT_XFERTYPE_MASK) == @@ -706,7 +706,7 @@ static void hub_tt_work(struct work_struct *work) container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; - spin_lock_irqsave (>tt.lock, flags); + spin_lock_irqsave(>tt.lock, flags); while (!list_empty(>tt.clear_list)) { struct list_head*next; struct usb_tt_clear *clear; @@ -715,14 +715,14 @@ static void hub_tt_work(struct work_struct *work) int status; next = hub->tt.clear_list.next; - clear = list_entry (next, struct usb_tt_clear, clear_list); - list_del (>clear_list); + clear = list_entry(next, struct usb_tt_clear, clear_list); + list_del(>clear_list); /* drop lock so HCD can concurrently report other TT errors */ - spin_unlock_irqrestore (>tt.lock, flags); - status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt); + spin_unlock_irqrestore(>tt.lock, flags); + status = hub_clear_tt_buffer(hdev, clear->devinfo, clear->tt); if (status && status != -ENODEV) - dev_err (>dev, + dev_err(>dev, "clear tt %d (%04x) error %d\n", clear->tt, clear->devinfo, status); @@ -734,7 +734,7 @@ static void hub_tt_work(struct work_struct *work) kfree(clear); spin_lock_irqsave(>tt.lock, flags); } - spin_unlock_irqrestore (>tt.lock, flags); + spin_unlock_irqrestore(>tt.lock, flags); } /** @@ -797,7 +797,7 @@ int usb_hub_clear_tt_buffer(struct urb *urb) */ clear = kmalloc(sizeof *clear, GFP_ATOMIC); if (clear == NULL) { - dev_err (>dev, "can't save CLEAR_TT_BUFFER state\n"); + dev_err(>dev, "can't save CLEAR_TT_BUFFER state\n"); /* FIXME recover somehow ... RESET_TT? */ return -ENOMEM; } @@ -806,10 +806,10 @@ int usb_hub_clear_tt_buffer(struct urb *urb) clear->tt = tt->multi ? udev->ttport : 1; clear->devinfo = usb_pipeendpoint (pipe); clear->devinfo |= udev->devnum << 4; - clear->
[PATCH] usb: core: hub.c: Removed some warnings generated by checkpatch.pl
Removed some checkpatch.pl warnings saying there was an unwanted space between function names and their arguments. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 73dfa19..9387cc20 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -50,8 +50,8 @@ DEFINE_MUTEX(usb_port_peer_mutex); /* cycle leds on hubs that aren't blinking for attention */ static bool blinkenlights = 0; -module_param (blinkenlights, bool, S_IRUGO); -MODULE_PARM_DESC (blinkenlights, true to cycle leds on hubs); +module_param(blinkenlights, bool, S_IRUGO); +MODULE_PARM_DESC(blinkenlights, true to cycle leds on hubs); /* * Device SATA8000 FW1.0 from DATAST0R Technology Corp requires about @@ -439,7 +439,7 @@ static void set_port_led(struct usb_hub *hub, int port1, int selector) #defineLED_CYCLE_PERIOD((2*HZ)/3) -static void led_work (struct work_struct *work) +static void led_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, leds.work); @@ -646,7 +646,7 @@ static void hub_irq(struct urb *urb) default:/* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ - dev_dbg (hub-intfdev, transfer -- %d\n, status); + dev_dbg(hub-intfdev, transfer -- %d\n, status); if ((++hub-nerrors 10) || hub-error) goto resubmit; hub-error = status; @@ -671,14 +671,14 @@ resubmit: if (hub-quiescing) return; - if ((status = usb_submit_urb (hub-urb, GFP_ATOMIC)) != 0 + if ((status = usb_submit_urb(hub-urb, GFP_ATOMIC)) != 0 status != -ENODEV status != -EPERM) - dev_err (hub-intfdev, resubmit -- %d\n, status); + dev_err(hub-intfdev, resubmit -- %d\n, status); } /* USB 2.0 spec Section 11.24.2.3 */ static inline int -hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) +hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt) { /* Need to clear both directions for control ep */ if (((devinfo 11) USB_ENDPOINT_XFERTYPE_MASK) == @@ -706,7 +706,7 @@ static void hub_tt_work(struct work_struct *work) container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; - spin_lock_irqsave (hub-tt.lock, flags); + spin_lock_irqsave(hub-tt.lock, flags); while (!list_empty(hub-tt.clear_list)) { struct list_head*next; struct usb_tt_clear *clear; @@ -715,14 +715,14 @@ static void hub_tt_work(struct work_struct *work) int status; next = hub-tt.clear_list.next; - clear = list_entry (next, struct usb_tt_clear, clear_list); - list_del (clear-clear_list); + clear = list_entry(next, struct usb_tt_clear, clear_list); + list_del(clear-clear_list); /* drop lock so HCD can concurrently report other TT errors */ - spin_unlock_irqrestore (hub-tt.lock, flags); - status = hub_clear_tt_buffer (hdev, clear-devinfo, clear-tt); + spin_unlock_irqrestore(hub-tt.lock, flags); + status = hub_clear_tt_buffer(hdev, clear-devinfo, clear-tt); if (status status != -ENODEV) - dev_err (hdev-dev, + dev_err(hdev-dev, clear tt %d (%04x) error %d\n, clear-tt, clear-devinfo, status); @@ -734,7 +734,7 @@ static void hub_tt_work(struct work_struct *work) kfree(clear); spin_lock_irqsave(hub-tt.lock, flags); } - spin_unlock_irqrestore (hub-tt.lock, flags); + spin_unlock_irqrestore(hub-tt.lock, flags); } /** @@ -797,7 +797,7 @@ int usb_hub_clear_tt_buffer(struct urb *urb) */ clear = kmalloc(sizeof *clear, GFP_ATOMIC); if (clear == NULL) { - dev_err (udev-dev, can't save CLEAR_TT_BUFFER state\n); + dev_err(udev-dev, can't save CLEAR_TT_BUFFER state\n); /* FIXME recover somehow ... RESET_TT? */ return -ENOMEM; } @@ -806,10 +806,10 @@ int usb_hub_clear_tt_buffer(struct urb *urb) clear-tt = tt-multi ? udev-ttport : 1; clear-devinfo = usb_pipeendpoint (pipe); clear-devinfo |= udev-devnum 4; - clear-devinfo |= usb_pipecontrol (pipe) + clear-devinfo |= usb_pipecontrol(pipe) ? (USB_ENDPOINT_XFER_CONTROL 11) : (USB_ENDPOINT_XFER_BULK 11); - if (usb_pipein (pipe)) + if (usb_pipein
[PATCH] drivers/usb/core: hcd.c: Removed BitTime space warnings
Removed BitTime macro space warnings generated by checkpatch.pl. Signed-off-by: Chase Metzger --- drivers/usb/core/hcd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 601476c7..299ff0d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1116,18 +1116,18 @@ long usb_calc_bus_time(int speed, int is_input, int isoc, int bytecount) switch (speed) { case USB_SPEED_LOW: /* INTR only */ if (is_input) { - tmp = (67667L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (67667L * (31L + 10L * BitTime(bytecount))) / 1000L; return 64060L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp; } else { - tmp = (66700L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (66700L * (31L + 10L * BitTime(bytecount))) / 1000L; return 64107L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp; } case USB_SPEED_FULL:/* ISOC or INTR */ if (isoc) { - tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (8354L * (31L + 10L * BitTime(bytecount))) / 1000L; return ((is_input) ? 7268L : 6265L) + BW_HOST_DELAY + tmp; } else { - tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (8354L * (31L + 10L * BitTime(bytecount))) / 1000L; return 9107L + BW_HOST_DELAY + tmp; } case USB_SPEED_HIGH:/* ISOC or INTR */ -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: devio.c: Reverted previous debug print changes
Changed dev_dbg(...) back to dev_printk(KERN_DEBUG, ...) based on previous patches feedback. Signed-off-by: Chase Metzger --- drivers/usb/core/devio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 62c0be6..2734a14 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i < 0 && i != -EPIPE) { - dev_dbg(>dev, "usbfs: USBDEVFS_CONTROL " + dev_printk(KERN_DEBUG, >dev, "usbfs: USBDEVFS_CONTROL " "failed cmd %s rqt %u rq %u len %u ret %d\n", current->comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1591,7 +1591,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_dbg(>dev->dev, "usbfs: usb_submit_urb returned %d\n", ret); + dev_printk(KERN_DEBUG, >dev->dev, + "usbfs: usb_submit_urb returned %d\n", ret); snoop_urb(ps->dev, as->userurb, as->urb->pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: hcd.c: Added parenthesis' to sizeof
Removed all warnings generated by checkpatch.pl about sizeof not having parenthesis'. Signed-off-by: Chase Metzger --- drivers/usb/core/hcd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 557f2b8..601476c7 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -447,7 +447,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) break; case 3: /* Manufacturer */ - snprintf(buf, sizeof buf, "%s %s %s", init_utsname()->sysname, + snprintf(buf, sizeof(buf), "%s %s %s", init_utsname()->sysname, init_utsname()->release, hcd->driver->description); s = buf; break; @@ -578,16 +578,16 @@ static int rh_call_control(struct usb_hcd *hcd, struct urb *urb) switch (hcd->speed) { case HCD_USB3: bufp = ss_rh_config_descriptor; - len = sizeof ss_rh_config_descriptor; + len = sizeof(ss_rh_config_descriptor); break; case HCD_USB25: case HCD_USB2: bufp = hs_rh_config_descriptor; - len = sizeof hs_rh_config_descriptor; + len = sizeof(hs_rh_config_descriptor); break; case HCD_USB11: bufp = fs_rh_config_descriptor; - len = sizeof fs_rh_config_descriptor; + len = sizeof(fs_rh_config_descriptor); break; default: goto error; @@ -1008,7 +1008,7 @@ static int register_root_hub(struct usb_hcd *hcd) usb_dev->devnum = devnum; usb_dev->bus->devnum_next = devnum + 1; memset(_dev->bus->devmap.devicemap, 0, - sizeof usb_dev->bus->devmap.devicemap); + sizeof(usb_dev->bus->devmap.devicemap)); set_bit(devnum, usb_dev->bus->devmap.devicemap); usb_set_device_state(usb_dev, USB_STATE_ADDRESS); @@ -1016,7 +1016,7 @@ static int register_root_hub(struct usb_hcd *hcd) usb_dev->ep0.desc.wMaxPacketSize = cpu_to_le16(64); retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE); - if (retval != sizeof usb_dev->descriptor) { + if (retval != sizeof(usb_dev->descriptor)) { mutex_unlock(_bus_list_lock); dev_dbg(parent_dev, "can't read %s device descriptor %d\n", dev_name(_dev->dev), retval); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: hcd.c: Removed all space warnings from checkpatch.pl
Removed all(except false positives, from calculations) space prohibited warnings generated by checkpatch.pl. Signed-off-by: Chase Metzger --- drivers/usb/core/hcd.c | 168 - 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 45a915c..557f2b8 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -90,8 +90,8 @@ unsigned long usb_hcds_loaded; EXPORT_SYMBOL_GPL(usb_hcds_loaded); /* host controllers we manage */ -LIST_HEAD (usb_bus_list); -EXPORT_SYMBOL_GPL (usb_bus_list); +LIST_HEAD(usb_bus_list); +EXPORT_SYMBOL_GPL(usb_bus_list); /* used when allocating bus numbers */ #define USB_MAXBUS 64 @@ -99,7 +99,7 @@ static DECLARE_BITMAP(busmap, USB_MAXBUS); /* used when updating list of hcds */ DEFINE_MUTEX(usb_bus_list_lock); /* exported only for usbfs */ -EXPORT_SYMBOL_GPL (usb_bus_list_lock); +EXPORT_SYMBOL_GPL(usb_bus_list_lock); /* used for controlling access to virtual root hubs */ static DEFINE_SPINLOCK(hcd_root_hub_lock); @@ -447,7 +447,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) break; case 3: /* Manufacturer */ - snprintf (buf, sizeof buf, "%s %s %s", init_utsname()->sysname, + snprintf(buf, sizeof buf, "%s %s %s", init_utsname()->sysname, init_utsname()->release, hcd->driver->description); s = buf; break; @@ -461,7 +461,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) /* Root hub control transfers execute synchronously */ -static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) +static int rh_call_control(struct usb_hcd *hcd, struct urb *urb) { struct usb_ctrlrequest *cmd; u16 typeReq, wValue, wIndex, wLength; @@ -485,9 +485,9 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) cmd = (struct usb_ctrlrequest *) urb->setup_packet; typeReq = (cmd->bRequestType << 8) | cmd->bRequest; - wValue = le16_to_cpu (cmd->wValue); - wIndex = le16_to_cpu (cmd->wIndex); - wLength = le16_to_cpu (cmd->wLength); + wValue = le16_to_cpu(cmd->wValue); + wIndex = le16_to_cpu(cmd->wIndex); + wLength = le16_to_cpu(cmd->wLength); if (wLength > urb->transfer_buffer_length) goto error; @@ -616,7 +616,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) break; case DeviceOutRequest | USB_REQ_SET_ADDRESS: /* wValue == urb->dev->devaddr */ - dev_dbg (hcd->self.controller, "root hub device address %d\n", + dev_dbg(hcd->self.controller, "root hub device address %d\n", wValue); break; @@ -632,7 +632,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) /* FALLTHROUGH */ case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: case EndpointOutRequest | USB_REQ_SET_FEATURE: - dev_dbg (hcd->self.controller, "no endpoint features yet\n"); + dev_dbg(hcd->self.controller, "no endpoint features yet\n"); break; /* CLASS REQUESTS (and errors) */ @@ -646,13 +646,13 @@ nongeneric: len = 4; break; case GetHubDescriptor: - len = sizeof (struct usb_hub_descriptor); + len = sizeof(struct usb_hub_descriptor); break; case DeviceRequest | USB_REQ_GET_DESCRIPTOR: /* len is returned by hub_control */ break; } - status = hcd->driver->hub_control (hcd, + status = hcd->driver->hub_control(hcd, typeReq, wValue, wIndex, tbuf, wLength); @@ -668,7 +668,7 @@ error: if (status < 0) { len = 0; if (status != -EPIPE) { - dev_dbg (hcd->self.controller, + dev_dbg(hcd->self.controller, "CTRL: TypeReq=0x%x val=0x%x " "idx=0x%x len=%d ==> %d\n", typeReq, wValue, wIndex, @@ -684,11 +684,11 @@ error: len = urb->transfer_buffer_length; urb->actual_length = len; /* always USB_DIR_IN, toward host */ - memcpy (ubuf, bufp, len); + memcpy(ubuf, bufp, len); /* report whether RH hardware supports remote wakeup */
[PATCH] drivers/usb/core: sysfs.c: Removed a couple warnings
Removed a warnings(from checkpatch.pl) about sizeof not having parenthesis'. added parenthesis' around the strings being used. Signed-off-by: Chase Metzger --- drivers/usb/core/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index d269738..bb8aff1 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -428,11 +428,11 @@ static ssize_t level_store(struct device *dev, struct device_attribute *attr, usb_lock_device(udev); - if (len == sizeof on_string - 1 && + if (len == sizeof(on_string) - 1 && strncmp(buf, on_string, len) == 0) usb_disable_autosuspend(udev); - else if (len == sizeof auto_string - 1 && + else if (len == sizeof(auto_string) - 1 && strncmp(buf, auto_string, len) == 0) usb_enable_autosuspend(udev); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: devio.c: Removed various errors and warnings generated by checkpatch.pl
Fixed several errors and warnings. Lines 29, 103, 1319, 1906 and 2408: removed unnecessary spaces or added appropriate spaces. Lines 1040 and 1591: changed dev_printk(KERN_DEBUG, ...) to dev_dbg(...). Signed-off-by: Chase Metzger --- drivers/usb/core/devio.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 1163553..62c0be6 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -29,7 +29,7 @@ *22.12.1999 0.1 Initial release (split from proc_usb.c) *04.01.2000 0.2 Turned into its own filesystem *30.09.2005 0.3 Fix user-triggerable oops in async URB delivery - * (CAN-2005-3055) + * (CAN-2005-3055) */ /*/ @@ -103,7 +103,7 @@ MODULE_PARM_DESC(usbfs_snoop, "true to log all usbfs traffic"); #define snoop(dev, format, arg...) \ do {\ if (usbfs_snoop)\ - dev_info(dev , format , ## arg);\ + dev_info(dev, format, ## arg); \ } while (0) enum snoop_when { @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i < 0 && i != -EPIPE) { - dev_printk(KERN_DEBUG, >dev, "usbfs: USBDEVFS_CONTROL " + dev_dbg(>dev, "usbfs: USBDEVFS_CONTROL " "failed cmd %s rqt %u rq %u len %u ret %d\n", current->comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1319,7 +1319,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb is_in = (uurb->endpoint & USB_ENDPOINT_DIR_MASK) != 0; u = 0; - switch(uurb->type) { + switch (uurb->type) { case USBDEVFS_URB_TYPE_CONTROL: if (!usb_endpoint_xfer_control(>desc)) return -EINVAL; @@ -1591,8 +1591,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_printk(KERN_DEBUG, >dev->dev, - "usbfs: usb_submit_urb returned %d\n", ret); + dev_dbg(>dev->dev, "usbfs: usb_submit_urb returned %d\n", ret); snoop_urb(ps->dev, as->userurb, as->urb->pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); @@ -1906,7 +1905,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) return -EFAULT; if ((ret = releaseintf(ps, ifnum)) < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } @@ -2408,7 +2407,7 @@ static int usbdev_notify(struct notifier_block *self, } static struct notifier_block usbdev_nb = { - .notifier_call =usbdev_notify, + .notifier_call =usbdev_notify, }; static struct cdev usb_device_cdev; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: hub.c: Removed all warnings about a space between a function name and parenthesis'
Removed 41 warnings all about a space between a function and the parenthesis' during a function call. Signed-off-by: Chase Metzger --- drivers/usb/core/hub.c | 82 +- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d7c3d5a..7ac2f82 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -50,8 +50,8 @@ DEFINE_MUTEX(usb_port_peer_mutex); /* cycle leds on hubs that aren't blinking for attention */ static bool blinkenlights = 0; -module_param (blinkenlights, bool, S_IRUGO); -MODULE_PARM_DESC (blinkenlights, "true to cycle leds on hubs"); +module_param(blinkenlights, bool, S_IRUGO); +MODULE_PARM_DESC(blinkenlights, "true to cycle leds on hubs"); /* * Device SATA8000 FW1.0 from DATAST0R Technology Corp requires about @@ -439,7 +439,7 @@ static void set_port_led(struct usb_hub *hub, int port1, int selector) #defineLED_CYCLE_PERIOD((2*HZ)/3) -static void led_work (struct work_struct *work) +static void led_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, leds.work); @@ -646,7 +646,7 @@ static void hub_irq(struct urb *urb) default:/* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ - dev_dbg (hub->intfdev, "transfer --> %d\n", status); + dev_dbg(hub->intfdev, "transfer --> %d\n", status); if ((++hub->nerrors < 10) || hub->error) goto resubmit; hub->error = status; @@ -671,14 +671,14 @@ resubmit: if (hub->quiescing) return; - if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0 + if ((status = usb_submit_urb(hub->urb, GFP_ATOMIC)) != 0 && status != -ENODEV && status != -EPERM) - dev_err (hub->intfdev, "resubmit --> %d\n", status); + dev_err(hub->intfdev, "resubmit --> %d\n", status); } /* USB 2.0 spec Section 11.24.2.3 */ static inline int -hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) +hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt) { /* Need to clear both directions for control ep */ if (((devinfo >> 11) & USB_ENDPOINT_XFERTYPE_MASK) == @@ -706,7 +706,7 @@ static void hub_tt_work(struct work_struct *work) container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; - spin_lock_irqsave (>tt.lock, flags); + spin_lock_irqsave(>tt.lock, flags); while (!list_empty(>tt.clear_list)) { struct list_head*next; struct usb_tt_clear *clear; @@ -715,14 +715,14 @@ static void hub_tt_work(struct work_struct *work) int status; next = hub->tt.clear_list.next; - clear = list_entry (next, struct usb_tt_clear, clear_list); - list_del (>clear_list); + clear = list_entry(next, struct usb_tt_clear, clear_list); + list_del(>clear_list); /* drop lock so HCD can concurrently report other TT errors */ - spin_unlock_irqrestore (>tt.lock, flags); - status = hub_clear_tt_buffer (hdev, clear->devinfo, clear->tt); + spin_unlock_irqrestore(>tt.lock, flags); + status = hub_clear_tt_buffer(hdev, clear->devinfo, clear->tt); if (status && status != -ENODEV) - dev_err (>dev, + dev_err(>dev, "clear tt %d (%04x) error %d\n", clear->tt, clear->devinfo, status); @@ -734,7 +734,7 @@ static void hub_tt_work(struct work_struct *work) kfree(clear); spin_lock_irqsave(>tt.lock, flags); } - spin_unlock_irqrestore (>tt.lock, flags); + spin_unlock_irqrestore(>tt.lock, flags); } /** @@ -795,8 +795,8 @@ int usb_hub_clear_tt_buffer(struct urb *urb) * since each TT has "at least two" buffers that can need it (and * there can be many TTs per hub). even if they're uncommon. */ - if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) { - dev_err (>dev, "can't save CLEAR_TT_BUFFER state\n"); + if ((clear = kmalloc(sizeof *clear, GFP_ATOMIC)) == NULL) { + dev_err(>dev, "can't save CLEAR_TT_BUFFER state\n"); /* FIXME recover somehow ... RESET_TT? */ return -ENOMEM; } @@ -805,10 +805,10 @@ int usb_hub_clear_t
[PATCH] drivers/usb/core: devio.c: Removed various errors and warnings generated by checkpatch.pl
Fixed several errors and warnings. Lines 29, 103, 1319, 1906 and 2408: removed unnecessary spaces or added appropriate spaces. Lines 1040 and 1591: changed dev_printk(KERN_DEBUG, ...) to dev_dbg(...). Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/devio.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 1163553..62c0be6 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -29,7 +29,7 @@ *22.12.1999 0.1 Initial release (split from proc_usb.c) *04.01.2000 0.2 Turned into its own filesystem *30.09.2005 0.3 Fix user-triggerable oops in async URB delivery - * (CAN-2005-3055) + * (CAN-2005-3055) */ /*/ @@ -103,7 +103,7 @@ MODULE_PARM_DESC(usbfs_snoop, true to log all usbfs traffic); #define snoop(dev, format, arg...) \ do {\ if (usbfs_snoop)\ - dev_info(dev , format , ## arg);\ + dev_info(dev, format, ## arg); \ } while (0) enum snoop_when { @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i 0 i != -EPIPE) { - dev_printk(KERN_DEBUG, dev-dev, usbfs: USBDEVFS_CONTROL + dev_dbg(dev-dev, usbfs: USBDEVFS_CONTROL failed cmd %s rqt %u rq %u len %u ret %d\n, current-comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1319,7 +1319,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb is_in = (uurb-endpoint USB_ENDPOINT_DIR_MASK) != 0; u = 0; - switch(uurb-type) { + switch (uurb-type) { case USBDEVFS_URB_TYPE_CONTROL: if (!usb_endpoint_xfer_control(ep-desc)) return -EINVAL; @@ -1591,8 +1591,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_printk(KERN_DEBUG, ps-dev-dev, - usbfs: usb_submit_urb returned %d\n, ret); + dev_dbg(ps-dev-dev, usbfs: usb_submit_urb returned %d\n, ret); snoop_urb(ps-dev, as-userurb, as-urb-pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); @@ -1906,7 +1905,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) return -EFAULT; if ((ret = releaseintf(ps, ifnum)) 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } @@ -2408,7 +2407,7 @@ static int usbdev_notify(struct notifier_block *self, } static struct notifier_block usbdev_nb = { - .notifier_call =usbdev_notify, + .notifier_call =usbdev_notify, }; static struct cdev usb_device_cdev; -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: sysfs.c: Removed a couple warnings
Removed a warnings(from checkpatch.pl) about sizeof not having parenthesis'. added parenthesis' around the strings being used. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/sysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/sysfs.c b/drivers/usb/core/sysfs.c index d269738..bb8aff1 100644 --- a/drivers/usb/core/sysfs.c +++ b/drivers/usb/core/sysfs.c @@ -428,11 +428,11 @@ static ssize_t level_store(struct device *dev, struct device_attribute *attr, usb_lock_device(udev); - if (len == sizeof on_string - 1 + if (len == sizeof(on_string) - 1 strncmp(buf, on_string, len) == 0) usb_disable_autosuspend(udev); - else if (len == sizeof auto_string - 1 + else if (len == sizeof(auto_string) - 1 strncmp(buf, auto_string, len) == 0) usb_enable_autosuspend(udev); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: hub.c: Removed all warnings about a space between a function name and parenthesis'
Removed 41 warnings all about a space between a function and the parenthesis' during a function call. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hub.c | 82 +- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index d7c3d5a..7ac2f82 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -50,8 +50,8 @@ DEFINE_MUTEX(usb_port_peer_mutex); /* cycle leds on hubs that aren't blinking for attention */ static bool blinkenlights = 0; -module_param (blinkenlights, bool, S_IRUGO); -MODULE_PARM_DESC (blinkenlights, true to cycle leds on hubs); +module_param(blinkenlights, bool, S_IRUGO); +MODULE_PARM_DESC(blinkenlights, true to cycle leds on hubs); /* * Device SATA8000 FW1.0 from DATAST0R Technology Corp requires about @@ -439,7 +439,7 @@ static void set_port_led(struct usb_hub *hub, int port1, int selector) #defineLED_CYCLE_PERIOD((2*HZ)/3) -static void led_work (struct work_struct *work) +static void led_work(struct work_struct *work) { struct usb_hub *hub = container_of(work, struct usb_hub, leds.work); @@ -646,7 +646,7 @@ static void hub_irq(struct urb *urb) default:/* presumably an error */ /* Cause a hub reset after 10 consecutive errors */ - dev_dbg (hub-intfdev, transfer -- %d\n, status); + dev_dbg(hub-intfdev, transfer -- %d\n, status); if ((++hub-nerrors 10) || hub-error) goto resubmit; hub-error = status; @@ -671,14 +671,14 @@ resubmit: if (hub-quiescing) return; - if ((status = usb_submit_urb (hub-urb, GFP_ATOMIC)) != 0 + if ((status = usb_submit_urb(hub-urb, GFP_ATOMIC)) != 0 status != -ENODEV status != -EPERM) - dev_err (hub-intfdev, resubmit -- %d\n, status); + dev_err(hub-intfdev, resubmit -- %d\n, status); } /* USB 2.0 spec Section 11.24.2.3 */ static inline int -hub_clear_tt_buffer (struct usb_device *hdev, u16 devinfo, u16 tt) +hub_clear_tt_buffer(struct usb_device *hdev, u16 devinfo, u16 tt) { /* Need to clear both directions for control ep */ if (((devinfo 11) USB_ENDPOINT_XFERTYPE_MASK) == @@ -706,7 +706,7 @@ static void hub_tt_work(struct work_struct *work) container_of(work, struct usb_hub, tt.clear_work); unsigned long flags; - spin_lock_irqsave (hub-tt.lock, flags); + spin_lock_irqsave(hub-tt.lock, flags); while (!list_empty(hub-tt.clear_list)) { struct list_head*next; struct usb_tt_clear *clear; @@ -715,14 +715,14 @@ static void hub_tt_work(struct work_struct *work) int status; next = hub-tt.clear_list.next; - clear = list_entry (next, struct usb_tt_clear, clear_list); - list_del (clear-clear_list); + clear = list_entry(next, struct usb_tt_clear, clear_list); + list_del(clear-clear_list); /* drop lock so HCD can concurrently report other TT errors */ - spin_unlock_irqrestore (hub-tt.lock, flags); - status = hub_clear_tt_buffer (hdev, clear-devinfo, clear-tt); + spin_unlock_irqrestore(hub-tt.lock, flags); + status = hub_clear_tt_buffer(hdev, clear-devinfo, clear-tt); if (status status != -ENODEV) - dev_err (hdev-dev, + dev_err(hdev-dev, clear tt %d (%04x) error %d\n, clear-tt, clear-devinfo, status); @@ -734,7 +734,7 @@ static void hub_tt_work(struct work_struct *work) kfree(clear); spin_lock_irqsave(hub-tt.lock, flags); } - spin_unlock_irqrestore (hub-tt.lock, flags); + spin_unlock_irqrestore(hub-tt.lock, flags); } /** @@ -795,8 +795,8 @@ int usb_hub_clear_tt_buffer(struct urb *urb) * since each TT has at least two buffers that can need it (and * there can be many TTs per hub). even if they're uncommon. */ - if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) { - dev_err (udev-dev, can't save CLEAR_TT_BUFFER state\n); + if ((clear = kmalloc(sizeof *clear, GFP_ATOMIC)) == NULL) { + dev_err(udev-dev, can't save CLEAR_TT_BUFFER state\n); /* FIXME recover somehow ... RESET_TT? */ return -ENOMEM; } @@ -805,10 +805,10 @@ int usb_hub_clear_tt_buffer(struct urb *urb) clear-tt = tt-multi ? udev-ttport : 1; clear-devinfo = usb_pipeendpoint (pipe); clear-devinfo |= udev-devnum 4; - clear-devinfo |= usb_pipecontrol (pipe) + clear-devinfo
[PATCH] drivers/usb/core: hcd.c: Removed all space warnings from checkpatch.pl
Removed all(except false positives, from calculations) space prohibited warnings generated by checkpatch.pl. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hcd.c | 168 - 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 45a915c..557f2b8 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -90,8 +90,8 @@ unsigned long usb_hcds_loaded; EXPORT_SYMBOL_GPL(usb_hcds_loaded); /* host controllers we manage */ -LIST_HEAD (usb_bus_list); -EXPORT_SYMBOL_GPL (usb_bus_list); +LIST_HEAD(usb_bus_list); +EXPORT_SYMBOL_GPL(usb_bus_list); /* used when allocating bus numbers */ #define USB_MAXBUS 64 @@ -99,7 +99,7 @@ static DECLARE_BITMAP(busmap, USB_MAXBUS); /* used when updating list of hcds */ DEFINE_MUTEX(usb_bus_list_lock); /* exported only for usbfs */ -EXPORT_SYMBOL_GPL (usb_bus_list_lock); +EXPORT_SYMBOL_GPL(usb_bus_list_lock); /* used for controlling access to virtual root hubs */ static DEFINE_SPINLOCK(hcd_root_hub_lock); @@ -447,7 +447,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) break; case 3: /* Manufacturer */ - snprintf (buf, sizeof buf, %s %s %s, init_utsname()-sysname, + snprintf(buf, sizeof buf, %s %s %s, init_utsname()-sysname, init_utsname()-release, hcd-driver-description); s = buf; break; @@ -461,7 +461,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) /* Root hub control transfers execute synchronously */ -static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) +static int rh_call_control(struct usb_hcd *hcd, struct urb *urb) { struct usb_ctrlrequest *cmd; u16 typeReq, wValue, wIndex, wLength; @@ -485,9 +485,9 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) cmd = (struct usb_ctrlrequest *) urb-setup_packet; typeReq = (cmd-bRequestType 8) | cmd-bRequest; - wValue = le16_to_cpu (cmd-wValue); - wIndex = le16_to_cpu (cmd-wIndex); - wLength = le16_to_cpu (cmd-wLength); + wValue = le16_to_cpu(cmd-wValue); + wIndex = le16_to_cpu(cmd-wIndex); + wLength = le16_to_cpu(cmd-wLength); if (wLength urb-transfer_buffer_length) goto error; @@ -616,7 +616,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) break; case DeviceOutRequest | USB_REQ_SET_ADDRESS: /* wValue == urb-dev-devaddr */ - dev_dbg (hcd-self.controller, root hub device address %d\n, + dev_dbg(hcd-self.controller, root hub device address %d\n, wValue); break; @@ -632,7 +632,7 @@ static int rh_call_control (struct usb_hcd *hcd, struct urb *urb) /* FALLTHROUGH */ case EndpointOutRequest | USB_REQ_CLEAR_FEATURE: case EndpointOutRequest | USB_REQ_SET_FEATURE: - dev_dbg (hcd-self.controller, no endpoint features yet\n); + dev_dbg(hcd-self.controller, no endpoint features yet\n); break; /* CLASS REQUESTS (and errors) */ @@ -646,13 +646,13 @@ nongeneric: len = 4; break; case GetHubDescriptor: - len = sizeof (struct usb_hub_descriptor); + len = sizeof(struct usb_hub_descriptor); break; case DeviceRequest | USB_REQ_GET_DESCRIPTOR: /* len is returned by hub_control */ break; } - status = hcd-driver-hub_control (hcd, + status = hcd-driver-hub_control(hcd, typeReq, wValue, wIndex, tbuf, wLength); @@ -668,7 +668,7 @@ error: if (status 0) { len = 0; if (status != -EPIPE) { - dev_dbg (hcd-self.controller, + dev_dbg(hcd-self.controller, CTRL: TypeReq=0x%x val=0x%x idx=0x%x len=%d == %d\n, typeReq, wValue, wIndex, @@ -684,11 +684,11 @@ error: len = urb-transfer_buffer_length; urb-actual_length = len; /* always USB_DIR_IN, toward host */ - memcpy (ubuf, bufp, len); + memcpy(ubuf, bufp, len); /* report whether RH hardware supports remote wakeup */ if (patch_wakeup - len offsetof (struct usb_config_descriptor, + len offsetof(struct usb_config_descriptor
[PATCH] drivers/usb/core: hcd.c: Added parenthesis' to sizeof
Removed all warnings generated by checkpatch.pl about sizeof not having parenthesis'. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hcd.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 557f2b8..601476c7 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -447,7 +447,7 @@ rh_string(int id, struct usb_hcd const *hcd, u8 *data, unsigned len) break; case 3: /* Manufacturer */ - snprintf(buf, sizeof buf, %s %s %s, init_utsname()-sysname, + snprintf(buf, sizeof(buf), %s %s %s, init_utsname()-sysname, init_utsname()-release, hcd-driver-description); s = buf; break; @@ -578,16 +578,16 @@ static int rh_call_control(struct usb_hcd *hcd, struct urb *urb) switch (hcd-speed) { case HCD_USB3: bufp = ss_rh_config_descriptor; - len = sizeof ss_rh_config_descriptor; + len = sizeof(ss_rh_config_descriptor); break; case HCD_USB25: case HCD_USB2: bufp = hs_rh_config_descriptor; - len = sizeof hs_rh_config_descriptor; + len = sizeof(hs_rh_config_descriptor); break; case HCD_USB11: bufp = fs_rh_config_descriptor; - len = sizeof fs_rh_config_descriptor; + len = sizeof(fs_rh_config_descriptor); break; default: goto error; @@ -1008,7 +1008,7 @@ static int register_root_hub(struct usb_hcd *hcd) usb_dev-devnum = devnum; usb_dev-bus-devnum_next = devnum + 1; memset(usb_dev-bus-devmap.devicemap, 0, - sizeof usb_dev-bus-devmap.devicemap); + sizeof(usb_dev-bus-devmap.devicemap)); set_bit(devnum, usb_dev-bus-devmap.devicemap); usb_set_device_state(usb_dev, USB_STATE_ADDRESS); @@ -1016,7 +1016,7 @@ static int register_root_hub(struct usb_hcd *hcd) usb_dev-ep0.desc.wMaxPacketSize = cpu_to_le16(64); retval = usb_get_device_descriptor(usb_dev, USB_DT_DEVICE_SIZE); - if (retval != sizeof usb_dev-descriptor) { + if (retval != sizeof(usb_dev-descriptor)) { mutex_unlock(usb_bus_list_lock); dev_dbg(parent_dev, can't read %s device descriptor %d\n, dev_name(usb_dev-dev), retval); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: devio.c: Reverted previous debug print changes
Changed dev_dbg(...) back to dev_printk(KERN_DEBUG, ...) based on previous patches feedback. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/devio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 62c0be6..2734a14 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i 0 i != -EPIPE) { - dev_dbg(dev-dev, usbfs: USBDEVFS_CONTROL + dev_printk(KERN_DEBUG, dev-dev, usbfs: USBDEVFS_CONTROL failed cmd %s rqt %u rq %u len %u ret %d\n, current-comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1591,7 +1591,8 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_dbg(ps-dev-dev, usbfs: usb_submit_urb returned %d\n, ret); + dev_printk(KERN_DEBUG, ps-dev-dev, + usbfs: usb_submit_urb returned %d\n, ret); snoop_urb(ps-dev, as-userurb, as-urb-pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] drivers/usb/core: hcd.c: Removed BitTime space warnings
Removed BitTime macro space warnings generated by checkpatch.pl. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/hcd.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 601476c7..299ff0d 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1116,18 +1116,18 @@ long usb_calc_bus_time(int speed, int is_input, int isoc, int bytecount) switch (speed) { case USB_SPEED_LOW: /* INTR only */ if (is_input) { - tmp = (67667L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (67667L * (31L + 10L * BitTime(bytecount))) / 1000L; return 64060L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp; } else { - tmp = (66700L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (66700L * (31L + 10L * BitTime(bytecount))) / 1000L; return 64107L + (2 * BW_HUB_LS_SETUP) + BW_HOST_DELAY + tmp; } case USB_SPEED_FULL:/* ISOC or INTR */ if (isoc) { - tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (8354L * (31L + 10L * BitTime(bytecount))) / 1000L; return ((is_input) ? 7268L : 6265L) + BW_HOST_DELAY + tmp; } else { - tmp = (8354L * (31L + 10L * BitTime (bytecount))) / 1000L; + tmp = (8354L * (31L + 10L * BitTime(bytecount))) / 1000L; return 9107L + BW_HOST_DELAY + tmp; } case USB_SPEED_HIGH:/* ISOC or INTR */ -- 1.9.1 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 2/2] drivers/usb/core: devio.c: Removed various warnings and errors generated by checkpatch.pl
Removed warnings and erros from checkpatch.pl that go against the coding style. Lines 29 and 103: removed unwanted spaces. Lines 1040 and 1591: changed dev_printk(KERN_DEBUG, ...) to dev_dbg(>dev). Lines 1942: changed an else switch to else { switch (...) {...} }. (Makes more sense(to me)). Lines 1319 and 1906: added spaces to fit coding style consistently. Signed-off-by: Chase Metzger --- drivers/usb/core/devio.c | 69 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 4b0448c..1a97df0 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -29,7 +29,7 @@ *22.12.1999 0.1 Initial release (split from proc_usb.c) *04.01.2000 0.2 Turned into its own filesystem *30.09.2005 0.3 Fix user-triggerable oops in async URB delivery - * (CAN-2005-3055) + * (CAN-2005-3055) */ /*/ @@ -103,7 +103,7 @@ MODULE_PARM_DESC(usbfs_snoop, "true to log all usbfs traffic"); #define snoop(dev, format, arg...) \ do {\ if (usbfs_snoop)\ - dev_info(dev , format , ## arg);\ + dev_info(dev, format, ## arg); \ } while (0) enum snoop_when { @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i < 0 && i != -EPIPE) { - dev_printk(KERN_DEBUG, >dev, "usbfs: USBDEVFS_CONTROL " + dev_dbg(>dev, "usbfs: USBDEVFS_CONTROL " "failed cmd %s rqt %u rq %u len %u ret %d\n", current->comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1319,7 +1319,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb is_in = (uurb->endpoint & USB_ENDPOINT_DIR_MASK) != 0; u = 0; - switch(uurb->type) { + switch (uurb->type) { case USBDEVFS_URB_TYPE_CONTROL: if (!usb_endpoint_xfer_control(>desc)) return -EINVAL; @@ -1591,8 +1591,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_printk(KERN_DEBUG, >dev->dev, - "usbfs: usb_submit_urb returned %d\n", ret); + dev_dbg(>dev->dev, "usbfs: usb_submit_urb returned %d\n", ret); snoop_urb(ps->dev, as->userurb, as->urb->pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); @@ -1906,7 +1905,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) return -EFAULT; if ((ret = releaseintf(ps, ifnum)) < 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } @@ -1942,36 +1941,38 @@ static int proc_ioctl(struct usb_dev_state *ps, struct usbdevfs_ioctl *ctl) retval = -EHOSTUNREACH; else if (!(intf = usb_ifnum_to_if(ps->dev, ctl->ifno))) retval = -EINVAL; - else switch (ctl->ioctl_code) { - - /* disconnect kernel driver from interface */ - case USBDEVFS_DISCONNECT: - if (intf->dev.driver) { - driver = to_usb_driver(intf->dev.driver); - dev_dbg(>dev, "disconnect by usbfs\n"); - usb_driver_release_interface(driver, intf); - } else - retval = -ENODATA; - break; + else { + switch (ctl->ioctl_code) { + + /* disconnect kernel driver from interface */ + case USBDEVFS_DISCONNECT: + if (intf->dev.driver) { + driver = to_usb_driver(intf->dev.driver); + dev_dbg(>dev, "disconnect by usbfs\n"); + usb_driver_release_interface(driver, intf); + } else + retval = -ENODATA; + break; - /* let kernel drivers try to (re)bind to the interface */ - case USBDEVFS_CONNECT: - if (!intf->dev.driver) - retval = device_attach(>dev); - else - retval = -EBUSY; - break; +
[PATCH 2/2] drivers/usb/core: devio.c: Removed various warnings and errors generated by checkpatch.pl
Removed warnings and erros from checkpatch.pl that go against the coding style. Lines 29 and 103: removed unwanted spaces. Lines 1040 and 1591: changed dev_printk(KERN_DEBUG, ...) to dev_dbg(dev-dev). Lines 1942: changed an else switch to else { switch (...) {...} }. (Makes more sense(to me)). Lines 1319 and 1906: added spaces to fit coding style consistently. Signed-off-by: Chase Metzger chasemetzge...@gmail.com --- drivers/usb/core/devio.c | 69 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 4b0448c..1a97df0 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -29,7 +29,7 @@ *22.12.1999 0.1 Initial release (split from proc_usb.c) *04.01.2000 0.2 Turned into its own filesystem *30.09.2005 0.3 Fix user-triggerable oops in async URB delivery - * (CAN-2005-3055) + * (CAN-2005-3055) */ /*/ @@ -103,7 +103,7 @@ MODULE_PARM_DESC(usbfs_snoop, true to log all usbfs traffic); #define snoop(dev, format, arg...) \ do {\ if (usbfs_snoop)\ - dev_info(dev , format , ## arg);\ + dev_info(dev, format, ## arg); \ } while (0) enum snoop_when { @@ -1040,7 +1040,7 @@ static int proc_control(struct usb_dev_state *ps, void __user *arg) snoop_urb(dev, NULL, pipe, max(i, 0), min(i, 0), COMPLETE, NULL, 0); } if (i 0 i != -EPIPE) { - dev_printk(KERN_DEBUG, dev-dev, usbfs: USBDEVFS_CONTROL + dev_dbg(dev-dev, usbfs: USBDEVFS_CONTROL failed cmd %s rqt %u rq %u len %u ret %d\n, current-comm, ctrl.bRequestType, ctrl.bRequest, ctrl.wLength, i); @@ -1319,7 +1319,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb is_in = (uurb-endpoint USB_ENDPOINT_DIR_MASK) != 0; u = 0; - switch(uurb-type) { + switch (uurb-type) { case USBDEVFS_URB_TYPE_CONTROL: if (!usb_endpoint_xfer_control(ep-desc)) return -EINVAL; @@ -1591,8 +1591,7 @@ static int proc_do_submiturb(struct usb_dev_state *ps, struct usbdevfs_urb *uurb } if (ret) { - dev_printk(KERN_DEBUG, ps-dev-dev, - usbfs: usb_submit_urb returned %d\n, ret); + dev_dbg(ps-dev-dev, usbfs: usb_submit_urb returned %d\n, ret); snoop_urb(ps-dev, as-userurb, as-urb-pipe, 0, ret, COMPLETE, NULL, 0); async_removepending(as); @@ -1906,7 +1905,7 @@ static int proc_releaseinterface(struct usb_dev_state *ps, void __user *arg) return -EFAULT; if ((ret = releaseintf(ps, ifnum)) 0) return ret; - destroy_async_on_interface (ps, ifnum); + destroy_async_on_interface(ps, ifnum); return 0; } @@ -1942,36 +1941,38 @@ static int proc_ioctl(struct usb_dev_state *ps, struct usbdevfs_ioctl *ctl) retval = -EHOSTUNREACH; else if (!(intf = usb_ifnum_to_if(ps-dev, ctl-ifno))) retval = -EINVAL; - else switch (ctl-ioctl_code) { - - /* disconnect kernel driver from interface */ - case USBDEVFS_DISCONNECT: - if (intf-dev.driver) { - driver = to_usb_driver(intf-dev.driver); - dev_dbg(intf-dev, disconnect by usbfs\n); - usb_driver_release_interface(driver, intf); - } else - retval = -ENODATA; - break; + else { + switch (ctl-ioctl_code) { + + /* disconnect kernel driver from interface */ + case USBDEVFS_DISCONNECT: + if (intf-dev.driver) { + driver = to_usb_driver(intf-dev.driver); + dev_dbg(intf-dev, disconnect by usbfs\n); + usb_driver_release_interface(driver, intf); + } else + retval = -ENODATA; + break; - /* let kernel drivers try to (re)bind to the interface */ - case USBDEVFS_CONNECT: - if (!intf-dev.driver) - retval = device_attach(intf-dev); - else - retval = -EBUSY; - break; + /* let kernel drivers try to (re)bind to the interface */ + case USBDEVFS_CONNECT: + if (!intf-dev.driver