* [PATCH 01/11] staging: dgnc: remove unused variables
@ 2015-10-03 15:22 Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 02/11] staging: dgnc: remove multiple blank lines Sudip Mukherjee
` (9 more replies)
0 siblings, 10 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
These variables were only assigned some values but were never used.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_cls.c | 4 +---
drivers/staging/dgnc/dgnc_tty.c | 11 ++---------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 76fe4b2..24fc28c 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -854,10 +854,8 @@ static void cls_copy_data_from_uart_to_queue(struct channel_t *ch)
* Discard character if we are ignoring the error mask.
*/
if (linestatus & error_mask) {
- unsigned char discard;
-
linestatus = 0;
- discard = readb(&ch->ch_cls_uart->txrx);
+ readb(&ch->ch_cls_uart->txrx);
continue;
}
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index fbfe79a..45f98db 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1349,12 +1349,10 @@ static void dgnc_tty_hangup(struct tty_struct *tty)
*/
static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
{
- struct ktermios *ts;
struct dgnc_board *bd;
struct channel_t *ch;
struct un_t *un;
unsigned long flags;
- int rc = 0;
if (!tty || tty->magic != TTY_MAGIC)
return;
@@ -1371,8 +1369,6 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return;
- ts = &tty->termios;
-
spin_lock_irqsave(&ch->ch_lock, flags);
/*
@@ -1434,7 +1430,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
/* wait for output to drain */
/* This will also return if we take an interrupt */
- rc = bd->bd_ops->drain(tty, 0);
+ bd->bd_ops->drain(tty, 0);
dgnc_tty_flush_buffer(tty);
tty_ldisc_flush(tty);
@@ -1685,7 +1681,6 @@ static int dgnc_tty_write(struct tty_struct *tty,
struct channel_t *ch = NULL;
struct un_t *un = NULL;
int bufcount = 0, n = 0;
- int orig_count = 0;
unsigned long flags;
ushort head;
ushort tail;
@@ -1711,7 +1706,6 @@ static int dgnc_tty_write(struct tty_struct *tty,
* This helps to figure out if we should ask the FEP
* to send us an event when it has more space available.
*/
- orig_count = count;
spin_lock_irqsave(&ch->ch_lock, flags);
@@ -1979,7 +1973,6 @@ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout)
struct dgnc_board *bd;
struct channel_t *ch;
struct un_t *un;
- int rc;
if (!tty || tty->magic != TTY_MAGIC)
return;
@@ -1996,7 +1989,7 @@ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout)
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return;
- rc = bd->bd_ops->drain(tty, 0);
+ bd->bd_ops->drain(tty, 0);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 02/11] staging: dgnc: remove multiple blank lines
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-04 8:31 ` Greg Kroah-Hartman
2015-10-03 15:22 ` [PATCH 03/11] staging: dgnc: remove blankline before brace Sudip Mukherjee
` (8 subsequent siblings)
9 siblings, 1 reply; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
checkpatch warns us about multiple blank lines which are not needed.
Remove them.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_driver.c | 10 --------
drivers/staging/dgnc/dgnc_mgmt.c | 5 ----
drivers/staging/dgnc/dgnc_neo.c | 37 ---------------------------
drivers/staging/dgnc/dgnc_sysfs.c | 37 ---------------------------
drivers/staging/dgnc/dgnc_tty.c | 51 --------------------------------------
5 files changed, 140 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 7546aff..38efea2 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -13,7 +13,6 @@
* PURPOSE. See the GNU General Public License for more details.
*/
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -57,7 +56,6 @@ static const struct file_operations dgnc_BoardFops = {
.release = dgnc_mgmt_close
};
-
/*
* Globals
*/
@@ -80,7 +78,6 @@ static ulong dgnc_poll_time; /* Time of next poll */
static uint dgnc_poll_stop; /* Used to tell poller to stop */
static struct timer_list dgnc_poll_timer;
-
static const struct pci_device_id dgnc_pci_tbl[] = {
{PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_DID), .driver_data = 0},
{PCI_DEVICE(DIGI_VID, PCI_DEVICE_CLASSIC_4_422_DID), .driver_data = 1},
@@ -355,13 +352,11 @@ static void dgnc_cleanup_board(struct dgnc_board *brd)
}
}
-
dgnc_Board[brd->boardnum] = NULL;
kfree(brd);
}
-
/*
* dgnc_found_board()
*
@@ -422,7 +417,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
pci_irq = pdev->irq;
brd->irq = pci_irq;
-
switch (brd->device) {
case PCI_DEVICE_CLASSIC_4_DID:
@@ -442,7 +436,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
* 4 Memory Mapped UARTs and Status
*/
-
/* get the PCI Base Address Registers */
brd->membase = pci_resource_start(pdev, 4);
@@ -483,7 +476,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
break;
-
case PCI_DEVICE_NEO_4_DID:
case PCI_DEVICE_NEO_8_DID:
case PCI_DEVICE_NEO_2DB9_DID:
@@ -593,7 +585,6 @@ failed:
}
-
static int dgnc_finalize_board_init(struct dgnc_board *brd)
{
int rc = 0;
@@ -628,7 +619,6 @@ static void dgnc_do_remap(struct dgnc_board *brd)
brd->re_map_membase = ioremap(brd->membase, 0x1000);
}
-
/*****************************************************************************
*
* Function:
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index 81c793a..81f0da2 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -32,11 +32,9 @@
#include "dgnc_pci.h"
#include "dgnc_mgmt.h"
-
/* Our "in use" variables, to enforce 1 open only */
static int dgnc_mgmt_in_use[MAXMGMTDEVICES];
-
/*
* dgnc_mgmt_open()
*
@@ -67,7 +65,6 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file)
return 0;
}
-
/*
* dgnc_mgmt_close()
*
@@ -90,7 +87,6 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file)
return 0;
}
-
/*
* dgnc_mgmt_ioctl()
*
@@ -256,7 +252,6 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
}
-
}
return 0;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 900e3ae..09d3de7 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -13,7 +13,6 @@
* PURPOSE. See the GNU General Public License for more details.
*/
-
#include <linux/kernel.h>
#include <linux/sched.h> /* For jiffies, task states */
#include <linux/interrupt.h> /* For tasklet and interrupt structs/defines */
@@ -57,7 +56,6 @@ static uint neo_get_uart_bytes_left(struct channel_t *ch);
static void neo_send_immediate_char(struct channel_t *ch, unsigned char c);
static irqreturn_t neo_intr(int irq, void *voidbrd);
-
struct board_ops dgnc_neo_ops = {
.tasklet = neo_tasklet,
.intr = neo_intr,
@@ -81,7 +79,6 @@ struct board_ops dgnc_neo_ops = {
static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
-
/*
* This function allows calls to ensure that all outstanding
* PCI writes have been completed, by doing a PCI read against
@@ -100,7 +97,6 @@ static inline void neo_set_cts_flow_control(struct channel_t *ch)
unsigned char ier = readb(&ch->ch_neo_uart->ier);
unsigned char efr = readb(&ch->ch_neo_uart->efr);
-
/* Turn on auto CTS flow control */
#if 1
ier |= UART_17158_IER_CTSDSR;
@@ -131,7 +127,6 @@ static inline void neo_set_cts_flow_control(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_rts_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
@@ -174,7 +169,6 @@ static inline void neo_set_rts_flow_control(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_ixon_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
@@ -211,7 +205,6 @@ static inline void neo_set_ixon_flow_control(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_ixoff_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
@@ -249,7 +242,6 @@ static inline void neo_set_ixoff_flow_control(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_no_input_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
@@ -266,7 +258,6 @@ static inline void neo_set_no_input_flow_control(struct channel_t *ch)
else
efr &= ~(UART_17158_EFR_ECB | UART_17158_EFR_IXOFF);
-
/* Why? Becuz Exar's spec says we have to zero it out before setting it */
writeb(0, &ch->ch_neo_uart->efr);
@@ -289,7 +280,6 @@ static inline void neo_set_no_input_flow_control(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
static inline void neo_set_no_output_flow_control(struct channel_t *ch)
{
unsigned char ier = readb(&ch->ch_neo_uart->ier);
@@ -327,7 +317,6 @@ static inline void neo_set_no_output_flow_control(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
/* change UARTs start/stop chars */
static inline void neo_set_new_start_stop_chars(struct channel_t *ch)
{
@@ -346,7 +335,6 @@ static inline void neo_set_new_start_stop_chars(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
/*
* No locks are assumed to be held when calling this function.
*/
@@ -377,7 +365,6 @@ static inline void neo_clear_break(struct channel_t *ch, int force)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* Parse the ISR register.
*/
@@ -507,7 +494,6 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port)
}
}
-
static inline void neo_parse_lsr(struct dgnc_board *brd, uint port)
{
struct channel_t *ch;
@@ -587,7 +573,6 @@ static inline void neo_parse_lsr(struct dgnc_board *brd, uint port)
}
}
-
/*
* neo_param()
* Send any/all changes to the line to the UART.
@@ -841,7 +826,6 @@ static void neo_param(struct tty_struct *tty)
neo_parse_modem(ch, readb(&ch->ch_neo_uart->msr));
}
-
/*
* Our board poller function.
*/
@@ -920,7 +904,6 @@ static void neo_tasklet(unsigned long data)
}
-
/*
* dgnc_neo_intr()
*
@@ -1067,7 +1050,6 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
return IRQ_HANDLED;
}
-
/*
* Neo specific way of turning off the receiver.
* Used as a way to enforce queue flow control when in
@@ -1082,7 +1064,6 @@ static void neo_disable_receiver(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
/*
* Neo specific way of turning on the receiver.
* Used as a way to un-enforce queue flow control when in
@@ -1097,7 +1078,6 @@ static void neo_enable_receiver(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
{
int qleft = 0;
@@ -1153,7 +1133,6 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
total -= 3;
}
-
/*
* Finally, bound the copy to make sure we don't overflow
* our own queue...
@@ -1306,7 +1285,6 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* This function basically goes to sleep for secs, or until
* it gets signalled that the port has fully drained.
@@ -1345,7 +1323,6 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
return rc;
}
-
/*
* Flush the WRITE FIFO on the Neo.
*
@@ -1375,7 +1352,6 @@ static void neo_flush_uart_write(struct channel_t *ch)
ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
}
-
/*
* Flush the READ FIFO on the Neo.
*
@@ -1403,7 +1379,6 @@ static void neo_flush_uart_read(struct channel_t *ch)
}
}
-
static void neo_copy_data_from_queue_to_uart(struct channel_t *ch)
{
ushort head;
@@ -1551,7 +1526,6 @@ exit_unlock:
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void neo_parse_modem(struct channel_t *ch, unsigned char signals)
{
unsigned char msignals = signals;
@@ -1608,7 +1582,6 @@ static void neo_parse_modem(struct channel_t *ch, unsigned char signals)
ch->ch_mistat &= ~UART_MSR_CTS;
}
-
/* Make the UART raise any of the output signals we want up */
static void neo_assert_modem_signals(struct channel_t *ch)
{
@@ -1629,7 +1602,6 @@ static void neo_assert_modem_signals(struct channel_t *ch)
udelay(10);
}
-
static void neo_send_start_character(struct channel_t *ch)
{
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
@@ -1643,7 +1615,6 @@ static void neo_send_start_character(struct channel_t *ch)
}
}
-
static void neo_send_stop_character(struct channel_t *ch)
{
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
@@ -1657,7 +1628,6 @@ static void neo_send_stop_character(struct channel_t *ch)
}
}
-
/*
* neo_uart_init
*/
@@ -1668,7 +1638,6 @@ static void neo_uart_init(struct channel_t *ch)
writeb(0, &ch->ch_neo_uart->efr);
writeb(UART_EFR_ECB, &ch->ch_neo_uart->efr);
-
/* Clear out UART and FIFO */
readb(&ch->ch_neo_uart->txrx);
writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT), &ch->ch_neo_uart->isr_fcr);
@@ -1682,7 +1651,6 @@ static void neo_uart_init(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
/*
* Make the UART completely turn off.
*/
@@ -1696,7 +1664,6 @@ static void neo_uart_off(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
}
-
static uint neo_get_uart_bytes_left(struct channel_t *ch)
{
unsigned char left = 0;
@@ -1718,7 +1685,6 @@ static uint neo_get_uart_bytes_left(struct channel_t *ch)
return left;
}
-
/* Channel lock MUST be held by the calling function! */
static void neo_send_break(struct channel_t *ch, int msecs)
{
@@ -1754,7 +1720,6 @@ static void neo_send_break(struct channel_t *ch, int msecs)
}
}
-
/*
* neo_send_immediate_char.
*
@@ -1772,7 +1737,6 @@ static void neo_send_immediate_char(struct channel_t *ch, unsigned char c)
neo_pci_posting_flush(ch->ch_bd);
}
-
static unsigned int neo_read_eeprom(unsigned char __iomem *base, unsigned int address)
{
unsigned int enable;
@@ -1813,7 +1777,6 @@ static unsigned int neo_read_eeprom(unsigned char __iomem *base, unsigned int ad
return val;
}
-
static void neo_vpd(struct dgnc_board *brd)
{
unsigned int i = 0;
diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
index 44db870..ca20009 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -13,7 +13,6 @@
* PURPOSE. See the GNU General Public License for more details.
*/
-
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/ctype.h>
@@ -26,28 +25,24 @@
#include "dgnc_driver.h"
#include "dgnc_mgmt.h"
-
static ssize_t dgnc_driver_version_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%s\n", DG_PART);
}
static DRIVER_ATTR(version, S_IRUSR, dgnc_driver_version_show, NULL);
-
static ssize_t dgnc_driver_boards_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", dgnc_NumBoards);
}
static DRIVER_ATTR(boards, S_IRUSR, dgnc_driver_boards_show, NULL);
-
static ssize_t dgnc_driver_maxboards_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%d\n", MAXBOARDS);
}
static DRIVER_ATTR(maxboards, S_IRUSR, dgnc_driver_maxboards_show, NULL);
-
static ssize_t dgnc_driver_pollrate_show(struct device_driver *ddp, char *buf)
{
return snprintf(buf, PAGE_SIZE, "%dms\n", dgnc_poll_tick);
@@ -66,7 +61,6 @@ static ssize_t dgnc_driver_pollrate_store(struct device_driver *ddp,
static DRIVER_ATTR(pollrate, (S_IRUSR | S_IWUSR), dgnc_driver_pollrate_show,
dgnc_driver_pollrate_store);
-
void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
{
int rc = 0;
@@ -80,7 +74,6 @@ void dgnc_create_driver_sysfiles(struct pci_driver *dgnc_driver)
pr_err("DGNC: sysfs driver_create_file failed!\n");
}
-
void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
{
struct device_driver *driverfs = &dgnc_driver->driver;
@@ -91,7 +84,6 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
driver_remove_file(driverfs, &driver_attr_pollrate);
}
-
#define DGNC_VERIFY_BOARD(p, bd) \
do { \
if (!p) \
@@ -104,8 +96,6 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
return 0; \
} while (0)
-
-
static ssize_t dgnc_vpd_show(struct device *p, struct device_attribute *attr,
char *buf)
{
@@ -145,7 +135,6 @@ static ssize_t dgnc_serial_number_show(struct device *p,
}
static DEVICE_ATTR(serial_number, S_IRUSR, dgnc_serial_number_show, NULL);
-
static ssize_t dgnc_ports_state_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -164,7 +153,6 @@ static ssize_t dgnc_ports_state_show(struct device *p,
}
static DEVICE_ATTR(ports_state, S_IRUSR, dgnc_ports_state_show, NULL);
-
static ssize_t dgnc_ports_baud_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -183,7 +171,6 @@ static ssize_t dgnc_ports_baud_show(struct device *p,
}
static DEVICE_ATTR(ports_baud, S_IRUSR, dgnc_ports_baud_show, NULL);
-
static ssize_t dgnc_ports_msignals_show(struct device *p,
struct device_attribute *attr,
char *buf)
@@ -214,7 +201,6 @@ static ssize_t dgnc_ports_msignals_show(struct device *p,
}
static DEVICE_ATTR(ports_msignals, S_IRUSR, dgnc_ports_msignals_show, NULL);
-
static ssize_t dgnc_ports_iflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -233,7 +219,6 @@ static ssize_t dgnc_ports_iflag_show(struct device *p,
}
static DEVICE_ATTR(ports_iflag, S_IRUSR, dgnc_ports_iflag_show, NULL);
-
static ssize_t dgnc_ports_cflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -252,7 +237,6 @@ static ssize_t dgnc_ports_cflag_show(struct device *p,
}
static DEVICE_ATTR(ports_cflag, S_IRUSR, dgnc_ports_cflag_show, NULL);
-
static ssize_t dgnc_ports_oflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -271,7 +255,6 @@ static ssize_t dgnc_ports_oflag_show(struct device *p,
}
static DEVICE_ATTR(ports_oflag, S_IRUSR, dgnc_ports_oflag_show, NULL);
-
static ssize_t dgnc_ports_lflag_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -290,7 +273,6 @@ static ssize_t dgnc_ports_lflag_show(struct device *p,
}
static DEVICE_ATTR(ports_lflag, S_IRUSR, dgnc_ports_lflag_show, NULL);
-
static ssize_t dgnc_ports_digi_flag_show(struct device *p,
struct device_attribute *attr,
char *buf)
@@ -310,7 +292,6 @@ static ssize_t dgnc_ports_digi_flag_show(struct device *p,
}
static DEVICE_ATTR(ports_digi_flag, S_IRUSR, dgnc_ports_digi_flag_show, NULL);
-
static ssize_t dgnc_ports_rxcount_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -329,7 +310,6 @@ static ssize_t dgnc_ports_rxcount_show(struct device *p,
}
static DEVICE_ATTR(ports_rxcount, S_IRUSR, dgnc_ports_rxcount_show, NULL);
-
static ssize_t dgnc_ports_txcount_show(struct device *p,
struct device_attribute *attr, char *buf)
{
@@ -348,7 +328,6 @@ static ssize_t dgnc_ports_txcount_show(struct device *p,
}
static DEVICE_ATTR(ports_txcount, S_IRUSR, dgnc_ports_txcount_show, NULL);
-
/* this function creates the sys files that will export each signal status
* to sysfs each value will be put in a separate filename
*/
@@ -373,7 +352,6 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
dev_err(&bd->pdev->dev, "dgnc: sysfs device_create_file failed!\n");
}
-
/* removes all the sys files created for that port */
void dgnc_remove_ports_sysfiles(struct dgnc_board *bd)
{
@@ -391,7 +369,6 @@ void dgnc_remove_ports_sysfiles(struct dgnc_board *bd)
device_remove_file(&(bd->pdev->dev), &dev_attr_serial_number);
}
-
static ssize_t dgnc_tty_state_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -418,7 +395,6 @@ static ssize_t dgnc_tty_state_show(struct device *d,
}
static DEVICE_ATTR(state, S_IRUSR, dgnc_tty_state_show, NULL);
-
static ssize_t dgnc_tty_baud_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -444,7 +420,6 @@ static ssize_t dgnc_tty_baud_show(struct device *d,
}
static DEVICE_ATTR(baud, S_IRUSR, dgnc_tty_baud_show, NULL);
-
static ssize_t dgnc_tty_msignals_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -479,7 +454,6 @@ static ssize_t dgnc_tty_msignals_show(struct device *d,
}
static DEVICE_ATTR(msignals, S_IRUSR, dgnc_tty_msignals_show, NULL);
-
static ssize_t dgnc_tty_iflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -505,7 +479,6 @@ static ssize_t dgnc_tty_iflag_show(struct device *d,
}
static DEVICE_ATTR(iflag, S_IRUSR, dgnc_tty_iflag_show, NULL);
-
static ssize_t dgnc_tty_cflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -531,7 +504,6 @@ static ssize_t dgnc_tty_cflag_show(struct device *d,
}
static DEVICE_ATTR(cflag, S_IRUSR, dgnc_tty_cflag_show, NULL);
-
static ssize_t dgnc_tty_oflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -557,7 +529,6 @@ static ssize_t dgnc_tty_oflag_show(struct device *d,
}
static DEVICE_ATTR(oflag, S_IRUSR, dgnc_tty_oflag_show, NULL);
-
static ssize_t dgnc_tty_lflag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -583,7 +554,6 @@ static ssize_t dgnc_tty_lflag_show(struct device *d,
}
static DEVICE_ATTR(lflag, S_IRUSR, dgnc_tty_lflag_show, NULL);
-
static ssize_t dgnc_tty_digi_flag_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -609,7 +579,6 @@ static ssize_t dgnc_tty_digi_flag_show(struct device *d,
}
static DEVICE_ATTR(digi_flag, S_IRUSR, dgnc_tty_digi_flag_show, NULL);
-
static ssize_t dgnc_tty_rxcount_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -635,7 +604,6 @@ static ssize_t dgnc_tty_rxcount_show(struct device *d,
}
static DEVICE_ATTR(rxcount, S_IRUSR, dgnc_tty_rxcount_show, NULL);
-
static ssize_t dgnc_tty_txcount_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -661,7 +629,6 @@ static ssize_t dgnc_tty_txcount_show(struct device *d,
}
static DEVICE_ATTR(txcount, S_IRUSR, dgnc_tty_txcount_show, NULL);
-
static ssize_t dgnc_tty_name_show(struct device *d,
struct device_attribute *attr, char *buf)
{
@@ -689,7 +656,6 @@ static ssize_t dgnc_tty_name_show(struct device *d,
}
static DEVICE_ATTR(custom_name, S_IRUSR, dgnc_tty_name_show, NULL);
-
static struct attribute *dgnc_sysfs_tty_entries[] = {
&dev_attr_state.attr,
&dev_attr_baud.attr,
@@ -705,13 +671,11 @@ static struct attribute *dgnc_sysfs_tty_entries[] = {
NULL
};
-
static struct attribute_group dgnc_tty_attribute_group = {
.name = NULL,
.attrs = dgnc_sysfs_tty_entries,
};
-
void dgnc_create_tty_sysfs(struct un_t *un, struct device *c)
{
int ret;
@@ -727,7 +691,6 @@ void dgnc_create_tty_sysfs(struct un_t *un, struct device *c)
}
-
void dgnc_remove_tty_sysfs(struct device *c)
{
sysfs_remove_group(&c->kobj, &dgnc_tty_attribute_group);
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 45f98db..6752e38 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -63,7 +63,6 @@ static struct digi_t dgnc_digi_init = {
.digi_term = "ansi" /* default terminal type */
};
-
/*
* Define a local default termios struct. All ports will be created
* with this termios initially.
@@ -80,7 +79,6 @@ static struct ktermios DgncDefaultTermios = {
.c_line = 0,
};
-
/* Our function prototypes */
static int dgnc_tty_open(struct tty_struct *tty, struct file *file);
static void dgnc_tty_close(struct tty_struct *tty, struct file *file);
@@ -108,7 +106,6 @@ static int dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf, int
static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios);
static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch);
-
static const struct tty_operations dgnc_tty_ops = {
.open = dgnc_tty_open,
.close = dgnc_tty_close,
@@ -163,7 +160,6 @@ int dgnc_tty_preinit(void)
return 0;
}
-
/*
* dgnc_tty_register()
*
@@ -275,7 +271,6 @@ int dgnc_tty_register(struct dgnc_board *brd)
return rc;
}
-
/*
* dgnc_tty_init()
*
@@ -371,7 +366,6 @@ err_free_channels:
return -ENOMEM;
}
-
/*
* dgnc_tty_post_uninit()
*
@@ -383,7 +377,6 @@ void dgnc_tty_post_uninit(void)
dgnc_TmpWriteBuf = NULL;
}
-
/*
* dgnc_tty_uninit()
*
@@ -476,9 +469,6 @@ static void dgnc_wmove(struct channel_t *ch, char *buf, uint n)
ch->ch_w_head = head;
}
-
-
-
/*=======================================================================
*
* dgnc_input - Process received data.
@@ -650,7 +640,6 @@ exit_unlock:
tty_ldisc_deref(ld);
}
-
/************************************************************************
* Determines when CARRIER changes state and takes appropriate
* action.
@@ -817,7 +806,6 @@ static void dgnc_set_custom_speed(struct channel_t *ch, uint newrate)
ch->ch_custom_speed = newrate;
}
-
void dgnc_check_queue_flow_control(struct channel_t *ch)
{
int qleft = 0;
@@ -890,7 +878,6 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
}
}
-
void dgnc_wakeup_writes(struct channel_t *ch)
{
int qlen = 0;
@@ -979,8 +966,6 @@ void dgnc_wakeup_writes(struct channel_t *ch)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
-
/************************************************************************
*
* TTY Entry points and helper functions
@@ -1085,11 +1070,9 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
spin_lock_irqsave(&ch->ch_lock, flags);
-
/* Store our unit into driver_data, so we always have it available. */
tty->driver_data = un;
-
/*
* Initialize tty's
*/
@@ -1100,7 +1083,6 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
/* Maybe do something here to the TTY struct as well? */
}
-
/*
* Allocate channel buffers for read/write/error.
* Set flag, so we don't get trounced on.
@@ -1190,7 +1172,6 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
return rc;
}
-
/*
* dgnc_block_til_ready()
*
@@ -1320,7 +1301,6 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc
return 0;
}
-
/*
* dgnc_tty_hangup()
*
@@ -1342,7 +1322,6 @@ static void dgnc_tty_hangup(struct tty_struct *tty)
}
-
/*
* dgnc_tty_close()
*
@@ -1408,7 +1387,6 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
tty->closing = 1;
-
/*
* Only officially close channel if count is 0 and
* DIGI_PRINTER bit is not set.
@@ -1484,7 +1462,6 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* dgnc_tty_chars_in_buffer()
*
@@ -1534,7 +1511,6 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
return chars;
}
-
/*
* dgnc_maxcps_room
*
@@ -1590,7 +1566,6 @@ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
return bytes_available;
}
-
/*
* dgnc_tty_write_room()
*
@@ -1651,7 +1626,6 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
return ret;
}
-
/*
* dgnc_tty_put_char()
*
@@ -1668,7 +1642,6 @@ static int dgnc_tty_put_char(struct tty_struct *tty, unsigned char c)
return 1;
}
-
/*
* dgnc_tty_write()
*
@@ -1812,7 +1785,6 @@ exit_retry:
return 0;
}
-
/*
* Return modem signals to ld.
*/
@@ -1860,7 +1832,6 @@ static int dgnc_tty_tiocmget(struct tty_struct *tty)
return result;
}
-
/*
* dgnc_tty_tiocmset()
*
@@ -1912,7 +1883,6 @@ static int dgnc_tty_tiocmset(struct tty_struct *tty,
return 0;
}
-
/*
* dgnc_tty_send_break()
*
@@ -1962,7 +1932,6 @@ static int dgnc_tty_send_break(struct tty_struct *tty, int msec)
}
-
/*
* dgnc_tty_wait_until_sent()
*
@@ -1992,7 +1961,6 @@ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout)
bd->bd_ops->drain(tty, 0);
}
-
/*
* dgnc_send_xchar()
*
@@ -2029,9 +1997,6 @@ static void dgnc_tty_send_xchar(struct tty_struct *tty, char c)
dev_dbg(tty->dev, "dgnc_tty_send_xchar finish\n");
}
-
-
-
/*
* Return modem signals to ld.
*/
@@ -2068,8 +2033,6 @@ static inline int dgnc_get_mstat(struct channel_t *ch)
return result;
}
-
-
/*
* Return modem signals to ld.
*/
@@ -2088,7 +2051,6 @@ static int dgnc_get_modem_info(struct channel_t *ch, unsigned int __user *value
return put_user(result, value);
}
-
/*
* dgnc_set_modem_info()
*
@@ -2168,7 +2130,6 @@ static int dgnc_set_modem_info(struct tty_struct *tty, unsigned int command, uns
return 0;
}
-
/*
* dgnc_tty_digigeta()
*
@@ -2210,7 +2171,6 @@ static int dgnc_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retin
return 0;
}
-
/*
* dgnc_tty_digiseta()
*
@@ -2293,7 +2253,6 @@ static int dgnc_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i
return 0;
}
-
/*
* dgnc_set_termios()
*/
@@ -2334,7 +2293,6 @@ static void dgnc_tty_set_termios(struct tty_struct *tty, struct ktermios *old_te
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_throttle(struct tty_struct *tty)
{
struct channel_t *ch;
@@ -2359,7 +2317,6 @@ static void dgnc_tty_throttle(struct tty_struct *tty)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_unthrottle(struct tty_struct *tty)
{
struct channel_t *ch;
@@ -2384,7 +2341,6 @@ static void dgnc_tty_unthrottle(struct tty_struct *tty)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_start(struct tty_struct *tty)
{
struct dgnc_board *bd;
@@ -2414,7 +2370,6 @@ static void dgnc_tty_start(struct tty_struct *tty)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
static void dgnc_tty_stop(struct tty_struct *tty)
{
struct dgnc_board *bd;
@@ -2444,7 +2399,6 @@ static void dgnc_tty_stop(struct tty_struct *tty)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
/*
* dgnc_tty_flush_chars()
*
@@ -2487,8 +2441,6 @@ static void dgnc_tty_flush_chars(struct tty_struct *tty)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
-
/*
* dgnc_tty_flush_buffer()
*
@@ -2533,8 +2485,6 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty)
spin_unlock_irqrestore(&ch->ch_lock, flags);
}
-
-
/*****************************************************************************
*
* The IOCTL function and all of its helpers
@@ -2610,7 +2560,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
return 0;
-
case TCSBRKP:
/* support for POSIX tcsendbreak()
* According to POSIX.1 spec (7.2.2.1.2) breaks should be
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 03/11] staging: dgnc: remove blankline before brace
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 02/11] staging: dgnc: remove multiple blank lines Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 04/11] staging: dgnc: remove blankline after brace Sudip Mukherjee
` (7 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
Blank lines are not needed before closing braces. checkpatch was giving
warning about this.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_cls.c | 7 -------
drivers/staging/dgnc/dgnc_driver.c | 2 --
drivers/staging/dgnc/dgnc_mgmt.c | 1 -
drivers/staging/dgnc/dgnc_neo.c | 1 -
drivers/staging/dgnc/dgnc_sysfs.c | 1 -
drivers/staging/dgnc/dgnc_tty.c | 4 ----
6 files changed, 16 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 24fc28c..db997dd 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -115,7 +115,6 @@ static inline void cls_set_cts_flow_control(struct channel_t *ch)
&ch->ch_cls_uart->isr_fcr);
ch->ch_t_tlevel = 16;
-
}
static inline void cls_set_ixon_flow_control(struct channel_t *ch)
@@ -161,7 +160,6 @@ static inline void cls_set_ixon_flow_control(struct channel_t *ch)
writeb((UART_FCR_ENABLE_FIFO | UART_16654_FCR_RXTRIGGER_16 |
UART_16654_FCR_TXTRIGGER_16 | UART_FCR_CLEAR_RCVR),
&ch->ch_cls_uart->isr_fcr);
-
}
static inline void cls_set_no_output_flow_control(struct channel_t *ch)
@@ -205,7 +203,6 @@ static inline void cls_set_no_output_flow_control(struct channel_t *ch)
ch->ch_r_watermark = 0;
ch->ch_t_tlevel = 16;
ch->ch_r_tlevel = 16;
-
}
static inline void cls_set_rts_flow_control(struct channel_t *ch)
@@ -244,7 +241,6 @@ static inline void cls_set_rts_flow_control(struct channel_t *ch)
ch->ch_r_watermark = 4;
ch->ch_r_tlevel = 8;
-
}
static inline void cls_set_ixoff_flow_control(struct channel_t *ch)
@@ -286,7 +282,6 @@ static inline void cls_set_ixoff_flow_control(struct channel_t *ch)
writeb((UART_FCR_ENABLE_FIFO | UART_16654_FCR_RXTRIGGER_16 |
UART_16654_FCR_TXTRIGGER_16 | UART_FCR_CLEAR_RCVR),
&ch->ch_cls_uart->isr_fcr);
-
}
static inline void cls_set_no_input_flow_control(struct channel_t *ch)
@@ -325,7 +320,6 @@ static inline void cls_set_no_input_flow_control(struct channel_t *ch)
ch->ch_t_tlevel = 16;
ch->ch_r_tlevel = 16;
-
}
/*
@@ -746,7 +740,6 @@ static void cls_tasklet(unsigned long data)
}
spin_unlock_irqrestore(&bd->bd_intr_lock, flags);
-
}
/*
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 38efea2..5cf4837 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -530,7 +530,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
dev_err(&brd->pdev->dev,
"Didn't find any compatible Neo/Classic PCI boards.\n");
return -ENXIO;
-
}
/*
@@ -582,7 +581,6 @@ failed:
brd->dpastatus = BD_NOFEP;
return -ENXIO;
-
}
static int dgnc_finalize_board_init(struct dgnc_board *brd)
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index 81f0da2..e8aaf35 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -251,7 +251,6 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
break;
}
-
}
return 0;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 09d3de7..fb95282 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -901,7 +901,6 @@ static void neo_tasklet(unsigned long data)
/* Allow interrupt routine to access the interrupt register again */
spin_unlock_irqrestore(&bd->bd_intr_lock, flags);
-
}
/*
diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
index ca20009..2e8fb91 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -688,7 +688,6 @@ void dgnc_create_tty_sysfs(struct un_t *un, struct device *c)
}
dev_set_drvdata(c, un);
-
}
void dgnc_remove_tty_sysfs(struct device *c)
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 6752e38..4a88e1b 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -353,7 +353,6 @@ int dgnc_tty_init(struct dgnc_board *brd)
ch->ch_pun.un_sysfs = classp;
dgnc_create_tty_sysfs(&ch->ch_pun, classp);
}
-
}
return 0;
@@ -1319,7 +1318,6 @@ static void dgnc_tty_hangup(struct tty_struct *tty)
/* flush the transmit queues */
dgnc_tty_flush_buffer(tty);
-
}
/*
@@ -1929,7 +1927,6 @@ static int dgnc_tty_send_break(struct tty_struct *tty, int msec)
spin_unlock_irqrestore(&ch->ch_lock, flags);
return 0;
-
}
/*
@@ -2678,7 +2675,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
ch->ch_pun.un_flags &= ~(UN_LOW|UN_EMPTY);
wake_up_interruptible(&ch->ch_pun.un_flags_wait);
}
-
}
}
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 04/11] staging: dgnc: remove blankline after brace
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 02/11] staging: dgnc: remove multiple blank lines Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 03/11] staging: dgnc: remove blankline before brace Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 05/11] staging: dgnc: remove space after cast Sudip Mukherjee
` (6 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
Blank lines are not needed after opening braces. checkpatch was giving
us warnings about this.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_cls.c | 4 ----
drivers/staging/dgnc/dgnc_driver.c | 3 ---
drivers/staging/dgnc/dgnc_mgmt.c | 1 -
drivers/staging/dgnc/dgnc_neo.c | 11 -----------
drivers/staging/dgnc/dgnc_tty.c | 11 -----------
5 files changed, 30 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index db997dd..32b05bb 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -378,7 +378,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port)
/* Here we try to figure out what caused the interrupt to happen */
while (1) {
-
isr = readb(&ch->ch_cls_uart->isr_fcr);
/* Bail if no pending interrupt on port */
@@ -472,7 +471,6 @@ static void cls_param(struct tty_struct *tty)
ch->ch_old_baud = 0;
return;
} else if (ch->ch_custom_speed) {
-
baud = ch->ch_custom_speed;
/* Handle transition from B0 */
if (ch->ch_flags & CH_BAUD0) {
@@ -704,7 +702,6 @@ static void cls_tasklet(unsigned long data)
* If board is ready, parse deeper to see if there is anything to do.
*/
if ((state == BOARD_READY) && (ports > 0)) {
-
/* Loop on each port */
for (i = 0; i < ports; i++) {
ch = bd->channels[i];
@@ -999,7 +996,6 @@ static void cls_copy_data_from_queue_to_uart(struct channel_t *ch)
n = min(n, qlen);
while (n > 0) {
-
/*
* If RTS Toggle mode is on, turn on RTS now if not already set,
* and make sure we get an event when the data transfer has
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 5cf4837..b47ff6a 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -418,7 +418,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
brd->irq = pci_irq;
switch (brd->device) {
-
case PCI_DEVICE_CLASSIC_4_DID:
case PCI_DEVICE_CLASSIC_8_DID:
case PCI_DEVICE_CLASSIC_4_422_DID:
@@ -517,7 +516,6 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
dgnc_do_remap(brd);
if (brd->re_map_membase) {
-
/* Read and store the dvid after remapping */
brd->dvid = readb(brd->re_map_membase + 0x8D);
@@ -610,7 +608,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
*/
static void dgnc_do_remap(struct dgnc_board *brd)
{
-
if (!brd || brd->magic != DGNC_BOARD_MAGIC)
return;
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index e8aaf35..5f46e69 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -99,7 +99,6 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
void __user *uarg = (void __user *) arg;
switch (cmd) {
-
case DIGI_GETDD:
{
/*
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index fb95282..3dd7342 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -320,7 +320,6 @@ static inline void neo_set_no_output_flow_control(struct channel_t *ch)
/* change UARTs start/stop chars */
static inline void neo_set_new_start_stop_chars(struct channel_t *ch)
{
-
/* if hardware flow control is set, then skip this whole thing */
if (ch->ch_digi.digi_flags & (CTSPACE | RTSPACE) || ch->ch_c_cflag & CRTSCTS)
return;
@@ -387,7 +386,6 @@ static inline void neo_parse_isr(struct dgnc_board *brd, uint port)
/* Here we try to figure out what caused the interrupt to happen */
while (1) {
-
isr = readb(&ch->ch_neo_uart->isr_fcr);
/* Bail if no pending interrupt */
@@ -626,7 +624,6 @@ static void neo_param(struct tty_struct *tty)
return;
} else if (ch->ch_custom_speed) {
-
baud = ch->ch_custom_speed;
/* Handle transition from B0 */
if (ch->ch_flags & CH_BAUD0) {
@@ -954,7 +951,6 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
/* Loop on each port */
while ((uart_poll & 0xff) != 0) {
-
tmp = uart_poll;
/* Check current port to see if it has interrupt pending */
@@ -977,7 +973,6 @@ static irqreturn_t neo_intr(int irq, void *voidbrd)
/* Switch on type of interrupt we have */
switch (type) {
-
case UART_17158_RXRDY_TIMEOUT:
/*
* RXRDY Time-out is cleared by reading data in the
@@ -1141,7 +1136,6 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
total = min(total, qleft);
while (total > 0) {
-
/*
* Grab the linestatus register, we need to check
* to see if there are any errors in the FIFO.
@@ -1206,7 +1200,6 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
* Also deal with any possible queue overflow here as well.
*/
while (1) {
-
/*
* Its possible we have a linestatus from the loop above
* this, so we "OR" on any extra bits.
@@ -1339,7 +1332,6 @@ static void neo_flush_uart_write(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
for (i = 0; i < 10; i++) {
-
/* Check to see if the UART feels it completely flushed the FIFO. */
tmp = readb(&ch->ch_neo_uart->isr_fcr);
if (tmp & 4)
@@ -1368,7 +1360,6 @@ static void neo_flush_uart_read(struct channel_t *ch)
neo_pci_posting_flush(ch->ch_bd);
for (i = 0; i < 10; i++) {
-
/* Check to see if the UART feels it completely flushed the FIFO. */
tmp = readb(&ch->ch_neo_uart->isr_fcr);
if (tmp & 2)
@@ -1473,7 +1464,6 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch)
n = min(n, qlen);
while (n > 0) {
-
s = ((head >= tail) ? head : WQUEUESIZE) - tail;
s = min(s, n);
@@ -1632,7 +1622,6 @@ static void neo_send_stop_character(struct channel_t *ch)
*/
static void neo_uart_init(struct channel_t *ch)
{
-
writeb(0, &ch->ch_neo_uart->ier);
writeb(0, &ch->ch_neo_uart->efr);
writeb(UART_EFR_ECB, &ch->ch_neo_uart->efr);
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 4a88e1b..9220187 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -520,7 +520,6 @@ void dgnc_input(struct channel_t *ch)
*/
if (!tp || (tp->magic != TTY_MAGIC) || !(ch->ch_tun.un_flags & UN_ISOPEN) ||
!(tp->termios.c_cflag & CREAD) || (ch->ch_tun.un_flags & UN_CLOSING)) {
-
ch->ch_r_head = tail;
/* Force queue flow control to be released, if needed */
@@ -671,7 +670,6 @@ void dgnc_carrier(struct channel_t *ch)
* Test for a VIRTUAL carrier transition to HIGH.
*/
if (((ch->ch_flags & CH_FCAR) == 0) && (virt_carrier == 1)) {
-
/*
* When carrier rises, wake any threads waiting
* for carrier in the open routine.
@@ -685,7 +683,6 @@ void dgnc_carrier(struct channel_t *ch)
* Test for a PHYSICAL carrier transition to HIGH.
*/
if (((ch->ch_flags & CH_CD) == 0) && (phys_carrier == 1)) {
-
/*
* When carrier rises, wake any threads waiting
* for carrier in the open routine.
@@ -706,7 +703,6 @@ void dgnc_carrier(struct channel_t *ch)
*/
if ((virt_carrier == 0) && ((ch->ch_flags & CH_CD) != 0) &&
(phys_carrier == 0)) {
-
/*
* When carrier drops:
*
@@ -1107,7 +1103,6 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
* Initialize if neither terminal or printer is open.
*/
if (!((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_ISOPEN)) {
-
/*
* Flush input queues.
*/
@@ -1197,7 +1192,6 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc
/* Loop forever */
while (1) {
-
sleep_on_un_flags = 0;
/*
@@ -1222,7 +1216,6 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc
* ch_wait_flags to wake us back up.
*/
if (!((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_CLOSING)) {
-
/*
* Our conditions to leave cleanly and happily:
* 1) NONBLOCKING on the tty is set.
@@ -1390,7 +1383,6 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
* DIGI_PRINTER bit is not set.
*/
if ((ch->ch_open_count == 0) && !(ch->ch_digi.digi_flags & DIGI_PRINTER)) {
-
ch->ch_flags &= ~(CH_STOPI | CH_FORCED_STOPI);
/*
@@ -1419,7 +1411,6 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
* If we have HUPCL set, lower DTR and RTS
*/
if (ch->ch_c_cflag & HUPCL) {
-
/* Drop RTS/DTR */
ch->ch_mostat &= ~(UART_MCR_DTR | UART_MCR_RTS);
bd->bd_ops->assert_modem_signals(ch);
@@ -2526,7 +2517,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
}
switch (cmd) {
-
/* Here are all the standard ioctl's that we MUST implement */
case TCSBRK:
@@ -2735,7 +2725,6 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
/* set information for ditty */
if (cmd == (DIGI_SETAW)) {
-
spin_unlock_irqrestore(&ch->ch_lock, flags);
rc = ch->ch_bd->bd_ops->drain(tty, 0);
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 05/11] staging: dgnc: remove space after cast
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
` (2 preceding siblings ...)
2015-10-03 15:22 ` [PATCH 04/11] staging: dgnc: remove blankline after brace Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 06/11] staging: dgnc: change style of NULL comparison Sudip Mukherjee
` (5 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
Space is not necessary after typecast.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_cls.c | 6 +++---
drivers/staging/dgnc/dgnc_driver.c | 6 +++---
drivers/staging/dgnc/dgnc_mgmt.c | 6 +++---
drivers/staging/dgnc/dgnc_neo.c | 12 ++++++------
drivers/staging/dgnc/dgnc_tty.c | 24 ++++++++++++------------
5 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index 32b05bb..e8a7851 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -438,7 +438,7 @@ static void cls_param(struct tty_struct *tty)
if (!tty || tty->magic != TTY_MAGIC)
return;
- un = (struct un_t *) tty->driver_data;
+ un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
return;
@@ -676,7 +676,7 @@ static void cls_param(struct tty_struct *tty)
*/
static void cls_tasklet(unsigned long data)
{
- struct dgnc_board *bd = (struct dgnc_board *) data;
+ struct dgnc_board *bd = (struct dgnc_board *)data;
struct channel_t *ch;
unsigned long flags;
int i;
@@ -904,7 +904,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
if (!tty || tty->magic != TTY_MAGIC)
return -ENXIO;
- un = (struct un_t *) tty->driver_data;
+ un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
return -ENXIO;
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index b47ff6a..e476503 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -453,7 +453,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
brd->iobase = pci_resource_start(pdev, 1);
brd->iobase_end = pci_resource_end(pdev, 1);
- brd->iobase = ((unsigned int) (brd->iobase)) & 0xFFFE;
+ brd->iobase = ((unsigned int)(brd->iobase)) & 0xFFFE;
/* Assign the board_ops struct */
brd->bd_ops = &dgnc_cls_ops;
@@ -560,7 +560,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
/* init our poll helper tasklet */
tasklet_init(&brd->helper_tasklet,
brd->bd_ops->tasklet,
- (unsigned long) brd);
+ (unsigned long)brd);
spin_lock_irqsave(&dgnc_global_lock, flags);
brd->msgbuf = NULL;
@@ -673,7 +673,7 @@ static void dgnc_poll_handler(ulong dummy)
new_time = dgnc_poll_time - jiffies;
- if ((ulong) new_time >= 2 * dgnc_poll_tick)
+ if ((ulong)new_time >= 2 * dgnc_poll_tick)
dgnc_poll_time = jiffies + dgnc_jiffies_from_ms(dgnc_poll_tick);
setup_timer(&dgnc_poll_timer, dgnc_poll_handler, 0);
diff --git a/drivers/staging/dgnc/dgnc_mgmt.c b/drivers/staging/dgnc/dgnc_mgmt.c
index 5f46e69..9ec3efe 100644
--- a/drivers/staging/dgnc/dgnc_mgmt.c
+++ b/drivers/staging/dgnc/dgnc_mgmt.c
@@ -96,7 +96,7 @@ int dgnc_mgmt_close(struct inode *inode, struct file *file)
long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
unsigned long flags;
- void __user *uarg = (void __user *) arg;
+ void __user *uarg = (void __user *)arg;
switch (cmd) {
case DIGI_GETDD:
@@ -142,8 +142,8 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
di.info_bdtype = dgnc_Board[brd]->dpatype;
di.info_bdstate = dgnc_Board[brd]->dpastatus;
di.info_ioport = 0;
- di.info_physaddr = (ulong) dgnc_Board[brd]->membase;
- di.info_physsize = (ulong) dgnc_Board[brd]->membase
+ di.info_physaddr = (ulong)dgnc_Board[brd]->membase;
+ di.info_physsize = (ulong)dgnc_Board[brd]->membase
- dgnc_Board[brd]->membase_end;
if (dgnc_Board[brd]->state != BOARD_FAILED)
di.info_nports = dgnc_Board[brd]->nasync;
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 3dd7342..0d7ba53 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -590,7 +590,7 @@ static void neo_param(struct tty_struct *tty)
if (!tty || tty->magic != TTY_MAGIC)
return;
- un = (struct un_t *) tty->driver_data;
+ un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
return;
@@ -828,7 +828,7 @@ static void neo_param(struct tty_struct *tty)
*/
static void neo_tasklet(unsigned long data)
{
- struct dgnc_board *bd = (struct dgnc_board *) data;
+ struct dgnc_board *bd = (struct dgnc_board *)data;
struct channel_t *ch;
unsigned long flags;
int i;
@@ -1151,7 +1151,7 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
break;
/* Make sure we don't go over the end of our queue */
- n = min(((uint) total), (RQUEUESIZE - (uint) head));
+ n = min(((uint)total), (RQUEUESIZE - (uint)head));
/*
* Cut down n even further if needed, this is to fix
@@ -1256,7 +1256,7 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch)
}
memcpy_fromio(ch->ch_rqueue + head, &ch->ch_neo_uart->txrxburst, 1);
- ch->ch_equeue[head] = (unsigned char) linestatus;
+ ch->ch_equeue[head] = (unsigned char)linestatus;
/* Ditch any remaining linestatus value. */
linestatus = 0;
@@ -1291,7 +1291,7 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
if (!tty || tty->magic != TTY_MAGIC)
return -ENXIO;
- un = (struct un_t *) tty->driver_data;
+ un = (struct un_t *)tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC)
return -ENXIO;
@@ -1447,7 +1447,7 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch)
n = readb(&ch->ch_neo_uart->tfifo);
- if ((unsigned int) n > ch->ch_t_tlevel)
+ if ((unsigned int)n > ch->ch_t_tlevel)
goto exit_unlock;
n = UART_17158_TX_FIFOSIZE - ch->ch_t_tlevel;
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 9220187..35f3ec4 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1390,7 +1390,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
*/
if ((un->un_type == DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
- (int) ch->ch_digi.digi_offlen);
+ (int)ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
}
@@ -1437,7 +1437,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
*/
if ((un->un_type == DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
- (int) ch->ch_digi.digi_offlen);
+ (int)ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
}
}
@@ -1704,7 +1704,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
*/
if ((un->un_type == DGNC_PRINT) && !(ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_onstr,
- (int) ch->ch_digi.digi_onlen);
+ (int)ch->ch_digi.digi_onlen);
head = (ch->ch_w_head) & tmask;
ch->ch_flags |= CH_PRON;
}
@@ -1715,7 +1715,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
*/
if ((un->un_type != DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
- (int) ch->ch_digi.digi_offlen);
+ (int)ch->ch_digi.digi_offlen);
head = (ch->ch_w_head) & tmask;
ch->ch_flags &= ~CH_PRON;
}
@@ -2492,7 +2492,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
struct un_t *un;
int rc;
unsigned long flags;
- void __user *uarg = (void __user *) arg;
+ void __user *uarg = (void __user *)arg;
if (!tty || tty->magic != TTY_MAGIC)
return -ENODEV;
@@ -2597,13 +2597,13 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
spin_unlock_irqrestore(&ch->ch_lock, flags);
- rc = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) arg);
+ rc = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *)arg);
return rc;
case TIOCSSOFTCAR:
spin_unlock_irqrestore(&ch->ch_lock, flags);
- rc = get_user(arg, (unsigned long __user *) arg);
+ rc = get_user(arg, (unsigned long __user *)arg);
if (rc)
return rc;
@@ -2746,7 +2746,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
uint loopback = 0;
/* Let go of locks when accessing user space, could sleep */
spin_unlock_irqrestore(&ch->ch_lock, flags);
- rc = get_user(loopback, (unsigned int __user *) arg);
+ rc = get_user(loopback, (unsigned int __user *)arg);
if (rc)
return rc;
spin_lock_irqsave(&ch->ch_lock, flags);
@@ -2764,7 +2764,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
case DIGI_GETCUSTOMBAUD:
spin_unlock_irqrestore(&ch->ch_lock, flags);
- rc = put_user(ch->ch_custom_speed, (unsigned int __user *) arg);
+ rc = put_user(ch->ch_custom_speed, (unsigned int __user *)arg);
return rc;
case DIGI_SETCUSTOMBAUD:
@@ -2772,7 +2772,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
int new_rate;
/* Let go of locks when accessing user space, could sleep */
spin_unlock_irqrestore(&ch->ch_lock, flags);
- rc = get_user(new_rate, (int __user *) arg);
+ rc = get_user(new_rate, (int __user *)arg);
if (rc)
return rc;
spin_lock_irqsave(&ch->ch_lock, flags);
@@ -2794,7 +2794,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
unsigned char c;
spin_unlock_irqrestore(&ch->ch_lock, flags);
- rc = get_user(c, (unsigned char __user *) arg);
+ rc = get_user(c, (unsigned char __user *)arg);
if (rc)
return rc;
spin_lock_irqsave(&ch->ch_lock, flags);
@@ -2849,7 +2849,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
events |= (EV_IPU | EV_IPS);
spin_unlock_irqrestore(&ch->ch_lock, flags);
- rc = put_user(events, (unsigned int __user *) arg);
+ rc = put_user(events, (unsigned int __user *)arg);
return rc;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 06/11] staging: dgnc: change style of NULL comparison
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
` (3 preceding siblings ...)
2015-10-03 15:22 ` [PATCH 05/11] staging: dgnc: remove space after cast Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 07/11] staging: dgnc: alignment style Sudip Mukherjee
` (4 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
Change the NULL comparison style as warned by checkpatch.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_tty.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index 35f3ec4..b40fd67 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1469,7 +1469,7 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
uint chars = 0;
unsigned long flags;
- if (tty == NULL)
+ if (!tty)
return 0;
un = tty->driver_data;
@@ -1570,7 +1570,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
int ret = 0;
unsigned long flags;
- if (tty == NULL || dgnc_TmpWriteBuf == NULL)
+ if (!tty || !dgnc_TmpWriteBuf)
return 0;
un = tty->driver_data;
@@ -1649,7 +1649,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
ushort tmask;
uint remain;
- if (tty == NULL || dgnc_TmpWriteBuf == NULL)
+ if (!tty || !dgnc_TmpWriteBuf)
return 0;
un = tty->driver_data;
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 07/11] staging: dgnc: alignment style
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
` (4 preceding siblings ...)
2015-10-03 15:22 ` [PATCH 06/11] staging: dgnc: change style of NULL comparison Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 08/11] staging: dgnc: remove NULL test Sudip Mukherjee
` (3 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
checkpatch was warning us that the alignment should match the open
parenthesis.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_cls.c | 14 +++++++-------
drivers/staging/dgnc/dgnc_driver.c | 2 +-
drivers/staging/dgnc/dgnc_neo.c | 2 +-
drivers/staging/dgnc/dgnc_tty.c | 30 +++++++++++++++---------------
4 files changed, 24 insertions(+), 24 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index e8a7851..d62b745 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -518,7 +518,7 @@ static void cls_param(struct tty_struct *tty)
* unit is NOT open
*/
if (!(ch->ch_tun.un_flags & UN_ISOPEN) &&
- (un->un_type == DGNC_PRINT))
+ (un->un_type == DGNC_PRINT))
baud = C_BAUD(ch->ch_pun.un_tty) & 0xff;
else
baud = C_BAUD(ch->ch_tun.un_tty) & 0xff;
@@ -532,7 +532,7 @@ static void cls_param(struct tty_struct *tty)
jindex = baud;
if ((iindex >= 0) && (iindex < 4) && (jindex >= 0) &&
- (jindex < 16)) {
+ (jindex < 16)) {
baud = bauds[iindex][jindex];
} else {
baud = 0;
@@ -641,7 +641,7 @@ static void cls_param(struct tty_struct *tty)
* disable flow control
*/
if ((ch->ch_startc == _POSIX_VDISABLE) ||
- (ch->ch_stopc == _POSIX_VDISABLE))
+ (ch->ch_stopc == _POSIX_VDISABLE))
cls_set_no_output_flow_control(ch);
else
cls_set_ixon_flow_control(ch);
@@ -657,7 +657,7 @@ static void cls_param(struct tty_struct *tty)
* flow control
*/
if ((ch->ch_startc == _POSIX_VDISABLE) ||
- (ch->ch_stopc == _POSIX_VDISABLE))
+ (ch->ch_stopc == _POSIX_VDISABLE))
cls_set_no_input_flow_control(ch);
else
cls_set_ixoff_flow_control(ch);
@@ -933,7 +933,7 @@ static void cls_flush_uart_write(struct channel_t *ch)
return;
writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_XMIT),
- &ch->ch_cls_uart->isr_fcr);
+ &ch->ch_cls_uart->isr_fcr);
udelay(10);
ch->ch_flags |= (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
@@ -979,7 +979,7 @@ static void cls_copy_data_from_queue_to_uart(struct channel_t *ch)
/* If port is "stopped", don't send any data to the UART */
if ((ch->ch_flags & CH_FORCED_STOP) ||
- (ch->ch_flags & CH_BREAK_SENDING))
+ (ch->ch_flags & CH_BREAK_SENDING))
goto exit_unlock;
if (!(ch->ch_flags & (CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM)))
@@ -1169,7 +1169,7 @@ static void cls_uart_init(struct channel_t *ch)
readb(&ch->ch_cls_uart->txrx);
writeb((UART_FCR_ENABLE_FIFO|UART_FCR_CLEAR_RCVR|UART_FCR_CLEAR_XMIT),
- &ch->ch_cls_uart->isr_fcr);
+ &ch->ch_cls_uart->isr_fcr);
udelay(10);
ch->ch_flags |= (CH_FIFO_ENABLED | CH_TX_FIFO_EMPTY | CH_TX_FIFO_LWM);
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index e476503..21d64b4 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -238,7 +238,7 @@ static int dgnc_start(void)
}
dev = device_create(dgnc_class, NULL,
- MKDEV(dgnc_Major, 0),
+ MKDEV(dgnc_Major, 0),
NULL, "dgnc_mgmt");
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 0d7ba53..99287bb 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1390,7 +1390,7 @@ static void neo_copy_data_from_queue_to_uart(struct channel_t *ch)
/* If port is "stopped", don't send any data to the UART */
if ((ch->ch_flags & CH_FORCED_STOP) ||
- (ch->ch_flags & CH_BREAK_SENDING))
+ (ch->ch_flags & CH_BREAK_SENDING))
goto exit_unlock;
/*
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index b40fd67..a2fe41b 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -344,12 +344,12 @@ int dgnc_tty_init(struct dgnc_board *brd)
struct device *classp;
classp = tty_register_device(&brd->SerialDriver, i,
- &(ch->ch_bd->pdev->dev));
+ &(ch->ch_bd->pdev->dev));
ch->ch_tun.un_sysfs = classp;
dgnc_create_tty_sysfs(&ch->ch_tun, classp);
classp = tty_register_device(&brd->PrintDriver, i,
- &(ch->ch_bd->pdev->dev));
+ &(ch->ch_bd->pdev->dev));
ch->ch_pun.un_sysfs = classp;
dgnc_create_tty_sysfs(&ch->ch_pun, classp);
}
@@ -897,7 +897,7 @@ void dgnc_wakeup_writes(struct channel_t *ch)
if (ch->ch_tun.un_flags & UN_ISOPEN) {
if ((ch->ch_tun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- ch->ch_tun.un_tty->ldisc->ops->write_wakeup) {
+ ch->ch_tun.un_tty->ldisc->ops->write_wakeup) {
spin_unlock_irqrestore(&ch->ch_lock, flags);
(ch->ch_tun.un_tty->ldisc->ops->write_wakeup)(ch->ch_tun.un_tty);
spin_lock_irqsave(&ch->ch_lock, flags);
@@ -938,7 +938,7 @@ void dgnc_wakeup_writes(struct channel_t *ch)
if (ch->ch_pun.un_flags & UN_ISOPEN) {
if ((ch->ch_pun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
- ch->ch_pun.un_tty->ldisc->ops->write_wakeup) {
+ ch->ch_pun.un_tty->ldisc->ops->write_wakeup) {
spin_unlock_irqrestore(&ch->ch_lock, flags);
(ch->ch_pun.un_tty->ldisc->ops->write_wakeup)(ch->ch_pun.un_tty);
spin_lock_irqsave(&ch->ch_lock, flags);
@@ -999,7 +999,7 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
* sleep waiting for it to happen or they cancel the open.
*/
rc = wait_event_interruptible(brd->state_wait,
- (brd->state & BOARD_READY));
+ (brd->state & BOARD_READY));
if (rc)
return rc;
@@ -1057,7 +1057,7 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file)
* ch_flags_wait to wake us back up.
*/
rc = wait_event_interruptible(ch->ch_flags_wait,
- (((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_CLOSING) == 0));
+ (((ch->ch_tun.un_flags | ch->ch_pun.un_flags) & UN_CLOSING) == 0));
/* If ret is non-zero, user ctrl-c'ed us */
if (rc)
@@ -1271,10 +1271,10 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc
*/
if (sleep_on_un_flags)
retval = wait_event_interruptible(un->un_flags_wait,
- (old_flags != (ch->ch_tun.un_flags | ch->ch_pun.un_flags)));
+ (old_flags != (ch->ch_tun.un_flags | ch->ch_pun.un_flags)));
else
retval = wait_event_interruptible(ch->ch_flags_wait,
- (old_flags != ch->ch_flags));
+ (old_flags != ch->ch_flags));
/*
* We got woken up for some reason.
@@ -1390,7 +1390,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
*/
if ((un->un_type == DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
- (int)ch->ch_digi.digi_offlen);
+ (int)ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
}
@@ -1437,7 +1437,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file)
*/
if ((un->un_type == DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
- (int)ch->ch_digi.digi_offlen);
+ (int)ch->ch_digi.digi_offlen);
ch->ch_flags &= ~CH_PRON;
}
}
@@ -1638,7 +1638,7 @@ static int dgnc_tty_put_char(struct tty_struct *tty, unsigned char c)
* In here exists all the Transparent Print magic as well.
*/
static int dgnc_tty_write(struct tty_struct *tty,
- const unsigned char *buf, int count)
+ const unsigned char *buf, int count)
{
struct channel_t *ch = NULL;
struct un_t *un = NULL;
@@ -1704,7 +1704,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
*/
if ((un->un_type == DGNC_PRINT) && !(ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_onstr,
- (int)ch->ch_digi.digi_onlen);
+ (int)ch->ch_digi.digi_onlen);
head = (ch->ch_w_head) & tmask;
ch->ch_flags |= CH_PRON;
}
@@ -1715,7 +1715,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
*/
if ((un->un_type != DGNC_PRINT) && (ch->ch_flags & CH_PRON)) {
dgnc_wmove(ch, ch->ch_digi.digi_offstr,
- (int)ch->ch_digi.digi_offlen);
+ (int)ch->ch_digi.digi_offlen);
head = (ch->ch_w_head) & tmask;
ch->ch_flags &= ~CH_PRON;
}
@@ -1828,7 +1828,7 @@ static int dgnc_tty_tiocmget(struct tty_struct *tty)
*/
static int dgnc_tty_tiocmset(struct tty_struct *tty,
- unsigned int set, unsigned int clear)
+ unsigned int set, unsigned int clear)
{
struct dgnc_board *bd;
struct channel_t *ch;
@@ -2485,7 +2485,7 @@ static void dgnc_tty_flush_buffer(struct tty_struct *tty)
* The usual assortment of ioctl's
*/
static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
- unsigned long arg)
+ unsigned long arg)
{
struct dgnc_board *bd;
struct channel_t *ch;
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 08/11] staging: dgnc: remove NULL test
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
` (5 preceding siblings ...)
2015-10-03 15:22 ` [PATCH 07/11] staging: dgnc: alignment style Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 09/11] staging: dgnc: remove parenthesis Sudip Mukherjee
` (2 subsequent siblings)
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
This NULL test is not required as iounmap will validate the argument.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_cls.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c
index d62b745..75040da 100644
--- a/drivers/staging/dgnc/dgnc_cls.c
+++ b/drivers/staging/dgnc/dgnc_cls.c
@@ -1296,6 +1296,5 @@ static void cls_vpd(struct dgnc_board *brd)
}
pr_info("\n");
- if (re_map_vpdbase)
- iounmap(re_map_vpdbase);
+ iounmap(re_map_vpdbase);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 09/11] staging: dgnc: remove parenthesis
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
` (6 preceding siblings ...)
2015-10-03 15:22 ` [PATCH 08/11] staging: dgnc: remove NULL test Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 10/11] staging: dgnc: remove initialization of global Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 11/11] staging: dgnc: remove dgnc_init_globals function Sudip Mukherjee
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
checkpatch was warning us about extra unneeded parenthesis.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_neo.c | 2 +-
drivers/staging/dgnc/dgnc_sysfs.c | 48 +++++++++++++++++++--------------------
drivers/staging/dgnc/dgnc_tty.c | 14 ++++++------
3 files changed, 32 insertions(+), 32 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c
index 99287bb..8106f52 100644
--- a/drivers/staging/dgnc/dgnc_neo.c
+++ b/drivers/staging/dgnc/dgnc_neo.c
@@ -1792,6 +1792,6 @@ static void neo_vpd(struct dgnc_board *brd)
/* Search for the serial number */
for (i = 0; i < NEO_VPD_IMAGEBYTES - 3; i++)
if (brd->vpd[i] == 'S' && brd->vpd[i + 1] == 'N')
- strncpy(brd->serial_num, &(brd->vpd[i + 3]), 9);
+ strncpy(brd->serial_num, &brd->vpd[i + 3], 9);
}
}
diff --git a/drivers/staging/dgnc/dgnc_sysfs.c b/drivers/staging/dgnc/dgnc_sysfs.c
index 2e8fb91..236a824 100644
--- a/drivers/staging/dgnc/dgnc_sysfs.c
+++ b/drivers/staging/dgnc/dgnc_sysfs.c
@@ -336,18 +336,18 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
int rc = 0;
dev_set_drvdata(&bd->pdev->dev, bd);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_state);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_baud);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_cflag);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_oflag);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_lflag);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_vpd);
- rc |= device_create_file(&(bd->pdev->dev), &dev_attr_serial_number);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_state);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_baud);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_msignals);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_iflag);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_cflag);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_oflag);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_lflag);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_digi_flag);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_rxcount);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_ports_txcount);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_vpd);
+ rc |= device_create_file(&bd->pdev->dev, &dev_attr_serial_number);
if (rc)
dev_err(&bd->pdev->dev, "dgnc: sysfs device_create_file failed!\n");
}
@@ -355,18 +355,18 @@ void dgnc_create_ports_sysfiles(struct dgnc_board *bd)
/* removes all the sys files created for that port */
void dgnc_remove_ports_sysfiles(struct dgnc_board *bd)
{
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_state);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_baud);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_msignals);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_iflag);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_cflag);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_oflag);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_lflag);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_digi_flag);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_rxcount);
- device_remove_file(&(bd->pdev->dev), &dev_attr_ports_txcount);
- device_remove_file(&(bd->pdev->dev), &dev_attr_vpd);
- device_remove_file(&(bd->pdev->dev), &dev_attr_serial_number);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_state);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_baud);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_msignals);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_iflag);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_cflag);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_oflag);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_lflag);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_digi_flag);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_rxcount);
+ device_remove_file(&bd->pdev->dev, &dev_attr_ports_txcount);
+ device_remove_file(&bd->pdev->dev, &dev_attr_vpd);
+ device_remove_file(&bd->pdev->dev, &dev_attr_serial_number);
}
static ssize_t dgnc_tty_state_show(struct device *d,
diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index a2fe41b..e12241e 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -344,12 +344,12 @@ int dgnc_tty_init(struct dgnc_board *brd)
struct device *classp;
classp = tty_register_device(&brd->SerialDriver, i,
- &(ch->ch_bd->pdev->dev));
+ &ch->ch_bd->pdev->dev);
ch->ch_tun.un_sysfs = classp;
dgnc_create_tty_sysfs(&ch->ch_tun, classp);
classp = tty_register_device(&brd->PrintDriver, i,
- &(ch->ch_bd->pdev->dev));
+ &ch->ch_bd->pdev->dev);
ch->ch_pun.un_sysfs = classp;
dgnc_create_tty_sysfs(&ch->ch_pun, classp);
}
@@ -675,7 +675,7 @@ void dgnc_carrier(struct channel_t *ch)
* for carrier in the open routine.
*/
- if (waitqueue_active(&(ch->ch_flags_wait)))
+ if (waitqueue_active(&ch->ch_flags_wait))
wake_up_interruptible(&ch->ch_flags_wait);
}
@@ -688,7 +688,7 @@ void dgnc_carrier(struct channel_t *ch)
* for carrier in the open routine.
*/
- if (waitqueue_active(&(ch->ch_flags_wait)))
+ if (waitqueue_active(&ch->ch_flags_wait))
wake_up_interruptible(&ch->ch_flags_wait);
}
@@ -715,7 +715,7 @@ void dgnc_carrier(struct channel_t *ch)
*
* Enable all select calls.
*/
- if (waitqueue_active(&(ch->ch_flags_wait)))
+ if (waitqueue_active(&ch->ch_flags_wait))
wake_up_interruptible(&ch->ch_flags_wait);
if (ch->ch_tun.un_open_count > 0)
@@ -899,7 +899,7 @@ void dgnc_wakeup_writes(struct channel_t *ch)
if ((ch->ch_tun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
ch->ch_tun.un_tty->ldisc->ops->write_wakeup) {
spin_unlock_irqrestore(&ch->ch_lock, flags);
- (ch->ch_tun.un_tty->ldisc->ops->write_wakeup)(ch->ch_tun.un_tty);
+ ch->ch_tun.un_tty->ldisc->ops->write_wakeup(ch->ch_tun.un_tty);
spin_lock_irqsave(&ch->ch_lock, flags);
}
@@ -940,7 +940,7 @@ void dgnc_wakeup_writes(struct channel_t *ch)
if ((ch->ch_pun.un_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
ch->ch_pun.un_tty->ldisc->ops->write_wakeup) {
spin_unlock_irqrestore(&ch->ch_lock, flags);
- (ch->ch_pun.un_tty->ldisc->ops->write_wakeup)(ch->ch_pun.un_tty);
+ ch->ch_pun.un_tty->ldisc->ops->write_wakeup(ch->ch_pun.un_tty);
spin_lock_irqsave(&ch->ch_lock, flags);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 10/11] staging: dgnc: remove initialization of global
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
` (7 preceding siblings ...)
2015-10-03 15:22 ` [PATCH 09/11] staging: dgnc: remove parenthesis Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 11/11] staging: dgnc: remove dgnc_init_globals function Sudip Mukherjee
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
globals variable will be initialied to 0 and the global pointers will be
to NULL. No need to initialize them separately.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_driver.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 21d64b4..0886e33 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -693,13 +693,6 @@ static void dgnc_poll_handler(ulong dummy)
*/
static void dgnc_init_globals(void)
{
- int i = 0;
-
- dgnc_NumBoards = 0;
-
- for (i = 0; i < MAXBOARDS; i++)
- dgnc_Board[i] = NULL;
-
init_timer(&dgnc_poll_timer);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 11/11] staging: dgnc: remove dgnc_init_globals function
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
` (8 preceding siblings ...)
2015-10-03 15:22 ` [PATCH 10/11] staging: dgnc: remove initialization of global Sudip Mukherjee
@ 2015-10-03 15:22 ` Sudip Mukherjee
9 siblings, 0 replies; 12+ messages in thread
From: Sudip Mukherjee @ 2015-10-03 15:22 UTC (permalink / raw)
To: Lidza Louina, Mark Hounschell, Greg Kroah-Hartman
Cc: linux-kernel, driverdev-devel, devel, Sudip Mukherjee
The dgnc_init_globals() function is only initializing the timer so
initialize it directly and remove dgnc_init_globals() and change the
comment appropriately.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
drivers/staging/dgnc/dgnc_driver.c | 18 ++----------------
1 file changed, 2 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 0886e33..9f5e4b6 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -38,7 +38,6 @@ MODULE_SUPPORTED_DEVICE("dgnc");
*/
static int dgnc_start(void);
static int dgnc_finalize_board_init(struct dgnc_board *brd);
-static void dgnc_init_globals(void);
static int dgnc_found_board(struct pci_dev *pdev, int id);
static void dgnc_cleanup_board(struct dgnc_board *brd);
static void dgnc_poll_handler(ulong dummy);
@@ -213,8 +212,8 @@ static int dgnc_start(void)
unsigned long flags;
struct device *dev;
- /* make sure that the globals are init'd before we do anything else */
- dgnc_init_globals();
+ /* make sure timer is initialized before we do anything else */
+ init_timer(&dgnc_poll_timer);
/*
* Register our base character device into the kernel.
@@ -683,16 +682,3 @@ static void dgnc_poll_handler(ulong dummy)
if (!dgnc_poll_stop)
add_timer(&dgnc_poll_timer);
}
-
-/*
- * dgnc_init_globals()
- *
- * This is where we initialize the globals from the static insmod
- * configuration variables. These are declared near the head of
- * this file.
- */
-static void dgnc_init_globals(void)
-{
- init_timer(&dgnc_poll_timer);
-}
-
--
1.9.1
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH 02/11] staging: dgnc: remove multiple blank lines
2015-10-03 15:22 ` [PATCH 02/11] staging: dgnc: remove multiple blank lines Sudip Mukherjee
@ 2015-10-04 8:31 ` Greg Kroah-Hartman
0 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2015-10-04 8:31 UTC (permalink / raw)
To: Sudip Mukherjee
Cc: Lidza Louina, Mark Hounschell, devel, driverdev-devel,
linux-kernel
On Sat, Oct 03, 2015 at 08:52:40PM +0530, Sudip Mukherjee wrote:
> checkpatch warns us about multiple blank lines which are not needed.
> Remove them.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> drivers/staging/dgnc/dgnc_driver.c | 10 --------
> drivers/staging/dgnc/dgnc_mgmt.c | 5 ----
> drivers/staging/dgnc/dgnc_neo.c | 37 ---------------------------
> drivers/staging/dgnc/dgnc_sysfs.c | 37 ---------------------------
> drivers/staging/dgnc/dgnc_tty.c | 51 --------------------------------------
> 5 files changed, 140 deletions(-)
Due to other patches sent before your series, this, and some of the
other patches in this series does not apply. Please rebase and resend
the remaining patches.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2015-10-04 8:31 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-03 15:22 [PATCH 01/11] staging: dgnc: remove unused variables Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 02/11] staging: dgnc: remove multiple blank lines Sudip Mukherjee
2015-10-04 8:31 ` Greg Kroah-Hartman
2015-10-03 15:22 ` [PATCH 03/11] staging: dgnc: remove blankline before brace Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 04/11] staging: dgnc: remove blankline after brace Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 05/11] staging: dgnc: remove space after cast Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 06/11] staging: dgnc: change style of NULL comparison Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 07/11] staging: dgnc: alignment style Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 08/11] staging: dgnc: remove NULL test Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 09/11] staging: dgnc: remove parenthesis Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 10/11] staging: dgnc: remove initialization of global Sudip Mukherjee
2015-10-03 15:22 ` [PATCH 11/11] staging: dgnc: remove dgnc_init_globals function Sudip Mukherjee
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).