Re: [PATCH v2] staging: gdm72xx: fix address space warnings
This fix isn't correct and Wim already fixed this. https://lkml.org/lkml/2015/12/11/221 regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: speakup: varhandlers: cleanup of function spk_get_punc_var
On Wed, Dec 09, 2015 at 10:47:18AM +0530, Sudip Mukherjee wrote: > On Mon, Dec 07, 2015 at 06:35:11PM +0530, Saurabh Sengar wrote: > > This patch does the following: > > * changed the complicated if statements to simple case statements > > * in case of E_DEFAULT, no need to return error as ERESTART, > > because this is the user asked for. Hence function should return success. > > * ret variable is 0 always, hence removed it. > > * removed one ternary operator, as it was always returning the status value > > only, > > and hence removed the status variable too > > That becomes 4 different changes. Please break them into separate > patches. It's cleaning up one function so you could argue that it's just one thing. Sometimes it's actually harder to review when a patch is broken into ultra tiny junks. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: speakup: varhandlers: cleanup of function spk_get_punc_var
On 12 December 2015 at 14:10, Dan Carpenter wrote: > On Wed, Dec 09, 2015 at 10:47:18AM +0530, Sudip Mukherjee wrote: >> On Mon, Dec 07, 2015 at 06:35:11PM +0530, Saurabh Sengar wrote: >> > This patch does the following: >> > * changed the complicated if statements to simple case statements >> > * in case of E_DEFAULT, no need to return error as ERESTART, >> > because this is the user asked for. Hence function should return success. >> > * ret variable is 0 always, hence removed it. >> > * removed one ternary operator, as it was always returning the status >> > value only, >> > and hence removed the status variable too >> >> That becomes 4 different changes. Please break them into separate >> patches. > > It's cleaning up one function so you could argue that it's just one > thing. Sometimes it's actually harder to review when a patch is broken > into ultra tiny junks. yes Dan, this is my point too. I was planning to cleanup many function in speakup. If I will be breakup in to such a small chunk, it will problem for both of us. The best I can do is to hide the details in description and just say clanup there. I am open to suggestions. Regards, Saurabh ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: comedi: fixed unwrapped commit description
Fixed an unwrapped commit description. Signed-off-by: Siddharth Ramesh --- drivers/staging/comedi/comedi.h | 62 ++--- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h index 66edda1..2c2984b 100644 --- a/drivers/staging/comedi/comedi.h +++ b/drivers/staging/comedi/comedi.h @@ -6,7 +6,8 @@ Copyright (C) 1998-2001 David A. Schleef This program is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by +it under the terms of the GNU Lesser General Public License as publishe +d by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -196,7 +197,7 @@ #define SDF_MODE3 0x0400 /* can do mode 3 */ #define SDF_MODE4 0x0800 /* can do mode 4 */ #define SDF_CMD0x1000 /* can do commands (deprecated) */ -#define SDF_SOFT_CALIBRATED0x2000 /* subdevice uses software calibration */ +#define SDF_SOFT_CALIBRATED0x2000 #define SDF_CMD_WRITE 0x4000 /* can do output commands */ #define SDF_CMD_READ 0x8000 /* can do input commands */ @@ -307,27 +308,36 @@ enum configuration_ids { * data[4] = configuration parameter 2 * data[5] = configuration parameter 3 * - * operation parameter 1 parameter 2 parameter 3 - * - --- --- --- + * operation parameter 1 parameter 2 paramete + * r 3 + * - --- --- + * --- * COMEDI_DIGITAL_TRIG_DISABLE - * COMEDI_DIGITAL_TRIG_ENABLE_EDGESleft-shiftrising-edges falling-edges - * COMEDI_DIGITAL_TRIG_ENABLE_LEVELS left-shifthigh-levels low-levels + * COMEDI_DIGITAL_TRIG_ENABLE_EDGESleft-shiftrising-edges falling- + * edges + * COMEDI_DIGITAL_TRIG_ENABLE_LEVELS left-shifthigh-levels low-leve + * ls * - * COMEDI_DIGITAL_TRIG_DISABLE returns the trigger to its default, inactive, + * COMEDI_DIGITAL_TRIG_DISABLE returns the trigger to its default, inactive + * , * unconfigured state. * - * COMEDI_DIGITAL_TRIG_ENABLE_EDGES sets the rising and/or falling edge inputs + * COMEDI_DIGITAL_TRIG_ENABLE_EDGES sets the rising and/or falling edge inp + * uts * that each can fire the trigger. * * COMEDI_DIGITAL_TRIG_ENABLE_LEVELS sets a combination of high and/or low * level inputs that can fire the trigger. * - * "left-shift" is useful if the trigger has more than 32 inputs to specify the + * "left-shift" is useful if the trigger has more than 32 inputs to specify + * the * first input for this configuration. * - * Some sequences of INSN_CONFIG_DIGITAL_TRIG instructions may have a (partly) + * Some sequences of INSN_CONFIG_DIGITAL_TRIG instructions may have a (part + * ly) * accumulative effect, depending on the low-level driver. This is useful - * when setting up a trigger that has more than 32 inputs or has a combination + * when setting up a trigger that has more than 32 inputs or has a combinat + * ion * of edge and level triggered inputs. */ enum comedi_digital_trig_op { @@ -717,7 +727,7 @@ enum ni_gpct_arm_source { NI_GPCT_ARM_UNKNOWN = 0x1000, }; -/* digital filtering options for ni 660x for use with INSN_CONFIG_FILTER. */ +/* digital filtering options for ni 660x for use with INSN_CONFIG_FILTER.*/ enum ni_gpct_filter_select { NI_GPCT_FILTER_OFF = 0x0, NI_GPCT_FILTER_TIMEBASE_3_SYNC = 0x1, @@ -750,8 +760,10 @@ enum ni_mio_clock_source { #define NI_MIO_PLL_RTSI_CLOCK(x) (NI_MIO_PLL_RTSI0_CLOCK + (x)) -/* Signals which can be routed to an NI RTSI pin with INSN_CONFIG_SET_ROUTING. - The numbers assigned are not arbitrary, they correspond to the bits required +/* Signals which can be routed to an NI RTSI pin with INSN_CONFIG_SET_ROUTI + * NG. + The numbers assigned are not arbitrary, they correspond to the bits requir + ed to program the board. */ enum ni_rtsi_routing { NI_RTSI_OUTPUT_ADR_START1 = 0, @@ -771,8 +783,10 @@ enum ni_rtsi_routing { /* Signals which can be routed to an NI PFI pin on an m-series board with * INSN_CONFIG_SET_ROUTING. These numbers are also returned by - * INSN_CONFIG_GET_ROUTING on pre-m-series boards, even though their routing - * cannot be changed. The numbers assigned are not arbitrary, they correspond + * INSN_CONFIG_GET_ROUTING on pre-m-series boards, even though their routin + * g + * cannot be changed. The numbers assigned are not arbitrary, they corresp + * ond * to the bits required to program the board. */ enum ni_pfi_routing { NI_PFI_OUTPUT_PFI_DEFAULT = 0, @@ -814,7 +828,8 @@ enum ni_660x_pfi_routing { NI_660X_PFI_OUTPUT_DIO = 2, /* static digital output */ }; -/* NI External Trigger lines. These values are
Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
On Fri, Dec 11, 2015 at 09:24:16PM -0500, Sanidhya Solanki wrote: > On Fri, 11 Dec 2015 16:02:33 +0300 > Dan Carpenter wrote: > > > On Fri, Dec 11, 2015 at 03:21:49AM -0500, Sanidhya Solanki wrote: > > > >From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001 > > > From: Sanidhya Solanki > > > Date: Fri, 11 Dec 2015 03:08:53 -0500 > > > Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes > > > > > > Don't include this stuff. > Whenever I remove that part, the "git am" command gives me an error that > it cannot detect patch format and the patch application fails. > You first have to email the patch to yourself for git am to work. Also you need to break the patch up into a patch series that fixes one type of issue at a time. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: comedi: fixed unwrapped commit description
This is a terrible patch... :( Why would you think that's helpful. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
On Sat, Dec 12, 2015 at 11:57:45AM +0300, Dan Carpenter wrote: > On Fri, Dec 11, 2015 at 09:24:16PM -0500, Sanidhya Solanki wrote: > > On Fri, 11 Dec 2015 16:02:33 +0300 > > Dan Carpenter wrote: > > > > > On Fri, Dec 11, 2015 at 03:21:49AM -0500, Sanidhya Solanki wrote: > > > > >From 1dbe78ce98037da5467d817a9db838d678b338ae Mon Sep 17 00:00:00 2001 > > > > From: Sanidhya Solanki > > > > Date: Fri, 11 Dec 2015 03:08:53 -0500 > > > > Subject: [PATCH] staging: dgnc: Patch includes the checkpatch fixes > > > > > > > > > Don't include this stuff. > > Whenever I remove that part, the "git am" command gives me an error that > > it cannot detect patch format and the patch application fails. > > > > You first have to email the patch to yourself for git am to work. You are not sending using git send-email. That header will be used by git send-email. Try using that. If you still want to use claws then remove these header, mail to yourself and try git am. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: speakup: varhandlers: cleanup of function spk_get_punc_var
On Sat, Dec 12, 2015 at 11:40:25AM +0300, Dan Carpenter wrote: > On Wed, Dec 09, 2015 at 10:47:18AM +0530, Sudip Mukherjee wrote: > > On Mon, Dec 07, 2015 at 06:35:11PM +0530, Saurabh Sengar wrote: > > > This patch does the following: > > > * changed the complicated if statements to simple case statements > > > * in case of E_DEFAULT, no need to return error as ERESTART, > > > because this is the user asked for. Hence function should return success. > > > * ret variable is 0 always, hence removed it. > > > * removed one ternary operator, as it was always returning the status > > > value only, > > > and hence removed the status variable too > > > > That becomes 4 different changes. Please break them into separate > > patches. > > It's cleaning up one function so you could argue that it's just one > thing. Then maybe that should have been mentioned in the commit message along with mentioning point wise the different changes made. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
Thank you everyone for your concern regarding my email client. Unfortunately, there is a bug in "git send-email" that leads to the gmail SMTP server rejecting certain patches sent by the git command. If I can replicate and fix the issue for " git am" (which I do apply after emailing to myself) I will not send the git header anymore. This bug is well documented. It presents itself as an error in line 1351/1320 in a gitconfig file. Rest assured you will not see the git header again. Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
On Sat, Dec 12, 2015 at 01:12:21AM -0500, Sanidhya Solanki wrote: > Thank you everyone for your concern regarding my email client. > > Unfortunately, there is a bug in "git send-email" that leads to the gmail > SMTP server rejecting certain patches sent by the git command. Is it? I am using git send-email from my beginning, never faced any problem in sending patch through gmail smtp server. Can you please send me the patch (offlist), so that i can test with my setup. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: speakup: varhandlers: cleanup of function spk_get_punc_var
On 12 December 2015 at 15:41, Sudip Mukherjee wrote: > On Sat, Dec 12, 2015 at 11:40:25AM +0300, Dan Carpenter wrote: >> On Wed, Dec 09, 2015 at 10:47:18AM +0530, Sudip Mukherjee wrote: >> > On Mon, Dec 07, 2015 at 06:35:11PM +0530, Saurabh Sengar wrote: >> > > This patch does the following: >> > > * changed the complicated if statements to simple case statements >> > > * in case of E_DEFAULT, no need to return error as ERESTART, >> > > because this is the user asked for. Hence function should return success. >> > > * ret variable is 0 always, hence removed it. >> > > * removed one ternary operator, as it was always returning the status >> > > value only, >> > > and hence removed the status variable too >> > >> > That becomes 4 different changes. Please break them into separate >> > patches. >> >> It's cleaning up one function so you could argue that it's just one >> thing. > > Then maybe that should have been mentioned in the commit message along > with mentioning point wise the different changes made. > That is already mentioned in subject line of patch, which will be the part of commit message. Regrads, Saurabh ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes
>From a1635ea5e75cb2f10728ae4ddf3a21567958e98f Mon Sep 17 00:00:00 2001 From: Sanidhya Solanki Date: Sat, 12 Dec 2015 02:20:03 -0500 Subject: [PATCH] [PATCH 1/3] staging: dgnc: Patch includes the checkpatch fixes Patch contains the spacing fixes that checkpatch prompted for, as asked by the TODO. Signed-off-by: Sanidhya Solanki --- drivers/staging/dgnc/dgnc_cls.c| 4 +- drivers/staging/dgnc/dgnc_driver.h | 8 -- drivers/staging/dgnc/dgnc_neo.c| 235 - drivers/staging/dgnc/dgnc_neo.h| 22 ++-- drivers/staging/dgnc/dgnc_pci.h| 1 - drivers/staging/dgnc/dgnc_sysfs.c | 18 ++- drivers/staging/dgnc/dgnc_tty.c| 46 +--- drivers/staging/dgnc/digi.h| 32 ++--- 8 files changed, 223 insertions(+), 143 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index 75040da..d312d35 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -1168,8 +1168,8 @@ static void cls_uart_init(struct channel_t *ch) /* Clear out UART and FIFO */ 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); + writeb((UART_FCR_ENABLE_FIFO | UART_FCR_CLEAR_RCVR | + UART_FCR_CLEAR_XMIT), &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.h b/drivers/staging/dgnc/dgnc_driver.h index ce7cd9b..e4be81b 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -88,7 +88,6 @@ #define _POSIX_VDISABLE '\0' #endif - /* * All the possible states the driver can be while being loaded. */ @@ -106,7 +105,6 @@ enum { BOARD_READY }; - /* * * Structures and closely related defines. @@ -145,7 +143,6 @@ struct board_ops { / #define BD_IS_PCI_EXPRESS 0x0001 /* Is a PCI Express board */ - /* * Per-board information */ @@ -241,7 +238,6 @@ struct dgnc_board { }; - / * Unit flag definitions for un_flags. / @@ -277,7 +273,6 @@ struct un_t { struct device *un_sysfs; }; - / * Device flag definitions for ch_flags. / @@ -300,7 +295,6 @@ struct un_t { #define CH_FORCED_STOP 0x2/* Output is forcibly stopped */ #define CH_FORCED_STOPI 0x4/* Input is forcibly stopped */ - /* Our Read/Error/Write queue sizes */ #define RQUEUEMASK 0x1FFF /* 8 K - 1 */ #define EQUEUEMASK 0x1FFF /* 8 K - 1 */ @@ -309,7 +303,6 @@ struct un_t { #define EQUEUESIZE RQUEUESIZE #define WQUEUESIZE (WQUEUEMASK + 1) - / * Channel information structure. / @@ -397,7 +390,6 @@ struct channel_t { ulong ch_intr_tx; /* Count of interrupts */ ulong ch_intr_rx; /* Count of interrupts */ - /* /proc// entries */ struct proc_dir_entry *proc_entry_pointer; struct dgnc_proc_entry *dgnc_channel_table; diff --git a/drivers/staging/dgnc/dgnc_neo.c b/drivers/staging/dgnc/dgnc_neo.c index 8106f52..2b94b75 100644 --- a/drivers/staging/dgnc/dgnc_neo.c +++ b/drivers/staging/dgnc/dgnc_neo.c @@ -77,7 +77,8 @@ struct board_ops dgnc_neo_ops = { .send_immediate_char = neo_send_immediate_char }; -static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; +static uint dgnc_offset_table[8] = { 0x01, 0x02, 0x04, 0x08, + 0x10, 0x20, 0x40, 0x80 }; /* * This function allows calls to ensure that all outstanding @@ -109,14 +110,17 @@ static inline void neo_set_cts_flow_control(struct channel_t *ch) /* Turn off auto Xon flow control */ efr &= ~UART_17158_EFR_IXON; - /* Why? Becuz Exar's spec says we have to zero it out before setting it */ + /* Why? Becuz Exar's spec says we have to +* zero it out before setting it. +*/ writeb(0, &ch->ch_neo_uart->efr); /* Turn on UART enhanced bits */ writeb(efr, &ch->ch_neo_uart->efr); /* Turn on table D, with 8 char hi/low watermarks */ - writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), &ch->ch_neo_uart->fctr); + writeb((UART_17158_FCTR_TRGD | UART_17158_FCTR_RTS_4DELAY), +
Re: [PATCH 2/3] staging: dgnc: Patch includes the checkpatch fixes
Patch contains the CamelCase fixes & Macro fixes that checkpatch prompted for, as asked by the TODO. Signed-off-by: Sanidhya Solanki --- drivers/staging/dgnc/dgnc_driver.c | 56 - drivers/staging/dgnc/dgnc_driver.h | 25 ++-- drivers/staging/dgnc/dgnc_mgmt.c | 28 ++--- drivers/staging/dgnc/dgnc_neo.c| 226 + drivers/staging/dgnc/dgnc_sysfs.c | 134 +- drivers/staging/dgnc/dgnc_tty.c| 197 drivers/staging/dgnc/digi.h| 20 ++-- 7 files changed, 367 insertions(+), 319 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index fc6d298..37fb8f9 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -48,7 +48,7 @@ static void dgnc_do_remap(struct dgnc_board *brd); /* * File operations permitted on Control/Management major. */ -static const struct file_operations dgnc_BoardFops = { +static const struct file_operations dgnc_board_fops = { .owner = THIS_MODULE, .unlocked_ioctl = dgnc_mgmt_ioctl, .open = dgnc_mgmt_open, @@ -58,11 +58,11 @@ static const struct file_operations dgnc_BoardFops = { /* * Globals */ -uint dgnc_NumBoards; -struct dgnc_board *dgnc_Board[MAXBOARDS]; +uint dgnc_num_boards; +struct dgnc_board *dgnc_board[MAXBOARDS]; DEFINE_SPINLOCK(dgnc_global_lock); DEFINE_SPINLOCK(dgnc_poll_lock); /* Poll scheduling lock */ -uint dgnc_Major; +uint dgnc_major; intdgnc_poll_tick = 20;/* Poll interval - 20 ms */ /* @@ -92,7 +92,7 @@ struct board_id { unsigned int is_pci_express; }; -static struct board_id dgnc_Ids[] = { +static struct board_id dgnc_ids[] = { { PCI_DEVICE_CLASSIC_4_PCI_NAME, 4, 0 }, { PCI_DEVICE_CLASSIC_4_422_PCI_NAME, 4, 0 }, { PCI_DEVICE_CLASSIC_8_PCI_NAME, 8, 0 }, @@ -144,19 +144,19 @@ static void dgnc_cleanup_module(void) dgnc_remove_driver_sysfiles(&dgnc_driver); - device_destroy(dgnc_class, MKDEV(dgnc_Major, 0)); + device_destroy(dgnc_class, MKDEV(dgnc_major, 0)); class_destroy(dgnc_class); - unregister_chrdev(dgnc_Major, "dgnc"); + unregister_chrdev(dgnc_major, "dgnc"); - for (i = 0; i < dgnc_NumBoards; ++i) { - dgnc_remove_ports_sysfiles(dgnc_Board[i]); - dgnc_tty_uninit(dgnc_Board[i]); - dgnc_cleanup_board(dgnc_Board[i]); + for (i = 0; i < dgnc_num_boards; ++i) { + dgnc_remove_ports_sysfiles(dgnc_board[i]); + dgnc_tty_uninit(dgnc_board[i]); + dgnc_cleanup_board(dgnc_board[i]); } dgnc_tty_post_uninit(); - if (dgnc_NumBoards) + if (dgnc_num_boards) pci_unregister_driver(&dgnc_driver); } @@ -187,7 +187,7 @@ static int __init dgnc_init_module(void) */ if (rc < 0) { /* Only unregister if it was actually registered. */ - if (dgnc_NumBoards) + if (dgnc_num_boards) pci_unregister_driver(&dgnc_driver); else pr_warn("WARNING: dgnc driver load failed. No Digi Neo or Classic boards found.\n"); @@ -222,12 +222,12 @@ static int dgnc_start(void) * * Register management/dpa devices */ - rc = register_chrdev(0, "dgnc", &dgnc_BoardFops); + rc = register_chrdev(0, "dgnc", &dgnc_board_fops); if (rc < 0) { pr_err(DRVSTR ": Can't register dgnc driver device (%d)\n", rc); return rc; } - dgnc_Major = rc; + dgnc_major = rc; dgnc_class = class_create(THIS_MODULE, "dgnc_mgmt"); if (IS_ERR(dgnc_class)) { @@ -237,7 +237,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); @@ -267,11 +267,11 @@ static int dgnc_start(void) return 0; failed_tty: - device_destroy(dgnc_class, MKDEV(dgnc_Major, 0)); + device_destroy(dgnc_class, MKDEV(dgnc_major, 0)); failed_device: class_destroy(dgnc_class); failed_class: - unregister_chrdev(dgnc_Major, "dgnc"); + unregister_chrdev(dgnc_major, "dgnc"); return rc; } @@ -288,7 +288,7 @@ static int dgnc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) } else { rc = dgnc_found_board(pdev, ent->driver_data); if (rc == 0) - dgnc_NumBoards++; + dgnc_num_board
Re: [PATCH 3/3] staging: dgnc: Patch includes the checkpatch fixes
Patch updates the TODO file. Signed-off-by: Sanidhya Solanki --- drivers/staging/dgnc/TODO | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgnc/TODO b/drivers/staging/dgnc/TODO index 0e0825b..0bdfd26 100644 --- a/drivers/staging/dgnc/TODO +++ b/drivers/staging/dgnc/TODO @@ -1,4 +1,3 @@ -* checkpatch fixes * remove unnecessary comments * remove unnecessary error messages. Example kzalloc() has its own error message. Adding an extra one is useless. -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: Patch includes the checkpatch fixes
Sorry about Patch 1/3 having the header information. The rest should be fine. I broke up the patches as you requested. I can also confirm that git am gives me an error if the patch to be applied does not contain the header information. Specifically, "Patch format detection failed.". Yes, this is only after I email myself the patch, reset to the cloned git directory, and then apply the patch. "git apply --check" returns no error in this scenario. Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !
Fixed coding style for null comparisons in netlogic driver to be more consistant with the rest of the kernel coding style Signed-off-by: Benjamin Young --- drivers/staging/netlogic/xlr_net.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index 8ae0175..ac93e63 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -147,7 +147,7 @@ static void xlr_net_fmn_handler(int bkt, int src_stnid, int size, addr = addr - MAC_SKB_BACK_PTR_SIZE; skb = (struct sk_buff *) *(unsigned long *)addr; skb->dev = adapter->netdev[port]; - if (skb->dev == NULL) + if (!skb->dev) return; ndev = skb->dev; priv = netdev_priv(ndev); @@ -878,7 +878,7 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv, priv->mii_bus->write = xlr_mii_write; priv->mii_bus->parent = &pdev->dev; priv->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); - if (priv->mii_bus->irq == NULL) { + if (!priv->mii_bus->irq) { pr_err("irq alloc failed\n"); mdiobus_free(priv->mii_bus); return -ENOMEM; @@ -1037,7 +1037,7 @@ static int xlr_net_probe(struct platform_device *pdev) priv->nd = (struct xlr_net_data *)pdev->dev.platform_data; res = platform_get_resource(pdev, IORESOURCE_MEM, port); - if (res == NULL) { + if (!res) { pr_err("No memory resource for MAC %d\n", priv->port_id); err = -ENODEV; @@ -1052,7 +1052,7 @@ static int xlr_net_probe(struct platform_device *pdev) adapter->netdev[port] = ndev; res = platform_get_resource(pdev, IORESOURCE_IRQ, port); - if (res == NULL) { + if (!res) { pr_err("No irq resource for MAC %d\n", priv->port_id); err = -ENODEV; goto err_gmac; -- 2.5.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: netlogic: Coding Style Fix Comparison to NULL could be written with !
On Sat, Dec 12, 2015 at 06:45:59AM -0800, Benjamin Young wrote: > Fixed coding style for null comparisons in netlogic driver to be more > consistant > with the rest of the kernel coding style > > Signed-off-by: Benjamin Young > --- > drivers/staging/netlogic/xlr_net.c | 8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/netlogic/xlr_net.c > b/drivers/staging/netlogic/xlr_net.c > index 8ae0175..ac93e63 100644 > --- a/drivers/staging/netlogic/xlr_net.c > +++ b/drivers/staging/netlogic/xlr_net.c > @@ -147,7 +147,7 @@ static void xlr_net_fmn_handler(int bkt, int src_stnid, > int size, > addr = addr - MAC_SKB_BACK_PTR_SIZE; > skb = (struct sk_buff *) *(unsigned long *)addr; > skb->dev = adapter->netdev[port]; > - if (skb->dev == NULL) > + if (!skb->dev) > return; > ndev = skb->dev; > priv = netdev_priv(ndev); > @@ -878,7 +878,7 @@ static int xlr_setup_mdio(struct xlr_net_priv *priv, > priv->mii_bus->write = xlr_mii_write; > priv->mii_bus->parent = &pdev->dev; > priv->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); > - if (priv->mii_bus->irq == NULL) { > + if (!priv->mii_bus->irq) { > pr_err("irq alloc failed\n"); > mdiobus_free(priv->mii_bus); > return -ENOMEM; > @@ -1037,7 +1037,7 @@ static int xlr_net_probe(struct platform_device *pdev) > priv->nd = (struct xlr_net_data *)pdev->dev.platform_data; > res = platform_get_resource(pdev, IORESOURCE_MEM, port); > > - if (res == NULL) { > + if (!res) { > pr_err("No memory resource for MAC %d\n", > priv->port_id); > err = -ENODEV; > @@ -1052,7 +1052,7 @@ static int xlr_net_probe(struct platform_device *pdev) > adapter->netdev[port] = ndev; > > res = platform_get_resource(pdev, IORESOURCE_IRQ, port); > - if (res == NULL) { > + if (!res) { > pr_err("No irq resource for MAC %d\n", priv->port_id); > err = -ENODEV; > goto err_gmac; > -- > 2.5.0 > Adding broadcom engineers. (Sorry did not see these adresses in the TODO file origionally) Thanks, Benjamin Young ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] STAGING: COMEDI: Using kernel types in plx9080.h
This patch makes plx9080.h use kernel types. Signed-off-by: Moritz König Signed-off-by: Fabian Lang --- drivers/staging/comedi/drivers/plx9080.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/plx9080.h b/drivers/staging/comedi/drivers/plx9080.h index f0af013..b7754c9 100644 --- a/drivers/staging/comedi/drivers/plx9080.h +++ b/drivers/staging/comedi/drivers/plx9080.h @@ -441,7 +441,7 @@ enum bigend_bits { static inline int plx9080_abort_dma(void __iomem *iobase, unsigned int channel) { void __iomem *dma_cs_addr; - uint8_t dma_status; + u8 dma_status; const int timeout = 1; unsigned int i; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/3] STAGING: COMEDI: checkpatch.pl cleanups in plx9080.h
This patchset fixes all the warnings and legitimate checks of checkpatch.pl in plx9080.h. The following warnings were fixed: * WARNING: Block comments use a trailing */ on a separate line * WARNING: Block comments use * on subsequent lines * WARNING: line over 80 characters The following checks were fixed: * CHECK: spaces preferred around that '-' (ctx:VxV) * CHECK: Prefer kernel type 'u8' over 'uint8_t' The following checks were not fixed: * CHECK: Avoid CamelCase: PCI version 21 seems to make sense Moritz König (3): STAGING: COMEDI: Fixed format of comments in plx9080.h STAGING: COMEDI: Added spaces around binary operators in plx9080.h STAGING: COMEDI: Using kernel types in plx9080.h drivers/staging/comedi/drivers/plx9080.h | 136 ++- 1 file changed, 97 insertions(+), 39 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] STAGING: COMEDI: Added spaces around binary operators in plx9080.h
This patch adds spaces around binary operators in plx9080.h. Signed-off-by: Moritz König Signed-off-by: Fabian Lang --- drivers/staging/comedi/drivers/plx9080.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/plx9080.h b/drivers/staging/comedi/drivers/plx9080.h index 40514f7..f0af013 100644 --- a/drivers/staging/comedi/drivers/plx9080.h +++ b/drivers/staging/comedi/drivers/plx9080.h @@ -436,7 +436,7 @@ enum bigend_bits { /* system allocates this many bytes for address mapping mailbox space */ #define MBX_ADDR_SPACE_360 0x80/* wanXL100s/200/400 */ -#define MBX_ADDR_MASK_360 (MBX_ADDR_SPACE_360-1) +#define MBX_ADDR_MASK_360 (MBX_ADDR_SPACE_360 - 1) static inline int plx9080_abort_dma(void __iomem *iobase, unsigned int channel) { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] STAGING: COMEDI: Fixed format of comments in plx9080.h
This patch fixes the format of comments in plx9080.h. Signed-off-by: Moritz König Signed-off-by: Fabian Lang --- drivers/staging/comedi/drivers/plx9080.h | 132 ++- 1 file changed, 95 insertions(+), 37 deletions(-) diff --git a/drivers/staging/comedi/drivers/plx9080.h b/drivers/staging/comedi/drivers/plx9080.h index 2570653..40514f7 100644 --- a/drivers/staging/comedi/drivers/plx9080.h +++ b/drivers/staging/comedi/drivers/plx9080.h @@ -34,7 +34,8 @@ struct plx_dma_desc { /* transfer_size is in bytes, only first 23 bits of register are used */ __le32 transfer_size; /* address of next descriptor (quad word aligned), plus some -* additional bits (see PLX_DMA0_DESCRIPTOR_REG) */ +* additional bits (see PLX_DMA0_DESCRIPTOR_REG) +*/ __le32 next; }; @@ -46,23 +47,38 @@ struct plx_dma_desc { ** **/ -#define PLX_LAS0RNG_REG 0x /* L, Local Addr Space 0 Range Register */ -#define PLX_LAS1RNG_REG 0x00f0 /* L, Local Addr Space 1 Range Register */ +#define PLX_LAS0RNG_REG 0x /* L, Local Addr Space 0 Range +* Register +*/ +#define PLX_LAS1RNG_REG 0x00f0 /* L, Local Addr Space 1 Range +* Register +*/ #define LRNG_IO 0x0001 /* Map to: 1=I/O, 0=Mem */ #define LRNG_ANY320x /* Locate anywhere in 32 bit */ #define LRNG_LT1MB0x0002 /* Locate in 1st meg */ #define LRNG_ANY640x0004 /* Locate anywhere in 64 bit */ -#define LRNG_MEM_MASK 0xfff0 /* bits that specify range for memory io */ -#define LRNG_IO_MASK 0xfffa /* bits that specify range for normal io */ - -#define PLX_LAS0MAP_REG 0x0004 /* L, Local Addr Space 0 Remap Register */ -#define PLX_LAS1MAP_REG 0x00f4 /* L, Local Addr Space 1 Remap Register */ +#define LRNG_MEM_MASK 0xfff0 /* bits that specify range for +* memory io +*/ +#define LRNG_IO_MASK 0xfffa /* bits that specify range for +* normal io +*/ +#define PLX_LAS0MAP_REG 0x0004 /* L, Local Addr Space 0 Remap +* Register +*/ +#define PLX_LAS1MAP_REG 0x00f4 /* L, Local Addr Space 1 Remap +* Register +*/ #define LMAP_EN 0x0001 /* Enable slave decode */ -#define LMAP_MEM_MASK 0xfff0 /* bits that specify decode for memory io */ -#define LMAP_IO_MASK 0xfffa /* bits that specify decode bits for normal io */ +#define LMAP_MEM_MASK 0xfff0 /* bits that specify decode for +* memory io +*/ +#define LMAP_IO_MASK 0xfffa /* bits that specify decode bits for +* normal io +*/ /* Mode/Arbitration Register. -*/ + */ #define PLX_MARB_REG 0x8 /* L, Local Arbitration Register */ #define PLX_DMAARB_REG 0xac enum marb_bits { @@ -72,24 +88,36 @@ enum marb_bits { MARB_LPEN = 0x0002, /* Pause Timer Enable */ MARB_BREQ = 0x0004, /* Local Bus BREQ Enable */ MARB_DMA_PRIORITY_MASK = 0x0018, - MARB_LBDS_GIVE_UP_BUS_MODE = 0x0020,/* local bus direct slave give up bus mode */ - MARB_DS_LLOCK_ENABLE = 0x0040, /* direct slave LLOCKo# enable */ + MARB_LBDS_GIVE_UP_BUS_MODE = 0x0020,/* local bus direct +* slave give up +* bus mode +*/ + MARB_DS_LLOCK_ENABLE = 0x0040, /* direct slave +* LLOCKo# enable +*/ MARB_PCI_REQUEST_MODE = 0x0080, MARB_PCIv21_MODE = 0x0100, /* pci specification v2.1 mode */ MARB_PCI_READ_NO_WRITE_MODE = 0x0200, MARB_PCI_READ_WITH_WRITE_FLUSH_MODE = 0x0400, - MARB_GATE_TIMER_WITH_BREQ = 0x0800, /* gate local bus latency timer with BREQ */ + MARB_GATE_TIMER_WITH_BREQ = 0x0800, /* gate local bus latency timer +* with BREQ +*/ MARB_PCI_READ_NO_FLUSH_MODE = 0x1000, MARB_USE_SUBSYSTEM_IDS = 0x2000, }; #define PLX_BIGEND
[PATCH V2 0/4] scsi: storvsc: Properly support FC hosts
Properly support FC hosts. Additional cleanup patches are also included. In this version I have adddressed comments from Dan Carpenter and from Johannes Thumshirn . K. Y. Srinivasan (4): scsi: storvsc: Fix a bug in the layout of the hv_fc_wwn_packet scsi: storvsc: Properly support Fibre Channel devices scsi: storvsc: Refactor the code in storvsc_channel_init() scsi: storvsc: Tighten up the interrupt path drivers/scsi/storvsc_drv.c | 256 1 files changed, 141 insertions(+), 115 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 2/4] scsi: storvsc: Properly support Fibre Channel devices
For FC devices managed by this driver, atttach the appropriate transport template. This will allow us to create the appropriate sysfs files for these devices. With this we can publish the wwn for both the port and the node. Signed-off-by: K. Y. Srinivasan Reviewed-by: Long Li Tested-by: Alex Ng --- V2: Fixed error paths - Dan Carpenter drivers/scsi/storvsc_drv.c | 162 +++- 1 files changed, 115 insertions(+), 47 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 00bb4bd..ab9828c 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -41,6 +41,7 @@ #include #include #include +#include /* * All wire protocol details (storage protocol between the guest and the host) @@ -397,6 +398,7 @@ static int storvsc_timeout = 180; static int msft_blist_flags = BLIST_TRY_VPD_PAGES; +static struct scsi_transport_template *fc_transport_template; static void storvsc_on_channel_callback(void *context); @@ -456,6 +458,11 @@ struct storvsc_device { /* Used for vsc/vsp channel reset process */ struct storvsc_cmd_request init_request; struct storvsc_cmd_request reset_request; + /* +* Currently active port and node names for FC devices. +*/ + u64 node_name; + u64 port_name; }; struct hv_host_device { @@ -695,7 +702,26 @@ static void handle_multichannel_storage(struct hv_device *device, int max_chns) vmbus_are_subchannels_present(device->channel); } -static int storvsc_channel_init(struct hv_device *device) +static void cache_wwn(struct storvsc_device *stor_device, + struct vstor_packet *vstor_packet) +{ + /* +* Cache the currently active port and node ww names. +*/ + if (vstor_packet->wwn_packet.primary_active) { + stor_device->node_name = + wwn_to_u64(vstor_packet->wwn_packet.primary_node_wwn); + stor_device->port_name = + wwn_to_u64(vstor_packet->wwn_packet.primary_port_wwn); + } else { + stor_device->node_name = + wwn_to_u64(vstor_packet->wwn_packet.secondary_node_wwn); + stor_device->port_name = + wwn_to_u64(vstor_packet->wwn_packet.secondary_port_wwn); + } +} + +static int storvsc_channel_init(struct hv_device *device, bool is_fc) { struct storvsc_device *stor_device; struct storvsc_cmd_request *request; @@ -727,19 +753,15 @@ static int storvsc_channel_init(struct hv_device *device) VM_PKT_DATA_INBAND, VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) - goto cleanup; + return ret; t = wait_for_completion_timeout(&request->wait_event, 5*HZ); - if (t == 0) { - ret = -ETIMEDOUT; - goto cleanup; - } + if (t == 0) + return -ETIMEDOUT; if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || - vstor_packet->status != 0) { - ret = -EINVAL; - goto cleanup; - } + vstor_packet->status != 0) + return -EINVAL; for (i = 0; i < ARRAY_SIZE(vmstor_protocols); i++) { @@ -764,18 +786,14 @@ static int storvsc_channel_init(struct hv_device *device) VM_PKT_DATA_INBAND, VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) - goto cleanup; + return ret; t = wait_for_completion_timeout(&request->wait_event, 5*HZ); - if (t == 0) { - ret = -ETIMEDOUT; - goto cleanup; - } + if (t == 0) + return -ETIMEDOUT; - if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO) { - ret = -EINVAL; - goto cleanup; - } + if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO) + return -EINVAL; if (vstor_packet->status == 0) { vmstor_proto_version = @@ -791,10 +809,8 @@ static int storvsc_channel_init(struct hv_device *device) } } - if (vstor_packet->status != 0) { - ret = -EINVAL; - goto cleanup; - } + if (vstor_packet->status != 0) + return -EINVAL; memset(vstor_packet, 0, sizeof(struct vstor_packet)); @@ -809,19 +825,15 @@ static int storvsc_channel_init(struct hv_device *device) VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); if (ret != 0) - goto cleanup; + return ret; t = wait_for_completion_time
[PATCH V2 4/4] scsi: storvsc: Tighten up the interrupt path
On the interrupt path, we repeatedly establish the pointer to the storvsc_device. Fix this. Signed-off-by: K. Y. Srinivasan Reviewed-by: Long Li Reviewed-by: Johannes Thumshirn Tested-by: Alex Ng --- drivers/scsi/storvsc_drv.c | 23 --- 1 files changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index 947f812..3d3d157 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -943,19 +943,16 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb, } -static void storvsc_command_completion(struct storvsc_cmd_request *cmd_request) +static void storvsc_command_completion(struct storvsc_cmd_request *cmd_request, + struct storvsc_device *stor_dev) { struct scsi_cmnd *scmnd = cmd_request->cmd; - struct hv_host_device *host_dev = shost_priv(scmnd->device->host); struct scsi_sense_hdr sense_hdr; struct vmscsi_request *vm_srb; struct Scsi_Host *host; - struct storvsc_device *stor_dev; - struct hv_device *dev = host_dev->dev; u32 payload_sz = cmd_request->payload_sz; void *payload = cmd_request->payload; - stor_dev = get_in_stor_device(dev); host = stor_dev->host; vm_srb = &cmd_request->vstor_packet.vm_srb; @@ -985,14 +982,13 @@ static void storvsc_command_completion(struct storvsc_cmd_request *cmd_request) kfree(payload); } -static void storvsc_on_io_completion(struct hv_device *device, +static void storvsc_on_io_completion(struct storvsc_device *stor_device, struct vstor_packet *vstor_packet, struct storvsc_cmd_request *request) { - struct storvsc_device *stor_device; struct vstor_packet *stor_pkt; + struct hv_device *device = stor_device->device; - stor_device = hv_get_drvdata(device); stor_pkt = &request->vstor_packet; /* @@ -1047,7 +1043,7 @@ static void storvsc_on_io_completion(struct hv_device *device, stor_pkt->vm_srb.data_transfer_length = vstor_packet->vm_srb.data_transfer_length; - storvsc_command_completion(request); + storvsc_command_completion(request, stor_device); if (atomic_dec_and_test(&stor_device->num_outstanding_req) && stor_device->drain_notify) @@ -1056,21 +1052,19 @@ static void storvsc_on_io_completion(struct hv_device *device, } -static void storvsc_on_receive(struct hv_device *device, +static void storvsc_on_receive(struct storvsc_device *stor_device, struct vstor_packet *vstor_packet, struct storvsc_cmd_request *request) { struct storvsc_scan_work *work; - struct storvsc_device *stor_device; switch (vstor_packet->operation) { case VSTOR_OPERATION_COMPLETE_IO: - storvsc_on_io_completion(device, vstor_packet, request); + storvsc_on_io_completion(stor_device, vstor_packet, request); break; case VSTOR_OPERATION_REMOVE_DEVICE: case VSTOR_OPERATION_ENUMERATE_BUS: - stor_device = get_in_stor_device(device); work = kmalloc(sizeof(struct storvsc_scan_work), GFP_ATOMIC); if (!work) return; @@ -1081,7 +1075,6 @@ static void storvsc_on_receive(struct hv_device *device, break; case VSTOR_OPERATION_FCHBA_DATA: - stor_device = get_in_stor_device(device); cache_wwn(stor_device, vstor_packet); fc_host_node_name(stor_device->host) = stor_device->node_name; fc_host_port_name(stor_device->host) = stor_device->port_name; @@ -1129,7 +1122,7 @@ static void storvsc_on_channel_callback(void *context) vmscsi_size_delta)); complete(&request->wait_event); } else { - storvsc_on_receive(device, + storvsc_on_receive(stor_device, (struct vstor_packet *)packet, request); } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 1/4] scsi: storvsc: Fix a bug in the layout of the hv_fc_wwn_packet
The hv_fc_wwn_packet is exchanged over vmbus. Make the definition in Linux match the Window's definition. Signed-off-by: K. Y. Srinivasan Reviewed-by: Johannes Thumshirn Reviewed-by: Long Li Tested-by: Alex Ng --- drivers/scsi/storvsc_drv.c |5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index c41f674..00bb4bd 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -92,9 +92,8 @@ enum vstor_packet_operation { */ struct hv_fc_wwn_packet { - boolprimary_active; - u8 reserved1; - u8 reserved2; + u8 primary_active; + u8 reserved1[3]; u8 primary_port_wwn[8]; u8 primary_node_wwn[8]; u8 secondary_port_wwn[8]; -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V2 3/4] scsi: storvsc: Refactor the code in storvsc_channel_init()
The function storvsc_channel_init() repeatedly interacts with the host to extract various channel properties. Refactor this code to eliminate code repetition. Signed-off-by: K. Y. Srinivasan Reviewed-by: Long Li Reviewed-by: Johannes Thumshirn Tested-by: Alex Ng --- V2: Fixed error paths - Dan Carpenter drivers/scsi/storvsc_drv.c | 126 1 files changed, 46 insertions(+), 80 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index ab9828c..947f812 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -721,29 +721,17 @@ static void cache_wwn(struct storvsc_device *stor_device, } } -static int storvsc_channel_init(struct hv_device *device, bool is_fc) + +static int storvsc_execute_vstor_op(struct hv_device *device, + struct storvsc_cmd_request *request, + bool status_check) { - struct storvsc_device *stor_device; - struct storvsc_cmd_request *request; struct vstor_packet *vstor_packet; - int ret, t, i; - int max_chns; - bool process_sub_channels = false; - - stor_device = get_out_stor_device(device); - if (!stor_device) - return -ENODEV; + int ret, t; - request = &stor_device->init_request; vstor_packet = &request->vstor_packet; - /* -* Now, initiate the vsc/vsp initialization protocol on the open -* channel -*/ - memset(request, 0, sizeof(struct storvsc_cmd_request)); init_completion(&request->wait_event); - vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION; vstor_packet->flags = REQUEST_COMPLETION_FLAG; ret = vmbus_sendpacket(device->channel, vstor_packet, @@ -759,17 +747,50 @@ static int storvsc_channel_init(struct hv_device *device, bool is_fc) if (t == 0) return -ETIMEDOUT; + if (!status_check) + return ret; + if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || vstor_packet->status != 0) return -EINVAL; + return ret; +} + +static int storvsc_channel_init(struct hv_device *device, bool is_fc) +{ + struct storvsc_device *stor_device; + struct storvsc_cmd_request *request; + struct vstor_packet *vstor_packet; + int ret, i; + int max_chns; + bool process_sub_channels = false; + + stor_device = get_out_stor_device(device); + if (!stor_device) + return -ENODEV; + + request = &stor_device->init_request; + vstor_packet = &request->vstor_packet; + + /* +* Now, initiate the vsc/vsp initialization protocol on the open +* channel +*/ + memset(request, 0, sizeof(struct storvsc_cmd_request)); + vstor_packet->operation = VSTOR_OPERATION_BEGIN_INITIALIZATION; + ret = storvsc_execute_vstor_op(device, request, true); + if (ret) + return ret; + /* +* Query host supported protocol version. +*/ for (i = 0; i < ARRAY_SIZE(vmstor_protocols); i++) { /* reuse the packet for version range supported */ memset(vstor_packet, 0, sizeof(struct vstor_packet)); vstor_packet->operation = VSTOR_OPERATION_QUERY_PROTOCOL_VERSION; - vstor_packet->flags = REQUEST_COMPLETION_FLAG; vstor_packet->version.major_minor = vmstor_protocols[i].protocol_version; @@ -778,20 +799,10 @@ static int storvsc_channel_init(struct hv_device *device, bool is_fc) * The revision number is only used in Windows; set it to 0. */ vstor_packet->version.revision = 0; - - ret = vmbus_sendpacket(device->channel, vstor_packet, - (sizeof(struct vstor_packet) - - vmscsi_size_delta), - (unsigned long)request, - VM_PKT_DATA_INBAND, - VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); + ret = storvsc_execute_vstor_op(device, request, false); if (ret != 0) return ret; - t = wait_for_completion_timeout(&request->wait_event, 5*HZ); - if (t == 0) - return -ETIMEDOUT; - if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO) return -EINVAL; @@ -815,26 +826,10 @@ static int storvsc_channel_init(struct hv_device *device, bool is_fc) memset(vstor_packet, 0, sizeof(struct vstor_packet)); vstor_packet->operation = VSTOR_OPERATION_QUERY_PROPERTIES; - vstor_packet->flags = REQUEST_COMPLETION_FLAG; - - ret = vmbus_sendpacket(device->channel, vstor_packet,
Re: [PATCH] staging: speakup: kobjects.c: fix char argument to %02x
On Sun, Dec 6, 2015 at 2:05 AM, Rasmus Villemoes wrote: > If char is signed and ch happens to be negative, printing ch with > "%02x" will not do as intended (when ch is -19, one will get > "ffed"). Fix that by masking with 0xff. > > Signed-off-by: Rasmus Villemoes > --- > drivers/staging/speakup/kobjects.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/speakup/kobjects.c > b/drivers/staging/speakup/kobjects.c > index fdfeb42b2b8f..8b88f03e266b 100644 > --- a/drivers/staging/speakup/kobjects.c > +++ b/drivers/staging/speakup/kobjects.c > @@ -567,7 +567,7 @@ ssize_t spk_var_show(struct kobject *kobj, struct > kobj_attribute *attr, > if (ch >= ' ' && ch < '~') > *cp1++ = ch; > else > - cp1 += sprintf(cp1, "\\x%02x", ch); > + cp1 += sprintf(cp1, "\\x%02x", ch & > 0xff); Have you considered to use string_escape_str()? This one clearly looks like ESCAPE_HEX. > } > *cp1++ = '"'; > *cp1++ = '\n'; > -- > 2.6.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- With Best Regards, Andy Shevchenko ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 2/4] scsi: storvsc: Properly support Fibre Channel devices
Hi Srinivasan, [auto build test ERROR on scsi/for-next] [also build test ERROR on v4.4-rc4 next-20151211] url: https://github.com/0day-ci/linux/commits/K-Y-Srinivasan/scsi-storvsc-Properly-support-FC-hosts/20151213-042209 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next config: x86_64-randconfig-s4-12130552 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): drivers/built-in.o: In function `storvsc_remove': >> storvsc_drv.c:(.text+0x2e3e58): undefined reference to `fc_remove_host' drivers/built-in.o: In function `storvsc_drv_init': >> storvsc_drv.c:(.init.text+0x107bf): undefined reference to >> `fc_attach_transport' >> storvsc_drv.c:(.init.text+0x107f9): undefined reference to >> `fc_release_transport' drivers/built-in.o: In function `storvsc_drv_exit': >> storvsc_drv.c:(.exit.text+0x1eb1): undefined reference to >> `fc_release_transport' --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 2/4] scsi: storvsc: Properly support Fibre Channel devices
Hi Srinivasan, [auto build test ERROR on scsi/for-next] [also build test ERROR on v4.4-rc4 next-20151211] url: https://github.com/0day-ci/linux/commits/K-Y-Srinivasan/scsi-storvsc-Properly-support-FC-hosts/20151213-042209 base: https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next config: x86_64-randconfig-h0-12130933 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All errors (new ones prefixed by >>): >> ERROR: "fc_release_transport" [drivers/scsi/hv_storvsc.ko] undefined! >> ERROR: "fc_remove_host" [drivers/scsi/hv_storvsc.ko] undefined! >> ERROR: "fc_attach_transport" [drivers/scsi/hv_storvsc.ko] undefined! --- 0-DAY kernel test infrastructureOpen Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation .config.gz Description: Binary data ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[GIT PULL] Staging driver fixes for 4.4-rc5
The following changes since commit 1ec218373b8ebda821aec00bb156a9c94fad9cd4: Linux 4.4-rc2 (2015-11-22 16:45:59 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ tags/staging-4.4-rc5 for you to fetch changes up to 9225c0b7b976dd9ceac2b80727a60d8fcb906a62: staging: lustre: echo_copy.._lsm() dereferences userland pointers directly (2015-12-01 12:13:32 -0800) Staging driver fixes for 4.4-rc5 Here are a few staging and IIO driver fixes for 4.4-rc5. All of them resolve reported problems and have been in linux-next for a while. Nothing major here, just small fixes where needed. Signed-off-by: Greg Kroah-Hartman Al Viro (1): staging: lustre: echo_copy.._lsm() dereferences userland pointers directly Dan Carpenter (1): iio: fix some warning messages Greg Kroah-Hartman (1): Merge tag 'iio-fixes-for-4.4b' of git://git.kernel.org/.../jic23/iio into staging-linus Ioana Ciornei (1): staging: iio: dummy: complete IIO events delivery to userspace Julia Lawall (1): iio: adc: spmi-vadc: add missing of_node_put Matt Ranostay (2): iio: lidar: return -EINVAL on invalid signal iio: light: apds9960: correct ->last_busy count drivers/iio/adc/qcom-spmi-vadc.c| 4 +++- drivers/iio/industrialio-buffer.c | 2 +- drivers/iio/industrialio-core.c | 2 +- drivers/iio/light/apds9960.c| 1 + drivers/iio/proximity/pulsedlight-lidar-lite-v2.c | 6 +++--- drivers/staging/iio/iio_simple_dummy_events.c | 2 +- drivers/staging/lustre/lustre/obdecho/echo_client.c | 20 +++- 7 files changed, 21 insertions(+), 16 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: netlogic: Coding Style Alignment should match open parenthesis
Fixed alignment issues with parenthesis so the code is easier to read. Signed-off-by: Benjamin Young --- drivers/staging/netlogic/platform_net.c | 12 +-- drivers/staging/netlogic/xlr_net.c | 159 +--- 2 files changed, 91 insertions(+), 80 deletions(-) diff --git a/drivers/staging/netlogic/platform_net.c b/drivers/staging/netlogic/platform_net.c index 7806c2b..f71e42a 100644 --- a/drivers/staging/netlogic/platform_net.c +++ b/drivers/staging/netlogic/platform_net.c @@ -121,8 +121,8 @@ static struct platform_device *gmac_controller2_init(void *gmac0_addr) ndata1.phy_addr[mac] = mac + 4 + 0x10; xlr_resource_init(&xlr_net1_res[mac * 2], - xlr_gmac_offsets[mac + 4], - xlr_gmac_irqs[mac + 4]); + xlr_gmac_offsets[mac + 4], + xlr_gmac_irqs[mac + 4]); } xlr_net_dev1.num_resources = 8; @@ -169,7 +169,7 @@ static void xls_gmac_init(void) xlr_net_dev0.num_resources = 2; xlr_resource_init(&xlr_net0_res[0], xlr_gmac_offsets[0], - xlr_gmac_irqs[0]); + xlr_gmac_irqs[0]); platform_device_register(&xlr_net_dev0); /* second block is XAUI, not supported yet */ @@ -182,8 +182,8 @@ static void xls_gmac_init(void) ndata0.phy_addr[mac] = mac + 0x10; xlr_resource_init(&xlr_net0_res[mac * 2], - xlr_gmac_offsets[mac], - xlr_gmac_irqs[mac]); + xlr_gmac_offsets[mac], + xlr_gmac_irqs[mac]); } xlr_net_dev0.num_resources = 8; platform_device_register(&xlr_net_dev0); @@ -223,7 +223,7 @@ static void xlr_gmac_init(void) ndata0.tx_stnid[mac] = FMN_STNID_GMAC0_TX0 + mac; ndata0.phy_addr[mac] = mac; xlr_resource_init(&xlr_net0_res[mac * 2], xlr_gmac_offsets[mac], - xlr_gmac_irqs[mac]); + xlr_gmac_irqs[mac]); } xlr_net_dev0.num_resources = 8; xlr_net_dev0.resource = xlr_net0_res; diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index ac93e63..7c44acf 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -69,8 +69,8 @@ static inline u32 xlr_nae_rdreg(u32 __iomem *base, unsigned int reg) return __raw_readl(base + reg); } -static inline void xlr_reg_update(u32 *base_addr, - u32 off, u32 val, u32 mask) +static inline void xlr_reg_update(u32 *base_addr, u32 off, + u32 val, u32 mask) { u32 tmp; @@ -122,8 +122,8 @@ static inline unsigned char *xlr_alloc_skb(void) return skb->data; } -static void xlr_net_fmn_handler(int bkt, int src_stnid, int size, - int code, struct nlm_fmn_msg *msg, void *arg) +static void xlr_net_fmn_handler(int bkt, int src_stnid, int size, int code, + struct nlm_fmn_msg *msg, void *arg) { struct sk_buff *skb; void *skb_data = NULL; @@ -247,7 +247,7 @@ static int xlr_net_stop(struct net_device *ndev) } static void xlr_make_tx_desc(struct nlm_fmn_msg *msg, unsigned long addr, - struct sk_buff *skb) +struct sk_buff *skb) { unsigned long physkb = virt_to_phys(skb); int cpu_core = nlm_core_id(); @@ -275,7 +275,7 @@ static void __maybe_unused xlr_wakeup_queue(unsigned long dev) } static netdev_tx_t xlr_net_start_xmit(struct sk_buff *skb, - struct net_device *ndev) + struct net_device *ndev) { struct nlm_fmn_msg msg; struct xlr_net_priv *priv = netdev_priv(ndev); @@ -304,10 +304,10 @@ static void xlr_hw_set_mac_addr(struct net_device *ndev) /* set mac station address */ xlr_nae_wreg(priv->base_addr, R_MAC_ADDR0, - ((ndev->dev_addr[5] << 24) | (ndev->dev_addr[4] << 16) | - (ndev->dev_addr[3] << 8) | (ndev->dev_addr[2]))); +((ndev->dev_addr[5] << 24) | (ndev->dev_addr[4] << 16) | +(ndev->dev_addr[3] << 8) | (ndev->dev_addr[2]))); xlr_nae_wreg(priv->base_addr, R_MAC_ADDR0 + 1, - ((ndev->dev_addr[1] << 24) | (ndev->dev_addr[0] << 16))); +((ndev->dev_addr[1] << 24) | (ndev->dev_addr[0] << 16))); xlr_nae_wreg(priv->base_addr, R_MAC_ADDR_MASK2, 0x); xlr_nae_wreg(priv->base_addr, R_MAC_ADDR_MASK2 + 1, 0x); @@ -315,12 +315,12 @@ static void xlr_hw_set_mac_addr(struct net_device *ndev) xlr_nae_wreg(priv->base_addr,