[PATCH] staging: dgnc: split two assignments into the two assignments on two lines.
split two assignments into the two assignments on two lines. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/TODO |2 -- drivers/staging/dgnc/dgnc_cls.c| 15 ++- drivers/staging/dgnc/dgnc_driver.c | 10 ++ drivers/staging/dgnc/dgnc_neo.c| 16 +++- drivers/staging/dgnc/dgnc_tty.c|9 ++--- 5 files changed, 33 insertions(+), 19 deletions(-) diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO index d2828c7..22adff1 100644 --- a/drivers/staging/dgnc/TODO +++ b/drivers/staging/dgnc/TODO @@ -1,6 +1,4 @@ * checkpatch fixes -* split two assignments into the two assignments on two lines; - don't use two equals signs * remove unecessary comments * remove unecessary error messages. Example kzalloc() has its own error message. Adding an extra one is useless. diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 84b1377..0393d6d 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -493,9 +493,12 @@ static void cls_param(struct tty_struct *tty) * If baud rate is zero, flush queues, and set mval to drop DTR. */ if ((ch-ch_c_cflag (CBAUD)) == 0) { - ch-ch_r_head = ch-ch_r_tail = 0; - ch-ch_e_head = ch-ch_e_tail = 0; - ch-ch_w_head = ch-ch_w_tail = 0; + ch-ch_r_head = 0; + ch-ch_r_tail = 0; + ch-ch_e_head = 0; + ch-ch_e_tail = 0; + ch-ch_w_head = 0; + ch-ch_w_tail = 0; cls_flush_uart_write(ch); cls_flush_uart_read(ch); @@ -627,7 +630,8 @@ static void cls_param(struct tty_struct *tty) break; } - ier = uart_ier = readb(ch-ch_cls_uart-ier); + uart_ier = readb(ch-ch_cls_uart-ier); + ier = uart_ier; uart_lcr = readb(ch-ch_cls_uart-lcr); if (baud == 0) @@ -915,7 +919,8 @@ static void cls_copy_data_from_uart_to_queue(struct channel_t *ch) * I hope thats okay with everyone? Yes? Good. */ while (qleft 1) { - ch-ch_r_tail = tail = (tail + 1) RQUEUEMASK; + tail = (tail + 1) RQUEUEMASK; + ch-ch_r_tail = tail; ch-ch_err_overrun++; qleft++; } diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 11bed56..2cc02c9 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -410,14 +410,16 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) unsigned long flags; /* get the board structure and prep it */ - brd = dgnc_Board[dgnc_NumBoards] = - kzalloc(sizeof(*brd), GFP_KERNEL); + dgnc_Board[dgnc_NumBoards] = kzalloc(sizeof(*brd), GFP_KERNEL); + brd = dgnc_Board[dgnc_NumBoards]; + if (!brd) return -ENOMEM; /* make a temporary message buffer for the boot messages */ - brd-msgbuf = brd-msgbuf_head = - kzalloc(sizeof(u8) * 8192, GFP_KERNEL); + brd-msgbuf_head = kzalloc(sizeof(u8) * 8192, GFP_KERNEL); + brd-msgbuf = brd-msgbuf_head; + if (!brd-msgbuf) { kfree(brd); return -ENOMEM; diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 920ce2d..d6f4a80 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -626,9 +626,12 @@ static void neo_param(struct tty_struct *tty) * If baud rate is zero, flush queues, and set mval to drop DTR. */ if ((ch-ch_c_cflag (CBAUD)) == 0) { - ch-ch_r_head = ch-ch_r_tail = 0; - ch-ch_e_head = ch-ch_e_tail = 0; - ch-ch_w_head = ch-ch_w_tail = 0; + ch-ch_r_head = 0; + ch-ch_r_tail = 0; + ch-ch_e_head = 0; + ch-ch_e_tail = 0; + ch-ch_w_head = 0; + ch-ch_w_tail = 0; neo_flush_uart_write(ch); neo_flush_uart_read(ch); @@ -754,7 +757,9 @@ static void neo_param(struct tty_struct *tty) break; } - ier = uart_ier = readb(ch-ch_neo_uart-ier); + uart_ier = readb(ch-ch_neo_uart-ier); + ier = uart_ier; + uart_lcr = readb(ch-ch_neo_uart-lcr); if (baud == 0) @@ -1285,7 +1290,8 @@ static void neo_copy_data_from_uart_to_queue(struct channel_t *ch) * I hope thats okay with everyone? Yes? Good. */ while (qleft 1) { - ch-ch_r_tail = tail = (tail + 1) RQUEUEMASK; + tail = (tail + 1) RQUEUEMASK; + ch-ch_r_tail
[PATCH] staging: dgnc: remove some unused macros
These macros do nothing, so remove it. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_driver.h |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index 020..7776874 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -54,9 +54,9 @@ #defineDEVSTR /dev/dg/dgnc /* /dev entries */ #defineDRVSTR dgnc /* Driver name string * displayed by APR */ -#defineAPR(args) do { PRINTF_TO_KMEM(args); printk(DRVSTR: ); printk args; \ +#defineAPR(args) do { printk(DRVSTR: ); printk args; \ } while (0) -#defineRAPR(args) do { PRINTF_TO_KMEM(args); printk args; } while (0) +#defineRAPR(args) do { printk args; } while (0) #define TRC_TO_CONSOLE 1 @@ -89,9 +89,6 @@ #defineDBG_CARR(dgnc_debug 0x1) -#define PRINTF_TO_KMEM(args) -# define TRC(ARGS) - /* Number of boards we support at once. */ #defineMAXBOARDS 20 #defineMAXPORTS8 -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: remove DPR Macros and related codes.
In dgnc_drivers.h, DPR macro and DPR_* macros are defined but do nothing. So remove them and related codes. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_cls.c| 51 drivers/staging/dgnc/dgnc_driver.c | 19 +-- drivers/staging/dgnc/dgnc_driver.h | 21 --- drivers/staging/dgnc/dgnc_mgmt.c | 23 drivers/staging/dgnc/dgnc_neo.c| 104 ++- drivers/staging/dgnc/dgnc_tty.c| 249 +++- 6 files changed, 29 insertions(+), 438 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index fe099c6..84b1377 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -99,7 +99,6 @@ static inline void cls_set_cts_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting CTSFLOW\n)); /* * The Enhanced Register Set may only be accessed when @@ -144,7 +143,6 @@ static inline void cls_set_ixon_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting IXON FLOW\n)); /* * The Enhanced Register Set may only be accessed when @@ -193,7 +191,6 @@ static inline void cls_set_no_output_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Unsetting Output FLOW\n)); /* * The Enhanced Register Set may only be accessed when @@ -240,7 +237,6 @@ static inline void cls_set_rts_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting RTSFLOW\n)); /* * The Enhanced Register Set may only be accessed when @@ -283,7 +279,6 @@ static inline void cls_set_ixoff_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting IXOFF FLOW\n)); /* * The Enhanced Register Set may only be accessed when @@ -328,7 +323,6 @@ static inline void cls_set_no_input_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Unsetting Input FLOW\n)); /* * The Enhanced Register Set may only be accessed when @@ -394,8 +388,6 @@ static inline void cls_clear_break(struct channel_t *ch, int force) writeb((temp ~UART_LCR_SBC), ch-ch_cls_uart-lcr); ch-ch_flags = ~(CH_BREAK_SENDING); ch-ch_stop_sending_break = 0; - DPR_IOCTL((Finishing UART_LCR_SBC! finished: %lx\n, - jiffies)); } } DGNC_UNLOCK(ch-ch_lock, lock_flags); @@ -430,9 +422,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) if (isr UART_IIR_NO_INT) break; - DPR_INTR((%s:%d port: %x isr: %x\n, __FILE__, __LINE__, -port, isr)); - /* Receive Interrupt pending */ if (isr (UART_IIR_RDI | UART_IIR_RDI_TIMEOUT)) { /* Read data from uart - queue */ @@ -464,7 +453,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) } /* Parse any modem signal changes */ - DPR_INTR((MOD_STAT: sending to parse_modem_sigs\n)); cls_parse_modem(ch, readb(ch-ch_cls_uart-msr)); } } @@ -501,10 +489,6 @@ static void cls_param(struct tty_struct *tty) if (!bd || bd-magic != DGNC_BOARD_MAGIC) return; - DPR_PARAM((param start: tdev: %x cflags: %x oflags: %x iflags: %x\n, - ch-ch_tun.un_dev, ch-ch_c_cflag, ch-ch_c_oflag, -ch-ch_c_iflag)); - /* * If baud rate is zero, flush queues, and set mval to drop DTR. */ @@ -588,8 +572,6 @@ static void cls_param(struct tty_struct *tty) (jindex 16)) { baud = bauds[iindex][jindex]; } else { - DPR_IOCTL((baud indices were out of range (%d)(%d), - iindex, jindex)); baud = 0; } @@ -840,14 +822,10 @@ static irqreturn_t cls_intr(int irq, void *voidbrd) /* If 0, no interrupts pending */ if (!poll_reg) { - DPR_INTR(( -Kernel interrupted to me, but no pending interrupts...\n)); DGNC_UNLOCK(brd-bd_intr_lock, lock_flags
Re: [PATCH] staging: dgnc: remove DPR Macros and related codes.
On 08/15/2014 03:08 PM, Greg KH wrote: On Tue, Aug 12, 2014 at 10:30:14PM +0900, Seunghun Lee wrote: In dgnc_drivers.h, DPR macro and DPR_* macros are defined but do nothing. So remove them and related codes. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_cls.c| 63 + drivers/staging/dgnc/dgnc_driver.c | 20 +-- drivers/staging/dgnc/dgnc_driver.h | 21 --- drivers/staging/dgnc/dgnc_mgmt.c | 23 drivers/staging/dgnc/dgnc_neo.c| 104 ++- drivers/staging/dgnc/dgnc_tty.c| 249 +++- 6 files changed, 36 insertions(+), 444 deletions(-) This conflicts with patches others have sent, can you refresh it after next Tuesday or so when I catch up with the pending patches and can push them out? thanks, greg k-h Ok, I will refresh it after next Tuesday. Thanks. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: android: fix a possible memory leak
Memory allocated by kstrdup should be freed. CC: Brian Swetland swetl...@google.com Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/android/logger.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c index 9b47e66..0bf0d24 100644 --- a/drivers/staging/android/logger.c +++ b/drivers/staging/android/logger.c @@ -790,7 +790,7 @@ static int __init create_log(char *log_name, int size) if (unlikely(ret)) { pr_err(failed to register misc device for log '%s'!\n, log-misc.name); - goto out_free_log; + goto out_free_misc_name; } pr_info(created %luK log '%s'\n, @@ -798,6 +798,9 @@ static int __init create_log(char *log_name, int size) return 0; +out_free_misc_name: + kfree(log-misc.name); + out_free_log: kfree(log); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: remove DPR Macros and related codes.
In dgnc_drivers.h, DPR macro and DPR_* macros are defined but do nothing. So remove them and related codes. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_cls.c| 63 + drivers/staging/dgnc/dgnc_driver.c | 20 +-- drivers/staging/dgnc/dgnc_driver.h | 21 --- drivers/staging/dgnc/dgnc_mgmt.c | 23 drivers/staging/dgnc/dgnc_neo.c| 104 ++- drivers/staging/dgnc/dgnc_tty.c| 249 +++- 6 files changed, 36 insertions(+), 444 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index cfa8384..8ff39e6 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -99,8 +99,7 @@ static inline void cls_set_cts_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting CTSFLOW\n)); - + /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -144,8 +143,7 @@ static inline void cls_set_ixon_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting IXON FLOW\n)); - + /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -193,8 +191,7 @@ static inline void cls_set_no_output_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Unsetting Output FLOW\n)); - + /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -240,8 +237,7 @@ static inline void cls_set_rts_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting RTSFLOW\n)); - + /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -283,8 +279,7 @@ static inline void cls_set_ixoff_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting IXOFF FLOW\n)); - + /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -328,8 +323,7 @@ static inline void cls_set_no_input_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Unsetting Input FLOW\n)); - + /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -393,8 +387,6 @@ static inline void cls_clear_break(struct channel_t *ch, int force) writeb((temp ~UART_LCR_SBC), ch-ch_cls_uart-lcr); ch-ch_flags = ~(CH_BREAK_SENDING); ch-ch_stop_sending_break = 0; - DPR_IOCTL((Finishing UART_LCR_SBC! finished: %lx\n, - jiffies)); } } DGNC_UNLOCK(ch-ch_lock, lock_flags); @@ -429,9 +421,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) if (isr UART_IIR_NO_INT) break; - DPR_INTR((%s:%d port: %x isr: %x\n, __FILE__, __LINE__, -port, isr)); - /* Receive Interrupt pending */ if (isr (UART_IIR_RDI | UART_IIR_RDI_TIMEOUT)) { /* Read data from uart - queue */ @@ -463,7 +452,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) } /* Parse any modem signal changes */ - DPR_INTR((MOD_STAT: sending to parse_modem_sigs\n)); cls_parse_modem(ch, readb(ch-ch_cls_uart-msr)); } } @@ -500,10 +488,6 @@ static void cls_param(struct tty_struct *tty) if (!bd || bd-magic != DGNC_BOARD_MAGIC) return; - DPR_PARAM((param start: tdev: %x cflags: %x oflags: %x iflags: %x\n, - ch-ch_tun.un_dev, ch-ch_c_cflag, ch-ch_c_oflag, -ch-ch_c_iflag)); - /* * If baud rate is zero, flush queues, and set mval to drop DTR. */ @@ -587,8 +571,6 @@ static void cls_param(struct tty_struct *tty) (jindex 16)) { baud = bauds[iindex][jindex]; } else { - DPR_IOCTL((baud indices were out of range (%d)(%d), - iindex, jindex)); baud = 0
[PATCH] staging: dgnc: remove some unused code
Remove some unused code. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_cls.c| 72 +- drivers/staging/dgnc/dgnc_driver.c | 39 +- drivers/staging/dgnc/dgnc_driver.h | 70 +- drivers/staging/dgnc/dgnc_mgmt.c | 23 --- drivers/staging/dgnc/dgnc_neo.c| 117 ++-- drivers/staging/dgnc/dgnc_tty.c| 271 6 files changed, 48 insertions(+), 544 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index cfa8384..85dcfb9 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -99,8 +99,6 @@ static inline void cls_set_cts_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting CTSFLOW\n)); - /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -144,8 +142,6 @@ static inline void cls_set_ixon_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting IXON FLOW\n)); - /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -193,8 +189,6 @@ static inline void cls_set_no_output_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Unsetting Output FLOW\n)); - /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -240,8 +234,6 @@ static inline void cls_set_rts_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting RTSFLOW\n)); - /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -283,8 +275,6 @@ static inline void cls_set_ixoff_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Setting IXOFF FLOW\n)); - /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -328,8 +318,6 @@ static inline void cls_set_no_input_flow_control(struct channel_t *ch) uchar ier = readb(ch-ch_cls_uart-ier); uchar isr_fcr = 0; - DPR_PARAM((Unsetting Input FLOW\n)); - /* * The Enhanced Register Set may only be accessed when * the Line Control Register is set to 0xBFh. @@ -393,8 +381,6 @@ static inline void cls_clear_break(struct channel_t *ch, int force) writeb((temp ~UART_LCR_SBC), ch-ch_cls_uart-lcr); ch-ch_flags = ~(CH_BREAK_SENDING); ch-ch_stop_sending_break = 0; - DPR_IOCTL((Finishing UART_LCR_SBC! finished: %lx\n, - jiffies)); } } DGNC_UNLOCK(ch-ch_lock, lock_flags); @@ -429,8 +415,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) if (isr UART_IIR_NO_INT) break; - DPR_INTR((%s:%d port: %x isr: %x\n, __FILE__, __LINE__, -port, isr)); /* Receive Interrupt pending */ if (isr (UART_IIR_RDI | UART_IIR_RDI_TIMEOUT)) { @@ -463,7 +447,6 @@ static inline void cls_parse_isr(struct dgnc_board *brd, uint port) } /* Parse any modem signal changes */ - DPR_INTR((MOD_STAT: sending to parse_modem_sigs\n)); cls_parse_modem(ch, readb(ch-ch_cls_uart-msr)); } } @@ -500,10 +483,6 @@ static void cls_param(struct tty_struct *tty) if (!bd || bd-magic != DGNC_BOARD_MAGIC) return; - DPR_PARAM((param start: tdev: %x cflags: %x oflags: %x iflags: %x\n, - ch-ch_tun.un_dev, ch-ch_c_cflag, ch-ch_c_oflag, -ch-ch_c_iflag)); - /* * If baud rate is zero, flush queues, and set mval to drop DTR. */ @@ -587,8 +566,6 @@ static void cls_param(struct tty_struct *tty) (jindex 16)) { baud = bauds[iindex][jindex]; } else { - DPR_IOCTL((baud indices were out of range (%d)(%d), - iindex, jindex)); baud = 0; } @@ -737,10 +714,8 @@ static void cls_tasklet(unsigned long data) int state = 0; int ports = 0; - if (!bd || bd
[PATCH 2/2] staging: dgnc: Remove unneeded dgnc_trace.c and dgnc_trace.h
Removes unneeded dgnc_trace.c and dgnc_trace.h CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/Makefile |2 +- drivers/staging/dgnc/dgnc_cls.c|1 - drivers/staging/dgnc/dgnc_driver.c |1 - drivers/staging/dgnc/dgnc_neo.c|1 - drivers/staging/dgnc/dgnc_trace.c | 54 drivers/staging/dgnc/dgnc_trace.h | 34 --- drivers/staging/dgnc/dgnc_tty.c|1 - 7 files changed, 1 insertion(+), 93 deletions(-) delete mode 100644 drivers/staging/dgnc/dgnc_trace.c delete mode 100644 drivers/staging/dgnc/dgnc_trace.h diff --git a/drivers/staging/dgnc/Makefile b/drivers/staging/dgnc/Makefile index 888c433..733434f 100644 --- a/drivers/staging/dgnc/Makefile +++ b/drivers/staging/dgnc/Makefile @@ -4,4 +4,4 @@ obj-$(CONFIG_DGNC) += dgnc.o dgnc-objs := dgnc_cls.o dgnc_driver.o\ dgnc_mgmt.o dgnc_neo.o\ - dgnc_trace.o dgnc_tty.o dgnc_sysfs.o + dgnc_tty.o dgnc_sysfs.o diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 5a76a8e..cfa8384 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -41,7 +41,6 @@ #include dgnc_driver.h /* Driver main header file */ #include dgnc_cls.h #include dgnc_tty.h -#include dgnc_trace.h static inline void cls_parse_isr(struct dgnc_board *brd, uint port); static inline void cls_clear_break(struct channel_t *ch, int force); diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index a5be911..764613b 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -40,7 +40,6 @@ #include dpacompat.h #include dgnc_mgmt.h #include dgnc_tty.h -#include dgnc_trace.h #include dgnc_cls.h #include dgnc_neo.h #include dgnc_sysfs.h diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 9de988c..68ff116 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -41,7 +41,6 @@ #include dgnc_driver.h /* Driver main header file */ #include dgnc_neo.h /* Our header file */ #include dgnc_tty.h -#include dgnc_trace.h static inline void neo_parse_lsr(struct dgnc_board *brd, uint port); static inline void neo_parse_isr(struct dgnc_board *brd, uint port); diff --git a/drivers/staging/dgnc/dgnc_trace.c b/drivers/staging/dgnc/dgnc_trace.c deleted file mode 100644 index 3bb2259..000 --- a/drivers/staging/dgnc/dgnc_trace.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2003 Digi International (www.digi.com) - * Scott H Kilau Scott_Kilau at digi dot com - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED; without even the - * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * - * NOTE TO LINUX KERNEL HACKERS: DO NOT REFORMAT THIS CODE! - * - * This is shared code between Digi's CVS archive and the - * Linux Kernel sources. - * Changing the source just for reformatting needlessly breaks - * our CVS diff history. - * - * Send any bug fixes/changes to: Eng.Linux at digi dot com. - * Thank you. - * - */ - -#include linux/kernel.h -#include linux/sched.h /* For jiffies, task states */ -#include linux/interrupt.h /* For tasklet and interrupt structs/defines */ -#include linux/vmalloc.h - -#include dgnc_driver.h -#include dgnc_trace.h - -#define TRC_TO_CONSOLE 1 - -/* file level globals */ -static char *dgnc_trcbuf; /* the ringbuffer */ - -/* - * dgnc_tracer_free() - * - * - */ -void dgnc_tracer_free(void) -{ - if (dgnc_trcbuf) - vfree(dgnc_trcbuf); -} diff --git a/drivers/staging/dgnc/dgnc_trace.h b/drivers/staging/dgnc/dgnc_trace.h deleted file mode 100644 index 4f4e2b9..000 --- a/drivers/staging/dgnc/dgnc_trace.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2003 Digi International (www.digi.com) - * Scott H Kilau Scott_Kilau at digi dot com - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY
[PATCH] staging: dgnc: removes comment related to the delete code.
This patch removes comment related to the delete code. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_cls.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 4b65306..06fc68b 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -1042,9 +1042,6 @@ static void cls_flush_uart_read(struct channel_t *ch) * * However, doing the statement below also incorrectly flushes * write data as well as just basically trashing the FIFO. -* -* I believe this is a BUG in this UART. -* So for now, we will leave the code #ifdef'ed out... */ udelay(10); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: remove commented code
This patch removes commented code in dgnc driver. CC: Lidza Louina lidza.lou...@gmail.com CC: Mark Hounschell ma...@compro.net Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_cls.c |5 +- drivers/staging/dgnc/dgnc_trace.c | 123 - drivers/staging/dgnc/dgnc_trace.h | 10 --- drivers/staging/dgnc/dgnc_tty.c | 18 -- drivers/staging/dgnc/digi.h |1 - 5 files changed, 1 insertion(+), 156 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 8e265c2..4b65306 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -1046,10 +1046,7 @@ static void cls_flush_uart_read(struct channel_t *ch) * I believe this is a BUG in this UART. * So for now, we will leave the code #ifdef'ed out... */ -#if 0 - writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR), -ch-ch_cls_uart-isr_fcr); -#endif + udelay(10); } diff --git a/drivers/staging/dgnc/dgnc_trace.c b/drivers/staging/dgnc/dgnc_trace.c index 2f62f2a..d764154 100644 --- a/drivers/staging/dgnc/dgnc_trace.c +++ b/drivers/staging/dgnc/dgnc_trace.c @@ -50,129 +50,6 @@ static int dgnc_trcbufi = 0;/* index of the tilde at the end of */ static DEFINE_SPINLOCK(dgnc_tracef_lock); #endif - -#if 0 - -#if !defined(TRC_TO_KMEM) !defined(TRC_TO_CONSOLE) - -void dgnc_tracef(const char *fmt, ...) -{ - return; -} - -#else /* !defined(TRC_TO_KMEM) !defined(TRC_TO_CONSOLE) */ - -void dgnc_tracef(const char *fmt, ...) -{ - va_list ap; - charbuf[TRC_MAXMSG+1]; - size_t lenbuf; - int i; - static int failed = FALSE; -# if defined(TRC_TO_KMEM) - unsigned longflags; -#endif - - if (failed) - return; -# if defined(TRC_TO_KMEM) - DGNC_LOCK(dgnc_tracef_lock, flags); -#endif - - /* Format buf using fmt and arguments contained in ap. */ - va_start(ap, fmt); - i = vsprintf(buf, fmt, ap); - va_end(ap); - lenbuf = strlen(buf); - -# if defined(TRC_TO_KMEM) - { - static int initd = 0; - - /* -* Now, in addition to (or instead of) printing this stuff out -* (which is a buffered operation), also tuck it away into a -* corner of memory which can be examined post-crash in kdb. -*/ - if (!initd) { - dgnc_trcbuf = (char *) vmalloc(dgnc_trcbuf_size); - if (!dgnc_trcbuf) { - failed = TRUE; - printk(dgnc: tracing init failed!\n); - return; - } - - memset(dgnc_trcbuf, '\0', dgnc_trcbuf_size); - dgnc_trcbufi = 0; - initd++; - - printk(dgnc: tracing enabled - TRC_DTRC -0x%lx 0x%x\n, - (unsigned long)dgnc_trcbuf, - dgnc_trcbuf_size); - } - -# if defined(TRC_ON_OVERFLOW_WRAP_AROUND) - /* -* This is the less CPU-intensive way to do things. We simply -* wrap around before we fall off the end of the buffer. A -* tilde (~) demarcates the current end of the trace. -* -* This method should be used if you are concerned about race -* conditions as it is less likely to affect the timing of -* things. -*/ - - if (dgnc_trcbufi + lenbuf = dgnc_trcbuf_size) { - /* We are wrapping, so wipe out the last tilde. */ - dgnc_trcbuf[dgnc_trcbufi] = '\0'; - /* put the new string at the beginning of the buffer */ - dgnc_trcbufi = 0; - } - - strcpy(dgnc_trcbuf[dgnc_trcbufi], buf); - dgnc_trcbufi += lenbuf; - dgnc_trcbuf[dgnc_trcbufi] = '~'; - -# elif defined(TRC_ON_OVERFLOW_SHIFT_BUFFER) - /* -* This is the more CPU-intensive way to do things. If we -* venture into the last 1/8 of the buffer, we shift the -* last 7/8 of the buffer forward, wiping out the first 1/8. -* Advantage: No wrap-around, only truncation from the -* beginning. -* -* This method should not be used if you are concerned about -* timing changes affecting the behaviour of the driver (ie, -* race conditions). -*/ - strcpy(dgnc_trcbuf[dgnc_trcbufi], buf); - dgnc_trcbufi += lenbuf
[PATCH 3/3] staging: dgnc: Fix space required after that ','
This patch fixes checkpatch errors: space required after that ',' Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_driver.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index f7730a1..b68246a 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -219,8 +219,8 @@ * Makes spotting lock/unlock locations easier. */ # define DGNC_SPINLOCK_INIT(x) spin_lock_init((x)) -# define DGNC_LOCK(x,y)spin_lock_irqsave((x), y) -# define DGNC_UNLOCK(x,y) spin_unlock_irqrestore((x), y) +# define DGNC_LOCK(x, y) spin_lock_irqsave((x), y) +# define DGNC_UNLOCK(x, y) spin_unlock_irqrestore((x), y) /* * All the possible states the driver can be while being loaded. -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: dgng: Fix Macros with complex values should be enclosed in parenthesis
This patch fixes a checkpatch errors Macros with complex values should be enclosed in parenthesis Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_driver.h | 40 drivers/staging/dgnc/digi.h| 60 ++-- drivers/staging/dgnc/dpacompat.h | 12 3 files changed, 56 insertions(+), 56 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index fe5ea90..f7730a1 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -111,32 +111,32 @@ #endif #if defined TRC_TO_KMEM -#define PRINTF_TO_KMEM(args) dgnc_tracef args +#define PRINTF_TO_KMEM(args) do { dgnc_tracef args } while (0) #else /* !defined TRC_TO_KMEM */ #define PRINTF_TO_KMEM(args) #endif #defineTRC(args) { PRINTF_TO_KMEM(args); PRINTF_TO_CONSOLE(args) } -# define DPR_INIT(ARGS)if (DBG_INIT) TRC(ARGS) -# define DPR_BASIC(ARGS) if (DBG_BASIC) TRC(ARGS) -# define DPR_CORE(ARGS)if (DBG_CORE) TRC(ARGS) -# define DPR_OPEN(ARGS)if (DBG_OPEN) TRC(ARGS) -# define DPR_CLOSE(ARGS) if (DBG_CLOSE) TRC(ARGS) -# define DPR_READ(ARGS)if (DBG_READ) TRC(ARGS) -# define DPR_WRITE(ARGS) if (DBG_WRITE) TRC(ARGS) -# define DPR_IOCTL(ARGS) if (DBG_IOCTL) TRC(ARGS) -# define DPR_PROC(ARGS)if (DBG_PROC) TRC(ARGS) -# define DPR_PARAM(ARGS) if (DBG_PARAM) TRC(ARGS) -# define DPR_PSCAN(ARGS) if (DBG_PSCAN) TRC(ARGS) -# define DPR_EVENT(ARGS) if (DBG_EVENT) TRC(ARGS) -# define DPR_DRAIN(ARGS) if (DBG_DRAIN) TRC(ARGS) -# define DPR_CARR(ARGS)if (DBG_CARR) TRC(ARGS) -# define DPR_MGMT(ARGS)if (DBG_MGMT) TRC(ARGS) -# define DPR_INTR(ARGS)if (DBG_INTR) TRC(ARGS) -# define DPR_MSIGS(ARGS) if (DBG_MSIGS) TRC(ARGS) - -# define DPR(ARGS) if (dgnc_debug) TRC(ARGS) +# define DPR_INIT(ARGS)do { if (DBG_INIT) TRC(ARGS) } while (0) +# define DPR_BASIC(ARGS) do { if (DBG_BASIC) TRC(ARGS) } while (0) +# define DPR_CORE(ARGS)do { if (DBG_CORE) TRC(ARGS) } while (0) +# define DPR_OPEN(ARGS)do { if (DBG_OPEN) TRC(ARGS) } while (0) +# define DPR_CLOSE(ARGS) do { if (DBG_CLOSE) TRC(ARGS) } while (0) +# define DPR_READ(ARGS)do { if (DBG_READ) TRC(ARGS) } while (0) +# define DPR_WRITE(ARGS) do { if (DBG_WRITE) TRC(ARGS) } while (0) +# define DPR_IOCTL(ARGS) do { if (DBG_IOCTL) TRC(ARGS) } while (0) +# define DPR_PROC(ARGS)do { if (DBG_PROC) TRC(ARGS) } while (0) +# define DPR_PARAM(ARGS) do { if (DBG_PARAM) TRC(ARGS) } while (0) +# define DPR_PSCAN(ARGS) do { if (DBG_PSCAN) TRC(ARGS) } while (0) +# define DPR_EVENT(ARGS) do { if (DBG_EVENT) TRC(ARGS) } while (0) +# define DPR_DRAIN(ARGS) do { if (DBG_DRAIN) TRC(ARGS) } while (0) +# define DPR_CARR(ARGS)do { if (DBG_CARR) TRC(ARGS) } while (0) +# define DPR_MGMT(ARGS)do { if (DBG_MGMT) TRC(ARGS) } while (0) +# define DPR_INTR(ARGS)do { if (DBG_INTR) TRC(ARGS) } while (0) +# define DPR_MSIGS(ARGS) do { if (DBG_MSIGS) TRC(ARGS) } while (0) + +# define DPR(ARGS) do { if (dgnc_debug) TRC(ARGS) } while (0) # define P(X) dgnc_tracef(#X =%p\n, X) # define X(X) dgnc_tracef(#X =%x\n, X) diff --git a/drivers/staging/dgnc/digi.h b/drivers/staging/dgnc/digi.h index 282908f..086cd9a 100644 --- a/drivers/staging/dgnc/digi.h +++ b/drivers/staging/dgnc/digi.h @@ -38,8 +38,8 @@ #if !defined(TIOCMODG) -#defineTIOCMODG('d'8) | 250 /* get modem ctrl state */ -#defineTIOCMODS('d'8) | 251 /* set modem ctrl state */ +#defineTIOCMODG(('d'8) | 250)/* get modem ctrl state */ +#defineTIOCMODS(('d'8) | 251)/* set modem ctrl state */ #ifndef TIOCM_LE #defineTIOCM_LE0x01/* line enable */ @@ -58,44 +58,44 @@ #endif #if !defined(TIOCMSET) -#defineTIOCMSET('d'8) | 252 /* set modem ctrl state */ -#defineTIOCMGET('d'8) | 253 /* set modem ctrl state */ +#defineTIOCMSET(('d'8) | 252)/* set modem ctrl state */ +#defineTIOCMGET(('d'8) | 253)/* set modem ctrl state */ #endif #if !defined(TIOCMBIC) -#defineTIOCMBIC('d'8) | 254 /* set modem ctrl state */ -#defineTIOCMBIS('d'8) | 255 /* set modem ctrl state */ +#defineTIOCMBIC(('d'8) | 254)/* set modem ctrl state */ +#defineTIOCMBIS(('d'8) | 255)/* set modem ctrl state */ #endif #if !defined(TIOCSDTR) -#define
[PATCH 2/3] staging: dgnc: Fix do not initialise statics to 0 or NULL
This patch fixes checkpatch errors do not initialise statics to 0 or NULL Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/dgnc/dgnc_trace.c |2 +- drivers/staging/dgnc/dgnc_tty.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_trace.c b/drivers/staging/dgnc/dgnc_trace.c index 2f62f2a..9be4715 100644 --- a/drivers/staging/dgnc/dgnc_trace.c +++ b/drivers/staging/dgnc/dgnc_trace.c @@ -43,7 +43,7 @@ static char *dgnc_trcbuf; /* the ringbuffer */ #if defined(TRC_TO_KMEM) -static int dgnc_trcbufi = 0; /* index of the tilde at the end of */ +static int dgnc_trcbufi; /* index of the tilde at the end of */ #endif #if defined(TRC_TO_KMEM) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index 714a069..919abda 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -67,7 +67,7 @@ * internal variables */ static struct dgnc_board *dgnc_BoardsByMajor[256]; -static uchar *dgnc_TmpWriteBuf = NULL; +static uchar *dgnc_TmpWriteBuf; static DECLARE_MUTEX(dgnc_TmpWriteSem); /* -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: ced1401: fix sparse warning for ced1401
This patch fixes below warning. drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in assignment (different address spaces) drivers/staging/ced1401/ced_ioc.c:703:30:expected void *[usertype] lpvBuff drivers/staging/ced1401/ced_ioc.c:703:30:got char [noderef] asn:1*puBuf Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/ced1401/usb1401.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ced1401/usb1401.h b/drivers/staging/ced1401/usb1401.h index ea0fe63..8327e9c 100644 --- a/drivers/staging/ced1401/usb1401.h +++ b/drivers/staging/ced1401/usb1401.h @@ -101,7 +101,7 @@ typedef struct circBlk { /* A structure holding all of the information about a transfer area - an area of */ /* memory set up for use either as a source or destination in DMA transfers. */ typedef struct transarea { - void*lpvBuff;/* User address of xfer area saved for completeness */ + void __user *lpvBuff;/* User address of xfer area saved for completeness */ UINTdwBaseOffset; /* offset to start of xfer area in first page */ UINTdwLength; /* Length of xfer area, in bytes */ struct page **pPages; /* Points at array of locked down pages */ -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: ced1401: fix sparse warning for ced1401
This patch fixes below warning. drivers/staging/ced1401/ced_ioc.c:703:30: warning: incorrect type in assignment (different address spaces) drivers/staging/ced1401/ced_ioc.c:703:30:expected void *[usertype] lpvBuff drivers/staging/ced1401/ced_ioc.c:703:30:got char [noderef] asn:1*puBuf Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/ced1401/ced_ioc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ced1401/ced_ioc.c b/drivers/staging/ced1401/ced_ioc.c index ebbc509..963b941 100644 --- a/drivers/staging/ced1401/ced_ioc.c +++ b/drivers/staging/ced1401/ced_ioc.c @@ -700,7 +700,7 @@ static int SetArea(DEVICE_EXTENSION *pdx, int nArea, char __user *puBuf, /* kmap() or kmap_atomic() to get a virtual address. page_address will give you */ /* (null) or at least it does in this context with an x86 machine. */ spin_lock_irq(pdx-stagedLock); - pTA-lpvBuff = puBuf; /* keep start of region (user address) */ + pTA-lpvBuff = (__force void *)puBuf; /* keep start of region (user address) */ pTA-dwBaseOffset = ulOffset; /* save offset in first page to start of xfer */ pTA-dwLength = dwLength; /* Size if the region in bytes */ pTA-pPages = pPages; /* list of pages that are used by buffer */ -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RESEND] [PATCH] staging: android: fix missing a blank line after declarations
This patch fixes Missing a blank line after declarations warnings. Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/android/alarm-dev.c |1 + drivers/staging/android/binder.c | 34 + drivers/staging/android/ion/ion.c | 10 drivers/staging/android/ion/ion_heap.c|2 ++ drivers/staging/android/ion/ion_priv.h|1 + drivers/staging/android/ion/ion_system_heap.c |5 drivers/staging/android/logger.c |3 +++ drivers/staging/android/sw_sync.c |2 ++ drivers/staging/android/sync.c|8 ++ drivers/staging/android/timed_gpio.c |1 + 10 files changed, 67 insertions(+) diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c index 2fc7cdd..f200e8a 100644 --- a/drivers/staging/android/alarm-dev.c +++ b/drivers/staging/android/alarm-dev.c @@ -329,6 +329,7 @@ static int alarm_release(struct inode *inode, struct file *file) if (file-private_data) { for (i = 0; i ANDROID_ALARM_TYPE_COUNT; i++) { uint32_t alarm_type_mask = 1U i; + if (alarm_enabled alarm_type_mask) { alarm_dbg(INFO, %s: clear alarm, pending %d\n, diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index fc59281..3a4394f 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -118,6 +118,7 @@ static int binder_set_stop_on_user_error(const char *val, struct kernel_param *kp) { int ret; + ret = param_set_int(val, kp); if (binder_stop_on_user_error 2) wake_up(binder_user_error_wait); @@ -194,6 +195,7 @@ static struct binder_transaction_log_entry *binder_transaction_log_add( struct binder_transaction_log *log) { struct binder_transaction_log_entry *e; + e = log-entry[log-next]; memset(e, 0, sizeof(*e)); log-next++; @@ -432,6 +434,7 @@ static inline void binder_unlock(const char *tag) static void binder_set_nice(long nice) { long min_nice; + if (can_nice(current, nice)) { set_user_nice(current, nice); return; @@ -584,6 +587,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, for (page_addr = start; page_addr end; page_addr += PAGE_SIZE) { int ret; struct page **page_array_ptr; + page = proc-pages[(page_addr - proc-buffer) / PAGE_SIZE]; BUG_ON(*page); @@ -726,6 +730,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc, binder_insert_allocated_buffer(proc, buffer); if (buffer_size != size) { struct binder_buffer *new_buffer = (void *)buffer-data + size; + list_add(new_buffer-entry, buffer-entry); new_buffer-free = 1; binder_insert_free_buffer(proc, new_buffer); @@ -838,6 +843,7 @@ static void binder_free_buf(struct binder_proc *proc, if (!list_is_last(buffer-entry, proc-buffers)) { struct binder_buffer *next = list_entry(buffer-entry.next, struct binder_buffer, entry); + if (next-free) { rb_erase(next-rb_node, proc-free_buffers); binder_delete_free_buffer(proc, next); @@ -846,6 +852,7 @@ static void binder_free_buf(struct binder_proc *proc, if (proc-buffers.next != buffer-entry) { struct binder_buffer *prev = list_entry(buffer-entry.prev, struct binder_buffer, entry); + if (prev-free) { binder_delete_free_buffer(proc, buffer); rb_erase(prev-rb_node, proc-free_buffers); @@ -1107,6 +1114,7 @@ static int binder_inc_ref(struct binder_ref *ref, int strong, struct list_head *target_list) { int ret; + if (strong) { if (ref-strong == 0) { ret = binder_inc_node(ref-node, 1, 1, target_list); @@ -1138,6 +1146,7 @@ static int binder_dec_ref(struct binder_ref *ref, int strong) ref-strong--; if (ref-strong == 0) { int ret; + ret = binder_dec_node(ref-node, strong, 1); if (ret) return ret; @@ -1177,6 +1186,7 @@ static void binder_send_failed_reply(struct binder_transaction *t, uint32_t error_code) { struct binder_thread *target_thread; + BUG_ON(t-flags TF_ONE_WAY); while (1) { target_thread = t-from; @@ -1247,6
[PATCH] staging: android: fix missing a blank line after declarations
This patch fixes Missing a blank line after declarations warnings. Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/android/alarm-dev.c |1 + drivers/staging/android/binder.c | 37 + drivers/staging/android/ion/ion.c | 10 +++ drivers/staging/android/ion/ion_heap.c|2 ++ drivers/staging/android/ion/ion_priv.h|1 + drivers/staging/android/ion/ion_system_heap.c |5 drivers/staging/android/logger.c |3 ++ drivers/staging/android/sw_sync.c |2 ++ drivers/staging/android/sync.c|8 ++ drivers/staging/android/timed_gpio.c |1 + 10 files changed, 70 insertions(+) diff --git a/drivers/staging/android/alarm-dev.c b/drivers/staging/android/alarm-dev.c index 2fc7cdd..f200e8a 100644 --- a/drivers/staging/android/alarm-dev.c +++ b/drivers/staging/android/alarm-dev.c @@ -329,6 +329,7 @@ static int alarm_release(struct inode *inode, struct file *file) if (file-private_data) { for (i = 0; i ANDROID_ALARM_TYPE_COUNT; i++) { uint32_t alarm_type_mask = 1U i; + if (alarm_enabled alarm_type_mask) { alarm_dbg(INFO, %s: clear alarm, pending %d\n, diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c index fc59281..8220304 100644 --- a/drivers/staging/android/binder.c +++ b/drivers/staging/android/binder.c @@ -118,6 +118,7 @@ static int binder_set_stop_on_user_error(const char *val, struct kernel_param *kp) { int ret; + ret = param_set_int(val, kp); if (binder_stop_on_user_error 2) wake_up(binder_user_error_wait); @@ -194,6 +195,7 @@ static struct binder_transaction_log_entry *binder_transaction_log_add( struct binder_transaction_log *log) { struct binder_transaction_log_entry *e; + e = log-entry[log-next]; memset(e, 0, sizeof(*e)); log-next++; @@ -228,8 +230,10 @@ struct binder_node { int internal_strong_refs; int local_weak_refs; int local_strong_refs; + binder_uintptr_t ptr; binder_uintptr_t cookie; + unsigned has_strong_ref:1; unsigned pending_strong_ref:1; unsigned has_weak_ref:1; @@ -432,6 +436,7 @@ static inline void binder_unlock(const char *tag) static void binder_set_nice(long nice) { long min_nice; + if (can_nice(current, nice)) { set_user_nice(current, nice); return; @@ -584,6 +589,7 @@ static int binder_update_page_range(struct binder_proc *proc, int allocate, for (page_addr = start; page_addr end; page_addr += PAGE_SIZE) { int ret; struct page **page_array_ptr; + page = proc-pages[(page_addr - proc-buffer) / PAGE_SIZE]; BUG_ON(*page); @@ -726,6 +732,7 @@ static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc, binder_insert_allocated_buffer(proc, buffer); if (buffer_size != size) { struct binder_buffer *new_buffer = (void *)buffer-data + size; + list_add(new_buffer-entry, buffer-entry); new_buffer-free = 1; binder_insert_free_buffer(proc, new_buffer); @@ -778,6 +785,7 @@ static void binder_delete_free_buffer(struct binder_proc *proc, if (!list_is_last(buffer-entry, proc-buffers)) { next = list_entry(buffer-entry.next, struct binder_buffer, entry); + if (buffer_start_page(next) == buffer_end_page(buffer)) { free_page_end = 0; if (buffer_start_page(next) == @@ -838,6 +846,7 @@ static void binder_free_buf(struct binder_proc *proc, if (!list_is_last(buffer-entry, proc-buffers)) { struct binder_buffer *next = list_entry(buffer-entry.next, struct binder_buffer, entry); + if (next-free) { rb_erase(next-rb_node, proc-free_buffers); binder_delete_free_buffer(proc, next); @@ -846,6 +855,7 @@ static void binder_free_buf(struct binder_proc *proc, if (proc-buffers.next != buffer-entry) { struct binder_buffer *prev = list_entry(buffer-entry.prev, struct binder_buffer, entry); + if (prev-free) { binder_delete_free_buffer(proc, buffer); rb_erase(prev-rb_node, proc-free_buffers); @@ -1107,6 +1117,7 @@ static int binder_inc_ref(struct binder_ref *ref, int strong, struct list_head *target_list) { int ret; + if (strong
[PATCH] staging : android : uapi : fix coding style
This patch fix checkpatch.pl warnings and errors. Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/android/uapi/binder.h |2 +- drivers/staging/android/uapi/ion.h| 20 +--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/android/uapi/binder.h b/drivers/staging/android/uapi/binder.h index 904adb7..dba4cef 100644 --- a/drivers/staging/android/uapi/binder.h +++ b/drivers/staging/android/uapi/binder.h @@ -169,7 +169,7 @@ struct binder_ptr_cookie { struct binder_handle_cookie { __u32 handle; binder_uintptr_t cookie; -} __attribute__((packed)); +} __packed; struct binder_pri_desc { __s32 priority; diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h index f09e7c1..36332dc 100644 --- a/drivers/staging/android/uapi/ion.h +++ b/drivers/staging/android/uapi/ion.h @@ -20,19 +20,17 @@ #include linux/ioctl.h #include linux/types.h -typedef int ion_user_handle_t; - /** * enum ion_heap_types - list of all possible types of heaps * @ION_HEAP_TYPE_SYSTEM: memory allocated via vmalloc * @ION_HEAP_TYPE_SYSTEM_CONTIG: memory allocated via kmalloc * @ION_HEAP_TYPE_CARVEOUT: memory allocated from a prereserved - * carveout heap, allocations are physically - * contiguous + * carveout heap, allocations are physically + * contiguous * @ION_HEAP_TYPE_DMA: memory allocated via DMA API * @ION_NUM_HEAPS: helper for iterating over heaps, a bit mask - * is used to identify the heaps, so only 32 - * total heap types are supported + * is used to identify the heaps, so only 32 + * total heap types are supported */ enum ion_heap_type { ION_HEAP_TYPE_SYSTEM, @@ -50,7 +48,7 @@ enum ion_heap_type { #define ION_HEAP_CARVEOUT_MASK (1 ION_HEAP_TYPE_CARVEOUT) #define ION_HEAP_TYPE_DMA_MASK (1 ION_HEAP_TYPE_DMA) -#define ION_NUM_HEAP_IDS sizeof(unsigned int) * 8 +#define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8) /** * allocation flags - the lower 16 bits are used by core ion, the upper 16 @@ -78,7 +76,7 @@ enum ion_heap_type { * @align: required alignment of the allocation * @heap_id_mask: mask of heap ids to allocate from * @flags: flags passed to heap - * @handle:pointer that will be populated with a cookie to use to + * @handle:pointer that will be populated with a cookie to use to * refer to this allocation * * Provided by userspace as an argument to the ioctl @@ -88,7 +86,7 @@ struct ion_allocation_data { size_t align; unsigned int heap_id_mask; unsigned int flags; - ion_user_handle_t handle; + int handle; }; /** @@ -102,7 +100,7 @@ struct ion_allocation_data { * provides the file descriptor and the kernel returns the handle. */ struct ion_fd_data { - ion_user_handle_t handle; + int handle; int fd; }; @@ -111,7 +109,7 @@ struct ion_fd_data { * @handle:a handle */ struct ion_handle_data { - ion_user_handle_t handle; + int handle; }; /** -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: android: uapi: fix coding style
This patch fix checkpatch.pl warning and errors. Signed-off-by: Seunghun Lee way...@gmail.com --- drivers/staging/android/uapi/ion.h | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/android/uapi/ion.h b/drivers/staging/android/uapi/ion.h index f09e7c1..6aa4956 100644 --- a/drivers/staging/android/uapi/ion.h +++ b/drivers/staging/android/uapi/ion.h @@ -27,12 +27,12 @@ typedef int ion_user_handle_t; * @ION_HEAP_TYPE_SYSTEM: memory allocated via vmalloc * @ION_HEAP_TYPE_SYSTEM_CONTIG: memory allocated via kmalloc * @ION_HEAP_TYPE_CARVEOUT: memory allocated from a prereserved - * carveout heap, allocations are physically - * contiguous + * carveout heap, allocations are physically + * contiguous * @ION_HEAP_TYPE_DMA: memory allocated via DMA API * @ION_NUM_HEAPS: helper for iterating over heaps, a bit mask - * is used to identify the heaps, so only 32 - * total heap types are supported + * is used to identify the heaps, so only 32 + * total heap types are supported */ enum ion_heap_type { ION_HEAP_TYPE_SYSTEM, @@ -50,7 +50,7 @@ enum ion_heap_type { #define ION_HEAP_CARVEOUT_MASK (1 ION_HEAP_TYPE_CARVEOUT) #define ION_HEAP_TYPE_DMA_MASK (1 ION_HEAP_TYPE_DMA) -#define ION_NUM_HEAP_IDS sizeof(unsigned int) * 8 +#define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8) /** * allocation flags - the lower 16 bits are used by core ion, the upper 16 @@ -78,7 +78,7 @@ enum ion_heap_type { * @align: required alignment of the allocation * @heap_id_mask: mask of heap ids to allocate from * @flags: flags passed to heap - * @handle:pointer that will be populated with a cookie to use to + * @handle:pointer that will be populated with a cookie to use to * refer to this allocation * * Provided by userspace as an argument to the ioctl -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel