[PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
This patch fix a sparse warning in lustre sources warning: incorrect type in argument 1 (different address spaces) expected void [noderef] *to got char * This is done by adding the missing __user attribute on userland pointers inside the LPROC_SEQ_FOPS-like macros: - LPROC_SEQ_FOPS - LPROC_SEQ_FOPS_RW_TYPE - LPROC_SEQ_FOPS_WR_ONLY - LDLM_POOL_PROC_WRITER The patch also updates all the functions that are used by this macro: - lprocfs_wr_* - *_seq_write as well as some helpers used by the previously modified functions (otherwise fixing the sparse warning add some new ones): - lprocfs_write_frac_helper - lprocfs_write_helper - lprocfs_write_u64_helper The patch also fixes one __user pointer direct dereference by strncmp in function fld_proc_hash_seq_write by adding the proper copy_from_user. Signed-off-by: Tristan Lelong --- drivers/staging/lustre/lustre/fld/lproc_fld.c | 14 -- .../staging/lustre/lustre/include/lprocfs_status.h | 44 + drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 5 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 4 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 7 +-- drivers/staging/lustre/lustre/lov/lproc_lov.c | 20 +--- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 7 +-- .../lustre/lustre/obdclass/linux/linux-module.c| 5 +- .../lustre/lustre/obdclass/lprocfs_status.c| 2 +- drivers/staging/lustre/lustre/osc/lproc_osc.c | 57 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 25 +- 11 files changed, 114 insertions(+), 76 deletions(-) diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c b/drivers/staging/lustre/lustre/fld/lproc_fld.c index 95e7de1..9f1db6c 100644 --- a/drivers/staging/lustre/lustre/fld/lproc_fld.c +++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c @@ -87,13 +87,21 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused) } static ssize_t -fld_proc_hash_seq_write(struct file *file, const char *buffer, - size_t count, loff_t *off) +fld_proc_hash_seq_write(struct file *file, + const char __user *buffer, + size_t count, loff_t *off) { struct lu_client_fld *fld; struct lu_fld_hash *hash = NULL; + char name[80]; int i; + if (count > 80) + return -ENAMETOOLONG; + + if (copy_from_user(name, buffer, count) != 0) + return -EFAULT; + fld = ((struct seq_file *)file->private_data)->private; LASSERT(fld != NULL); @@ -101,7 +109,7 @@ fld_proc_hash_seq_write(struct file *file, const char *buffer, if (count != strlen(fld_hash[i].fh_name)) continue; - if (!strncmp(fld_hash[i].fh_name, buffer, count)) { + if (!strncmp(fld_hash[i].fh_name, name, count)) { hash = &fld_hash[i]; break; } diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index cfe503b..8a25cf6 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -627,16 +627,16 @@ struct adaptive_timeout; extern int lprocfs_at_hist_helper(struct seq_file *m, struct adaptive_timeout *at); extern int lprocfs_rd_timeouts(struct seq_file *m, void *data); -extern int lprocfs_wr_timeouts(struct file *file, const char *buffer, +extern int lprocfs_wr_timeouts(struct file *file, const char __user *buffer, unsigned long count, void *data); -extern int lprocfs_wr_evict_client(struct file *file, const char *buffer, +extern int lprocfs_wr_evict_client(struct file *file, const char __user *buffer, size_t count, loff_t *off); -extern int lprocfs_wr_ping(struct file *file, const char *buffer, +extern int lprocfs_wr_ping(struct file *file, const char __user *buffer, size_t count, loff_t *off); -extern int lprocfs_wr_import(struct file *file, const char *buffer, +extern int lprocfs_wr_import(struct file *file, const char __user *buffer, size_t count, loff_t *off); extern int lprocfs_rd_pinger_recov(struct seq_file *m, void *n); -extern int lprocfs_wr_pinger_recov(struct file *file, const char *buffer, +extern int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer, size_t count, loff_t *off); /* Statfs helpers */ @@ -650,8 +650,8 @@ extern int lprocfs_rd_filesfree(struct seq_file *m, void *data); extern int lprocfs_write_helper(const char __user *buffer, unsigned long count, int *val); extern int lprocfs_seq_read_frac_helper(struct seq_file *m, long val, int mult); -extern int lprocfs_write_u64_helper(const char *buffer, u
Re: [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
On Fri, Dec 05, 2014 at 12:28:11AM -0800, Joe Perches wrote: > On Fri, 2014-12-05 at 00:03 -0800, Tristan Lelong wrote: > > This patch fix a sparse warning in lustre sources > > > > warning: incorrect type in argument 1 (different address spaces) > > expected void [noderef] *to > > got char * > [] > > diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c > > b/drivers/staging/lustre/lustre/fld/lproc_fld.c > [] > > @@ -87,13 +87,21 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused) > > } > > > > static ssize_t > > -fld_proc_hash_seq_write(struct file *file, const char *buffer, > > - size_t count, loff_t *off) > > +fld_proc_hash_seq_write(struct file *file, > > + const char __user *buffer, > > + size_t count, loff_t *off) > > { > > struct lu_client_fld *fld; > > struct lu_fld_hash *hash = NULL; > > + char name[80]; > > int i; > > > > + if (count > 80) > > + return -ENAMETOOLONG; > > + > > + if (copy_from_user(name, buffer, count) != 0) > > + return -EFAULT; > > + > > fld = ((struct seq_file *)file->private_data)->private; > > LASSERT(fld != NULL); > > > > Why 80? Is there no #define for this length? > No, there is no define. I thought about adding one, but several other files and structure members in the lustre sources are using this specific value, and it seemed like a modification to do in another patch. Let me know if you feel I should do it in a patch serie. Regards ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
On Fri, 2014-12-05 at 00:37 -0800, Tristan Lelong wrote: > On Fri, Dec 05, 2014 at 12:28:11AM -0800, Joe Perches wrote: > > On Fri, 2014-12-05 at 00:03 -0800, Tristan Lelong wrote: [] > > > diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c > > > b/drivers/staging/lustre/lustre/fld/lproc_fld.c [] > > > + char name[80]; [] > > Why 80? Is there no #define for this length? > > > No, there is no define. > > I thought about adding one, but several other files and structure > members in the lustre sources are using this specific value, and it > seemed like a modification to do in another patch. > > Let me know if you feel I should do it in a patch serie. No worries if it's not a new number. It'd be nice if you would submit a new patch with a #define and a conversion to use the #define one day. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
On Fri, 2014-12-05 at 00:03 -0800, Tristan Lelong wrote: > This patch fix a sparse warning in lustre sources > > warning: incorrect type in argument 1 (different address spaces) > expected void [noderef] *to > got char * [] > diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c > b/drivers/staging/lustre/lustre/fld/lproc_fld.c [] > @@ -87,13 +87,21 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused) > } > > static ssize_t > -fld_proc_hash_seq_write(struct file *file, const char *buffer, > - size_t count, loff_t *off) > +fld_proc_hash_seq_write(struct file *file, > + const char __user *buffer, > + size_t count, loff_t *off) > { > struct lu_client_fld *fld; > struct lu_fld_hash *hash = NULL; > + char name[80]; > int i; > > + if (count > 80) > + return -ENAMETOOLONG; > + > + if (copy_from_user(name, buffer, count) != 0) > + return -EFAULT; > + > fld = ((struct seq_file *)file->private_data)->private; > LASSERT(fld != NULL); > Why 80? Is there no #define for this length? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v4 1/6] mfd: rtsx: add func to split u32 into register
Hi Lee, this patch can be applied if you think it is ok, it doesn't depends other patches. regards. micky. On 12/05/2014 01:54 PM, micky_ch...@realsil.com.cn wrote: > From: Micky Ching > > Add helper function to write u32 to registers, if we want to put u32 > value to 4 continuous register, this can help us reduce tedious work. > > Signed-off-by: Micky Ching > Acked-by: Lee Jones > --- > include/linux/mfd/rtsx_pci.h | 9 + > 1 file changed, 9 insertions(+) > > diff --git a/include/linux/mfd/rtsx_pci.h b/include/linux/mfd/rtsx_pci.h > index 74346d5..9234449 100644 > --- a/include/linux/mfd/rtsx_pci.h > +++ b/include/linux/mfd/rtsx_pci.h > @@ -558,6 +558,7 @@ > #define SD_SAMPLE_POINT_CTL 0xFDA7 > #define SD_PUSH_POINT_CTL 0xFDA8 > #define SD_CMD0 0xFDA9 > +#define SD_CMD_START 0x40 > #define SD_CMD1 0xFDAA > #define SD_CMD2 0xFDAB > #define SD_CMD3 0xFDAC > @@ -967,4 +968,12 @@ static inline u8 *rtsx_pci_get_cmd_data(struct rtsx_pcr > *pcr) > return (u8 *)(pcr->host_cmds_ptr); > } > > +static inline void rtsx_pci_write_be32(struct rtsx_pcr *pcr, u16 reg, u32 > val) > +{ > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg, 0xFF, val >> 24); > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 1, 0xFF, val >> 16); > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 2, 0xFF, val >> 8); > + rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, reg + 3, 0xFF, val); > +} > + > #endif ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Drivers:staging:octeon: Fixed checkpatch warning
Fixed the checkpatch warning: Missing a blank line after declarations Signed-off-by: Athira Lekshmi --- drivers/staging/octeon/ethernet-rx.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c index 44e372f..220106e 100644 --- a/drivers/staging/octeon/ethernet-rx.c +++ b/drivers/staging/octeon/ethernet-rx.c @@ -84,6 +84,7 @@ static int cvm_irq_cpu; static void cvm_oct_enable_napi(void *_) { int cpu = smp_processor_id(); + napi_schedule(&cvm_oct_napi[cpu].napi); } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Drivers:staging:octeon: Fixed checkpatch warning
On Fri, Dec 05, 2014 at 04:25:22PM +0530, Athira Lekshmi wrote: > Fixed the checkpatch warning: > Missing a blank line after declarations this is not applying to next-20141204. sudip > > Signed-off-by: Athira Lekshmi > --- > drivers/staging/octeon/ethernet-rx.c |1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/staging/octeon/ethernet-rx.c > b/drivers/staging/octeon/ethernet-rx.c > index 44e372f..220106e 100644 > --- a/drivers/staging/octeon/ethernet-rx.c > +++ b/drivers/staging/octeon/ethernet-rx.c > @@ -84,6 +84,7 @@ static int cvm_irq_cpu; > static void cvm_oct_enable_napi(void *_) > { > int cpu = smp_processor_id(); > + > napi_schedule(&cvm_oct_napi[cpu].napi); > } > > -- > 1.7.9.5 > > -- > 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/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 2/2] staging: media: lirc: lirc_zilog.c: keep consistency in dev functions
On Thu, Dec 04, 2014 at 10:35:24PM +, Luis de Bethencourt wrote: > The previous patch switched some dev functions to move the string to a second > line. Doing this for all similar functions because it makes the driver easier > to read if all similar lines use the same criteria. > > Signed-off-by: Luis de Bethencourt > --- > drivers/staging/media/lirc/lirc_zilog.c | 155 > +--- > 1 file changed, 102 insertions(+), 53 deletions(-) > > diff --git a/drivers/staging/media/lirc/lirc_zilog.c > b/drivers/staging/media/lirc/lirc_zilog.c > index 8814a7e..af46827 100644 > --- a/drivers/staging/media/lirc/lirc_zilog.c > +++ b/drivers/staging/media/lirc/lirc_zilog.c > @@ -322,7 +322,8 @@ static int add_to_buf(struct IR *ir) > struct IR_tx *tx; > > if (lirc_buffer_full(rbuf)) { > - dev_dbg(ir->l.dev, "buffer overflow\n"); > + dev_dbg(ir->l.dev, > + "buffer overflow\n"); No. Don't do this. It's better if it is on one line. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v18 06/12] dt-bindings: add document for dw_hdmi
Am Freitag, den 05.12.2014, 14:27 +0800 schrieb Andy Yan: > Signed-off-by: Andy Yan This binding is mostly a copy of the existing Documentation/devicetree/bindings/drm/imx/hdmi.txt, but there is a new reg-io-width property to configure the register access bus width and we have added new compatibles "rockchip,rk3288-dw-hdmi" and the common "snps,dw-hdmi-tx". Could we get an Ack for this and patch 11 by the device tree maintainers? regards Philipp > --- > > Changes in v18: > - add port bindings > - correct some spelling mistakes in dw_hdmi bindings doc > > Changes in v17: None > Changes in v16: > - describe ddc-i2c-bus as optional > - add common clocks bindings > > Changes in v15: None > Changes in v14: None > Changes in v13: None > Changes in v12: None > Changes in v11: None > Changes in v10: None > Changes in v9: None > Changes in v8: > - correct some spelling mistake > - modify ddc-i2c-bus and interrupt description > > Changes in v7: None > Changes in v6: None > Changes in v5: None > Changes in v4: None > Changes in v3: None > > .../devicetree/bindings/drm/bridge/dw_hdmi.txt | 50 > ++ > 1 file changed, 50 insertions(+) > create mode 100644 Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt > > diff --git a/Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt > b/Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt > new file mode 100644 > index 000..a905c14 > --- /dev/null > +++ b/Documentation/devicetree/bindings/drm/bridge/dw_hdmi.txt > @@ -0,0 +1,50 @@ > +DesignWare HDMI bridge bindings > + > +Required properties: > +- compatible: platform specific such as: > + * "snps,dw-hdmi-tx" > + * "fsl,imx6q-hdmi" > + * "fsl,imx6dl-hdmi" > + * "rockchip,rk3288-dw-hdmi" > +- reg: Physical base address and length of the controller's registers. > +- interrupts: The HDMI interrupt number > +- clocks, clock-names : must have the phandles to the HDMI iahb and isfr > clocks, > + as described in Documentation/devicetree/bindings/clock/clock-bindings.txt, > + the clocks are soc specific, the clock-names should be "iahb", "isfr" > +-port@[X]: SoC specific port nodes with endpoint definitions as defined > + in Documentation/devicetree/bindings/media/video-interfaces.txt, > + please refer to the SoC specific binding document: > +* Documentation/devicetree/bindings/drm/imx/hdmi.txt > +* Documentation/devicetree/bindings/video/dw_hdmi-rockchip.txt > + > +Optional properties > +- reg-io-width: the width of the reg:1,4, default set to 1 if not present > +- ddc-i2c-bus: phandle of an I2C controller used for DDC EDID probing > +- clocks, clock-names: phandle to the HDMI CEC clock, name should be "cec" > + > +Example: > + hdmi: hdmi@012 { > + compatible = "fsl,imx6q-hdmi"; > + reg = <0x0012 0x9000>; > + interrupts = <0 115 0x04>; > + gpr = <&gpr>; > + clocks = <&clks 123>, <&clks 124>; > + clock-names = "iahb", "isfr"; > + ddc-i2c-bus = <&i2c2>; > + > + port@0 { > + reg = <0>; > + > + hdmi_mux_0: endpoint { > + remote-endpoint = <&ipu1_di0_hdmi>; > + }; > + }; > + > + port@1 { > + reg = <1>; > + > + hdmi_mux_1: endpoint { > + remote-endpoint = <&ipu1_di1_hdmi>; > + }; > + }; > + }; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v18 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi
Hi Andy, Am Freitag, den 05.12.2014, 14:22 +0800 schrieb Andy Yan: > We found Freescale imx6 and Rockchip rk3288 and Ingenic JZ4780 (Xburst/MIPS) > use the interface compatible Designware HDMI IP, but they also have some > lightly differences, such as phy pll configuration, register width(imx hdmi > register is one byte, but rk3288 is 4 bytes width and can only be accessed > by word), 4K support(imx6 doesn't support 4k, but rk3288 does), and HDMI2.0 > support. > > To reuse the imx-hdmi driver, we make this patch set: > (1): fix some CodingStyle warning to make checkpatch happy > (2): convert imx-hdmi to drm_bridge > (3): split platform specific code > (4): move imx-hdmi to bridge/dw_hdmi > (5): extend dw_hdmi.c to support rk3288 hdmi > (6): add rockchip rk3288 platform specific code dw_hdmi-rockchip.c > > Changes in v18: > - remove a multiple blank lines in imx-hdmi.c > - fix a checkpatch warning in imx-hdmi_pltfm.c > - add port bindings > - correct some spelling mistakes in dw_hdmi bindings doc > - correct some spelling mistakes in dw_hdmi-rockchip bindings doc [...] I am happy with the series so far. Pending Acks from the device tree maintainers for the new binding documents, I'd like to apply either the whole of it on top of git://git.pengutronix.de/git/pza/linux.git imx-drm/next or take at least the i.MX specific patches (1-5) because of the dependency on the imx-drm OF helper conversion. regards Philipp ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Relatives
Hello, My name is Ms.Maria McCaner; I work with the Track You Service, a consulting Firm in London , UK . We are conducting a standard process investigation involving a client who shares the same name with you and also the circumstances surrounding investments made by this client at HSBC Bank Plc. The HSBC Private Banking client died intestate and nominated no next of kin to inherit the title over the investments made with HSBC Bank Plc. The essence of this communication with you is to request that you provide us information on three issues: 1-Are you aware of any relative/relation having the same surname, whose last known contact address was Madrid , Spain ? 2-Are you aware of any investment of considerable value made by such a person at the HSBC Bank Plc.? 3-Can you establish beyond reasonable doubt your eligibility to assume status of next of kin to the deceased? It is pertinent that you inform us ASAP whether or not you are familiar with this personality that we may put an end to this communication with you and our inquiries surrounding this personality. You must appreciate that we are constrained from providing you with more detailed information at this point. PLEASE RESPOND BACK TO MY PRIVATE AND DIRECT EMAIL ADDRESS; (strcks...@aol.co.uk) as soon as possible to afford us the opportunity to close this investigation. Thank you for accommodating our inquiry. Yours sincerely, Ms.Maria McCaner, Tracking You Service, For: HSBC Private Clients. This is a confidential message from Track you service Ltd --- Este mensaje no contiene virus ni malware porque la protección de avast! Antivirus está activa. http://www.avast.com ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723au: hal: Added blank line after declaration
This patch fix the checkpatch.pl warning: WARNING: Missing blank line after declaration Signed-off-by: Anjana Sasindran --- drivers/staging/rtl8723au/hal/odm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c index 1c0f106d..cabe33a 100644 --- a/drivers/staging/rtl8723au/hal/odm.c +++ b/drivers/staging/rtl8723au/hal/odm.c @@ -1435,6 +1435,7 @@ static void ODM_EdcaTurboInit23a(struct dm_odm_t *pDM_Odm) { struct rtw_adapter *Adapter = pDM_Odm->Adapter; + pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = false; pDM_Odm->DM_EDCA_Table.bIsCurRDLState = false; Adapter->recvpriv.bIsAnyNonBEPkts = false; @@ -1591,6 +1592,7 @@ ConvertTo_dB23a( void ODM_SingleDualAntennaDefaultSetting(struct dm_odm_t *pDM_Odm) { struct sw_ant_sw *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; + pDM_SWAT_Table->ANTA_ON = true; pDM_SWAT_Table->ANTB_ON = true; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8723au: hal: Removed a space before semicolon
This patch fix the checkpatch.pl warning: WARNING: space before semicolon prohibited Signed-off-by: Anjana Sasindran --- drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c index 6151e85..6878c91 100644 --- a/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c +++ b/drivers/staging/rtl8723au/hal/rtl8723a_bt-coexist.c @@ -9145,7 +9145,7 @@ u32 BTDM_BtTxRxCounterL(struct rtw_adapter *padapter) u32 counters = 0; counters = pHalData->bt_coexist.halCoex8723.lowPriorityTx+ - pHalData->bt_coexist.halCoex8723.lowPriorityRx ; + pHalData->bt_coexist.halCoex8723.lowPriorityRx; return counters; } -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v18 0/12] dw-hdmi: convert imx hdmi to bridge/dw_hdmi
Hi Philipp: On 2014年12月05日 21:55, Philipp Zabel wrote: Hi Andy, Am Freitag, den 05.12.2014, 14:22 +0800 schrieb Andy Yan: We found Freescale imx6 and Rockchip rk3288 and Ingenic JZ4780 (Xburst/MIPS) use the interface compatible Designware HDMI IP, but they also have some lightly differences, such as phy pll configuration, register width(imx hdmi register is one byte, but rk3288 is 4 bytes width and can only be accessed by word), 4K support(imx6 doesn't support 4k, but rk3288 does), and HDMI2.0 support. To reuse the imx-hdmi driver, we make this patch set: (1): fix some CodingStyle warning to make checkpatch happy (2): convert imx-hdmi to drm_bridge (3): split platform specific code (4): move imx-hdmi to bridge/dw_hdmi (5): extend dw_hdmi.c to support rk3288 hdmi (6): add rockchip rk3288 platform specific code dw_hdmi-rockchip.c Changes in v18: - remove a multiple blank lines in imx-hdmi.c - fix a checkpatch warning in imx-hdmi_pltfm.c - add port bindings - correct some spelling mistakes in dw_hdmi bindings doc - correct some spelling mistakes in dw_hdmi-rockchip bindings doc [...] I am happy with the series so far. Pending Acks from the device tree maintainers for the new binding documents, I'd like to apply either the whole of it on top of git://git.pengutronix.de/git/pza/linux.git imx-drm/next or take at least the i.MX specific patches (1-5) because of the dependency on the imx-drm OF helper conversion. regards Philipp I am very glad to see you are happy with the patch set, it's would be very nice if you can apply all of it. Thanks very much for you review. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: mt29f_spinand: check for the return value of spinand_read_status
The spinan_read_status can fail, check for the return value and fail if the spinand_read_status fails. Cc: Kamlakant Patel Signed-off-by: Devendra Naga --- compile tested only with make allmodconfig (platform X86_64 ) drivers/staging/mt29f_spinand/mt29f_spinand.c | 17 - 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index 3628bcb..3b191fc 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -626,7 +626,8 @@ static int spinand_write_page_hwecc(struct mtd_info *mtd, static int spinand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, uint8_t *buf, int oob_required, int page) { - u8 retval, status; + int retval; + u8 status; uint8_t *p = buf; int eccsize = chip->ecc.size; int eccsteps = chip->ecc.steps; @@ -640,6 +641,13 @@ static int spinand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip, while (1) { retval = spinand_read_status(info->spi, &status); + if (retval < 0) { + dev_err(&mtd->dev, + "error %d reading status register\n", + retval); + return retval; + } + if ((status & STATUS_OIP_MASK) == STATUS_READY) { if ((status & STATUS_ECC_MASK) == STATUS_ECC_ERROR) { pr_info("spinand: ECC error\n"); @@ -685,6 +693,13 @@ static int spinand_wait(struct mtd_info *mtd, struct nand_chip *chip) while (time_before(jiffies, timeo)) { retval = spinand_read_status(info->spi, &status); + if (retval < 0) { + dev_err(&mtd->dev, + "error %d reading status register\n", + retval); + return retval; + } + if ((status & STATUS_OIP_MASK) == STATUS_READY) return 0; -- 1.9.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: panel: Remove magic numbers in LCD commands
Get rid of magic numbers in LCD commands and replace them with defined values, so that it's more obvious that the commands are doing. Signed-off-by: Mariusz Gorski --- drivers/staging/panel/panel.c | 83 +-- 1 file changed, 57 insertions(+), 26 deletions(-) diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index b68a9c3..fbba46f 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c @@ -130,6 +130,28 @@ #define LCD_FLAG_N 0x0040 /* 2-rows mode */ #define LCD_FLAG_L 0x0080 /* backlight enabled */ +/* LCD commands */ +#define LCD_CMD_DISPLAY_CLEAR 0x01/* Clear entire display */ + +#define LCD_CMD_ENTRY_MODE 0x04/* Set entry mode */ +#define LCD_CMD_CURSOR_INC 0x02/* Increment cursor */ + +#define LCD_CMD_DISPLAY_CTRL 0x08/* Display control */ +#define LCD_CMD_DISPLAY_ON 0x04/* Set display on */ +#define LCD_CMD_CURSOR_ON 0x02/* Set cursor on */ +#define LCD_CMD_BLINK_ON 0x01/* Set blink on */ + +#define LCD_CMD_SHIFT 0x10/* Shift cursor/display */ +#define LCD_CMD_DISPLAY_SHIFT 0x08/* Shift display instead of cursor */ +#define LCD_CMD_SHIFT_RIGHT0x04/* Shift display/cursor to the right */ + +#define LCD_CMD_FUNCTION_SET 0x20/* Set function */ +#define LCD_CMD_DATA_LEN_8BITS 0x10/* Set data length to 8 bits */ + +#define LCD_CMD_SET_CGRAM_ADDR 0x40/* Set char generator RAM address */ + +#define LCD_CMD_SET_DDRAM_ADDR 0x80/* Set display data RAM address */ + #define LCD_ESCAPE_LEN 24 /* max chars for LCD escape command */ #define LCD_ESCAPE_CHAR27 /* use char 27 for escape command */ @@ -883,7 +905,7 @@ static void lcd_write_data_tilcd(int data) static void lcd_gotoxy(void) { - lcd_write_cmd(0x80 /* set DDRAM address */ + lcd_write_cmd(LCD_CMD_SET_DDRAM_ADDR | (lcd.addr.y ? lcd.hwidth : 0) /* we force the cursor to stay at the end of the line if it wants to go farther */ @@ -991,7 +1013,7 @@ static void lcd_clear_fast_tilcd(void) /* clears the display and resets X/Y */ static void lcd_clear_display(void) { - lcd_write_cmd(0x01);/* clear display */ + lcd_write_cmd(LCD_CMD_DISPLAY_CLEAR); lcd.addr.x = 0; lcd.addr.y = 0; /* we must wait a few milliseconds (15) */ @@ -1005,26 +1027,29 @@ static void lcd_init_display(void) long_sleep(20); /* wait 20 ms after power-up for the paranoid */ - lcd_write_cmd(0x30);/* 8bits, 1 line, small fonts */ + /* 8bits, 1 line, small fonts; let's do it 3 times */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS); long_sleep(10); - lcd_write_cmd(0x30);/* 8bits, 1 line, small fonts */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS); long_sleep(10); - lcd_write_cmd(0x30);/* 8bits, 1 line, small fonts */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS); long_sleep(10); - lcd_write_cmd(0x30 /* set font height and lines number */ + /* set font height and lines number */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS | ((lcd.flags & LCD_FLAG_F) ? 4 : 0) | ((lcd.flags & LCD_FLAG_N) ? 8 : 0) ); long_sleep(10); - lcd_write_cmd(0x08);/* display off, cursor off, blink off */ + /* display off, cursor off, blink off */ + lcd_write_cmd(LCD_CMD_DISPLAY_CTRL); long_sleep(10); - lcd_write_cmd(0x08 /* set display mode */ - | ((lcd.flags & LCD_FLAG_D) ? 4 : 0) - | ((lcd.flags & LCD_FLAG_C) ? 2 : 0) - | ((lcd.flags & LCD_FLAG_B) ? 1 : 0) + lcd_write_cmd(LCD_CMD_DISPLAY_CTRL /* set display mode */ + | ((lcd.flags & LCD_FLAG_D) ? LCD_CMD_DISPLAY_ON : 0) + | ((lcd.flags & LCD_FLAG_C) ? LCD_CMD_CURSOR_ON : 0) + | ((lcd.flags & LCD_FLAG_B) ? LCD_CMD_BLINK_ON : 0) ); lcd_backlight((lcd.flags & LCD_FLAG_L) ? 1 : 0); @@ -1032,7 +1057,7 @@ static void lcd_init_display(void) long_sleep(10); /* entry mode set : increment, cursor shifting */ - lcd_write_cmd(0x06); + lcd_write_cmd(LCD_CMD_ENTRY_MODE | LCD_CMD_CURSOR_INC); lcd_clear_display(); } @@ -1116,7 +1141,7 @@ static inline int handle_lcd_special_code(void) if (lcd.addr.x > 0) { /* back one char if not at end of line */ if (lcd.addr.x < lcd.bwidth) - lcd_write_cmd(0x10); + lcd_write_cmd(LCD_CMD_SHIFT); lcd.addr.x--; } processed = 1;
Re: [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
On Fri, Dec 05, 2014 at 12:03:47AM -0800, Tristan Lelong wrote: > This patch fix a sparse warning in lustre sources > > warning: incorrect type in argument 1 (different address spaces) > expected void [noderef] *to > got char * > > This is done by adding the missing __user attribute on userland pointers > inside > the LPROC_SEQ_FOPS-like macros: > - LPROC_SEQ_FOPS > - LPROC_SEQ_FOPS_RW_TYPE > - LPROC_SEQ_FOPS_WR_ONLY > - LDLM_POOL_PROC_WRITER > > The patch also updates all the functions that are used by this macro: > - lprocfs_wr_* > - *_seq_write > > as well as some helpers used by the previously modified functions (otherwise > fixing the sparse warning add some new ones): > - lprocfs_write_frac_helper > - lprocfs_write_helper > - lprocfs_write_u64_helper > > The patch also fixes one __user pointer direct dereference by strncmp > in function fld_proc_hash_seq_write by adding the proper copy_from_user. > > Signed-off-by: Tristan Lelong > --- > drivers/staging/lustre/lustre/fld/lproc_fld.c | 14 -- > .../staging/lustre/lustre/include/lprocfs_status.h | 44 + > drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 5 +- > drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 4 +- > drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 7 +-- > drivers/staging/lustre/lustre/lov/lproc_lov.c | 20 +--- > drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 7 +-- > .../lustre/lustre/obdclass/linux/linux-module.c| 5 +- > .../lustre/lustre/obdclass/lprocfs_status.c| 2 +- > drivers/staging/lustre/lustre/osc/lproc_osc.c | 57 > +- > .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c| 25 +- > 11 files changed, 114 insertions(+), 76 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c > b/drivers/staging/lustre/lustre/fld/lproc_fld.c > index 95e7de1..9f1db6c 100644 > --- a/drivers/staging/lustre/lustre/fld/lproc_fld.c > +++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c > @@ -87,13 +87,21 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused) > } > > static ssize_t > -fld_proc_hash_seq_write(struct file *file, const char *buffer, > - size_t count, loff_t *off) > +fld_proc_hash_seq_write(struct file *file, > + const char __user *buffer, > + size_t count, loff_t *off) > { > struct lu_client_fld *fld; > struct lu_fld_hash *hash = NULL; > + char name[80]; > int i; > > + if (count > 80) > + return -ENAMETOOLONG; > + > + if (copy_from_user(name, buffer, count) != 0) > + return -EFAULT; How was this code ever working before? And I know Joe asked, but how do you know that 80 is ok? And why on the stack? Shouldn't you just compare count to strlen(fld_hash[i].fh_name)? like you do later on? > + > fld = ((struct seq_file *)file->private_data)->private; > LASSERT(fld != NULL); > > @@ -101,7 +109,7 @@ fld_proc_hash_seq_write(struct file *file, const char > *buffer, > if (count != strlen(fld_hash[i].fh_name)) > continue; > > - if (!strncmp(fld_hash[i].fh_name, buffer, count)) { > + if (!strncmp(fld_hash[i].fh_name, name, count)) { So right now the code is just accessing user memory directly? Seriously? Ugh. Anyway, I don't like large stack variables like this, can you make it dynamic instead? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: panel: Remove magic numbers in LCD commands
Get rid of magic numbers in LCD commands and replace them with defined values, so that it's more obvious that the commands are doing. Signed-off-by: Mariusz Gorski --- v2: Found and got rid of two more magic number usages drivers/staging/panel/panel.c | 96 +-- 1 file changed, 66 insertions(+), 30 deletions(-) diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index b68a9c3..9c68ccf 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c @@ -130,6 +130,30 @@ #define LCD_FLAG_N 0x0040 /* 2-rows mode */ #define LCD_FLAG_L 0x0080 /* backlight enabled */ +/* LCD commands */ +#define LCD_CMD_DISPLAY_CLEAR 0x01/* Clear entire display */ + +#define LCD_CMD_ENTRY_MODE 0x04/* Set entry mode */ +#define LCD_CMD_CURSOR_INC 0x02/* Increment cursor */ + +#define LCD_CMD_DISPLAY_CTRL 0x08/* Display control */ +#define LCD_CMD_DISPLAY_ON 0x04/* Set display on */ +#define LCD_CMD_CURSOR_ON 0x02/* Set cursor on */ +#define LCD_CMD_BLINK_ON 0x01/* Set blink on */ + +#define LCD_CMD_SHIFT 0x10/* Shift cursor/display */ +#define LCD_CMD_DISPLAY_SHIFT 0x08/* Shift display instead of cursor */ +#define LCD_CMD_SHIFT_RIGHT0x04/* Shift display/cursor to the right */ + +#define LCD_CMD_FUNCTION_SET 0x20/* Set function */ +#define LCD_CMD_DATA_LEN_8BITS 0x10/* Set data length to 8 bits */ +#define LCD_CMD_TWO_LINES 0x08/* Set to two display lines */ +#define LCD_CMD_FONT_5X10_DOTS 0x04/* Set char font to 5x10 dots */ + +#define LCD_CMD_SET_CGRAM_ADDR 0x40/* Set char generator RAM address */ + +#define LCD_CMD_SET_DDRAM_ADDR 0x80/* Set display data RAM address */ + #define LCD_ESCAPE_LEN 24 /* max chars for LCD escape command */ #define LCD_ESCAPE_CHAR27 /* use char 27 for escape command */ @@ -883,7 +907,7 @@ static void lcd_write_data_tilcd(int data) static void lcd_gotoxy(void) { - lcd_write_cmd(0x80 /* set DDRAM address */ + lcd_write_cmd(LCD_CMD_SET_DDRAM_ADDR | (lcd.addr.y ? lcd.hwidth : 0) /* we force the cursor to stay at the end of the line if it wants to go farther */ @@ -991,7 +1015,7 @@ static void lcd_clear_fast_tilcd(void) /* clears the display and resets X/Y */ static void lcd_clear_display(void) { - lcd_write_cmd(0x01);/* clear display */ + lcd_write_cmd(LCD_CMD_DISPLAY_CLEAR); lcd.addr.x = 0; lcd.addr.y = 0; /* we must wait a few milliseconds (15) */ @@ -1005,26 +1029,29 @@ static void lcd_init_display(void) long_sleep(20); /* wait 20 ms after power-up for the paranoid */ - lcd_write_cmd(0x30);/* 8bits, 1 line, small fonts */ + /* 8bits, 1 line, small fonts; let's do it 3 times */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS); long_sleep(10); - lcd_write_cmd(0x30);/* 8bits, 1 line, small fonts */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS); long_sleep(10); - lcd_write_cmd(0x30);/* 8bits, 1 line, small fonts */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS); long_sleep(10); - lcd_write_cmd(0x30 /* set font height and lines number */ - | ((lcd.flags & LCD_FLAG_F) ? 4 : 0) - | ((lcd.flags & LCD_FLAG_N) ? 8 : 0) + /* set font height and lines number */ + lcd_write_cmd(LCD_CMD_FUNCTION_SET | LCD_CMD_DATA_LEN_8BITS + | ((lcd.flags & LCD_FLAG_F) ? LCD_CMD_FONT_5X10_DOTS : 0) + | ((lcd.flags & LCD_FLAG_N) ? LCD_CMD_TWO_LINES : 0) ); long_sleep(10); - lcd_write_cmd(0x08);/* display off, cursor off, blink off */ + /* display off, cursor off, blink off */ + lcd_write_cmd(LCD_CMD_DISPLAY_CTRL); long_sleep(10); - lcd_write_cmd(0x08 /* set display mode */ - | ((lcd.flags & LCD_FLAG_D) ? 4 : 0) - | ((lcd.flags & LCD_FLAG_C) ? 2 : 0) - | ((lcd.flags & LCD_FLAG_B) ? 1 : 0) + lcd_write_cmd(LCD_CMD_DISPLAY_CTRL /* set display mode */ + | ((lcd.flags & LCD_FLAG_D) ? LCD_CMD_DISPLAY_ON : 0) + | ((lcd.flags & LCD_FLAG_C) ? LCD_CMD_CURSOR_ON : 0) + | ((lcd.flags & LCD_FLAG_B) ? LCD_CMD_BLINK_ON : 0) ); lcd_backlight((lcd.flags & LCD_FLAG_L) ? 1 : 0); @@ -1032,7 +1059,7 @@ static void lcd_init_display(void) long_sleep(10); /* entry mode set : increment, cursor shifting */ - lcd_write_cmd(0x06); + lcd_write_cmd(LCD_CMD_ENTRY_MODE | LCD_CMD_CURSOR_INC); lcd_clear_display(); } @@ -1116,7 +1143,7 @@ static inline int handle_lcd_special_code(void)
[PATCH 10/69] staging: unisys: fix strict checks in create_device()
Use the variable name rather than the type, and add a set of missing brackets to the if statement in create_device(). Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 1ddbe78..8a48091 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -361,7 +361,7 @@ create_device(struct controlvm_message *msg, char *buf) POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo, POSTCODE_SEVERITY_INFO); - dev = kzalloc(sizeof(struct device_info), GFP_ATOMIC); + dev = kzalloc(sizeof(*dev), GFP_ATOMIC); if (!dev) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: kmalloc for dev failed.\n"); POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, @@ -377,9 +377,9 @@ create_device(struct controlvm_message *msg, char *buf) sema_init(&dev->interrupt_callback_lock, 1);/* unlocked */ sprintf(dev->devid, "vbus%u:dev%u", (unsigned)busNo, (unsigned)devNo); /* map the channel memory for the device. */ - if (msg->hdr.flags.test_message) + if (msg->hdr.flags.test_message) { dev->chanptr = (void __iomem *)__va(dev->channel_addr); - else { + } else { pReqHandler = req_handler_find(dev->channel_uuid); if (pReqHandler) /* generic service handler registered for this -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 13/69] staging: unisys: add missing brackets in Process_Incoming()
Fix the brackets in the else clause in Process_Incoming(). Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 0930919..4d15844 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1315,8 +1315,9 @@ Process_Incoming(void *v) &List_Polling_Device_Channels))) { new_tail = lelt; dev->moved_to_tail_cnt++; - } else + } else { dev->last_on_list_cnt++; + } } } if (Incoming_ThreadInfo.should_stop) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 11/69] staging: unisys: remove extraneous blank lines in uislib.c
Fix the line spacing errors in uislib.c. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 8a48091..e255f1f 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -875,7 +875,6 @@ uislib_client_inject_add_bus(u32 bus_no, uuid_le inst_uuid, } EXPORT_SYMBOL_GPL(uislib_client_inject_add_bus); - int uislib_client_inject_del_bus(u32 bus_no) { @@ -920,7 +919,6 @@ uislib_client_inject_resume_vhba(u32 bus_no, u32 dev_no) return rc; } return 0; - } EXPORT_SYMBOL_GPL(uislib_client_inject_resume_vhba); @@ -1073,7 +1071,6 @@ uislib_client_inject_resume_vnic(u32 bus_no, u32 dev_no) return -1; } return 0; - } EXPORT_SYMBOL_GPL(uislib_client_inject_resume_vnic); @@ -1132,12 +1129,10 @@ info_debugfs_read_helper(char **buff, int *buff_len) read_lock(&BusListLock); for (bus = BusListHead; bus; bus = bus->next) { - if (PLINE("bus=0x%p, busNo=%d, deviceCount=%d\n", bus, bus->bus_no, bus->device_count) < 0) goto err_done_unlock; - if (PLINE("Devices:\n") < 0) goto err_done_unlock; @@ -1322,7 +1317,6 @@ Process_Incoming(void *v) } else dev->last_on_list_cnt++; } - } if (Incoming_ThreadInfo.should_stop) break; @@ -1473,7 +1467,6 @@ EXPORT_SYMBOL_GPL(uislib_force_channel_interrupt); static int __init uislib_mod_init(void) { - if (!unisys_spar_platform) return -ENODEV; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 09/69] staging: unisys: refactor create_bus()
Fix the missing braces and logical continuation problems in create_bus(). Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index f25dd2f..1ddbe78 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -192,8 +192,10 @@ create_bus(struct controlvm_message *msg, char *buf) bus->guest_handle = 0; bus->bus_no = busNo; bus->local_vnic = 1; - } else - bus->bus_no = bus->guest_handle = busNo; + } else { + bus->bus_no = busNo; + bus->guest_handle = busNo; + } sprintf(bus->name, "%d", (int)bus->bus_no); bus->device_count = deviceCount; bus->device = @@ -220,8 +222,8 @@ create_bus(struct controlvm_message *msg, char *buf) kfree(bus); return CONTROLVM_RESP_ERROR_ALREADY_DONE; } - if ((msg->cmd.create_bus.channel_addr != 0) - && (msg->cmd.create_bus.channel_bytes != 0)) { + if ((msg->cmd.create_bus.channel_addr != 0) && + (msg->cmd.create_bus.channel_bytes != 0)) { bus->bus_channel_bytes = msg->cmd.create_bus.channel_bytes; bus->bus_channel = init_vbus_channel(msg->cmd.create_bus.channel_addr, @@ -256,9 +258,9 @@ create_bus(struct controlvm_message *msg, char *buf) /* add bus at the head of our list */ write_lock(&BusListLock); - if (!BusListHead) + if (!BusListHead) { BusListHead = bus; - else { + } else { bus->next = BusListHead; BusListHead = bus; } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 04/69] staging: unisys: get rid of channel stub
The functions in channels/* aren't used in a lot of places. In fact, the functions in channel.c can be moved to uislib/uisqueue.c, and the rest of the files in channels can be eliminated. This patch deletes the channels directory and files, removes it from all Kconfigs that referenced them, removes the reference in the Makefile, and moves the functions inside of channels.c to uislib/uisqueue.c. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/Kconfig | 1 - drivers/staging/unisys/Makefile| 1 - drivers/staging/unisys/channels/Kconfig| 10 -- drivers/staging/unisys/channels/Makefile | 11 -- drivers/staging/unisys/channels/channel.c | 219 - drivers/staging/unisys/channels/chanstub.c | 75 -- drivers/staging/unisys/channels/chanstub.h | 23 --- drivers/staging/unisys/uislib/Kconfig | 2 +- drivers/staging/unisys/uislib/uislib.c | 1 - drivers/staging/unisys/uislib/uisqueue.c | 195 - drivers/staging/unisys/virthba/Kconfig | 2 +- 11 files changed, 195 insertions(+), 345 deletions(-) delete mode 100644 drivers/staging/unisys/channels/Kconfig delete mode 100644 drivers/staging/unisys/channels/Makefile delete mode 100644 drivers/staging/unisys/channels/channel.c delete mode 100644 drivers/staging/unisys/channels/chanstub.c delete mode 100644 drivers/staging/unisys/channels/chanstub.h diff --git a/drivers/staging/unisys/Kconfig b/drivers/staging/unisys/Kconfig index ac080c9..19fcb34 100644 --- a/drivers/staging/unisys/Kconfig +++ b/drivers/staging/unisys/Kconfig @@ -12,7 +12,6 @@ if UNISYSSPAR source "drivers/staging/unisys/visorutil/Kconfig" source "drivers/staging/unisys/visorchannel/Kconfig" source "drivers/staging/unisys/visorchipset/Kconfig" -source "drivers/staging/unisys/channels/Kconfig" source "drivers/staging/unisys/uislib/Kconfig" source "drivers/staging/unisys/virtpci/Kconfig" source "drivers/staging/unisys/virthba/Kconfig" diff --git a/drivers/staging/unisys/Makefile b/drivers/staging/unisys/Makefile index b988d69..68b9925 100644 --- a/drivers/staging/unisys/Makefile +++ b/drivers/staging/unisys/Makefile @@ -4,7 +4,6 @@ obj-$(CONFIG_UNISYS_VISORUTIL) += visorutil/ obj-$(CONFIG_UNISYS_VISORCHANNEL) += visorchannel/ obj-$(CONFIG_UNISYS_VISORCHIPSET) += visorchipset/ -obj-$(CONFIG_UNISYS_CHANNELSTUB) += channels/ obj-$(CONFIG_UNISYS_UISLIB)+= uislib/ obj-$(CONFIG_UNISYS_VIRTPCI) += virtpci/ obj-$(CONFIG_UNISYS_VIRTHBA) += virthba/ diff --git a/drivers/staging/unisys/channels/Kconfig b/drivers/staging/unisys/channels/Kconfig deleted file mode 100644 index 179c6ce..000 --- a/drivers/staging/unisys/channels/Kconfig +++ /dev/null @@ -1,10 +0,0 @@ -# -# Unisys channels configuration -# - -config UNISYS_CHANNELSTUB - tristate "Unisys channelstub driver" - depends on UNISYSSPAR && UNISYS_VISORUTIL - ---help--- - If you say Y here, you will enable the Unisys channels driver. - diff --git a/drivers/staging/unisys/channels/Makefile b/drivers/staging/unisys/channels/Makefile deleted file mode 100644 index adc1842..000 --- a/drivers/staging/unisys/channels/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# -# Makefile for Unisys channelstub -# - -obj-$(CONFIG_UNISYS_CHANNELSTUB) += visorchannelstub.o - -visorchannelstub-y := channel.o chanstub.o - -ccflags-y += -Idrivers/staging/unisys/include -ccflags-y += -Idrivers/staging/unisys/common-spar/include -ccflags-y += -Idrivers/staging/unisys/common-spar/include/channels diff --git a/drivers/staging/unisys/channels/channel.c b/drivers/staging/unisys/channels/channel.c deleted file mode 100644 index 74cc4d6..000 --- a/drivers/staging/unisys/channels/channel.c +++ /dev/null @@ -1,219 +0,0 @@ -/* Copyright (C) 2010 - 2013 UNISYS CORPORATION - * All rights reserved. - * - * 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 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for more - * details. - */ - -#include -#ifdef CONFIG_MODVERSIONS -#include -#endif -#include -#include /* for module_init and module_exit */ -#include /* for memcpy */ -#include - -/* Implementation of exported functions for Supervisor channels */ -#include "channel.h" - -/* - * Routine Description: - * Tries to insert the prebuilt signal pointed to by pSignal into the nth - * Queue of the Channel pointed to by pChannel - * - * Parameters: - * pChannel: (IN) points to the IO Channel - * Que
[PATCH 18/69] staging: unisys: fix CamelCase in create_bus()
Fix CamelCase local variable names: busNo => bus_no deviceCount => dev_count Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 08416d2..9c995c5 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -149,7 +149,7 @@ static __iomem void *init_vbus_channel(u64 ch_addr, u32 ch_bytes) static int create_bus(struct controlvm_message *msg, char *buf) { - u32 busNo, deviceCount; + u32 bus_no, dev_count; struct bus_info *tmp, *bus; size_t size; @@ -161,19 +161,19 @@ create_bus(struct controlvm_message *msg, char *buf) return CONTROLVM_RESP_ERROR_MAX_BUSES; } - busNo = msg->cmd.create_bus.bus_no; - deviceCount = msg->cmd.create_bus.dev_count; + bus_no = msg->cmd.create_bus.bus_no; + dev_count = msg->cmd.create_bus.dev_count; - POSTCODE_LINUX_4(BUS_CREATE_ENTRY_PC, busNo, deviceCount, + POSTCODE_LINUX_4(BUS_CREATE_ENTRY_PC, bus_no, dev_count, POSTCODE_SEVERITY_INFO); size = sizeof(struct bus_info) + - (deviceCount * sizeof(struct device_info *)); + (dev_count * sizeof(struct device_info *)); bus = kzalloc(size, GFP_ATOMIC); if (!bus) { LOGERR("CONTROLVM_BUS_CREATE Failed: kmalloc for bus failed.\n"); - POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, busNo, + POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, bus_no, POSTCODE_SEVERITY_ERR); return CONTROLVM_RESP_ERROR_KMALLOC_FAILED; } @@ -184,14 +184,14 @@ create_bus(struct controlvm_message *msg, char *buf) if (msg->hdr.flags.test_message) { /* This implies we're the IOVM so set guest handle to 0... */ bus->guest_handle = 0; - bus->bus_no = busNo; + bus->bus_no = bus_no; bus->local_vnic = 1; } else { - bus->bus_no = busNo; - bus->guest_handle = busNo; + bus->bus_no = bus_no; + bus->guest_handle = bus_no; } sprintf(bus->name, "%d", (int)bus->bus_no); - bus->device_count = deviceCount; + bus->device_count = dev_count; bus->device = (struct device_info **)((char *)bus + sizeof(struct bus_info)); bus->bus_inst_uuid = msg->cmd.create_bus.bus_inst_uuid; @@ -206,7 +206,7 @@ create_bus(struct controlvm_message *msg, char *buf) } read_unlock(&bus_list_lock); if (tmp) { - /* found a bus already in the list with same busNo - + /* found a bus already in the list with same bus_no - * reject add */ LOGERR("CONTROLVM_BUS_CREATE Failed: bus %d already exists.\n", @@ -228,9 +228,9 @@ create_bus(struct controlvm_message *msg, char *buf) struct guest_msgs cmd; cmd.msgtype = GUEST_ADD_VBUS; - cmd.add_vbus.bus_no = busNo; + cmd.add_vbus.bus_no = bus_no; cmd.add_vbus.chanptr = bus->bus_channel; - cmd.add_vbus.dev_count = deviceCount; + cmd.add_vbus.dev_count = dev_count; cmd.add_vbus.bus_uuid = msg->cmd.create_bus.bus_data_type_uuid; cmd.add_vbus.instance_uuid = msg->cmd.create_bus.bus_inst_uuid; if (!virt_control_chan_func) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 02/69] staging: unisys: fix line spacing in globals.h
Get rid of the extra blank lines in globals.h. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/globals.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/globals.h b/drivers/staging/unisys/visorchipset/globals.h index 0fe1459..a1d35d4 100644 --- a/drivers/staging/unisys/visorchipset/globals.h +++ b/drivers/staging/unisys/visorchipset/globals.h @@ -15,7 +15,6 @@ * details. */ - #ifndef __VISORCHIPSET_GLOBALS_H__ #define __VISORCHIPSET_GLOBALS_H__ @@ -28,7 +27,6 @@ #define MYDRVNAME "visorchipset" - /* module parameters */ extern int visorchipset_testvnic; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 03/69] staging: unisys: remove testing.h
Nobody is using this file so remove it and the reference to it in visorchipset_main.c. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/testing.h | 43 -- .../unisys/visorchipset/visorchipset_main.c| 1 - 2 files changed, 44 deletions(-) delete mode 100644 drivers/staging/unisys/visorchipset/testing.h diff --git a/drivers/staging/unisys/visorchipset/testing.h b/drivers/staging/unisys/visorchipset/testing.h deleted file mode 100644 index 573aa8b..000 --- a/drivers/staging/unisys/visorchipset/testing.h +++ /dev/null @@ -1,43 +0,0 @@ -/* testing.h - * - * Copyright (C) 2010 - 2013 UNISYS CORPORATION - * All rights reserved. - * - * 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 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for more - * details. - */ - -#ifndef __VISORCHIPSET_TESTING_H__ -#define __VISORCHIPSET_TESTING_H__ - -#define VISORCHIPSET_TEST_PROC -#include -#include "globals.h" -#include "controlvmchannel.h" - -void test_produce_test_message(struct controlvm_message *msg, - int isLocalTestAddr); -BOOL test_consume_test_message(struct controlvm_message *msg); -void test_manufacture_vnic_client_add(void *p); -void test_manufacture_vnic_client_add_phys(HOSTADDRESS addr); -void test_manufacture_preamble_messages(void); -void test_manufacture_device_attach(ulong busNo, ulong devNo); -void test_manufacture_device_add(ulong busNo, ulong devNo, uuid_le dataTypeGuid, -void *pChannel); -void test_manufacture_add_bus(ulong busNo, ulong maxDevices, - uuid_le id, u8 *name, BOOL isServer); -void test_manufacture_device_destroy(ulong busNo, ulong devNo); -void test_manufacture_bus_destroy(ulong busNo); -void test_manufacture_detach_externalPort(ulong switchNo, ulong externalPortNo); -void test_manufacture_detach_internalPort(ulong switchNo, ulong internalPortNo); -void test_cleanup(void); - -#endif diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c index 7e6be32..2651f89 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_main.c +++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c @@ -20,7 +20,6 @@ #include "procobjecttree.h" #include "visorchannel.h" #include "periodic_work.h" -#include "testing.h" #include "file.h" #include "parser.h" #include "uniklog.h" -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 05/69] staging: unisys: remove unused types from visorchipset.h
Delete the following unused types, and unused function prototypes: VISORCHIPSET_SWITCH_INFO VISORCHIPSET_EXTERNALPORT_INFO VISORCHIPSET_INTERNALPORT_INFO visorchipset_get_switch_info() visorchipset_get_externalport_info() Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/visorchipset.h | 55 -- 1 file changed, 55 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/visorchipset.h b/drivers/staging/unisys/visorchipset/visorchipset.h index 46dad63..98f3ba4 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset.h +++ b/drivers/staging/unisys/visorchipset/visorchipset.h @@ -158,61 +158,6 @@ findbus(struct list_head *list, u32 bus_no) return NULL; } -/** Attributes for a particular Supervisor switch. - */ -struct visorchipset_switch_info { - u32 switch_no; - struct visorchipset_state state; - uuid_le switch_type_uuid; - u8 *authservice1; - u8 *authservice2; - u8 *authservice3; - u8 *security_context; - u64 reserved; - u32 reserved2; /* control_vm_id */ - struct device dev; - BOOL dev_exists; - struct controlvm_message_header pending_msg_hdr; -}; - -/** Attributes for a particular Supervisor external port, which is connected - * to a specific switch. - */ -struct visorchipset_externalport_info { - u32 switch_no; - u32 external_port_no; - struct visorchipset_state state; - uuid_le network_zone_uuid; - int pd_port; - u8 *ip; - u8 *ip_netmask; - u8 *ip_broadcast; - u8 *ip_network; - u8 *ip_gateway; - u8 *ip_dns; - u64 reserved1; - u32 reserved2; /* control_vm_id */ - struct device dev; - BOOL dev_exists; - struct controlvm_message_header pending_msg_hdr; -}; - -/** Attributes for a particular Supervisor internal port, which is how a - * device connects to a particular switch. - */ -struct visorchipset_internalport_info { - u32 switch_no; - u32 internal_port_no; - struct visorchipset_state state; - u32 bus_no; /* valid only when state.attached == 1 */ - u32 dev_no; /* valid only when state.attached == 1 */ - u64 reserved1; - u32 reserved2; /* CONTROLVM_ID */ - struct controlvm_message_header pending_msg_hdr; - MYPROCOBJECT *proc_object; - -}; - /* These functions will be called from within visorchipset when certain * events happen. (The implementation of these functions is outside of * visorchipset.) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 15/69] staging: unisys: get rid of doubled assignment in uislib_mod_init()
Split the doubled assignment in uislib_mod_init() into two separate assignments. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index d6151ee..0f33ac6 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1495,7 +1495,8 @@ uislib_mod_init(void) /* initialize global pointers to NULL */ BusListHead = NULL; - BusListCount = MaxBusCount = 0; + BusListCount = 0; + MaxBusCount = 0; rwlock_init(&BusListLock); virt_control_chan_func = NULL; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 00/69] checkpatch fix series for Unisys drivers
This patch series contains all of the previously-submitted patches in order and reviewed individually. The patches contain fixes based on errors, warnings, and checks generated by checkpatch.pl, removal of log message macros, and fixes to remove unnecessary goto statements. Benjamin Romer (51): staging: unisys: fix line spacing in visorchipset_umode.h staging: unisys: fix line spacing in globals.h staging: unisys: remove testing.h staging: unisys: get rid of channel stub staging: unisys: remove unused types from visorchipset.h staging: unisys: add comment to spinlock in struct charqueue staging: unisys: clean up typecasts in uislib.c staging: unisys: fix alignment in uislib.c staging: unisys: refactor create_bus() staging: unisys: fix strict checks in create_device() staging: unisys: remove extraneous blank lines in uislib.c staging: unisys: add missing brackets in info_debugfs_read() staging: unisys: add missing brackets in Process_Incoming() staging: unisys: remove extra parens from uislib_enable_channel_interrupts() staging: unisys: get rid of doubled assignment in uislib_mod_init() staging: unisys: fix CamelCase global variable names in uislib.c staging: unisys: refactor init_vbus_channel() staging: unisys: fix CamelCase in create_bus() staging: unisys: fix CamelCase in destroy_bus() staging: unisys: refactor create_device() staging: unisys: refactor pause_device() staging: unisys: refactor resume_device() staging: unisys: refactor destroy_device() staging: unisys: refactor delete_bus_glue() staging: unisys: refactor delete_device_glue() staging: unisys: refactor info_debugfs_read() staging: unisys: refactor find_dev() staging: unisys: rename Process_Incoming() staging: unisys: rename Initialize_incoming_thread() staging: unisys: fix CamelCase Work queue name in uislib.c staging: unisys: fix spacing in uisqueue.c staging: unisys: fix CamelCase names in do_locked_client_insert() staging: unisys: fix line spacing in uisthread.c staging: unisys: fix line spacing in uisutils.c staging: unisys: fix spacing in uisutils.c staging: unisys: fix brackets in uisctrl_register_req_handler_ex() staging: unisys: refactor uisctrl_register_req_handler_ex() staging: unisys: refactor uisctrl_unregister_req_handler_ex() staging: unisys: fix CamelCase globals in uisutils.c staging: unisys: refactor req_handler_add() staging: unisys: refactor visorchipset_file_init() staging: unisys: fix CamelCase global variables in file.c staging: unisys: get rid of HAVE_UNLOCKED_IOCTL code staging: unisys: get rid of goto in visorchipset_open() staging: unisys: fix CamelCase in visorchipset_mmap() staging: unisys: get rid of goto in visorchipset_ioctl() staging: unisys: remove ERRDRV and related macros staging: unisys: remove DBGINF() macros staging: unisys: get rid of LOGINFO() macros staging: unisys: remove LOGVER() macros staging: unisys: get rid of LOGWRN() macro and uisklog.h Bryan Thompson (4): staging: unisys: visorchannel: Rename CamelCase variable channelBytes staging: unisys: visorchannel: Rename CamelCase variable nQueues staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct staging: unisys: Remove VISORCHANNEL typedef Ken Depro (14): staging: unisys: virthba: Remove unneeded spaces after casts staging: unisys: virthba: Fix open parenthesis alignment checks staging: unisys: virthba: Fix logical continuation checks staging: unisys: virthba: Remove blank lines before/after braces staging: unisys: virthba: Fix missing braces at end of if-else statements staging: unisys: virthba: Change alloc calls to use var name instead of type staging: unisys: virthba: Fix a couple checkpatch problems staging: unisys: virthba: Fix "else not useful after return" warning staging: unisys: virthba: Fix warnings regarding lines over 80 characters staging: unisys: virthba: Fix a couple open parenthesis alignment issues staging: unisys: virthba: Fix CamelCase for Disk Add/Remove global variables staging: unisys: virthba: Fix remaining CamelCase global variables staging: unisys: virthba: Fix CamelCase for a couple function names staging: unisys: virthba: Fix CamelCase for local variables drivers/staging/unisys/Kconfig | 1 - drivers/staging/unisys/Makefile| 1 - drivers/staging/unisys/channels/Kconfig| 10 - drivers/staging/unisys/channels/Makefile | 11 - drivers/staging/unisys/channels/channel.c | 219 - drivers/staging/unisys/channels/chanstub.c | 75 -- drivers/staging/unisys/channels/chanstub.h | 23 - drivers/staging/unisys/include/procobjecttree.h| 1 - drivers/staging/unisys/include/timskmod.h | 22 +- drivers/staging/unisys/include/uisqueue.h | 1 - drivers/staging/unisys/include/uisutils.h | 4 +- drivers/staging/unis
[PATCH 17/69] staging: unisys: refactor init_vbus_channel()
Clean up the function definition so it's a single line. Remove the unnecessary goto statements and just return directly. Remove the unneeded local variable for the return result. Fix CamelCase parameters and local variable names: channelAddr => ch_addr channelBytes => ch_bytes pChan => ch Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index ead0290..08416d2 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -128,28 +128,22 @@ init_msg_header(struct controlvm_message *msg, u32 id, uint rsp, uint svr) msg->hdr.flags.server = svr; } -static __iomem void * -init_vbus_channel(u64 channelAddr, u32 channelBytes) +static __iomem void *init_vbus_channel(u64 ch_addr, u32 ch_bytes) { - void __iomem *rc = NULL; - void __iomem *pChan = uislib_ioremap_cache(channelAddr, channelBytes); + void __iomem *ch = uislib_ioremap_cache(ch_addr, ch_bytes); - if (!pChan) { + if (!ch) { LOGERR("CONTROLVM_BUS_CREATE error: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed", - (unsigned long long)channelAddr, - (unsigned long long)channelBytes); - rc = NULL; - goto Away; + (unsigned long long)ch_addr, + (unsigned long long)ch_bytes); + return NULL; } - if (!SPAR_VBUS_CHANNEL_OK_CLIENT(pChan)) { + if (!SPAR_VBUS_CHANNEL_OK_CLIENT(ch)) { ERRDRV("%s channel cannot be used", __func__); - uislib_iounmap(pChan); - rc = NULL; - goto Away; + uislib_iounmap(ch); + return NULL; } - rc = pChan; -Away: - return rc; + return ch; } static int -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/69] staging: unisys: fix line spacing in visorchipset_umode.h
Just get rid of the extra blank lines in this file. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/visorchipset_umode.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/visorchipset_umode.h b/drivers/staging/unisys/visorchipset/visorchipset_umode.h index 06ba5b7..6cf6eccb 100644 --- a/drivers/staging/unisys/visorchipset/visorchipset_umode.h +++ b/drivers/staging/unisys/visorchipset/visorchipset_umode.h @@ -26,8 +26,6 @@ #ifndef __VISORCHIPSET_UMODE_H #define __VISORCHIPSET_UMODE_H - - /** The user-mode program can access the control channel buffer directly * via this memory map. */ -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 14/69] staging: unisys: remove extra parens from uislib_enable_channel_interrupts()
Get rid of the extra parenthesis in uislib_enable_channel_interrupts(). Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 4d15844..d6151ee 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1403,7 +1403,7 @@ uislib_enable_channel_interrupts(u32 bus_no, u32 dev_no, dev->interrupt = interrupt; dev->interrupt_context = interrupt_context; dev->polling = TRUE; - list_add_tail(&(dev->list_polling_device_channels), + list_add_tail(&dev->list_polling_device_channels, &List_Polling_Device_Channels); up(&Lock_Polling_Device_Channels); } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 29/69] staging: unisys: rename Initialize_incoming_thread()
Fix the CamelCase name of this function: Initialize_incoming_thread => initialize_incoming_thread Update all references to use the new name. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 3b81bbf..29c12a3 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1340,13 +1340,13 @@ static int process_incoming(void *v) } static BOOL -Initialize_incoming_thread(void) +initialize_incoming_thread(void) { if (incoming_started) return TRUE; if (!uisthread_start(&incoming_ti, &process_incoming, NULL, "dev_incoming")) { - LOGERR("uisthread_start Initialize_incoming_thread FAILED"); + LOGERR("uisthread_start initialize_incoming_thread FAILED"); return FALSE; } incoming_started = TRUE; @@ -1373,7 +1373,7 @@ uislib_enable_channel_interrupts(u32 bus_no, u32 dev_no, return; } down(&poll_dev_lock); - Initialize_incoming_thread(); + initialize_incoming_thread(); dev->interrupt = interrupt; dev->interrupt_context = interrupt_context; dev->polling = TRUE; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 24/69] staging: unisys: refactor delete_bus_glue()
Fix the function declaration to be a single line, and rename the CamelCase parameter: busNo => bus_no Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 4f6f2c9..328f16b 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -774,15 +774,14 @@ init_chipset(struct controlvm_message *msg, char *buf) return CONTROLVM_RESP_SUCCESS; } -static int -delete_bus_glue(u32 busNo) +static int delete_bus_glue(u32 bus_no) { struct controlvm_message msg; init_msg_header(&msg, CONTROLVM_BUS_DESTROY, 0, 0); - msg.cmd.destroy_bus.bus_no = busNo; + msg.cmd.destroy_bus.bus_no = bus_no; if (destroy_bus(&msg, NULL) != CONTROLVM_RESP_SUCCESS) { - LOGERR("destroy_bus failed. busNo=0x%x\n", busNo); + LOGERR("destroy_bus failed. bus_no=0x%x\n", bus_no); return 0; } return 1; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 33/69] staging: unisys: fix line spacing in uisthread.c
Just remove the one extra blank line. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisthread.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/unisys/uislib/uisthread.c b/drivers/staging/unisys/uislib/uisthread.c index c0fc812..25adf1a 100644 --- a/drivers/staging/unisys/uislib/uisthread.c +++ b/drivers/staging/unisys/uislib/uisthread.c @@ -53,7 +53,6 @@ uisthread_start(struct uisthread_info *thrinfo, wake_up_process(thrinfo->task); LOGINF("started thread pid:%d\n", thrinfo->id); return 1; - } EXPORT_SYMBOL_GPL(uisthread_start); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 35/69] staging: unisys: fix spacing in uisutils.c
Fix as many spacing problems as possible by indenting lines properly and getting rid of spaces between typecasts and their targets. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisutils.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c index 941f007..5865df7 100644 --- a/drivers/staging/unisys/uislib/uisutils.c +++ b/drivers/staging/unisys/uislib/uisutils.c @@ -48,7 +48,7 @@ atomic_t uisutils_registered_services = ATOMIC_INIT(0); int uisutil_add_proc_line_ex(int *total, char **buffer, int *buffer_remaining, - char *format, ...) +char *format, ...) { va_list args; int len; @@ -95,7 +95,7 @@ uisctrl_register_req_handler(int type, void *fptr, } if (chipset_driver_info) bus_device_info_init(chipset_driver_info, "chipset", "uislib", - VERSION, NULL); +VERSION, NULL); return 1; } @@ -147,7 +147,7 @@ Away: if (rc) { if (chipset_driver_info) bus_device_info_init(chipset_driver_info, "chipset", - "uislib", VERSION, NULL); +"uislib", VERSION, NULL); } else LOGERR("failed to register type %pUL.\n", &switch_uuid); @@ -163,7 +163,7 @@ uisctrl_unregister_req_handler_ex(uuid_le switch_uuid) LOGINF("type=%pUL.\n", &switch_uuid); if (req_handler_del(switch_uuid) < 0) { LOGERR("failed to remove %pUL from server list\n", - &switch_uuid); + &switch_uuid); goto Away; } atomic_dec(&uisutils_registered_services); @@ -213,10 +213,10 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in, frags[count].pi_pfn = page_to_pfn(virt_to_page(skb->data + offset)); frags[count].pi_off = - (unsigned long) (skb->data + offset) & PI_PAGE_MASK; + (unsigned long)(skb->data + offset) & PI_PAGE_MASK; size = min(firstfraglen, - (unsigned int) (PI_PAGE_SIZE - frags[count].pi_off)); + (unsigned int)(PI_PAGE_SIZE - frags[count].pi_off)); /* can take smallest of firstfraglen(what's left) OR * bytes left in the page */ @@ -230,7 +230,7 @@ uisutil_copy_fragsinfo_from_skb(unsigned char *calling_ctx, void *skb_in, if ((count + numfrags) > frags_max) { LOGERR(" FAILED %s frags array too small: max:%d count+nr_frags:%d\n", -calling_ctx, frags_max, count + numfrags); + calling_ctx, frags_max, count + numfrags); return -1; /* failure */ } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 31/69] staging: unisys: fix spacing in uisqueue.c
Correct alignment for a couple of functions and remove the space between a typecast and its target. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c index 69151e4..9869c9f 100644 --- a/drivers/staging/unisys/uislib/uisqueue.c +++ b/drivers/staging/unisys/uislib/uisqueue.c @@ -226,7 +226,7 @@ EXPORT_SYMBOL_GPL(spar_signalqueue_empty); unsigned long long uisqueue_interlocked_or(unsigned long long __iomem *tgt, - unsigned long long set) + unsigned long long set) { unsigned long long i; unsigned long long j; @@ -244,7 +244,7 @@ EXPORT_SYMBOL_GPL(uisqueue_interlocked_or); unsigned long long uisqueue_interlocked_and(unsigned long long __iomem *tgt, - unsigned long long set) +unsigned long long set) { unsigned long long i; unsigned long long j; @@ -294,7 +294,7 @@ uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo, char oktowait, u8 *channel_id) { while (!do_locked_client_insert(queueinfo, whichqueue, cmdrsp, - (spinlock_t *) insertlock, + (spinlock_t *)insertlock, issue_irq_if_empty, irq_handle, channel_id)) { if (oktowait != OK_TO_WAIT) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 07/69] staging: unisys: clean up typecasts in uislib.c
Remove all extraneous spaces from typecasts in uislib.c. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 42 +- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 9bcaa0f..c28d6f3 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -136,8 +136,8 @@ init_vbus_channel(u64 channelAddr, u32 channelBytes) if (!pChan) { LOGERR("CONTROLVM_BUS_CREATE error: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed", -(unsigned long long) channelAddr, -(unsigned long long) channelBytes); +(unsigned long long)channelAddr, +(unsigned long long)channelBytes); rc = NULL; goto Away; } @@ -194,10 +194,10 @@ create_bus(struct controlvm_message *msg, char *buf) bus->local_vnic = 1; } else bus->bus_no = bus->guest_handle = busNo; - sprintf(bus->name, "%d", (int) bus->bus_no); + sprintf(bus->name, "%d", (int)bus->bus_no); bus->device_count = deviceCount; bus->device = - (struct device_info **) ((char *) bus + sizeof(struct bus_info)); + (struct device_info **)((char *)bus + sizeof(struct bus_info)); bus->bus_inst_uuid = msg->cmd.create_bus.bus_inst_uuid; bus->bus_channel_bytes = 0; bus->bus_channel = NULL; @@ -373,7 +373,7 @@ create_device(struct controlvm_message *msg, char *buf) dev->bus_no = busNo; dev->dev_no = devNo; sema_init(&dev->interrupt_callback_lock, 1);/* unlocked */ - sprintf(dev->devid, "vbus%u:dev%u", (unsigned) busNo, (unsigned) devNo); + sprintf(dev->devid, "vbus%u:dev%u", (unsigned)busNo, (unsigned)devNo); /* map the channel memory for the device. */ if (msg->hdr.flags.test_message) dev->chanptr = (void __iomem *)__va(dev->channel_addr); @@ -955,7 +955,7 @@ uislib_client_inject_add_vhba(u32 bus_no, u32 dev_no, msg.cmd.create_device.channel_addr = phys_chan_addr; if (chan_bytes < MIN_IO_CHANNEL_SIZE) { LOGERR("wrong channel size.chan_bytes = 0x%x IO_CHANNEL_SIZE= 0x%x\n", -chan_bytes, (unsigned int) MIN_IO_CHANNEL_SIZE); +chan_bytes, (unsigned int)MIN_IO_CHANNEL_SIZE); POSTCODE_LINUX_4(VHBA_CREATE_FAILURE_PC, chan_bytes, MIN_IO_CHANNEL_SIZE, POSTCODE_SEVERITY_ERR); return 0; @@ -1014,7 +1014,7 @@ uislib_client_inject_add_vnic(u32 bus_no, u32 dev_no, msg.cmd.create_device.channel_addr = phys_chan_addr; if (chan_bytes < MIN_IO_CHANNEL_SIZE) { LOGERR("wrong channel size.chan_bytes = 0x%x IO_CHANNEL_SIZE= 0x%x\n", -chan_bytes, (unsigned int) MIN_IO_CHANNEL_SIZE); +chan_bytes, (unsigned int)MIN_IO_CHANNEL_SIZE); POSTCODE_LINUX_4(VNIC_CREATE_FAILURE_PC, chan_bytes, MIN_IO_CHANNEL_SIZE, POSTCODE_SEVERITY_ERR); return 0; @@ -1225,14 +1225,14 @@ find_dev(u32 busNo, u32 devNo) if (devNo >= bus->device_count) { LOGERR("%s bad busNo, devNo=%d,%d", __func__, - (int) (busNo), (int) (devNo)); + (int)(busNo), (int)(devNo)); goto Away; } dev = bus->device[devNo]; if (!dev) LOGERR("%s bad busNo, devNo=%d,%d", __func__, - (int) (busNo), (int) (devNo)); + (int)(busNo), (int)(devNo)); goto Away; } } @@ -1396,8 +1396,8 @@ uislib_enable_channel_interrupts(u32 bus_no, u32 dev_no, dev = find_dev(bus_no, dev_no); if (!dev) { - LOGERR("%s busNo=%d, devNo=%d", __func__, (int) (bus_no), - (int) (dev_no)); + LOGERR("%s busNo=%d, devNo=%d", __func__, (int)(bus_no), + (int)(dev_no)); return; } down(&Lock_Polling_Device_Channels); @@ -1421,8 +1421,8 @@ uislib_disable_channel_interrupts(u32 bus_no, u32 dev_no) dev = find_dev(bus_no, dev_no); if (!dev) { - LOGERR("%s busNo=%d, devNo=%d", __func__, (int) (bus_no), - (int) (dev_no)); + LOGERR("%s busNo=%d, devNo=%d", __func__, (int)(bus_no), + (int)(dev_no)); return; } d
[PATCH 26/69] staging: unisys: refactor info_debugfs_read()
Fix the function declaration so the type is on the same line as the name, and fix the CamelCase local variable name: TotalBytes => total_bytes Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index d251822..614919c 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1154,12 +1154,11 @@ err_done: return -1; } -static ssize_t -info_debugfs_read(struct file *file, char __user *buf, - size_t len, loff_t *offset) +static ssize_t info_debugfs_read(struct file *file, char __user *buf, +size_t len, loff_t *offset) { char *temp; - int totalBytes = 0; + int total_bytes = 0; int remaining_bytes = PROC_READ_BUFFER_SIZE; /* *start = buf; */ @@ -1178,14 +1177,14 @@ info_debugfs_read(struct file *file, char __user *buf, if ((*offset == 0) || (!debug_buf_valid)) { DBGINF("calling info_debugfs_read_helper.\n"); /* if the read fails, then -1 will be returned */ - totalBytes = info_debugfs_read_helper(&temp, &remaining_bytes); + total_bytes = info_debugfs_read_helper(&temp, &remaining_bytes); debug_buf_valid = 1; } else { - totalBytes = strlen(debug_buf); + total_bytes = strlen(debug_buf); } return simple_read_from_buffer(buf, len, offset, - debug_buf, totalBytes); + debug_buf, total_bytes); } static struct device_info * -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 49/69] staging: unisys: visorchannel: Describe spinlocks in VISORCHANNEL_Tag struct
From: Bryan Thompson Add comments indicating the requirements and use of the insert_lock and remove_lock in the VISORCHANNEL_Tag structure. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchannel/visorchannel_funcs.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 1568b95..1ce25c2 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -33,9 +33,10 @@ struct VISORCHANNEL_Tag { struct channel_header chan_hdr; uuid_le guid; ulong size; - BOOL needs_lock; - spinlock_t insert_lock; - spinlock_t remove_lock; + BOOL needs_lock;/* channel creator knows if more than one +* thread will be inserting or removing */ + spinlock_t insert_lock; /* protect head writes in chan_hdr */ + spinlock_t remove_lock; /* protect tail writes in chan_hdr */ struct { struct signal_queue_header req_queue; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 42/69] staging: unisys: fix CamelCase global variables in file.c
Fix CamelCase names: Cdev => file_cdev PControlVm_channel => file_controlvm_channel MajorDev => majordev Registered => registered Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 54 +++--- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index cb5bcb9..f4d01ed 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -28,10 +28,10 @@ #define CURRENT_FILE_PC VISOR_CHIPSET_PC_file_c -static struct cdev Cdev; -static VISORCHANNEL **PControlVm_channel; -static dev_t MajorDev = -1; /**< indicates major num for device */ -static BOOL Registered = FALSE; +static struct cdev file_cdev; +static VISORCHANNEL **file_controlvm_channel; +static dev_t majordev = -1; /**< indicates major num for device */ +static BOOL registered = FALSE; static int visorchipset_open(struct inode *inode, struct file *file); static int visorchipset_release(struct inode *inode, struct file *file); @@ -61,50 +61,50 @@ int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel) { int rc = 0; - PControlVm_channel = controlvm_channel; - MajorDev = major_dev; - cdev_init(&Cdev, &visorchipset_fops); - Cdev.owner = THIS_MODULE; - if (MAJOR(MajorDev) == 0) { + file_controlvm_channel = controlvm_channel; + majordev = major_dev; + cdev_init(&file_cdev, &visorchipset_fops); + file_cdev.owner = THIS_MODULE; + if (MAJOR(majordev) == 0) { /* dynamic major device number registration required */ - if (alloc_chrdev_region(&MajorDev, 0, 1, MYDRVNAME) < 0) { + if (alloc_chrdev_region(&majordev, 0, 1, MYDRVNAME) < 0) { ERRDRV("Unable to allocate+register char device %s", MYDRVNAME); return -1; } - Registered = TRUE; - INFODRV("New major number %d registered\n", MAJOR(MajorDev)); + registered = TRUE; + INFODRV("New major number %d registered\n", MAJOR(majordev)); } else { /* static major device number registration required */ - if (register_chrdev_region(MajorDev, 1, MYDRVNAME) < 0) { + if (register_chrdev_region(majordev, 1, MYDRVNAME) < 0) { ERRDRV("Unable to register char device %s", MYDRVNAME); return -1; } - Registered = TRUE; - INFODRV("Static major number %d registered\n", MAJOR(MajorDev)); + registered = TRUE; + INFODRV("Static major number %d registered\n", MAJOR(majordev)); } - rc = cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1); + rc = cdev_add(&file_cdev, MKDEV(MAJOR(majordev), 0), 1); if (rc < 0) { ERRDRV("failed to create char device: (status=%d)\n", rc); return -1; } INFODRV("Registered char device for %s (major=%d)", - MYDRVNAME, MAJOR(MajorDev)); + MYDRVNAME, MAJOR(majordev)); return 0; } void visorchipset_file_cleanup(void) { - if (Cdev.ops != NULL) - cdev_del(&Cdev); - Cdev.ops = NULL; - if (Registered) { - if (MAJOR(MajorDev) >= 0) { - unregister_chrdev_region(MajorDev, 1); - MajorDev = MKDEV(0, 0); + if (file_cdev.ops != NULL) + cdev_del(&file_cdev); + file_cdev.ops = NULL; + if (registered) { + if (MAJOR(majordev) >= 0) { + unregister_chrdev_region(majordev, 1); + majordev = MKDEV(0, 0); } - Registered = FALSE; + registered = FALSE; } } @@ -148,11 +148,11 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) switch (offset) { case VISORCHIPSET_MMAP_CONTROLCHANOFFSET: vma->vm_flags |= VM_IO; - if (*PControlVm_channel == NULL) { + if (*file_controlvm_channel == NULL) { ERRDRV("%s no controlvm channel yet", __func__); return -ENXIO; } - visorchannel_read(*PControlVm_channel, + visorchannel_read(*file_controlvm_channel, offsetof(struct spar_controlvm_channel_protocol, gp_control_channel), &addr, sizeof(addr)); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 40/69] staging: unisys: refactor req_handler_add()
Fix the CamelCase parameter names: Server_Channel_Ok => server_channel_ok Server_Channel_Init => server_channel_init clientStr => clientstr clientStrLen => clientstr_len And remove the extra parenthesis in the list_add_tail() call at the end. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisutils.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c index 4f89b2c..d9f527d 100644 --- a/drivers/staging/unisys/uislib/uisutils.c +++ b/drivers/staging/unisys/uislib/uisutils.c @@ -269,9 +269,10 @@ req_handler_add(uuid_le switch_uuid, const char *switch_type_name, int (*controlfunc)(struct io_msgs *), unsigned long min_channel_bytes, - int (*Server_Channel_Ok)(unsigned long channelBytes), - int (*Server_Channel_Init) - (void *x, unsigned char *clientStr, u32 clientStrLen, u64 bytes)) + int (*server_channel_ok)(unsigned long channel_bytes), + int (*server_channel_init) + (void *x, unsigned char *clientstr, u32 clientstr_len, + u64 bytes)) { struct req_handler_info *rc = NULL; @@ -281,13 +282,13 @@ req_handler_add(uuid_le switch_uuid, rc->switch_uuid = switch_uuid; rc->controlfunc = controlfunc; rc->min_channel_bytes = min_channel_bytes; - rc->server_channel_ok = Server_Channel_Ok; - rc->server_channel_init = Server_Channel_Init; + rc->server_channel_ok = server_channel_ok; + rc->server_channel_init = server_channel_init; if (switch_type_name) strncpy(rc->switch_type_name, switch_type_name, sizeof(rc->switch_type_name) - 1); spin_lock(&req_handler_info_list_lock); - list_add_tail(&(rc->list_link), &req_handler_info_list); + list_add_tail(&rc->list_link, &req_handler_info_list); spin_unlock(&req_handler_info_list_lock); return rc; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 48/69] staging: unisys: visorchannel: Rename CamelCase variable nQueues
From: Bryan Thompson Rename the visorchannel_debug parameter nQueues to num_queues. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchannel/visorchannel.h | 2 +- drivers/staging/unisys/visorchannel/visorchannel_funcs.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5dbfddb..3f2184c 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -68,7 +68,7 @@ u64 visorchannel_get_clientpartition(VISORCHANNEL *channel); uuid_le visorchannel_get_uuid(VISORCHANNEL *channel); struct memregion *visorchannel_get_memregion(VISORCHANNEL *channel); char *visorchannel_uuid_id(uuid_le *guid, char *s); -void visorchannel_debug(VISORCHANNEL *channel, int nQueues, +void visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off); void visorchannel_dump_section(VISORCHANNEL *chan, char *s, int off, int len, struct seq_file *seq); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 6601b3e..1568b95 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -565,7 +565,7 @@ sigqueue_debug(struct signal_queue_header *q, int which, struct seq_file *seq) } void -visorchannel_debug(VISORCHANNEL *channel, int nQueues, +visorchannel_debug(VISORCHANNEL *channel, int num_queues, struct seq_file *seq, u32 off) { HOSTADDRESS addr = 0; @@ -625,7 +625,7 @@ visorchannel_debug(VISORCHANNEL *channel, int nQueues, if ((phdr->ch_space_offset == 0) || (errcode < 0)) ; else - for (i = 0; i < nQueues; i++) { + for (i = 0; i < num_queues; i++) { struct signal_queue_header q; errcode = visorchannel_read(channel, -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 32/69] staging: unisys: fix CamelCase names in do_locked_client_insert()
Fix CamelCase names: pSignal => signal Remove unused parameters issueInterruptIfEmpty and interruptHandle, and update callers of this function. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisqueue.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c index 9869c9f..71bb7b6 100644 --- a/drivers/staging/unisys/uislib/uisqueue.c +++ b/drivers/staging/unisys/uislib/uisqueue.c @@ -263,22 +263,21 @@ EXPORT_SYMBOL_GPL(uisqueue_interlocked_and); static u8 do_locked_client_insert(struct uisqueue_info *queueinfo, unsigned int whichqueue, - void *pSignal, + void *signal, spinlock_t *lock, - unsigned char issueInterruptIfEmpty, - u64 interruptHandle, u8 *channelId) + u8 *channel_id) { unsigned long flags; u8 rc = 0; spin_lock_irqsave(lock, flags); - if (!spar_channel_client_acquire_os(queueinfo->chan, channelId)) + if (!spar_channel_client_acquire_os(queueinfo->chan, channel_id)) goto unlock; - if (spar_signal_insert(queueinfo->chan, whichqueue, pSignal)) { + if (spar_signal_insert(queueinfo->chan, whichqueue, signal)) { queueinfo->packets_sent++; rc = 1; } - spar_channel_client_release_os(queueinfo->chan, channelId); + spar_channel_client_release_os(queueinfo->chan, channel_id); unlock: spin_unlock_irqrestore((spinlock_t *)lock, flags); return rc; @@ -295,8 +294,7 @@ uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo, { while (!do_locked_client_insert(queueinfo, whichqueue, cmdrsp, (spinlock_t *)insertlock, - issue_irq_if_empty, - irq_handle, channel_id)) { + channel_id)) { if (oktowait != OK_TO_WAIT) { LOGERR("FAILED visor_signal_insert failed; cannot wait; insert aborted\n"); return 0; /* failed to queue */ -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 23/69] staging: unisys: refactor destroy_device()
Fix the function declaration so it is a single line. Rename CamelCase local variable names: busNo => bus_no devNo => dev_no Fix use of uuid_le_cmp() to check for 0 instead of using !uuid_le_cmp(). Fix spelling error DESTORY to correctly read DESTROY. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 40 +- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index ca52f47..4f6f2c9 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -661,33 +661,33 @@ static int resume_device(struct controlvm_message *msg) return retval; } -static int -destroy_device(struct controlvm_message *msg, char *buf) +static int destroy_device(struct controlvm_message *msg, char *buf) { - u32 busNo, devNo; + u32 bus_no, dev_no; struct bus_info *bus; struct device_info *dev; struct guest_msgs cmd; int retval = CONTROLVM_RESP_SUCCESS; - busNo = msg->cmd.destroy_device.bus_no; - devNo = msg->cmd.destroy_device.bus_no; + bus_no = msg->cmd.destroy_device.bus_no; + dev_no = msg->cmd.destroy_device.bus_no; read_lock(&bus_list_lock); - LOGINF("destroy_device called for busNo=%u, devNo=%u", busNo, devNo); + LOGINF("destroy_device called for bus_no=%u, dev_no=%u", bus_no, + dev_no); for (bus = bus_list; bus; bus = bus->next) { - if (bus->bus_no == busNo) { + if (bus->bus_no == bus_no) { /* make sure the device number is valid */ - if (devNo >= bus->device_count) { - LOGERR("CONTROLVM_DEVICE_DESTORY Failed: device(%d) >= deviceCount(%d).", - devNo, bus->device_count); + if (dev_no >= bus->device_count) { + LOGERR("CONTROLVM_DEVICE_DESTROY Failed: device(%d) >= device_count(%d).", + dev_no, bus->device_count); retval = CONTROLVM_RESP_ERROR_DEVICE_INVALID; } else { /* make sure this device exists */ - dev = bus->device[devNo]; + dev = bus->device[dev_no]; if (!dev) { LOGERR("CONTROLVM_DEVICE_DESTROY Failed: device %d does not exist.", - devNo); + dev_no); retval = CONTROLVM_RESP_ERROR_ALREADY_DONE; } @@ -698,7 +698,7 @@ destroy_device(struct controlvm_message *msg, char *buf) if (!bus) { LOGERR("CONTROLVM_DEVICE_DESTROY Failed: bus %d does not exist", - busNo); + bus_no); retval = CONTROLVM_RESP_ERROR_BUS_INVALID; } read_unlock(&bus_list_lock); @@ -706,12 +706,12 @@ destroy_device(struct controlvm_message *msg, char *buf) /* the msg is bound for virtpci; send * guest_msgs struct to callback */ - if (!uuid_le_cmp(dev->channel_uuid, -spar_vhba_channel_protocol_uuid)) { + if (uuid_le_cmp(dev->channel_uuid, + spar_vhba_channel_protocol_uuid) == 0) { cmd.msgtype = GUEST_DEL_VHBA; cmd.del_vhba.chanptr = dev->chanptr; - } else if (!uuid_le_cmp(dev->channel_uuid, - spar_vnic_channel_protocol_uuid)) { + } else if (uuid_le_cmp(dev->channel_uuid, + spar_vnic_channel_protocol_uuid) == 0) { cmd.msgtype = GUEST_DEL_VNIC; cmd.del_vnic.chanptr = dev->chanptr; } else { @@ -720,7 +720,7 @@ destroy_device(struct controlvm_message *msg, char *buf) CONTROLVM_RESP_ERROR_CHANNEL_TYPE_UNKNOWN; } if (!virt_control_chan_func) { - LOGERR("CONTROLVM_DEVICE_DESTORY Failed: virtpci callback not registered."); + LOGERR("CONTROLVM_DEVICE_DESTROY Failed: virtpci callback not registered."); return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE; } @@ -736,7 +736,7 @@ destroy_device(struct controlvm_message *msg, char *buf) */ if (dev->polling) { LOGINF("calling uislib_disable_channel_interrupts"); - uisli
[PATCH 30/69] staging: unisys: fix CamelCase Work queue name in uislib.c
Fix CamelCase name: Work_wakeup_polling_device_channels => work_wakeup_polling_device_channels Update references to use the new name. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 29c12a3..a9eedde 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1414,7 +1414,7 @@ do_wakeup_polling_device_channels(struct work_struct *dummy) } } -static DECLARE_WORK(Work_wakeup_polling_device_channels, +static DECLARE_WORK(work_wakeup_polling_device_channels, do_wakeup_polling_device_channels); /* Call this function when you want to send a hint to process_incoming() that @@ -1432,7 +1432,7 @@ uislib_force_channel_interrupt(u32 bus_no, u32 dev_no) * the process_incoming() thread. */ tot_wakeup_cnt++; - schedule_work(&Work_wakeup_polling_device_channels); + schedule_work(&work_wakeup_polling_device_channels); } EXPORT_SYMBOL_GPL(uislib_force_channel_interrupt); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 19/69] staging: unisys: fix CamelCase in destroy_bus()
Fix the CamelCase local variable: busNo => bus_no Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 9c995c5..ab72e81 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -272,15 +272,15 @@ destroy_bus(struct controlvm_message *msg, char *buf) int i; struct bus_info *bus, *prev = NULL; struct guest_msgs cmd; - u32 busNo; + u32 bus_no; - busNo = msg->cmd.destroy_bus.bus_no; + bus_no = msg->cmd.destroy_bus.bus_no; read_lock(&bus_list_lock); bus = bus_list; while (bus) { - if (bus->bus_no == busNo) + if (bus->bus_no == bus_no) break; prev = bus; bus = bus->next; @@ -288,7 +288,7 @@ destroy_bus(struct controlvm_message *msg, char *buf) if (!bus) { LOGERR("CONTROLVM_BUS_DESTROY Failed: failed to find bus %d.\n", - busNo); + bus_no); read_unlock(&bus_list_lock); return CONTROLVM_RESP_ERROR_ALREADY_DONE; } @@ -297,7 +297,7 @@ destroy_bus(struct controlvm_message *msg, char *buf) for (i = 0; i < bus->device_count; i++) { if (bus->device[i] != NULL) { LOGERR("CONTROLVM_BUS_DESTROY Failed: device %i attached to bus %d.", - i, busNo); + i, bus_no); read_unlock(&bus_list_lock); return CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED; } @@ -310,7 +310,7 @@ destroy_bus(struct controlvm_message *msg, char *buf) /* client messages require us to call the virtpci callback associated with this bus. */ cmd.msgtype = GUEST_DEL_VBUS; - cmd.del_vbus.bus_no = busNo; + cmd.del_vbus.bus_no = bus_no; if (!virt_control_chan_func) { LOGERR("CONTROLVM_BUS_DESTROY Failed: virtpci callback not registered."); return CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_FAILURE; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 16/69] staging: unisys: fix CamelCase global variable names in uislib.c
Fix CamelCase names: ProcReadBufferValid => debug_buf_valid ProcReadBuffer => debug_buf BusListHead => bus_list BusListLock => bus_list_lock BusListCount => bus_list_count MaxBusCount => max_bus_count PhysicalDataChan => phys_data_chan PlatformNumber => platform_no Incoming_ThreadInfo => incoming_ti Incoming_Thread_Started => incoming_started List_Polling_Device_Channels => poll_dev_chan Lock_Polling_Device_Channels => poll_dev_lock Wakeup_Polling_Device_Channels => poll_dev_wake_q Go_Polling_Device_Channels => poll_dev_start Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 210 - 1 file changed, 105 insertions(+), 105 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 0f33ac6..ead0290 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -58,8 +58,8 @@ /* global function pointers that act as callback functions into virtpcimod */ int (*virt_control_chan_func)(struct guest_msgs *); -static int ProcReadBufferValid; -static char *ProcReadBuffer; /* Note this MUST be global, +static int debug_buf_valid; +static char *debug_buf;/* Note this MUST be global, * because the contents must */ static unsigned int chipset_inited; @@ -70,24 +70,24 @@ static unsigned int chipset_inited; UIS_THREAD_WAIT;\ } while (1) -static struct bus_info *BusListHead; -static rwlock_t BusListLock; -static int BusListCount; /* number of buses in the list */ -static int MaxBusCount;/* maximum number of buses expected */ -static u64 PhysicalDataChan; -static int PlatformNumber; +static struct bus_info *bus_list; +static rwlock_t bus_list_lock; +static int bus_list_count; /* number of buses in the list */ +static int max_bus_count; /* maximum number of buses expected */ +static u64 phys_data_chan; +static int platform_no; -static struct uisthread_info Incoming_ThreadInfo; -static BOOL Incoming_Thread_Started = FALSE; -static LIST_HEAD(List_Polling_Device_Channels); +static struct uisthread_info incoming_ti; +static BOOL incoming_started = FALSE; +static LIST_HEAD(poll_dev_chan); static unsigned long long tot_moved_to_tail_cnt; static unsigned long long tot_wait_cnt; static unsigned long long tot_wakeup_cnt; static unsigned long long tot_schedule_cnt; static int en_smart_wakeup = 1; -static DEFINE_SEMAPHORE(Lock_Polling_Device_Channels); /* unlocked */ -static DECLARE_WAIT_QUEUE_HEAD(Wakeup_Polling_Device_Channels); -static int Go_Polling_Device_Channels; +static DEFINE_SEMAPHORE(poll_dev_lock);/* unlocked */ +static DECLARE_WAIT_QUEUE_HEAD(poll_dev_wake_q); +static int poll_dev_start; #define CALLHOME_PROC_ENTRY_FN "callhome" #define CALLHOME_THROTTLED_PROC_ENTRY_FN "callhome_throttled" @@ -159,10 +159,10 @@ create_bus(struct controlvm_message *msg, char *buf) struct bus_info *tmp, *bus; size_t size; - if (MaxBusCount == BusListCount) { + if (max_bus_count == bus_list_count) { LOGERR("CONTROLVM_BUS_CREATE Failed: max buses:%d already created\n", - MaxBusCount); - POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, MaxBusCount, + max_bus_count); + POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, max_bus_count, POSTCODE_SEVERITY_ERR); return CONTROLVM_RESP_ERROR_MAX_BUSES; } @@ -205,12 +205,12 @@ create_bus(struct controlvm_message *msg, char *buf) bus->bus_channel = NULL; /* add bus to our bus list - but check for duplicates first */ - read_lock(&BusListLock); - for (tmp = BusListHead; tmp; tmp = tmp->next) { + read_lock(&bus_list_lock); + for (tmp = bus_list; tmp; tmp = tmp->next) { if (tmp->bus_no == bus->bus_no) break; } - read_unlock(&BusListLock); + read_unlock(&bus_list_lock); if (tmp) { /* found a bus already in the list with same busNo - * reject add @@ -257,15 +257,15 @@ create_bus(struct controlvm_message *msg, char *buf) } /* add bus at the head of our list */ - write_lock(&BusListLock); - if (!BusListHead) { - BusListHead = bus; + write_lock(&bus_list_lock); + if (!bus_list) { + bus_list = bus; } else { - bus->next = BusListHead; - BusListHead = bus; + bus->next = bus_list; + bus_list = bus; } - BusListCount++; - write_unlock(&BusListLock); + bus_list_count++; + write_unlock(&bus_list_lock); POSTCODE_LINUX_3(BUS_CREATE_EXIT_PC, bus->bus_no, POSTCODE_SEVERITY_INFO); @@ -282,9 +282,9 @@ destroy_bus
[PATCH 41/69] staging: unisys: refactor visorchipset_file_init()
Fix the declaration so it is a single line. Fix CamelCase parameter names: MajorDev => major_dev pControlVm_channel => controlvm_channel Remove the unnecessary gotos and just return directly in error cases. Fix the last error condition so it returns the result of cdev_add() instead of always zero. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 22 ++ drivers/staging/unisys/visorchipset/file.h | 2 +- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index 373fa36..cb5bcb9 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -57,13 +57,12 @@ static const struct file_operations visorchipset_fops = { .mmap = visorchipset_mmap, }; -int -visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel) +int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel) { - int rc = -1; + int rc = 0; - PControlVm_channel = pControlVm_channel; - MajorDev = majorDev; + PControlVm_channel = controlvm_channel; + MajorDev = major_dev; cdev_init(&Cdev, &visorchipset_fops); Cdev.owner = THIS_MODULE; if (MAJOR(MajorDev) == 0) { @@ -71,7 +70,7 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel) if (alloc_chrdev_region(&MajorDev, 0, 1, MYDRVNAME) < 0) { ERRDRV("Unable to allocate+register char device %s", MYDRVNAME); - goto Away; + return -1; } Registered = TRUE; INFODRV("New major number %d registered\n", MAJOR(MajorDev)); @@ -79,20 +78,19 @@ visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel) /* static major device number registration required */ if (register_chrdev_region(MajorDev, 1, MYDRVNAME) < 0) { ERRDRV("Unable to register char device %s", MYDRVNAME); - goto Away; + return -1; } Registered = TRUE; INFODRV("Static major number %d registered\n", MAJOR(MajorDev)); } - if (cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1) < 0) { + rc = cdev_add(&Cdev, MKDEV(MAJOR(MajorDev), 0), 1); + if (rc < 0) { ERRDRV("failed to create char device: (status=%d)\n", rc); - goto Away; + return -1; } INFODRV("Registered char device for %s (major=%d)", MYDRVNAME, MAJOR(MajorDev)); - rc = 0; -Away: - return rc; + return 0; } void diff --git a/drivers/staging/unisys/visorchipset/file.h b/drivers/staging/unisys/visorchipset/file.h index 21bb906..fb434eb 100644 --- a/drivers/staging/unisys/visorchipset/file.h +++ b/drivers/staging/unisys/visorchipset/file.h @@ -20,7 +20,7 @@ #include "globals.h" -int visorchipset_file_init(dev_t majorDev, VISORCHANNEL **pControlVm_channel); +int visorchipset_file_init(dev_t major_dev, VISORCHANNEL **controlvm_channel); void visorchipset_file_cleanup(void); #endif -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 12/69] staging: unisys: add missing brackets in info_debugfs_read()
The if statement in info_debugfs_read() needs another set of brackets for the else clause. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index e255f1f..0930919 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1202,8 +1202,9 @@ info_debugfs_read(struct file *file, char __user *buf, /* if the read fails, then -1 will be returned */ totalBytes = info_debugfs_read_helper(&temp, &remaining_bytes); ProcReadBufferValid = 1; - } else + } else { totalBytes = strlen(ProcReadBuffer); + } return simple_read_from_buffer(buf, len, offset, ProcReadBuffer, totalBytes); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 28/69] staging: unisys: rename Process_Incoming()
Fix the CamelCase function name: Process_Incoming => process_incoming Update all references to use the new name. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 908ec49..3b81bbf 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1234,8 +1234,7 @@ static struct device_info *find_dev(u32 bus_no, u32 dev_no) *less-busy ones. * */ -static int -Process_Incoming(void *v) +static int process_incoming(void *v) { unsigned long long cur_cycles, old_cycles, idle_cycles, delta_cycles; struct list_head *new_tail = NULL; @@ -1346,7 +1345,7 @@ Initialize_incoming_thread(void) if (incoming_started) return TRUE; if (!uisthread_start(&incoming_ti, -&Process_Incoming, NULL, "dev_incoming")) { +&process_incoming, NULL, "dev_incoming")) { LOGERR("uisthread_start Initialize_incoming_thread FAILED"); return FALSE; } @@ -1355,7 +1354,7 @@ Initialize_incoming_thread(void) } /* Add a new device/channel to the list being processed by - * Process_Incoming(). + * process_incoming(). * - indicates the function to call periodically. * - indicates the data to pass to the *function. @@ -1385,7 +1384,7 @@ uislib_enable_channel_interrupts(u32 bus_no, u32 dev_no, EXPORT_SYMBOL_GPL(uislib_enable_channel_interrupts); /* Remove a device/channel from the list being processed by - * Process_Incoming(). + * process_incoming(). */ void uislib_disable_channel_interrupts(u32 bus_no, u32 dev_no) @@ -1418,7 +1417,7 @@ do_wakeup_polling_device_channels(struct work_struct *dummy) static DECLARE_WORK(Work_wakeup_polling_device_channels, do_wakeup_polling_device_channels); -/* Call this function when you want to send a hint to Process_Incoming() that +/* Call this function when you want to send a hint to process_incoming() that * your device might have more requests. */ void @@ -1430,7 +1429,7 @@ uislib_force_channel_interrupt(u32 bus_no, u32 dev_no) return; /* The point of using schedule_work() instead of just doing * the work inline is to force a slight delay before waking up -* the Process_Incoming() thread. +* the process_incoming() thread. */ tot_wakeup_cnt++; schedule_work(&Work_wakeup_polling_device_channels); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 34/69] staging: unisys: fix line spacing in uisutils.c
Just remove the couple of extra blank lines. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisutils.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c index 4a5b867..941f007 100644 --- a/drivers/staging/unisys/uislib/uisutils.c +++ b/drivers/staging/unisys/uislib/uisutils.c @@ -42,7 +42,6 @@ atomic_t uisutils_registered_services = ATOMIC_INIT(0); * uisctrl_register_req_handler() or * uisctrl_register_req_handler_ex() */ - /*/ /* Utility functions */ /*/ @@ -255,7 +254,6 @@ dolist: if (skb_shinfo(skb)->frag_list) { for (skbinlist = skb_shinfo(skb)->frag_list; skbinlist; skbinlist = skbinlist->next) { - c = uisutil_copy_fragsinfo_from_skb("recursive", skbinlist, skbinlist->len - skbinlist->data_len, -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 37/69] staging: unisys: refactor uisctrl_register_req_handler_ex()
Fix CamelCase local variable name: pReqHandlerInfo => req_handler Get rid of the useless goto and just return straight away on an error. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisutils.c | 39 +++- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c index 6d13eb2..9ca10e9 100644 --- a/drivers/staging/unisys/uislib/uisutils.c +++ b/drivers/staging/unisys/uislib/uisutils.c @@ -112,46 +112,43 @@ uisctrl_register_req_handler_ex(uuid_le switch_uuid, u32 client_str_len, u64 bytes), struct ultra_vbus_deviceinfo *chipset_driver_info) { - struct req_handler_info *pReqHandlerInfo; - int rc = 0; /* assume failure */ + struct req_handler_info *req_handler; LOGINF("type=%pUL, controlfunc=0x%p.\n", &switch_uuid, controlfunc); if (!controlfunc) { LOGERR("%pUL: controlfunc must be supplied\n", &switch_uuid); - goto Away; + return 0; } if (!server_channel_ok) { LOGERR("%pUL: Server_Channel_Ok must be supplied\n", &switch_uuid); - goto Away; + return 0; } if (!server_channel_init) { LOGERR("%pUL: Server_Channel_Init must be supplied\n", &switch_uuid); - goto Away; + return 0; } - pReqHandlerInfo = req_handler_add(switch_uuid, - switch_type_name, - controlfunc, - min_channel_bytes, - server_channel_ok, server_channel_init); - if (!pReqHandlerInfo) { + req_handler = req_handler_add(switch_uuid, + switch_type_name, + controlfunc, + min_channel_bytes, + server_channel_ok, server_channel_init); + if (!req_handler) { LOGERR("failed to add %pUL to server list\n", &switch_uuid); - goto Away; + return 0; } atomic_inc(&uisutils_registered_services); - rc = 1; /* success */ -Away: - if (rc) { - if (chipset_driver_info) - bus_device_info_init(chipset_driver_info, "chipset", -"uislib", VERSION, NULL); - } else { - LOGERR("failed to register type %pUL.\n", &switch_uuid); + if (chipset_driver_info) { + bus_device_info_init(chipset_driver_info, "chipset", +"uislib", VERSION, NULL); + return 1; } - return rc; + + LOGERR("failed to register type %pUL.\n", &switch_uuid); + return 0; } EXPORT_SYMBOL_GPL(uisctrl_register_req_handler_ex); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 65/69] staging: unisys: virthba: Fix a couple open parenthesis alignment issues
From: Ken Depro This patch fixes a couple checkpatch checks where alignment of the parameters did not match the open parenthesis of the function. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 4af52e4..8dd808d 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -1284,7 +1284,8 @@ drain_queue(struct virthba_info *virthbainfo, struct chaninfo *dc, * deletion */ scsicmd = del_scsipending_entry(virthbainfo, - (uintptr_t)cmdrsp->scsi.scsicmd); + (uintptr_t) +cmdrsp->scsi.scsicmd); if (!scsicmd) break; /* complete the orig cmd */ @@ -1303,7 +1304,8 @@ drain_queue(struct virthba_info *virthbainfo, struct chaninfo *dc, process_disk_notify(shost, cmdrsp); } else if (cmdrsp->cmdtype == CMD_VDISKMGMT_TYPE) { if (!del_scsipending_entry(virthbainfo, - (uintptr_t)cmdrsp->vdiskmgmt.scsicmd)) + (uintptr_t) + cmdrsp->vdiskmgmt.scsicmd)) break; complete_vdiskmgmt_command(cmdrsp); } else { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 43/69] staging: unisys: get rid of HAVE_UNLOCKED_IOCTL code
We definitely have it, so there's no point in keeping the older stuff around. Get rid of the #ifdefs and old code. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index f4d01ed..4b0c158 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -36,23 +36,14 @@ static BOOL registered = FALSE; static int visorchipset_open(struct inode *inode, struct file *file); static int visorchipset_release(struct inode *inode, struct file *file); static int visorchipset_mmap(struct file *file, struct vm_area_struct *vma); -#ifdef HAVE_UNLOCKED_IOCTL long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg); -#else -int visorchipset_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg); -#endif static const struct file_operations visorchipset_fops = { .owner = THIS_MODULE, .open = visorchipset_open, .read = NULL, .write = NULL, -#ifdef HAVE_UNLOCKED_IOCTL .unlocked_ioctl = visorchipset_ioctl, -#else - .ioctl = visorchipset_ioctl, -#endif .release = visorchipset_release, .mmap = visorchipset_mmap, }; @@ -178,14 +169,7 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) return 0; } -#ifdef HAVE_UNLOCKED_IOCTL -long -visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) -#else -int -visorchipset_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) -#endif +long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int rc = SUCCESS; s64 adjustment; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 22/69] staging: unisys: refactor resume_device()
Fix the function declaration so it is a single line. Fix CamelCase local variable names: busNo => bus_no devNo => dev_no Fix use of uuid_le_cmp() to check for 0 instead of using !uuid_le_cmp(). Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 35be4e6..ca52f47 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -593,32 +593,31 @@ static int pause_device(struct controlvm_message *msg) return retval; } -static int -resume_device(struct controlvm_message *msg) +static int resume_device(struct controlvm_message *msg) { - u32 busNo, devNo; + u32 bus_no, dev_no; struct bus_info *bus; struct device_info *dev; struct guest_msgs cmd; int retval = CONTROLVM_RESP_SUCCESS; - busNo = msg->cmd.device_change_state.bus_no; - devNo = msg->cmd.device_change_state.dev_no; + bus_no = msg->cmd.device_change_state.bus_no; + dev_no = msg->cmd.device_change_state.dev_no; read_lock(&bus_list_lock); for (bus = bus_list; bus; bus = bus->next) { - if (bus->bus_no == busNo) { + if (bus->bus_no == bus_no) { /* make sure the device number is valid */ - if (devNo >= bus->device_count) { + if (dev_no >= bus->device_count) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: device(%d) >= deviceCount(%d).", - devNo, bus->device_count); + dev_no, bus->device_count); retval = CONTROLVM_RESP_ERROR_DEVICE_INVALID; } else { /* make sure this device exists */ - dev = bus->device[devNo]; + dev = bus->device[dev_no]; if (!dev) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: device %d does not exist.", - devNo); + dev_no); retval = CONTROLVM_RESP_ERROR_ALREADY_DONE; } @@ -629,7 +628,7 @@ resume_device(struct controlvm_message *msg) if (!bus) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE:resume Failed: bus %d does not exist", - busNo); + bus_no); retval = CONTROLVM_RESP_ERROR_BUS_INVALID; } read_unlock(&bus_list_lock); @@ -637,12 +636,12 @@ resume_device(struct controlvm_message *msg) * guest_msgs struct to callback */ if (retval == CONTROLVM_RESP_SUCCESS) { - if (!uuid_le_cmp(dev->channel_uuid, -spar_vhba_channel_protocol_uuid)) { + if (uuid_le_cmp(dev->channel_uuid, + spar_vhba_channel_protocol_uuid) == 0) { cmd.msgtype = GUEST_RESUME_VHBA; cmd.resume_vhba.chanptr = dev->chanptr; - } else if (!uuid_le_cmp(dev->channel_uuid, - spar_vnic_channel_protocol_uuid)) { + } else if (uuid_le_cmp(dev->channel_uuid, + spar_vnic_channel_protocol_uuid) == 0) { cmd.msgtype = GUEST_RESUME_VNIC; cmd.resume_vnic.chanptr = dev->chanptr; } else { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 50/69] staging: unisys: Remove VISORCHANNEL typedef
From: Bryan Thompson Remove the VISORCHANNEL typedef and rename the base VISORCHANNEL_Tag structure to visorchannel to follow consistent naming. The longer struct visorchannel type required additional line wrapping to remain less than 81 characters. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchannel/visorchannel.h | 67 ++-- .../unisys/visorchannel/visorchannel_funcs.c | 72 +++--- drivers/staging/unisys/visorchipset/file.c | 5 +- drivers/staging/unisys/visorchipset/file.h | 3 +- .../unisys/visorchipset/visorchipset_main.c| 2 +- 5 files changed, 76 insertions(+), 73 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 3f2184c..63f1b97 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -29,49 +29,48 @@ #define BOOL int #endif -/* VISORCHANNEL is an opaque structure to users. - * Fields are declared only in the implementation .c files. - */ -typedef struct VISORCHANNEL_Tag VISORCHANNEL; - /* Note that for visorchannel_create() and visorchannel_create_overlapped(), * and arguments may be 0 if we are a channel CLIENT. * In this case, the values can simply be read from the channel header. */ -VISORCHANNEL *visorchannel_create(HOSTADDRESS physaddr, - ulong channel_bytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped(ulong channel_bytes, -VISORCHANNEL *parent, ulong off, -uuid_le guid); -VISORCHANNEL *visorchannel_create_with_lock(HOSTADDRESS physaddr, - ulong channel_bytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channel_bytes, - VISORCHANNEL *parent, - ulong off, uuid_le guid); -void visorchannel_destroy(VISORCHANNEL *channel); -int visorchannel_read(VISORCHANNEL *channel, ulong offset, +struct visorchannel *visorchannel_create(HOSTADDRESS physaddr, +ulong channel_bytes, uuid_le guid); +struct visorchannel *visorchannel_create_overlapped(ulong channel_bytes, + struct visorchannel *parent, + ulong off, uuid_le guid); +struct visorchannel *visorchannel_create_with_lock(HOSTADDRESS physaddr, + ulong channel_bytes, + uuid_le guid); +struct visorchannel *visorchannel_create_overlapped_with_lock( + ulong channel_bytes, + struct visorchannel *parent, + ulong off, uuid_le guid); +void visorchannel_destroy(struct visorchannel *channel); +int visorchannel_read(struct visorchannel *channel, ulong offset, void *local, ulong nbytes); -int visorchannel_write(VISORCHANNEL *channel, ulong offset, +int visorchannel_write(struct visorchannel *channel, ulong offset, void *local, ulong nbytes); -int visorchannel_clear(VISORCHANNEL *channel, ulong offset, +int visorchannel_clear(struct visorchannel *channel, ulong offset, u8 ch, ulong nbytes); -BOOL visorchannel_signalremove(VISORCHANNEL *channel, u32 queue, void *msg); -BOOL visorchannel_signalinsert(VISORCHANNEL *channel, u32 queue, void *msg); -int visorchannel_signalqueue_slots_avail(VISORCHANNEL *channel, u32 queue); -int visorchannel_signalqueue_max_slots(VISORCHANNEL *channel, u32 queue); - -HOSTADDRESS visorchannel_get_physaddr(VISORCHANNEL *channel); -ulong visorchannel_get_nbytes(VISORCHANNEL *channel); -char *visorchannel_id(VISORCHANNEL *channel, char *s); -char *visorchannel_zoneid(VISORCHANNEL *channel, char *s); -u64 visorchannel_get_clientpartition(VISORCHANNEL *channel); -uuid_le visorchannel_get_uuid(VISORCHANNEL *channel); -struct memregion *visorchannel_get_memregion(VISORCHANNEL *channel); +BOOL visorchannel_signalremove(struct visorchannel *channel, u32 queue, + void *msg); +BOOL visorchannel_signalinsert(struct visorchannel *channel, u32 queue, + void *msg); +int visorchannel_signalqueue_slots_avail(struct visorchannel *channel, +u32 queue); +int visorchannel_signalqueue_max_slots(struct visorchannel *channel, u32 queue); +HOSTADDRESS visorchannel_get_physaddr(struct visorchannel *channel); +ulong visorchannel_get_nbytes(struct visorchannel *channel); +char *visorchannel_id(struct visorchannel *channel, char *s); +char *visorchannel_zoneid(struct visorchannel *channel, ch
[PATCH 27/69] staging: unisys: refactor find_dev()
Fix the function definition so that it is a single line. Fix CamelCase parameter names: busNo => bus_no devNo => dev_no Get rid of the goto and just break out of the for loop, since that does the exact same thing. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 614919c..908ec49 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1187,31 +1187,29 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf, debug_buf, total_bytes); } -static struct device_info * -find_dev(u32 busNo, u32 devNo) +static struct device_info *find_dev(u32 bus_no, u32 dev_no) { struct bus_info *bus; struct device_info *dev = NULL; read_lock(&bus_list_lock); for (bus = bus_list; bus; bus = bus->next) { - if (bus->bus_no == busNo) { + if (bus->bus_no == bus_no) { /* make sure the device number is valid */ - if (devNo >= bus->device_count) { - LOGERR("%s bad busNo, devNo=%d,%d", + if (dev_no >= bus->device_count) { + LOGERR("%s bad bus_no, dev_no=%d,%d", __func__, - (int)(busNo), (int)(devNo)); - goto Away; + (int)bus_no, (int)dev_no); + break; } - dev = bus->device[devNo]; + dev = bus->device[dev_no]; if (!dev) - LOGERR("%s bad busNo, devNo=%d,%d", + LOGERR("%s bad bus_no, dev_no=%d,%d", __func__, - (int)(busNo), (int)(devNo)); - goto Away; + (int)bus_no, (int)dev_no); + break; } } -Away: read_unlock(&bus_list_lock); return dev; } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 36/69] staging: unisys: fix brackets in uisctrl_register_req_handler_ex()
Add the missing brackets to the last if statement in this function. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c index 5865df7..6d13eb2 100644 --- a/drivers/staging/unisys/uislib/uisutils.c +++ b/drivers/staging/unisys/uislib/uisutils.c @@ -148,9 +148,9 @@ Away: if (chipset_driver_info) bus_device_info_init(chipset_driver_info, "chipset", "uislib", VERSION, NULL); - } else + } else { LOGERR("failed to register type %pUL.\n", &switch_uuid); - + } return rc; } EXPORT_SYMBOL_GPL(uisctrl_register_req_handler_ex); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 20/69] staging: unisys: refactor create_device()
OK, lets clean up this messy function. The entire thing is reflowed so spacing and indentation is correct. Tests that created extra indentation were swapped for equivalent negative tests that did not create extra indentation. Use of cmp_uuid_le() were fixed to test specifically for the zero case, and not to lazily use !cmp_uuid_le(). CamelCase local variable names were fixed: busNo => bus_no devNo => dev_no minSize => min_size pReqHandler => req_handler Away => cleanup Finally, the struct guest_msgs cmd declaration was moved to the beginning of the function, and cringing and wincing at the function was significantly reduced. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 250 - 1 file changed, 119 insertions(+), 131 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index ab72e81..09a4680 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -339,26 +339,26 @@ remove: return CONTROLVM_RESP_SUCCESS; } -static int -create_device(struct controlvm_message *msg, char *buf) +static int create_device(struct controlvm_message *msg, char *buf) { struct device_info *dev; struct bus_info *bus; - u32 busNo, devNo; + struct guest_msgs cmd; + u32 bus_no, dev_no; int result = CONTROLVM_RESP_SUCCESS; - u64 minSize = MIN_IO_CHANNEL_SIZE; - struct req_handler_info *pReqHandler; + u64 min_size = MIN_IO_CHANNEL_SIZE; + struct req_handler_info *req_handler; - busNo = msg->cmd.create_device.bus_no; - devNo = msg->cmd.create_device.dev_no; + bus_no = msg->cmd.create_device.bus_no; + dev_no = msg->cmd.create_device.dev_no; - POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, devNo, busNo, + POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, dev_no, bus_no, POSTCODE_SEVERITY_INFO); dev = kzalloc(sizeof(*dev), GFP_ATOMIC); if (!dev) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: kmalloc for dev failed.\n"); - POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, + POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, bus_no, POSTCODE_SEVERITY_ERR); return CONTROLVM_RESP_ERROR_KMALLOC_FAILED; } @@ -366,28 +366,28 @@ create_device(struct controlvm_message *msg, char *buf) dev->channel_uuid = msg->cmd.create_device.data_type_uuid; dev->intr = msg->cmd.create_device.intr; dev->channel_addr = msg->cmd.create_device.channel_addr; - dev->bus_no = busNo; - dev->dev_no = devNo; + dev->bus_no = bus_no; + dev->dev_no = dev_no; sema_init(&dev->interrupt_callback_lock, 1);/* unlocked */ - sprintf(dev->devid, "vbus%u:dev%u", (unsigned)busNo, (unsigned)devNo); + sprintf(dev->devid, "vbus%u:dev%u", (unsigned)bus_no, (unsigned)dev_no); /* map the channel memory for the device. */ if (msg->hdr.flags.test_message) { dev->chanptr = (void __iomem *)__va(dev->channel_addr); } else { - pReqHandler = req_handler_find(dev->channel_uuid); - if (pReqHandler) + req_handler = req_handler_find(dev->channel_uuid); + if (req_handler) /* generic service handler registered for this * channel */ - minSize = pReqHandler->min_channel_bytes; - if (minSize > msg->cmd.create_device.channel_bytes) { + min_size = req_handler->min_channel_bytes; + if (min_size > msg->cmd.create_device.channel_bytes) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: channel size is too small, channel size:0x%lx, required size:0x%lx", - (ulong) msg->cmd.create_device.channel_bytes, - (ulong) minSize); - POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, -POSTCODE_SEVERITY_ERR); + (ulong)msg->cmd.create_device.channel_bytes, + (ulong)min_size); + POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, dev_no, +bus_no, POSTCODE_SEVERITY_ERR); result = CONTROLVM_RESP_ERROR_CHANNEL_SIZE_TOO_SMALL; - goto Away; + goto cleanup; } dev->chanptr = uislib_ioremap_cache(dev->channel_addr, @@ -397,9 +397,9 @@ create_device(struct controlvm_message *msg, char *buf) dev->channel_addr, msg->cmd.create_device.channel_bytes);
[PATCH 45/69] staging: unisys: fix CamelCase in visorchipset_mmap()
Fix CamelCase name: physAddr => physaddr Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index d43c403..b82bc4a 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -121,7 +121,7 @@ visorchipset_release(struct inode *inode, struct file *file) static int visorchipset_mmap(struct file *file, struct vm_area_struct *vma) { - ulong physAddr = 0; + ulong physaddr = 0; ulong offset = vma->vm_pgoff << PAGE_SHIFT; GUEST_PHYSICAL_ADDRESS addr = 0; @@ -146,10 +146,10 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) ERRDRV("%s control channel address is 0", __func__); return -ENXIO; } - physAddr = (ulong) (addr); - DEBUGDRV("mapping physical address = 0x%lx", physAddr); + physaddr = (ulong)addr; + DEBUGDRV("mapping physical address = 0x%lx", physaddr); if (remap_pfn_range(vma, vma->vm_start, - physAddr >> PAGE_SHIFT, + physaddr >> PAGE_SHIFT, vma->vm_end - vma->vm_start, /*pgprot_noncached */ (vma->vm_page_prot))) { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 61/69] staging: unisys: virthba: Change alloc calls to use var name instead of type
From: Ken Depro This patch changes a couple of kzalloc calls to pass the variable name to the call, rather than the variable struct type. This is a result of checks generated during the checkpatch script. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 4e56a0d..83a94c0 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -397,7 +397,7 @@ process_disk_notify(struct Scsi_Host *shost, struct uiscmdrsp *cmdrsp) struct diskaddremove *dar; unsigned long flags; - dar = kzalloc(sizeof(struct diskaddremove), GFP_ATOMIC); + dar = kzalloc(sizeof(*dar), GFP_ATOMIC); if (dar) { dar->add = cmdrsp->disknotify.add; dar->shost = shost; @@ -1051,8 +1051,8 @@ virthba_slave_alloc(struct scsi_device *scsidev) (vdisk->next->lun == scsidev->lun)) return 0; } - tmpvdisk = kzalloc(sizeof(struct virtdisk_info), GFP_ATOMIC); - if (!tmpvdisk) + tmpvdisk = kzalloc(sizeof(*tmpvdisk), GFP_ATOMIC); + if (!tmpvdisk) /* error allocating */ return 0; tmpvdisk->channel = scsidev->channel; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 59/69] staging: unisys: virthba: Remove blank lines before/after braces
From: Ken Depro This patch removes unnecessary blank lines either before opening braces or after closing braces, as reported by the checkpatch script. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 54a3546..ae73d11 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -980,7 +980,6 @@ virthba_queue_command_lck(struct scsi_cmnd *scsicmd, sgl = scsi_sglist(scsicmd); for_each_sg(sgl, sg, scsi_sg_count(scsicmd), i) { - cmdrsp->scsi.gpi_list[i].address = sg_phys(sg); cmdrsp->scsi.gpi_list[i].length = sg->length; if ((i != 0) && (sg->offset != 0)) @@ -1196,7 +1195,6 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) bufind += sg[i].length; } } else { - vdisk = &((struct virthba_info *)scsidev->host->hostdata)->head; for ( ; vdisk->next; vdisk = vdisk->next) { if ((scsidev->channel != vdisk->channel) || @@ -1644,7 +1642,6 @@ virthba_mod_init(void) POSTCODE_LINUX_3(VHBA_CREATE_FAILURE_PC, error, POSTCODE_SEVERITY_ERR); } else { - /* create the debugfs directories and entries */ virthba_debugfs_dir = debugfs_create_dir("virthba", NULL); debugfs_create_file("info", S_IRUSR, virthba_debugfs_dir, @@ -1735,7 +1732,6 @@ virthba_mod_exit(void) debugfs_remove_recursive(virthba_debugfs_dir); pr_info("Leaving virthba_mod_exit\n"); - } /* specify function to be run at module insertion time */ -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 46/69] staging: unisys: get rid of goto in visorchipset_ioctl()
Remove another completely unnecessary goto and just return the values directly. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 18 +- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index b82bc4a..ced3fbe 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -166,7 +166,6 @@ visorchipset_mmap(struct file *file, struct vm_area_struct *vma) long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - int rc = SUCCESS; s64 adjustment; s64 vrtc_offset; @@ -177,28 +176,21 @@ long visorchipset_ioctl(struct file *file, unsigned int cmd, unsigned long arg) vrtc_offset = issue_vmcall_query_guest_virtual_time_offset(); if (copy_to_user ((void __user *)arg, &vrtc_offset, sizeof(vrtc_offset))) { - rc = -EFAULT; - goto Away; + return -EFAULT; } DBGINF("insde visorchipset_ioctl, cmd=%d, vrtc_offset=%lld", cmd, vrtc_offset); - break; + return SUCCESS; case VMCALL_UPDATE_PHYSICAL_TIME: if (copy_from_user (&adjustment, (void __user *)arg, sizeof(adjustment))) { - rc = -EFAULT; - goto Away; + return -EFAULT; } DBGINF("insde visorchipset_ioctl, cmd=%d, adjustment=%lld", cmd, adjustment); - rc = issue_vmcall_update_physical_time(adjustment); - break; + return issue_vmcall_update_physical_time(adjustment); default: LOGERR("visorchipset_ioctl received invalid command"); - rc = -EFAULT; - break; + return -EFAULT; } -Away: - DBGINF("exiting %d!", rc); - return rc; } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 25/69] staging: unisys: refactor delete_device_glue()
Fix the function declaration so it is a single line, and fix CamelCase function parameter names: busNo => bus_no devNo => dev_no Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 328f16b..d251822 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -787,17 +787,16 @@ static int delete_bus_glue(u32 bus_no) return 1; } -static int -delete_device_glue(u32 busNo, u32 devNo) +static int delete_device_glue(u32 bus_no, u32 dev_no) { struct controlvm_message msg; init_msg_header(&msg, CONTROLVM_DEVICE_DESTROY, 0, 0); - msg.cmd.destroy_device.bus_no = busNo; - msg.cmd.destroy_device.dev_no = devNo; + msg.cmd.destroy_device.bus_no = bus_no; + msg.cmd.destroy_device.dev_no = dev_no; if (destroy_device(&msg, NULL) != CONTROLVM_RESP_SUCCESS) { - LOGERR("destroy_device failed. busNo=0x%x devNo=0x%x\n", busNo, - devNo); + LOGERR("destroy_device failed. bus_no=0x%x dev_no=0x%x\n", + bus_no, dev_no); return 0; } return 1; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 64/69] staging: unisys: virthba: Fix warnings regarding lines over 80 characters
From: Ken Depro This patch fixes warnings generated by checkpatch script regarding lines over 80 characters long. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 612239e..4af52e4 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -84,7 +84,8 @@ static int virthba_host_reset_handler(struct scsi_cmnd *scsicmd); static const char *virthba_get_info(struct Scsi_Host *shp); static int virthba_ioctl(struct scsi_device *dev, int cmd, void __user *arg); static int virthba_queue_command_lck(struct scsi_cmnd *scsicmd, -void (*virthba_cmnd_done)(struct scsi_cmnd *)); +void (*virthba_cmnd_done) + (struct scsi_cmnd *)); static const struct x86_cpu_id unisys_spar_ids[] = { { X86_VENDOR_INTEL, 6, 62, X86_FEATURE_ANY }, -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 54/69] staging: unisys: remove LOGVER() macros
Delete these entirely as the only place that was using it had existing pr_info() statements with the exact same content. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/uniklog.h | 28 drivers/staging/unisys/virthba/virthba.c | 4 2 files changed, 32 deletions(-) diff --git a/drivers/staging/unisys/include/uniklog.h b/drivers/staging/unisys/include/uniklog.h index 74a723e..cca662a 100644 --- a/drivers/staging/unisys/include/uniklog.h +++ b/drivers/staging/unisys/include/uniklog.h @@ -26,34 +26,6 @@ #include /* - * # LOGVER - * - * \brief Log verbose message - logs a message at the LOG_DEBUG level, - *which can be disabled at runtime - * - * \param devname the device name of the device reporting this message, or - *NULL if this message is NOT device-related. - * \param fmt printf()-style format string containing the message to log. - * \param args Optional arguments to be formatted and inserted into the format - * \param string. - * \return nothing - * - * Logs the specified message at the LOG_DEBUG level. Note also that - * LOG_DEBUG messages can be enabled/disabled at runtime as well. - */ -#define LOGVER(fmt, args...) pr_debug(fmt, ## args) -#define LOGVERDEV(devname, fmt, args...) \ - pr_debug("%s " fmt, devname, ## args) -#define LOGVERNAME(vnic, fmt, args...) \ - do {\ - if (vnic != NULL) { \ - pr_debug("%s " fmt, vnic->name, ## args); \ - } else {\ - pr_debug(fmt, ## args); \ - } \ - } while (0) - -/* * # LOGWRN * * \brief Log warning message - Logs a message at the LOG_WARNING level, diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 0f70a71..071c4bf 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -464,10 +464,6 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) struct signal_queue_header __iomem *pqhdr; u64 mask; - LOGVER("entering virthba_probe...\n"); - LOGVER("virtpcidev bus_no<<%d>>devNo<<%d>>", virtpcidev->bus_no, - virtpcidev->device_no); - pr_info("entering virthba_probe...\n"); pr_info("virtpcidev bus_no<<%d>>devNo<<%d>>", virtpcidev->bus_no, virtpcidev->device_no); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 06/69] staging: unisys: add comment to spinlock in struct charqueue
Add a comment to the charqueue's spinlock to explain that it is a lock for the structure. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorutil/charqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorutil/charqueue.c b/drivers/staging/unisys/visorutil/charqueue.c index 1ce7003..ac7acb7 100644 --- a/drivers/staging/unisys/visorutil/charqueue.c +++ b/drivers/staging/unisys/visorutil/charqueue.c @@ -28,7 +28,7 @@ struct charqueue { int alloc_size; int nslots; - spinlock_t lock; + spinlock_t lock; /* read/write lock for this structure */ int head, tail; unsigned char buf[0]; }; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 55/69] staging: unisys: get rid of LOGWRN() macro and uisklog.h
Get rid of LOGWRN() and all related macros, and call pr_warn() directly instead. Removing the LOGWRN() macro set makes uisklog.h empty, so remove the file too. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/procobjecttree.h| 1 - drivers/staging/unisys/include/timskmod.h | 6 --- drivers/staging/unisys/include/uisqueue.h | 1 - drivers/staging/unisys/include/uniklog.h | 57 -- drivers/staging/unisys/uislib/uislib.c | 1 - drivers/staging/unisys/uislib/uisthread.c | 1 - drivers/staging/unisys/uislib/uisutils.c | 1 - drivers/staging/unisys/virthba/virthba.c | 1 - drivers/staging/unisys/virtpci/virtpci.c | 1 - drivers/staging/unisys/visorchannel/globals.h | 1 - drivers/staging/unisys/visorchipset/globals.h | 1 - drivers/staging/unisys/visorchipset/parser.h | 1 - .../unisys/visorchipset/visorchipset_main.c| 15 +++--- drivers/staging/unisys/visorutil/charqueue.h | 1 - drivers/staging/unisys/visorutil/easyproc.c| 1 - .../staging/unisys/visorutil/memregion_direct.c| 1 - drivers/staging/unisys/visorutil/periodic_work.c | 4 +- drivers/staging/unisys/visorutil/visorkmodutils.c | 1 - 18 files changed, 8 insertions(+), 88 deletions(-) delete mode 100644 drivers/staging/unisys/include/uniklog.h diff --git a/drivers/staging/unisys/include/procobjecttree.h b/drivers/staging/unisys/include/procobjecttree.h index 1174056..809c679 100644 --- a/drivers/staging/unisys/include/procobjecttree.h +++ b/drivers/staging/unisys/include/procobjecttree.h @@ -26,7 +26,6 @@ #ifndef __PROCOBJECTTREE_H__ #define __PROCOBJECTTREE_H__ -#include "uniklog.h" #include "timskmod.h" /* These are opaque structures to users. diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h index 5f33d5c..403827d 100644 --- a/drivers/staging/unisys/include/timskmod.h +++ b/drivers/staging/unisys/include/timskmod.h @@ -87,12 +87,6 @@ (void *)(p2) = SWAPPOINTERS_TEMP; \ } while (0) -#define WARNDRV(fmt, args...) LOGWRN(fmt, ## args) -#define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args) - -#define WARNDEV(devname, fmt, args...)LOGWRNDEV(devname, fmt, ## args) -#define SECUREDEV(devname, fmt, args...) LOGWRNDEV(devname, fmt, ## args) - /** Verifies the consistency of your PRIVATEDEVICEDATA structure using * conventional "signature" fields: * diff --git a/drivers/staging/unisys/include/uisqueue.h b/drivers/staging/unisys/include/uisqueue.h index 25b6181..08ba16e 100644 --- a/drivers/staging/unisys/include/uisqueue.h +++ b/drivers/staging/unisys/include/uisqueue.h @@ -25,7 +25,6 @@ #include "linux/version.h" #include "iochannel.h" -#include "uniklog.h" #include #include #include diff --git a/drivers/staging/unisys/include/uniklog.h b/drivers/staging/unisys/include/uniklog.h deleted file mode 100644 index cca662a..000 --- a/drivers/staging/unisys/include/uniklog.h +++ /dev/null @@ -1,57 +0,0 @@ -/* uniklog.h - * - * Copyright (C) 2010 - 2013 UNISYS CORPORATION - * All rights reserved. - * - * 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 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or - * NON INFRINGEMENT. See the GNU General Public License for more - * details. - */ - -/* This module contains macros to aid developers in logging messages. - * - * This module is affected by the DEBUG compiletime option. - * - */ -#ifndef __UNIKLOG_H__ -#define __UNIKLOG_H__ - -#include - -/* - * # LOGWRN - * - * \brief Log warning message - Logs a message at the LOG_WARNING level, - *including source line number information - * - * \param devname the device name of the device reporting this message, or - *NULL if this message is NOT device-related. - * \param fmt printf()-style format string containing the message to log. - * \param args Optional arguments to be formatted and inserted into the format - * \param string. - * \return nothing - * - * Logs the specified error message at the LOG_WARNING level. It will also - * include the file, line number, and function name of where the error - * originated in the log message. - */ -#define LOGWRN(fmt, args...) pr_warn(fmt, ## args) -#define LOGWRNDEV(devname, fmt, args...) \ - pr_warn("%s " fmt, devname, ## args) -#define LOGWRNNAME(vnic, fmt, args...) \ - do {\ - if (vnic != NULL) { \ -
[PATCH 69/69] staging: unisys: virthba: Fix CamelCase for local variables
From: Ken Depro This patch fixes the CamelCase local variables in virthba.c, reported by the checkpatch script: pChannelHeader --> pchhdr Features_addr --> features_addr Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 06a19fb..44c92be 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -421,7 +421,7 @@ static irqreturn_t virthba_ISR(int irq, void *dev_id) { struct virthba_info *virthbainfo = (struct virthba_info *)dev_id; - struct channel_header __iomem *pChannelHeader; + struct channel_header __iomem *pchhdr; struct signal_queue_header __iomem *pqhdr; u64 mask; unsigned long long rc1; @@ -429,23 +429,23 @@ virthba_ISR(int irq, void *dev_id) if (virthbainfo == NULL) return IRQ_NONE; virthbainfo->interrupts_rcvd++; - pChannelHeader = virthbainfo->chinfo.queueinfo->chan; - if (((readq(&pChannelHeader->features) + pchhdr = virthbainfo->chinfo.queueinfo->chan; + if (((readq(&pchhdr->features) & ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS) != 0) && -((readq(&pChannelHeader->features) & +((readq(&pchhdr->features) & ULTRA_IO_DRIVER_DISABLES_INTS) != 0)) { virthbainfo->interrupts_disabled++; mask = ~ULTRA_CHANNEL_ENABLE_INTS; rc1 = uisqueue_interlocked_and(virthbainfo->flags_addr, mask); } - if (spar_signalqueue_empty(pChannelHeader, IOCHAN_FROM_IOPART)) { + if (spar_signalqueue_empty(pchhdr, IOCHAN_FROM_IOPART)) { virthbainfo->interrupts_notme++; return IRQ_NONE; } pqhdr = (struct signal_queue_header __iomem *) - ((char __iomem *)pChannelHeader + -readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART; + ((char __iomem *)pchhdr + +readq(&pchhdr->ch_space_offset)) + IOCHAN_FROM_IOPART; writeq(readq(&pqhdr->num_irq_received) + 1, &pqhdr->num_irq_received); atomic_set(&virthbainfo->interrupt_rcvd, 1); @@ -462,7 +462,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) int rsp; int i; irq_handler_t handler = virthba_ISR; - struct channel_header __iomem *pChannelHeader; + struct channel_header __iomem *pchhdr; struct signal_queue_header __iomem *pqhdr; u64 mask; @@ -583,10 +583,10 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) virthbainfo->chinfo.queueinfo, &virthbainfo->chinfo.threadinfo); - pChannelHeader = virthbainfo->chinfo.queueinfo->chan; + pchhdr = virthbainfo->chinfo.queueinfo->chan; pqhdr = (struct signal_queue_header __iomem *) - ((char __iomem *)pChannelHeader + -readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART; + ((char __iomem *)pchhdr + +readq(&pchhdr->ch_space_offset)) + IOCHAN_FROM_IOPART; virthbainfo->flags_addr = &pqhdr->features; if (!uisthread_start(&virthbainfo->chinfo.threadinfo, @@ -619,15 +619,15 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) virthbainfo->interrupt_vector = -1; POSTCODE_LINUX_2(VHBA_PROBE_FAILURE_PC, POSTCODE_SEVERITY_ERR); } else { - u64 __iomem *Features_addr = + u64 __iomem *features_addr = &virthbainfo->chinfo.queueinfo->chan->features; pr_err("request_irq(%d) uislib_virthba_ISR request succeeded\n", virthbainfo->interrupt_vector); mask = ~(ULTRA_IO_CHANNEL_IS_POLLING | ULTRA_IO_DRIVER_DISABLES_INTS); - uisqueue_interlocked_and(Features_addr, mask); + uisqueue_interlocked_and(features_addr, mask); mask = ULTRA_IO_DRIVER_ENABLES_INTS; - uisqueue_interlocked_or(Features_addr, mask); + uisqueue_interlocked_or(features_addr, mask); rsltq_wait_usecs = 400; } @@ -1418,7 +1418,7 @@ static ssize_t enable_ints_write(struct file *file, const char __user *buffer, int i, new_value; struct virthba_info *virthbainfo; - u64 __iomem *Features_addr; + u64 __iomem *features_addr; u64 mask; if (count >= ARRAY_SIZE(buf)) @@ -1443,21 +1443,21 @@ static ssize_t enable_ints_write(struct file *file, const char __user *buffer, for (i = 0; i < VIRTHBASOPENMAX; i++) { if (virthbas
[PATCH 60/69] staging: unisys: virthba: Fix missing braces at end of if-else statements
From: Ken Depro This patch fixes checkpatch warnings that resulted from the else portion of if-else statements missing braces, so that it conforms with the rest of the statement. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index ae73d11..4e56a0d 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -1304,8 +1304,9 @@ drain_queue(struct virthba_info *virthbainfo, struct chaninfo *dc, (uintptr_t)cmdrsp->vdiskmgmt.scsicmd)) break; complete_vdiskmgmt_command(cmdrsp); - } else + } else { pr_err("Invalid cmdtype %d\n", cmdrsp->cmdtype); + } /* cmdrsp is now available for reuse */ } } @@ -1586,8 +1587,9 @@ virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state) } else if (virthbainfo->serverchangingstate) { pr_err("Server already processing change state message\n"); return 0; - } else + } else { pr_err("Server already down, but another server down message received."); + } return 1; } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 39/69] staging: unisys: fix CamelCase globals in uisutils.c
Rename CamelCase global variable names: ReqHandlerInfo_list => req_handler_info_list ReqHandlerInfo_list_lock => req_handler_info_list_lock Update all references to use the new name. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisutils.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c index e8c868e..4f89b2c 100644 --- a/drivers/staging/unisys/uislib/uisutils.c +++ b/drivers/staging/unisys/uislib/uisutils.c @@ -261,8 +261,8 @@ dolist: if (skb_shinfo(skb)->frag_list) { } EXPORT_SYMBOL_GPL(uisutil_copy_fragsinfo_from_skb); -static LIST_HEAD(ReqHandlerInfo_list); /* list of struct req_handler_info */ -static DEFINE_SPINLOCK(ReqHandlerInfo_list_lock); +static LIST_HEAD(req_handler_info_list); /* list of struct req_handler_info */ +static DEFINE_SPINLOCK(req_handler_info_list_lock); struct req_handler_info * req_handler_add(uuid_le switch_uuid, @@ -286,9 +286,9 @@ req_handler_add(uuid_le switch_uuid, if (switch_type_name) strncpy(rc->switch_type_name, switch_type_name, sizeof(rc->switch_type_name) - 1); - spin_lock(&ReqHandlerInfo_list_lock); - list_add_tail(&(rc->list_link), &ReqHandlerInfo_list); - spin_unlock(&ReqHandlerInfo_list_lock); + spin_lock(&req_handler_info_list_lock); + list_add_tail(&(rc->list_link), &req_handler_info_list); + spin_unlock(&req_handler_info_list_lock); return rc; } @@ -299,15 +299,15 @@ req_handler_find(uuid_le switch_uuid) struct list_head *lelt, *tmp; struct req_handler_info *entry = NULL; - spin_lock(&ReqHandlerInfo_list_lock); - list_for_each_safe(lelt, tmp, &ReqHandlerInfo_list) { + spin_lock(&req_handler_info_list_lock); + list_for_each_safe(lelt, tmp, &req_handler_info_list) { entry = list_entry(lelt, struct req_handler_info, list_link); if (uuid_le_cmp(entry->switch_uuid, switch_uuid) == 0) { - spin_unlock(&ReqHandlerInfo_list_lock); + spin_unlock(&req_handler_info_list_lock); return entry; } } - spin_unlock(&ReqHandlerInfo_list_lock); + spin_unlock(&req_handler_info_list_lock); return NULL; } @@ -318,8 +318,8 @@ req_handler_del(uuid_le switch_uuid) struct req_handler_info *entry = NULL; int rc = -1; - spin_lock(&ReqHandlerInfo_list_lock); - list_for_each_safe(lelt, tmp, &ReqHandlerInfo_list) { + spin_lock(&req_handler_info_list_lock); + list_for_each_safe(lelt, tmp, &req_handler_info_list) { entry = list_entry(lelt, struct req_handler_info, list_link); if (uuid_le_cmp(entry->switch_uuid, switch_uuid) == 0) { list_del(lelt); @@ -327,6 +327,6 @@ req_handler_del(uuid_le switch_uuid) rc++; } } - spin_unlock(&ReqHandlerInfo_list_lock); + spin_unlock(&req_handler_info_list_lock); return rc; } -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 52/69] staging: unisys: remove DBGINF() macros
Remove the DBGINF() group of logging macros and use pr_debug() instead. Fix places that used the DBGINF() macro so they actually print the expected value, because they were not being compiled at all before the switchover. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/timskmod.h | 2 -- drivers/staging/unisys/include/uniklog.h | 39 drivers/staging/unisys/uislib/uislib.c | 8 ++--- drivers/staging/unisys/uislib/uisutils.c | 2 +- drivers/staging/unisys/virthba/virthba.c | 57 +++--- drivers/staging/unisys/virtpci/virtpci.c | 41 ++--- drivers/staging/unisys/visorchipset/file.c | 18 +- 7 files changed, 64 insertions(+), 103 deletions(-) diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h index 7831dbc..3d563c4 100644 --- a/drivers/staging/unisys/include/timskmod.h +++ b/drivers/staging/unisys/include/timskmod.h @@ -91,14 +91,12 @@ #define WARNDRV(fmt, args...) LOGWRN(fmt, ## args) #define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args) #define INFODRV(fmt, args...) LOGINF(fmt, ## args) -#define DEBUGDRV(fmt, args...) DBGINF(fmt, ## args) #define PRINTKDEV(devname, fmt, args...) LOGINFDEV(devname, fmt, ## args) #define WARNDEV(devname, fmt, args...)LOGWRNDEV(devname, fmt, ## args) #define SECUREDEV(devname, fmt, args...) LOGWRNDEV(devname, fmt, ## args) #define INFODEV(devname, fmt, args...)LOGINFDEV(devname, fmt, ## args) #define INFODEVX(devno, fmt, args...) LOGINFDEVX(devno, fmt, ## args) -#define DEBUGDEV(devname, fmt, args...) DBGINFDEV(devname, fmt, ## args) /** Verifies the consistency of your PRIVATEDEVICEDATA structure using * conventional "signature" fields: diff --git a/drivers/staging/unisys/include/uniklog.h b/drivers/staging/unisys/include/uniklog.h index e94120b..edc12f0 100644 --- a/drivers/staging/unisys/include/uniklog.h +++ b/drivers/staging/unisys/include/uniklog.h @@ -26,45 +26,6 @@ #include /* - * # DBGINF - * - * \brief Log debug informational message - log a LOG_INFO message only - *if DEBUG compiletime option enabled - * - * \param devname the device name of the device reporting this message, or - *NULL if this message is NOT device-related. - * \param fmt printf()-style format string containing the message to log. - * \param args Optional arguments to be formatted and inserted into the - * format string. - * \return nothing - * - * Log a message at the LOG_INFO level, but only if DEBUG is enabled. If - * DEBUG is disabled, this expands to a no-op. - */ - -/* - * # DBGVER - * - * \brief Log debug verbose message - log a LOG_DEBUG message only if - *DEBUG compiletime option enabled - * - * \param devname the device name of the device reporting this message, or - *NULL if this message is NOT device-related. - * \param fmt printf()-style format string containing the message to log. - * \param args Optional arguments to be formatted and inserted into the - * format string. - * \return nothing - * - * Log a message at the LOG_DEBUG level, but only if DEBUG is enabled. If - * DEBUG is disabled, this expands to a no-op. Note also that LOG_DEBUG - * messages can be enabled/disabled at runtime as well. - */ -#define DBGINFDEV(devname, fmt, args...)do { } while (0) -#define DBGVERDEV(devname, fmt, args...)do { } while (0) -#define DBGINF(fmt, args...)do { } while (0) -#define DBGVER(fmt, args...)do { } while (0) - -/* * # LOGINF * * \brief Log informational message - logs a message at the LOG_INFO level diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index eb58449..d986fde 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -1161,7 +1161,7 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf, /* *start = buf; */ if (debug_buf == NULL) { - DBGINF("debug_buf == NULL; allocating buffer.\n."); + pr_debug("debug_buf == NULL; allocating buffer.\n."); debug_buf = vmalloc(PROC_READ_BUFFER_SIZE); if (debug_buf == NULL) { @@ -1173,7 +1173,7 @@ static ssize_t info_debugfs_read(struct file *file, char __user *buf, temp = debug_buf; if ((*offset == 0) || (!debug_buf_valid)) { - DBGINF("calling info_debugfs_read_helper.\n"); + pr_debug("calling info_debugfs_read_helper.\n"); /* if the read fails, then -1 will be returned */ total_bytes = info_debugfs_read_helper(&temp, &remaining_bytes); debug_buf_valid = 1; @@ -1333,7 +1333,7 @@ static int process_incoming(void *v) idle_cycles = idle_cycles + delta_cycles; } } - DBGINF("exit
[PATCH 44/69] staging: unisys: get rid of goto in visorchipset_open()
This goto uses CamelCase and was completely unnecessary. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchipset/file.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/unisys/visorchipset/file.c b/drivers/staging/unisys/visorchipset/file.c index 4b0c158..d43c403 100644 --- a/drivers/staging/unisys/visorchipset/file.c +++ b/drivers/staging/unisys/visorchipset/file.c @@ -103,17 +103,12 @@ static int visorchipset_open(struct inode *inode, struct file *file) { unsigned minor_number = iminor(inode); - int rc = -ENODEV; DEBUGDRV("%s", __func__); if (minor_number != 0) - goto Away; + return -ENODEV; file->private_data = NULL; - rc = 0; -Away: - if (rc < 0) - ERRDRV("%s minor=%d failed", __func__, minor_number); - return rc; + return 0; } static int -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 47/69] staging: unisys: visorchannel: Rename CamelCase variable channelBytes
From: Bryan Thompson Rename channelBytes to channel_bytes in the series of visorchannel_create functions provided by visorchannel. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/visorchannel/visorchannel.h | 10 - .../unisys/visorchannel/visorchannel_funcs.c | 26 +++--- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/staging/unisys/visorchannel/visorchannel.h b/drivers/staging/unisys/visorchannel/visorchannel.h index 5061edf..5dbfddb 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel.h +++ b/drivers/staging/unisys/visorchannel/visorchannel.h @@ -35,17 +35,17 @@ typedef struct VISORCHANNEL_Tag VISORCHANNEL; /* Note that for visorchannel_create() and visorchannel_create_overlapped(), - * and arguments may be 0 if we are a channel CLIENT. + * and arguments may be 0 if we are a channel CLIENT. * In this case, the values can simply be read from the channel header. */ VISORCHANNEL *visorchannel_create(HOSTADDRESS physaddr, - ulong channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped(ulong channelBytes, + ulong channel_bytes, uuid_le guid); +VISORCHANNEL *visorchannel_create_overlapped(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid); VISORCHANNEL *visorchannel_create_with_lock(HOSTADDRESS physaddr, - ulong channelBytes, uuid_le guid); -VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channelBytes, + ulong channel_bytes, uuid_le guid); +VISORCHANNEL *visorchannel_create_overlapped_with_lock(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid); void visorchannel_destroy(VISORCHANNEL *channel); diff --git a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c index 36559d5..6601b3e 100644 --- a/drivers/staging/unisys/visorchannel/visorchannel_funcs.c +++ b/drivers/staging/unisys/visorchannel/visorchannel_funcs.c @@ -49,7 +49,7 @@ struct VISORCHANNEL_Tag { * NOT modify this data area. */ static VISORCHANNEL * -visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_guts(HOSTADDRESS physaddr, ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid, BOOL needs_lock) { @@ -87,18 +87,18 @@ visorchannel_create_guts(HOSTADDRESS physaddr, ulong channelBytes, rc = NULL; goto cleanup; } - if (channelBytes == 0) + if (channel_bytes == 0) /* we had better be a CLIENT of this channel */ - channelBytes = (ulong)p->chan_hdr.size; + channel_bytes = (ulong)p->chan_hdr.size; if (uuid_le_cmp(guid, NULL_UUID_LE) == 0) /* we had better be a CLIENT of this channel */ guid = p->chan_hdr.chtype; - if (visor_memregion_resize(p->memregion, channelBytes) < 0) { + if (visor_memregion_resize(p->memregion, channel_bytes) < 0) { ERRDRV("visor_memregion_resize failed: (status=0)\n"); rc = NULL; goto cleanup; } - p->size = channelBytes; + p->size = channel_bytes; p->guid = guid; rc = p; @@ -114,37 +114,37 @@ cleanup: } VISORCHANNEL * -visorchannel_create(HOSTADDRESS physaddr, ulong channelBytes, uuid_le guid) +visorchannel_create(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, FALSE); } EXPORT_SYMBOL_GPL(visorchannel_create); VISORCHANNEL * -visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channelBytes, +visorchannel_create_with_lock(HOSTADDRESS physaddr, ulong channel_bytes, uuid_le guid) { - return visorchannel_create_guts(physaddr, channelBytes, NULL, 0, guid, + return visorchannel_create_guts(physaddr, channel_bytes, NULL, 0, guid, TRUE); } EXPORT_SYMBOL_GPL(visorchannel_create_with_lock); VISORCHANNEL * -visorchannel_create_overlapped(ulong channelBytes, +visorchannel_create_overlapped(ulong channel_bytes, VISORCHANNEL *parent, ulong off, uuid_le guid) { - return visorchannel_create_guts(0, channelBytes, parent, off, guid, + return visorchannel_create_guts(0, channel_bytes, parent, off, guid, FALSE); } EXPORT_SYMBOL_GPL(vi
[PATCH 56/69] staging: unisys: virthba: Remove unneeded spaces after casts
From: Ken Depro This patch removes all unnecessary spaces after casts, as reported by the checkpatch script. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 130 +++ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 8684580..2a854b9 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -259,7 +259,7 @@ add_scsipending_entry(struct virthba_info *vhbainfo, char cmdtype, void *new) insert_location = vhbainfo->nextinsert; while (vhbainfo->pending[insert_location].sent != NULL) { insert_location = (insert_location + 1) % MAX_PENDING_REQUESTS; - if (insert_location == (int) vhbainfo->nextinsert) { + if (insert_location == (int)vhbainfo->nextinsert) { pr_err("Queue should be full. insert_location<<%d>> Unable to find open slot for pending commands.\n", insert_location); spin_unlock_irqrestore(&vhbainfo->privlock, flags); @@ -288,7 +288,7 @@ add_scsipending_entry_with_wait(struct virthba_info *vhbainfo, char cmdtype, insert_location = add_scsipending_entry(vhbainfo, cmdtype, new); } - return (unsigned int) insert_location; + return (unsigned int)insert_location; } static void * @@ -299,13 +299,13 @@ del_scsipending_entry(struct virthba_info *vhbainfo, uintptr_t del) if (del >= MAX_PENDING_REQUESTS) { pr_err("Invalid queue position <<%lu>> given to delete. MAX_PENDING_REQUESTS <<%d>>\n", -(unsigned long) del, MAX_PENDING_REQUESTS); +(unsigned long)del, MAX_PENDING_REQUESTS); } else { spin_lock_irqsave(&vhbainfo->privlock, flags); if (vhbainfo->pending[del].sent == NULL) pr_err("Deleting already cleared queue entry at <<%lu>>.\n", -(unsigned long) del); +(unsigned long)del); sent = vhbainfo->pending[del].sent; @@ -417,7 +417,7 @@ process_disk_notify(struct Scsi_Host *shost, struct uiscmdrsp *cmdrsp) static irqreturn_t virthba_ISR(int irq, void *dev_id) { - struct virthba_info *virthbainfo = (struct virthba_info *) dev_id; + struct virthba_info *virthbainfo = (struct virthba_info *)dev_id; struct channel_header __iomem *pChannelHeader; struct signal_queue_header __iomem *pqhdr; u64 mask; @@ -441,7 +441,7 @@ virthba_ISR(int irq, void *dev_id) return IRQ_NONE; } pqhdr = (struct signal_queue_header __iomem *) - ((char __iomem *) pChannelHeader + + ((char __iomem *)pChannelHeader + readq(&pChannelHeader->ch_space_offset)) + IOCHAN_FROM_IOPART; writeq(readq(&pqhdr->num_irq_received) + 1, &pqhdr->num_irq_received); @@ -496,19 +496,19 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) * the max-channel value. */ pr_info("virtpcidev->scsi.max.max_channel=%u, max_id=%u, max_lun=%u, cmd_per_lun=%u, max_io_size=%u\n", -(unsigned) virtpcidev->scsi.max.max_channel - 1, -(unsigned) virtpcidev->scsi.max.max_id, -(unsigned) virtpcidev->scsi.max.max_lun, -(unsigned) virtpcidev->scsi.max.cmd_per_lun, -(unsigned) virtpcidev->scsi.max.max_io_size); - scsihost->max_channel = (unsigned) virtpcidev->scsi.max.max_channel; - scsihost->max_id = (unsigned) virtpcidev->scsi.max.max_id; - scsihost->max_lun = (unsigned) virtpcidev->scsi.max.max_lun; - scsihost->cmd_per_lun = (unsigned) virtpcidev->scsi.max.cmd_per_lun; +(unsigned)virtpcidev->scsi.max.max_channel - 1, +(unsigned)virtpcidev->scsi.max.max_id, +(unsigned)virtpcidev->scsi.max.max_lun, +(unsigned)virtpcidev->scsi.max.cmd_per_lun, +(unsigned)virtpcidev->scsi.max.max_io_size); + scsihost->max_channel = (unsigned)virtpcidev->scsi.max.max_channel; + scsihost->max_id = (unsigned)virtpcidev->scsi.max.max_id; + scsihost->max_lun = (unsigned)virtpcidev->scsi.max.max_lun; + scsihost->cmd_per_lun = (unsigned)virtpcidev->scsi.max.cmd_per_lun; scsihost->max_sectors = - (unsigned short) (virtpcidev->scsi.max.max_io_size >> 9); + (unsigned short)(virtpcidev->scsi.max.max_io_size >> 9); scsihost->sg_tablesize = - (unsigned short) (virtpcidev->scsi.max.max_io_size / PAGE_SIZE); + (unsigned short)(virtpcidev->scsi.max.max_io_size / PAGE_SIZE); if (scsihost->sg_tablesize > MAX_PHYS_INFO) scsihost->sg_tablesize = MAX_PHYS_INFO; pr_inf
[PATCH 08/69] staging: unisys: fix alignment in uislib.c
Fix almost all of the parenthesis alignment problems in uislib.c. The 2 remaining issues are in create_device(), which is heavily indented and needs to be refactored entirely anyway. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 48 +- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index c28d6f3..f25dd2f 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -114,7 +114,7 @@ static unsigned long long cycles_before_wait, wait_cycles; /*/ static ssize_t info_debugfs_read(struct file *file, char __user *buf, - size_t len, loff_t *offset); +size_t len, loff_t *offset); static const struct file_operations debugfs_info_fops = { .read = info_debugfs_read, }; @@ -136,8 +136,8 @@ init_vbus_channel(u64 channelAddr, u32 channelBytes) if (!pChan) { LOGERR("CONTROLVM_BUS_CREATE error: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed", -(unsigned long long)channelAddr, -(unsigned long long)channelBytes); + (unsigned long long)channelAddr, + (unsigned long long)channelBytes); rc = NULL; goto Away; } @@ -161,7 +161,7 @@ create_bus(struct controlvm_message *msg, char *buf) if (MaxBusCount == BusListCount) { LOGERR("CONTROLVM_BUS_CREATE Failed: max buses:%d already created\n", -MaxBusCount); + MaxBusCount); POSTCODE_LINUX_3(BUS_CREATE_FAILURE_PC, MaxBusCount, POSTCODE_SEVERITY_ERR); return CONTROLVM_RESP_ERROR_MAX_BUSES; @@ -301,7 +301,7 @@ destroy_bus(struct controlvm_message *msg, char *buf) for (i = 0; i < bus->device_count; i++) { if (bus->device[i] != NULL) { LOGERR("CONTROLVM_BUS_DESTROY Failed: device %i attached to bus %d.", -i, busNo); + i, busNo); read_unlock(&BusListLock); return CONTROLVM_RESP_ERROR_BUS_DEVICE_ATTACHED; } @@ -386,8 +386,8 @@ create_device(struct controlvm_message *msg, char *buf) minSize = pReqHandler->min_channel_bytes; if (minSize > msg->cmd.create_device.channel_bytes) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: channel size is too small, channel size:0x%lx, required size:0x%lx", -(ulong) msg->cmd.create_device.channel_bytes, -(ulong) minSize); + (ulong) msg->cmd.create_device.channel_bytes, + (ulong) minSize); POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); result = CONTROLVM_RESP_ERROR_CHANNEL_SIZE_TOO_SMALL; @@ -398,8 +398,8 @@ create_device(struct controlvm_message *msg, char *buf) msg->cmd.create_device.channel_bytes); if (!dev->chanptr) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: ioremap_cache of channelAddr:%Lx for channelBytes:%llu failed", -dev->channel_addr, -msg->cmd.create_device.channel_bytes); + dev->channel_addr, + msg->cmd.create_device.channel_bytes); result = CONTROLVM_RESP_ERROR_IOREMAP_FAILED; POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, POSTCODE_SEVERITY_ERR); @@ -415,7 +415,7 @@ create_device(struct controlvm_message *msg, char *buf) /* make sure the device number is valid */ if (devNo >= bus->device_count) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: device (%d) >= deviceCount (%d).", -devNo, bus->device_count); + devNo, bus->device_count); result = CONTROLVM_RESP_ERROR_MAX_DEVICES; POSTCODE_LINUX_4(DEVICE_CREATE_FAILURE_PC, devNo, busNo, @@ -426,7 +426,7 @@ create_device(struct controlvm_message *msg, char *buf) /* make sure this device is not already set */ if (bus->device[devNo]) { LOGERR("CONTROLVM_DEVICE_CREATE Failed: device %d is alre
[PATCH 62/69] staging: unisys: virthba: Fix a couple checkpatch problems
From: Ken Depro This patch fixes a couple small issues reported by the checkpatch script: Adds a blank line after a struct definition. Removes unnecessary parentheses surrounding a dereference of a struct member. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 83a94c0..b78156d 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -165,6 +165,7 @@ struct virtdisk_info { atomic_t error_count; struct virtdisk_info *next; }; + /* Each Scsi_Host has a host_data area that contains this struct. */ struct virthba_info { struct Scsi_Host *scsihost; @@ -1523,7 +1524,7 @@ virthba_serverdown_complete(struct work_struct *work) /* Fail Commands that weren't completed */ spin_lock_irqsave(&virthbainfo->privlock, flags); for (i = 0; i < MAX_PENDING_REQUESTS; i++) { - pendingdel = &(virthbainfo->pending[i]); + pendingdel = &virthbainfo->pending[i]; switch (pendingdel->cmdtype) { case CMD_SCSI_TYPE: scsicmd = (struct scsi_cmnd *)pendingdel->sent; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 21/69] staging: unisys: refactor pause_device()
Fix the function declaration so it is on a single line. Fix CamelCase local variables: busNo => bus_no devNo => dev_no Fix use of uuid_le_cmp() to check for 0 instead of using !uuid_le_cmp(). Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uislib.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index 09a4680..35be4e6 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -526,32 +526,31 @@ cleanup: return result; } -static int -pause_device(struct controlvm_message *msg) +static int pause_device(struct controlvm_message *msg) { - u32 busNo, devNo; + u32 bus_no, dev_no; struct bus_info *bus; struct device_info *dev; struct guest_msgs cmd; int retval = CONTROLVM_RESP_SUCCESS; - busNo = msg->cmd.device_change_state.bus_no; - devNo = msg->cmd.device_change_state.dev_no; + bus_no = msg->cmd.device_change_state.bus_no; + dev_no = msg->cmd.device_change_state.dev_no; read_lock(&bus_list_lock); for (bus = bus_list; bus; bus = bus->next) { - if (bus->bus_no == busNo) { + if (bus->bus_no == bus_no) { /* make sure the device number is valid */ - if (devNo >= bus->device_count) { + if (dev_no >= bus->device_count) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause Failed: device(%d) >= deviceCount(%d).", - devNo, bus->device_count); + dev_no, bus->device_count); retval = CONTROLVM_RESP_ERROR_DEVICE_INVALID; } else { /* make sure this device exists */ - dev = bus->device[devNo]; + dev = bus->device[dev_no]; if (!dev) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause Failed: device %d does not exist.", - devNo); + dev_no); retval = CONTROLVM_RESP_ERROR_ALREADY_DONE; } @@ -561,7 +560,7 @@ pause_device(struct controlvm_message *msg) } if (!bus) { LOGERR("CONTROLVM_DEVICE_CHANGESTATE:pause Failed: bus %d does not exist", - busNo); + bus_no); retval = CONTROLVM_RESP_ERROR_BUS_INVALID; } read_unlock(&bus_list_lock); @@ -569,12 +568,12 @@ pause_device(struct controlvm_message *msg) /* the msg is bound for virtpci; send * guest_msgs struct to callback */ - if (!uuid_le_cmp(dev->channel_uuid, -spar_vhba_channel_protocol_uuid)) { + if (uuid_le_cmp(dev->channel_uuid, + spar_vhba_channel_protocol_uuid) == 0) { cmd.msgtype = GUEST_PAUSE_VHBA; cmd.pause_vhba.chanptr = dev->chanptr; - } else if (!uuid_le_cmp(dev->channel_uuid, - spar_vnic_channel_protocol_uuid)) { + } else if (uuid_le_cmp(dev->channel_uuid, + spar_vnic_channel_protocol_uuid) == 0) { cmd.msgtype = GUEST_PAUSE_VNIC; cmd.pause_vnic.chanptr = dev->chanptr; } else { -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 38/69] staging: unisys: refactor uisctrl_unregister_req_handler_ex()
Get rid of the unnecessary goto statement and just return directly. Signed-off-by: Bryan Thompson Signed-off-by: Benjamin Romer --- drivers/staging/unisys/uislib/uisutils.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging/unisys/uislib/uisutils.c b/drivers/staging/unisys/uislib/uisutils.c index 9ca10e9..e8c868e 100644 --- a/drivers/staging/unisys/uislib/uisutils.c +++ b/drivers/staging/unisys/uislib/uisutils.c @@ -155,20 +155,14 @@ EXPORT_SYMBOL_GPL(uisctrl_register_req_handler_ex); int uisctrl_unregister_req_handler_ex(uuid_le switch_uuid) { - int rc = 0; /* assume failure */ - LOGINF("type=%pUL.\n", &switch_uuid); if (req_handler_del(switch_uuid) < 0) { LOGERR("failed to remove %pUL from server list\n", &switch_uuid); - goto Away; + return 0; } atomic_dec(&uisutils_registered_services); - rc = 1; /* success */ -Away: - if (!rc) - LOGERR("failed to unregister type %pUL.\n", &switch_uuid); - return rc; + return 1; } EXPORT_SYMBOL_GPL(uisctrl_unregister_req_handler_ex); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 68/69] staging: unisys: virthba: Fix CamelCase for a couple function names
From: Ken Depro This patch fixes CamelCase function names in virthba.c, reported by the checkpatch script: doDiskAddRemove --> do_disk_add_remove SendDiskAddRemove --> send_disk_add_remove Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index e03de4c..06a19fb 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -107,7 +107,7 @@ static void virthba_slave_destroy(struct scsi_device *scsidev); static int process_incoming_rsps(void *); static int virthba_serverup(struct virtpci_dev *virtpcidev); static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); -static void doDiskAddRemove(struct work_struct *work); +static void do_disk_add_remove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); static ssize_t info_debugfs_read(struct file *file, char __user *buf, size_t len, loff_t *offset); @@ -343,7 +343,7 @@ static unsigned short dar_work_queue_sched; } static inline void -SendDiskAddRemove(struct diskaddremove *dar) +send_disk_add_remove(struct diskaddremove *dar) { struct scsi_device *sdev; int error; @@ -370,7 +370,7 @@ SendDiskAddRemove(struct diskaddremove *dar) /* dar_work_queue Handler Thread */ /*/ static void -doDiskAddRemove(struct work_struct *work) +do_disk_add_remove(struct work_struct *work) { struct diskaddremove *dar; struct diskaddremove *tmphead; @@ -385,7 +385,7 @@ doDiskAddRemove(struct work_struct *work) while (tmphead) { dar = tmphead; tmphead = dar->next; - SendDiskAddRemove(dar); + send_disk_add_remove(dar); i++; } } @@ -1661,7 +1661,7 @@ virthba_mod_init(void) virthba_debugfs_dir, NULL, &debugfs_enable_ints_fops); /* Initialize dar_work_queue */ - INIT_WORK(&dar_work_queue, doDiskAddRemove); + INIT_WORK(&dar_work_queue, do_disk_add_remove); spin_lock_init(&dar_work_queue_lock); /* clear out array */ -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 57/69] staging: unisys: virthba: Fix open parenthesis alignment checks
From: Ken Depro This patch fixes the "alignment should match open parenthesis" checks from the checkpatch script. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 120 --- 1 file changed, 61 insertions(+), 59 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 2a854b9..e99404a 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -109,9 +109,10 @@ static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state); static void doDiskAddRemove(struct work_struct *work); static void virthba_serverdown_complete(struct work_struct *work); static ssize_t info_debugfs_read(struct file *file, char __user *buf, - size_t len, loff_t *offset); +size_t len, loff_t *offset); static ssize_t enable_ints_write(struct file *file, - const char __user *buffer, size_t count, loff_t *ppos); +const char __user *buffer, size_t count, +loff_t *ppos); /*/ /* Globals */ @@ -261,7 +262,7 @@ add_scsipending_entry(struct virthba_info *vhbainfo, char cmdtype, void *new) insert_location = (insert_location + 1) % MAX_PENDING_REQUESTS; if (insert_location == (int)vhbainfo->nextinsert) { pr_err("Queue should be full. insert_location<<%d>> Unable to find open slot for pending commands.\n", -insert_location); + insert_location); spin_unlock_irqrestore(&vhbainfo->privlock, flags); return -1; } @@ -299,13 +300,13 @@ del_scsipending_entry(struct virthba_info *vhbainfo, uintptr_t del) if (del >= MAX_PENDING_REQUESTS) { pr_err("Invalid queue position <<%lu>> given to delete. MAX_PENDING_REQUESTS <<%d>>\n", -(unsigned long)del, MAX_PENDING_REQUESTS); + (unsigned long)del, MAX_PENDING_REQUESTS); } else { spin_lock_irqsave(&vhbainfo->privlock, flags); if (vhbainfo->pending[del].sent == NULL) pr_err("Deleting already cleared queue entry at <<%lu>>.\n", -(unsigned long)del); + (unsigned long)del); sent = vhbainfo->pending[del].sent; @@ -355,8 +356,8 @@ SendDiskAddRemove(struct diskaddremove *dar) dar->lun); if (error) pr_err("Failed scsi_add_device: host_no=%d[chan=%d:id=%d:lun=%d]\n", -dar->shost->host_no, dar->channel, dar->id, -dar->lun); + dar->shost->host_no, dar->channel, dar->id, + dar->lun); } else pr_err("Failed scsi_device_lookup:[chan=%d:id=%d:lun=%d]\n", dar->channel, dar->id, dar->lun); @@ -406,8 +407,8 @@ process_disk_notify(struct Scsi_Host *shost, struct uiscmdrsp *cmdrsp) QUEUE_DISKADDREMOVE(dar); } else { pr_err("kmalloc failed for dar. host_no=%d[chan=%d:id=%d:lun=%d]\n", -shost->host_no, cmdrsp->disknotify.channel, -cmdrsp->disknotify.id, cmdrsp->disknotify.lun); + shost->host_no, cmdrsp->disknotify.channel, + cmdrsp->disknotify.id, cmdrsp->disknotify.lun); } } @@ -465,7 +466,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) pr_info("entering virthba_probe...\n"); pr_info("virtpcidev bus_no<<%d>>devNo<<%d>>", virtpcidev->bus_no, - virtpcidev->device_no); + virtpcidev->device_no); POSTCODE_LINUX_2(VHBA_PROBE_ENTRY_PC, POSTCODE_SEVERITY_INFO); /* call scsi_host_alloc to register a scsi host adapter * instance - this virthba that has just been created is an @@ -486,7 +487,7 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) return -ENODEV; pr_debug("scsihost: 0x%p, scsihost->this_id: %d, host_no: %d.\n", - scsihost, scsihost->this_id, scsihost->host_no); +scsihost, scsihost->this_id, scsihost->host_no); scsihost->this_id = UIS_MAGIC_VHBA; /* linux treats max-channel differently than max-id & max-lun. @@ -496,11 +497,11 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) * the max-channel value. */ pr_info("virtpcidev->scsi.max.max_channel=%u, max_id=%u, max_lun=%u, cmd_per_lun=%u,
[PATCH 63/69] staging: unisys: virthba: Fix "else not useful after return" warning
From: Ken Depro This patch fixes a warning generated during the checkpatch script that stated "else not useful after return". I modified the code to return a designated status at the end of the function, and replaced the return statement in the "else if" to set the status accordingly. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index b78156d..612239e 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -1573,6 +1573,8 @@ virthba_serverdown_complete(struct work_struct *work) static int virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state) { + int stat = 1; + struct virthba_info *virthbainfo = (struct virthba_info *)((struct Scsi_Host *)virtpcidev->scsi. scsihost)->hostdata; @@ -1587,12 +1589,12 @@ virthba_serverdown(struct virtpci_dev *virtpcidev, u32 state) &virthbainfo->serverdown_completion); } else if (virthbainfo->serverchangingstate) { pr_err("Server already processing change state message\n"); - return 0; + stat = 0; } else { pr_err("Server already down, but another server down message received."); } - return 1; + return stat; } /*/ -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 58/69] staging: unisys: virthba: Fix logical continuation checks
From: Ken Depro This patch fixes checkpatch checks where the logical operator should be at the end of the line above, not beginning the next line. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 38 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index e99404a..54a3546 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -429,8 +429,8 @@ virthba_ISR(int irq, void *dev_id) virthbainfo->interrupts_rcvd++; pChannelHeader = virthbainfo->chinfo.queueinfo->chan; if (((readq(&pChannelHeader->features) - & ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS) != 0) - && ((readq(&pChannelHeader->features) & + & ULTRA_IO_IOVM_IS_OK_WITH_DRIVER_DISABLING_INTS) != 0) && +((readq(&pChannelHeader->features) & ULTRA_IO_DRIVER_DISABLES_INTS) != 0)) { virthbainfo->interrupts_disabled++; @@ -800,9 +800,9 @@ virthba_abort_handler(struct scsi_cmnd *scsicmd) scsidev = scsicmd->device; for (vdisk = &((struct virthba_info *)scsidev->host->hostdata)->head; vdisk->next; vdisk = vdisk->next) { - if ((scsidev->channel == vdisk->channel) - && (scsidev->id == vdisk->id) - && (scsidev->lun == vdisk->lun)) { + if ((scsidev->channel == vdisk->channel) && + (scsidev->id == vdisk->id) && + (scsidev->lun == vdisk->lun)) { if (atomic_read(&vdisk->error_count) < VIRTHBA_ERROR_COUNT) { atomic_inc(&vdisk->error_count); @@ -826,9 +826,9 @@ virthba_bus_reset_handler(struct scsi_cmnd *scsicmd) scsidev = scsicmd->device; for (vdisk = &((struct virthba_info *)scsidev->host->hostdata)->head; vdisk->next; vdisk = vdisk->next) { - if ((scsidev->channel == vdisk->channel) - && (scsidev->id == vdisk->id) - && (scsidev->lun == vdisk->lun)) { + if ((scsidev->channel == vdisk->channel) && + (scsidev->id == vdisk->id) && + (scsidev->lun == vdisk->lun)) { if (atomic_read(&vdisk->error_count) < VIRTHBA_ERROR_COUNT) { atomic_inc(&vdisk->error_count); @@ -852,9 +852,9 @@ virthba_device_reset_handler(struct scsi_cmnd *scsicmd) scsidev = scsicmd->device; for (vdisk = &((struct virthba_info *)scsidev->host->hostdata)->head; vdisk->next; vdisk = vdisk->next) { - if ((scsidev->channel == vdisk->channel) - && (scsidev->id == vdisk->id) - && (scsidev->lun == vdisk->lun)) { + if ((scsidev->channel == vdisk->channel) && + (scsidev->id == vdisk->id) && + (scsidev->lun == vdisk->lun)) { if (atomic_read(&vdisk->error_count) < VIRTHBA_ERROR_COUNT) { atomic_inc(&vdisk->error_count); @@ -1120,9 +1120,9 @@ do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) /* Okay see what our error_count is here */ for (vdisk = &((struct virthba_info *)scsidev->host->hostdata)->head; vdisk->next; vdisk = vdisk->next) { - if ((scsidev->channel != vdisk->channel) - || (scsidev->id != vdisk->id) - || (scsidev->lun != vdisk->lun)) + if ((scsidev->channel != vdisk->channel) || + (scsidev->id != vdisk->id) || + (scsidev->lun != vdisk->lun)) continue; if (atomic_read(&vdisk->error_count) < VIRTHBA_ERROR_COUNT) { @@ -1158,8 +1158,8 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) struct virtdisk_info *vdisk; scsidev = scsicmd->device; - if ((cmdrsp->scsi.cmnd[0] == INQUIRY) - && (cmdrsp->scsi.bufflen >= MIN_INQUIRY_RESULT_LEN)) { + if ((cmdrsp->scsi.cmnd[0] == INQUIRY) && + (cmdrsp->scsi.bufflen >= MIN_INQUIRY_RESULT_LEN)) { if (cmdrsp->scsi.no_disk_result == 0) return; @@ -1199,9 +1199,9 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) vdisk = &((struct virthba_info *)scsidev->host->hostdata)->head; for ( ; vdisk->next; vdisk = vdisk->next) { - if ((scsidev->channel != vdisk->channel) - || (scsidev->id != vdisk->id) - || (scsidev->lun != vdisk->lun)) + if ((
[PATCH 66/69] staging: unisys: virthba: Fix CamelCase for Disk Add/Remove global variables
From: Ken Depro This patch fixes the Disk Add/Remove (DAR) related CamelCase global variables in virthba.c, reported by the checkpatch script: DARWorkQ --> dar_work_queue DARWorkQHead --> dar_work_queue_head DARWorkQLock --> dar_work_queue_lock DARWorkQSched --> dar_work_queue_sched Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 48 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index 8dd808d..aaf5319 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -195,7 +195,7 @@ struct virthba_info { struct virtdisk_info head; }; -/* Work Data for DARWorkQ */ +/* Work Data for dar_work_queue */ struct diskaddremove { u8 add; /* 0-remove, 1-add */ struct Scsi_Host *shost; /* Scsi Host for this virthba instance */ @@ -320,26 +320,26 @@ del_scsipending_entry(struct virthba_info *vhbainfo, uintptr_t del) return sent; } -/* DARWorkQ (Disk Add/Remove) */ -static struct work_struct DARWorkQ; -static struct diskaddremove *DARWorkQHead; -static spinlock_t DARWorkQLock; -static unsigned short DARWorkQSched; +/* dar_work_queue (Disk Add/Remove) */ +static struct work_struct dar_work_queue; +static struct diskaddremove *dar_work_queue_head; +static spinlock_t dar_work_queue_lock; +static unsigned short dar_work_queue_sched; #define QUEUE_DISKADDREMOVE(dar) { \ - spin_lock_irqsave(&DARWorkQLock, flags); \ - if (!DARWorkQHead) { \ - DARWorkQHead = dar; \ + spin_lock_irqsave(&dar_work_queue_lock, flags); \ + if (!dar_work_queue_head) { \ + dar_work_queue_head = dar; \ dar->next = NULL; \ } \ else { \ - dar->next = DARWorkQHead; \ - DARWorkQHead = dar; \ + dar->next = dar_work_queue_head; \ + dar_work_queue_head = dar; \ } \ - if (!DARWorkQSched) { \ - schedule_work(&DARWorkQ); \ - DARWorkQSched = 1; \ + if (!dar_work_queue_sched) { \ + schedule_work(&dar_work_queue); \ + dar_work_queue_sched = 1; \ } \ - spin_unlock_irqrestore(&DARWorkQLock, flags); \ + spin_unlock_irqrestore(&dar_work_queue_lock, flags); \ } static inline void @@ -367,7 +367,7 @@ SendDiskAddRemove(struct diskaddremove *dar) } /*/ -/* DARWorkQ Handler Thread */ +/* dar_work_queue Handler Thread */ /*/ static void doDiskAddRemove(struct work_struct *work) @@ -377,11 +377,11 @@ doDiskAddRemove(struct work_struct *work) int i = 0; unsigned long flags; - spin_lock_irqsave(&DARWorkQLock, flags); - tmphead = DARWorkQHead; - DARWorkQHead = NULL; - DARWorkQSched = 0; - spin_unlock_irqrestore(&DARWorkQLock, flags); + spin_lock_irqsave(&dar_work_queue_lock, flags); + tmphead = dar_work_queue_head; + dar_work_queue_head = NULL; + dar_work_queue_sched = 0; + spin_unlock_irqrestore(&dar_work_queue_lock, flags); while (tmphead) { dar = tmphead; tmphead = dar->next; @@ -391,7 +391,7 @@ doDiskAddRemove(struct work_struct *work) } /*/ -/* Routine to add entry to DARWorkQ */ +/* Routine to add entry to dar_work_queue*/ /*/ static void process_disk_notify(struct Scsi_Host *shost, struct uiscmdrsp *cmdrsp) @@ -1660,8 +1660,8 @@ virthba_mod_init(void) virthba_debugfs_dir, NULL, &debugfs_enable_ints_fops); /* Initialize dar_work_queue */ - INIT_WORK(&DARWorkQ, doDiskAddRemove); - spin_lock_init(&DARWorkQLock); + INIT_WORK(&dar_work_queue, doDiskAddRemove); + spin_lock_init(&dar_work_queue_lock); /* clear out array */ for (i = 0; i < VIRTHBASOPENMAX; i++) -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 51/69] staging: unisys: remove ERRDRV and related macros
Remove the ERRDRV() macro family and use pr_err directly everywhere it was used. Completely remove any error messages that used the macro but are redundant, for example, several of the messages were from memory allocation failures. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/timskmod.h | 9 +- drivers/staging/unisys/include/uisutils.h | 4 +- drivers/staging/unisys/include/uniklog.h | 38 -- drivers/staging/unisys/uislib/uislib.c | 120 +- drivers/staging/unisys/uislib/uisqueue.c | 4 +- drivers/staging/unisys/uislib/uisthread.c | 4 +- drivers/staging/unisys/uislib/uisutils.c | 24 ++-- drivers/staging/unisys/virthba/virthba.c | 87 ++--- drivers/staging/unisys/virtpci/virtpci.c | 71 ++- .../unisys/visorchannel/visorchannel_funcs.c | 41 +++--- drivers/staging/unisys/visorchipset/file.c | 16 +-- drivers/staging/unisys/visorchipset/parser.c | 39 +++--- .../unisys/visorchipset/visorchipset_main.c| 140 ++--- drivers/staging/unisys/visorutil/charqueue.c | 2 +- drivers/staging/unisys/visorutil/easyproc.c| 25 ++-- .../staging/unisys/visorutil/memregion_direct.c| 18 ++- drivers/staging/unisys/visorutil/periodic_work.c | 8 +- drivers/staging/unisys/visorutil/procobjecttree.c | 30 +++-- 18 files changed, 308 insertions(+), 372 deletions(-) diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h index cff7983..7831dbc 100644 --- a/drivers/staging/unisys/include/timskmod.h +++ b/drivers/staging/unisys/include/timskmod.h @@ -73,7 +73,7 @@ */ #define ASSERT(cond) \ do { if (!(cond)) \ - HUHDRV("ASSERT failed - %s", \ + pr_err("ASSERT failed - %s", \ __stringify(cond)); \ } while (0) @@ -88,19 +88,12 @@ } while (0) #define PRINTKDRV(fmt, args...) LOGINF(fmt, ## args) -#define TBDDRV(fmt, args...)LOGERR(fmt, ## args) -#define HUHDRV(fmt, args...)LOGERR(fmt, ## args) -#define ERRDRV(fmt, args...)LOGERR(fmt, ## args) #define WARNDRV(fmt, args...) LOGWRN(fmt, ## args) #define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args) #define INFODRV(fmt, args...) LOGINF(fmt, ## args) #define DEBUGDRV(fmt, args...) DBGINF(fmt, ## args) #define PRINTKDEV(devname, fmt, args...) LOGINFDEV(devname, fmt, ## args) -#define TBDDEV(devname, fmt, args...) LOGERRDEV(devname, fmt, ## args) -#define HUHDEV(devname, fmt, args...) LOGERRDEV(devname, fmt, ## args) -#define ERRDEV(devname, fmt, args...) LOGERRDEV(devname, fmt, ## args) -#define ERRDEVX(devno, fmt, args...) LOGERRDEVX(devno, fmt, ## args) #define WARNDEV(devname, fmt, args...)LOGWRNDEV(devname, fmt, ## args) #define SECUREDEV(devname, fmt, args...) LOGWRNDEV(devname, fmt, ## args) #define INFODEV(devname, fmt, args...)LOGINFDEV(devname, fmt, ## args) diff --git a/drivers/staging/unisys/include/uisutils.h b/drivers/staging/unisys/include/uisutils.h index 7414220..f937892 100644 --- a/drivers/staging/unisys/include/uisutils.h +++ b/drivers/staging/unisys/include/uisutils.h @@ -206,10 +206,10 @@ wait_for_valid_guid(uuid_le __iomem *guid) (void __iomem *)guid, sizeof(uuid_le)); if (uuid_le_cmp(tmpguid, NULL_UUID_LE) != 0) break; - LOGERR("Waiting for non-0 GUID (why???)...\n"); + pr_err("Waiting for non-0 GUID (why???)...\n"); UIS_THREAD_WAIT_SEC(5); } - LOGERR("OK... GUID is non-0 now\n"); + pr_err("OK... GUID is non-0 now\n"); } /* CopyFragsInfoFromSkb returns the number of entries added to frags array diff --git a/drivers/staging/unisys/include/uniklog.h b/drivers/staging/unisys/include/uniklog.h index ecd1bdb..e94120b 100644 --- a/drivers/staging/unisys/include/uniklog.h +++ b/drivers/staging/unisys/include/uniklog.h @@ -122,44 +122,6 @@ } while (0) /* - * # LOGERR - * - * \brief Log error message - logs a message at the LOG_ERR level, - *including source line number information - * - * \param devname the device name of the device reporting this message, or - *NULL if this message is NOT device-related. - * \param fmt printf()-style format string containing the message to log. - * \param args Optional arguments to be formatted and inserted into the format - * \param string. - * \return nothing - * - * Logs the specified error message at the LOG_ERR level. It will also - * include the file, line number, and function name of where the error - * originated in the log message. - */ -#define LOGERR(fmt, args...) pr_err(fmt, ## args) -#define LO
[PATCH 53/69] staging: unisys: get rid of LOGINFO() macros
Remove the entire set of LOGINFO() macros and replace them with calls to pr_info() instead. Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/include/timskmod.h | 5 -- drivers/staging/unisys/include/uniklog.h | 29 drivers/staging/unisys/uislib/uislib.c | 40 +- drivers/staging/unisys/uislib/uisthread.c | 6 +- drivers/staging/unisys/uislib/uisutils.c | 6 +- drivers/staging/unisys/virthba/virthba.c | 54 +++--- drivers/staging/unisys/virtpci/virtpci.c | 72 +- .../unisys/visorchannel/visorchannel_main.c| 4 +- drivers/staging/unisys/visorchipset/file.c | 6 +- .../unisys/visorchipset/visorchipset_main.c| 86 +++--- 10 files changed, 137 insertions(+), 171 deletions(-) diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h index 3d563c4..5f33d5c 100644 --- a/drivers/staging/unisys/include/timskmod.h +++ b/drivers/staging/unisys/include/timskmod.h @@ -87,16 +87,11 @@ (void *)(p2) = SWAPPOINTERS_TEMP; \ } while (0) -#define PRINTKDRV(fmt, args...) LOGINF(fmt, ## args) #define WARNDRV(fmt, args...) LOGWRN(fmt, ## args) #define SECUREDRV(fmt, args...) LOGWRN(fmt, ## args) -#define INFODRV(fmt, args...) LOGINF(fmt, ## args) -#define PRINTKDEV(devname, fmt, args...) LOGINFDEV(devname, fmt, ## args) #define WARNDEV(devname, fmt, args...)LOGWRNDEV(devname, fmt, ## args) #define SECUREDEV(devname, fmt, args...) LOGWRNDEV(devname, fmt, ## args) -#define INFODEV(devname, fmt, args...)LOGINFDEV(devname, fmt, ## args) -#define INFODEVX(devno, fmt, args...) LOGINFDEVX(devno, fmt, ## args) /** Verifies the consistency of your PRIVATEDEVICEDATA structure using * conventional "signature" fields: diff --git a/drivers/staging/unisys/include/uniklog.h b/drivers/staging/unisys/include/uniklog.h index edc12f0..74a723e 100644 --- a/drivers/staging/unisys/include/uniklog.h +++ b/drivers/staging/unisys/include/uniklog.h @@ -26,35 +26,6 @@ #include /* - * # LOGINF - * - * \brief Log informational message - logs a message at the LOG_INFO level - * - * \param devname the device name of the device reporting this message, or - *NULL if this message is NOT device-related. - * \param fmt printf()-style format string containing the message to log. - * \param args Optional arguments to be formatted and inserted into the - * format string. - * \return nothing - * - * Logs the specified message at the LOG_INFO level. - */ - -#define LOGINF(fmt, args...) pr_info(fmt, ## args) -#define LOGINFDEV(devname, fmt, args...) \ - pr_info("%s " fmt, devname, ## args) -#define LOGINFDEVX(devno, fmt, args...) \ - pr_info("dev%d " fmt, devno, ## args) -#define LOGINFNAME(vnic, fmt, args...) \ - do {\ - if (vnic != NULL) { \ - pr_info("%s " fmt, vnic->name, ## args);\ - } else {\ - pr_info(fmt, ## args); \ - } \ - } while (0) - -/* * # LOGVER * * \brief Log verbose message - logs a message at the LOG_DEBUG level, diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c index d986fde..b6a7fb0 100644 --- a/drivers/staging/unisys/uislib/uislib.c +++ b/drivers/staging/unisys/uislib/uislib.c @@ -671,7 +671,7 @@ static int destroy_device(struct controlvm_message *msg, char *buf) dev_no = msg->cmd.destroy_device.bus_no; read_lock(&bus_list_lock); - LOGINF("destroy_device called for bus_no=%u, dev_no=%u", bus_no, + pr_info("destroy_device called for bus_no=%u, dev_no=%u", bus_no, dev_no); for (bus = bus_list; bus; bus = bus->next) { if (bus->bus_no == bus_no) { @@ -733,12 +733,12 @@ static int destroy_device(struct controlvm_message *msg, char *buf) * kernel paging request" */ if (dev->polling) { - LOGINF("calling uislib_disable_channel_interrupts"); + pr_info("calling uislib_disable_channel_interrupts"); uislib_disable_channel_interrupts(bus_no, dev_no); } /* unmap the channel memory for the device. */ if (!msg->hdr.flags.test_message) { - LOGINF("destroy_device, doing iounmap"); + pr_info("destroy_device, doing iounmap"); uislib_iounmap(dev->chanptr); } kfree(dev); @@ -806,7 +806,7 @@ uislib_client_inject_add_bus(u32 bus_no, uuid_le
[PATCH 67/69] staging: unisys: virthba: Fix remaining CamelCase global variables
From: Ken Depro This patch fixes the remaining CamelCase global variables in virthba.c reported by the checkpatch script: MaxBuffLen --> max_buff_len VirtHbasOpen --> virthbas_open Signed-off-by: Ken Depro Signed-off-by: Benjamin Romer --- drivers/staging/unisys/virthba/virthba.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c index aaf5319..e03de4c 100644 --- a/drivers/staging/unisys/virthba/virthba.c +++ b/drivers/staging/unisys/virthba/virthba.c @@ -120,7 +120,7 @@ static ssize_t enable_ints_write(struct file *file, /*/ static int rsltq_wait_usecs = 4000;/* Default 4ms */ -static unsigned int MaxBuffLen; +static unsigned int max_buff_len; /* Module options */ static char *virthba_options = "NONE"; @@ -246,7 +246,7 @@ static const struct file_operations debugfs_enable_ints_fops = { #define VIRTHBASOPENMAX 1 /* array of open devices maintained by open() and close(); */ -static struct virthba_devices_open VirtHbasOpen[VIRTHBASOPENMAX]; +static struct virthba_devices_open virthbas_open[VIRTHBASOPENMAX]; static struct dentry *virthba_debugfs_dir; /*/ @@ -545,8 +545,8 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id) virthbainfo = (struct virthba_info *)scsihost->hostdata; memset(virthbainfo, 0, sizeof(struct virthba_info)); for (i = 0; i < VIRTHBASOPENMAX; i++) { - if (VirtHbasOpen[i].virthbainfo == NULL) { - VirtHbasOpen[i].virthbainfo = virthbainfo; + if (virthbas_open[i].virthbainfo == NULL) { + virthbas_open[i].virthbainfo = virthbainfo; break; } } @@ -954,8 +954,8 @@ virthba_queue_command_lck(struct scsi_cmnd *scsicmd, cmdrsp->scsi.bufflen = scsi_bufflen(scsicmd); /* keep track of the max buffer length so far. */ - if (cmdrsp->scsi.bufflen > MaxBuffLen) - MaxBuffLen = cmdrsp->scsi.bufflen; + if (cmdrsp->scsi.bufflen > max_buff_len) + max_buff_len = cmdrsp->scsi.bufflen; if (scsi_sg_count(scsicmd) > MAX_PHYS_INFO) { pr_err("scsicmd use_sg:%d greater than MAX:%d\n", @@ -1375,13 +1375,14 @@ static ssize_t info_debugfs_read(struct file *file, return -ENOMEM; for (i = 0; i < VIRTHBASOPENMAX; i++) { - if (VirtHbasOpen[i].virthbainfo == NULL) + if (virthbas_open[i].virthbainfo == NULL) continue; - virthbainfo = VirtHbasOpen[i].virthbainfo; + virthbainfo = virthbas_open[i].virthbainfo; str_pos += scnprintf(vbuf + str_pos, - len - str_pos, "MaxBuffLen:%u\n", MaxBuffLen); + len - str_pos, "max_buff_len:%u\n", + max_buff_len); str_pos += scnprintf(vbuf + str_pos, len - str_pos, "\nvirthba result queue poll wait:%d usecs.\n", @@ -1440,8 +1441,8 @@ static ssize_t enable_ints_write(struct file *file, const char __user *buffer, /* set all counts to new_value usually 0 */ for (i = 0; i < VIRTHBASOPENMAX; i++) { - if (VirtHbasOpen[i].virthbainfo != NULL) { - virthbainfo = VirtHbasOpen[i].virthbainfo; + if (virthbas_open[i].virthbainfo != NULL) { + virthbainfo = virthbas_open[i].virthbainfo; Features_addr = &virthbainfo->chinfo.queueinfo->chan->features; if (new_value == 1) { @@ -1665,7 +1666,7 @@ virthba_mod_init(void) /* clear out array */ for (i = 0; i < VIRTHBASOPENMAX; i++) - VirtHbasOpen[i].virthbainfo = NULL; + virthbas_open[i].virthbainfo = NULL; /* Initialize the serverdown workqueue */ virthba_serverdown_workqueue = create_singlethread_workqueue("virthba_serverdown"); -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
On Fri, Dec 05, 2014 at 12:44:07AM -0800, Joe Perches wrote: > On Fri, 2014-12-05 at 00:37 -0800, Tristan Lelong wrote: > > On Fri, Dec 05, 2014 at 12:28:11AM -0800, Joe Perches wrote: > > > On Fri, 2014-12-05 at 00:03 -0800, Tristan Lelong wrote: > [] > > > > diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c > > > > b/drivers/staging/lustre/lustre/fld/lproc_fld.c > [] > > > > + char name[80]; > [] > > > Why 80? Is there no #define for this length? > > > > > No, there is no define. > > > > I thought about adding one, but several other files and structure > > members in the lustre sources are using this specific value, and it > > seemed like a modification to do in another patch. > > > > Let me know if you feel I should do it in a patch serie. > > No worries if it's not a new number. > > It'd be nice if you would submit a new > patch with a #define and a conversion > to use the #define one day. > > No worries, I'll be happy to submit a patch to fix this soon. Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
On Fri, Dec 05, 2014 at 01:27:23PM -0800, Greg KH wrote: > On Fri, Dec 05, 2014 at 12:03:47AM -0800, Tristan Lelong wrote: > > static ssize_t > > -fld_proc_hash_seq_write(struct file *file, const char *buffer, > > - size_t count, loff_t *off) > > +fld_proc_hash_seq_write(struct file *file, > > + const char __user *buffer, > > + size_t count, loff_t *off) > > { > > struct lu_client_fld *fld; > > struct lu_fld_hash *hash = NULL; > > + char name[80]; > > int i; > > > > + if (count > 80) > > + return -ENAMETOOLONG; > > + > > + if (copy_from_user(name, buffer, count) != 0) > > + return -EFAULT; > > How was this code ever working before? I have no idea, and was actually surprised that this was there. > > And I know Joe asked, but how do you know that 80 is ok? And why on the > stack? 80 is the sizeof(struct lu_fld_hash.fh_name) and there is no define for that. A few other structure members are using this 80 value internally, and as I told Joe, I will analyze if they are all related and submit a patch to use a define instead. > > Shouldn't you just compare count to strlen(fld_hash[i].fh_name)? like you > do later on? > This is actually done in the for loop already. I first compare with the maximum size, then the loop use the strlen of each entries in the table, and finally does the strncmp. > > Anyway, I don't like large stack variables like this, can you make it > dynamic instead? > I can definitely do this with a kmalloc, I'll submit a v2 tonight. Thanks ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH V2 1/1] Drivers: hv: vmbus: Implement a clockevent device
> -Original Message- > From: Jason Wang [mailto:jasow...@redhat.com] > Sent: Thursday, December 4, 2014 10:52 PM > To: KY Srinivasan > Cc: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; KY > Srinivasan > Subject: Re: [PATCH V2 1/1] Drivers: hv: vmbus: Implement a clockevent > device > > > > On Fri, Dec 5, 2014 at 10:18 AM, K. Y. Srinivasan > wrote: > > Implement a clockevent device based on the timer support available on > > Hyper-V. > > > > Signed-off-by: K. Y. Srinivasan > > --- > > arch/x86/include/uapi/asm/hyperv.h | 11 + > > drivers/hv/hv.c| 78 > > > > drivers/hv/hyperv_vmbus.h | 21 ++ > > drivers/hv/vmbus_drv.c | 40 +- > > 4 files changed, 148 insertions(+), 2 deletions(-) > > > > diff --git a/arch/x86/include/uapi/asm/hyperv.h > > b/arch/x86/include/uapi/asm/hyperv.h > > index 462efe7..90c458e 100644 > > --- a/arch/x86/include/uapi/asm/hyperv.h > > +++ b/arch/x86/include/uapi/asm/hyperv.h > > @@ -187,6 +187,17 @@ > > #define HV_X64_MSR_SINT14 0x409E > > #define HV_X64_MSR_SINT15 0x409F > > > > +/* > > + * Synthetic Timer MSRs. Four timers per vcpu. > > + */ > > +#define HV_X64_MSR_STIMER0_CONFIG 0x40B0 > > +#define HV_X64_MSR_STIMER0_COUNT 0x40B1 > > +#define HV_X64_MSR_STIMER1_CONFIG 0x40B2 > > +#define HV_X64_MSR_STIMER1_COUNT 0x40B3 > > +#define HV_X64_MSR_STIMER2_CONFIG 0x40B4 > > +#define HV_X64_MSR_STIMER2_COUNT 0x40B5 > > +#define HV_X64_MSR_STIMER3_CONFIG 0x40B6 > > +#define HV_X64_MSR_STIMER3_COUNT 0x40B7 > > > > #define HV_X64_MSR_HYPERCALL_ENABLE0x0001 > > #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT12 > > diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 3e4235c..e2749c0 > > 100644 > > --- a/drivers/hv/hv.c > > +++ b/drivers/hv/hv.c > > @@ -28,7 +28,9 @@ > > #include > > #include > > #include > > +#include > > #include > > +#include > > #include "hyperv_vmbus.h" > > > > /* The one and only */ > > @@ -37,6 +39,10 @@ struct hv_context hv_context = { > > .hypercall_page = NULL, > > }; > > > > +#define HV_TIMER_FREQUENCY (10 * 1000 * 1000) /* 100ns period */ > > +#define HV_MAX_MAX_DELTA_TICKS 0x #define > HV_MIN_DELTA_TICKS > > +1 > > + > > /* > > * query_hypervisor_info - Get version info of the windows hypervisor > > */ > > @@ -144,6 +150,8 @@ int hv_init(void) > >sizeof(int) * NR_CPUS); > > memset(hv_context.event_dpc, 0, > >sizeof(void *) * NR_CPUS); > > + memset(hv_context.clk_evt, 0, > > + sizeof(void *) * NR_CPUS); > > > > max_leaf = query_hypervisor_info(); > > > > @@ -258,10 +266,63 @@ u16 hv_signal_event(void *con_id) > > return status; > > } > > > > +static int hv_ce_set_next_event(unsigned long delta, > > + struct clock_event_device *evt) > > +{ > > + cycle_t current_tick; > > + > > + WARN_ON(evt->mode != CLOCK_EVT_MODE_ONESHOT); > > + > > + rdmsrl(HV_X64_MSR_TIME_REF_COUNT, current_tick); > > + current_tick += delta; > > + wrmsrl(HV_X64_MSR_STIMER0_COUNT, current_tick); > > + return 0; > > +} > > + > > +static void hv_ce_setmode(enum clock_event_mode mode, > > + struct clock_event_device *evt) > > +{ > > + union hv_timer_config timer_cfg; > > + > > + switch (mode) { > > + case CLOCK_EVT_MODE_PERIODIC: > > + /* unsupported */ > > + break; > > + > > + case CLOCK_EVT_MODE_ONESHOT: > > + timer_cfg.enable = 1; > > + timer_cfg.auto_enable = 1; > > + timer_cfg.sintx = VMBUS_MESSAGE_SINT; > > + wrmsrl(HV_X64_MSR_STIMER0_CONFIG, > timer_cfg.as_uint64); > > + break; > > + > > + case CLOCK_EVT_MODE_UNUSED: > > + case CLOCK_EVT_MODE_SHUTDOWN: > > + wrmsrl(HV_X64_MSR_STIMER0_COUNT, 0); > > + wrmsrl(HV_X64_MSR_STIMER0_CONFIG, 0); > > + break; > > + case CLOCK_EVT_MODE_RESUME: > > + break; > > + } > > +} > > + > > +static void hv_init_clockevent_device(struct clock_event_device > > *dev, int cpu) > > +{ > > + dev->name = "Hyper-V clockevent"; > > + dev->features = CLOCK_EVT_FEAT_ONESHOT; > > + dev->cpumask = cpumask_of(cpu); > > + dev->rating = 1000, > > + dev->owner = THIS_MODULE, > > + > > + dev->set_mode = hv_ce_setmode; > > + dev->set_next_event = hv_ce_set_next_event; } > > + > > > > int hv_synic_alloc(void) > > { > > size_t size = sizeof(struct tasklet_struct); > > + size_t ced_size = sizeof(struct clock_event_device); > > int cpu; > > > > for_each_online_cpu(cpu) { > > @@ -272,6 +333,13 @@ int hv_synic_alloc(void) > > } > > tasklet_init(hv_context.event_dpc[cpu], vmbus_on_event,
Re: [PATCH 29/69] staging: unisys: rename Initialize_incoming_thread()
> static BOOL > -Initialize_incoming_thread(void) > +initialize_incoming_thread(void) > { > if (incoming_started) > return TRUE; > if (!uisthread_start(&incoming_ti, > &process_incoming, NULL, "dev_incoming")) { > - LOGERR("uisthread_start Initialize_incoming_thread > FAILED"); > + LOGERR("uisthread_start initialize_incoming_thread > FAILED"); Not related to the patch, but improving the error message with a return code saying + LOGERR("failed to start the thread, reason = %d\n", ret); You might consider using dev_ routines for logging than the driver wrappers. > return FALSE; > } > incoming_started = TRUE; > @@ -1373,7 +1373,7 @@ uislib_enable_channel_interrupts(u32 bus_no, u32 dev_no, > return; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/69] staging: unisys: refactor create_bus()
On Fri, Dec 5, 2014 at 5:08 PM, Benjamin Romer wrote: > Fix the missing braces and logical continuation problems in create_bus(). > > Signed-off-by: Ken Depro > Signed-off-by: Benjamin Romer > --- > drivers/staging/unisys/uislib/uislib.c | 14 -- > 1 file changed, 8 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/unisys/uislib/uislib.c > b/drivers/staging/unisys/uislib/uislib.c > index f25dd2f..1ddbe78 100644 > --- a/drivers/staging/unisys/uislib/uislib.c > +++ b/drivers/staging/unisys/uislib/uislib.c > @@ -192,8 +192,10 @@ create_bus(struct controlvm_message *msg, char *buf) > bus->guest_handle = 0; > bus->bus_no = busNo; > bus->local_vnic = 1; > - } else > - bus->bus_no = bus->guest_handle = busNo; > + } else { > + bus->bus_no = busNo; > + bus->guest_handle = busNo; You might consider not using camel case letters.. > + } > sprintf(bus->name, "%d", (int)bus->bus_no); > bus->device_count = deviceCount; > bus->device = > @@ -220,8 +222,8 @@ create_bus(struct controlvm_message *msg, char *buf) > kfree(bus); > return CONTROLVM_RESP_ERROR_ALREADY_DONE; > } > - if ((msg->cmd.create_bus.channel_addr != 0) > - && (msg->cmd.create_bus.channel_bytes != 0)) { > + if ((msg->cmd.create_bus.channel_addr != 0) && > + (msg->cmd.create_bus.channel_bytes != 0)) { This check can be written as + if (msg->cmd.create_bus.channel_addr && + msg->cmd.create_bus.channel_bytes) { > bus->bus_channel_bytes = msg->cmd.create_bus.channel_bytes; > bus->bus_channel = > init_vbus_channel(msg->cmd.create_bus.channel_addr, > @@ -256,9 +258,9 @@ create_bus(struct controlvm_message *msg, char *buf) > > /* add bus at the head of our list */ > write_lock(&BusListLock); > - if (!BusListHead) > + if (!BusListHead) { please try not to use camel case letters... > BusListHead = bus; > - else { > + } else { > bus->next = BusListHead; > BusListHead = bus; > } > -- > 2.1.0 > > ___ > devel mailing list > de...@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: panel: Remove magic numbers in LCD commands
On Fri, Dec 05, 2014 at 10:10:43PM +0100, Mariusz Gorski wrote: > Get rid of magic numbers in LCD commands and replace them with defined > values, so that it's more obvious that the commands are doing. > > Signed-off-by: Mariusz Gorski I didn't remember I wrote something that awful! Obvious ack. Acked-by: Willy Tarreau Thanks, willy ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH V3 1/1] Drivers: hv: vmbus: Implement a clockevent device
Implement a clockevent device based on the timer support available on Hyper-V. In This version of the patch I have addressed Jason's review comments. Signed-off-by: K. Y. Srinivasan Reviewed-by: Jason Wang --- arch/x86/include/uapi/asm/hyperv.h | 11 + drivers/hv/hv.c| 78 drivers/hv/hyperv_vmbus.h | 21 ++ drivers/hv/vmbus_drv.c | 37 - 4 files changed, 145 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/uapi/asm/hyperv.h b/arch/x86/include/uapi/asm/hyperv.h index 462efe7..90c458e 100644 --- a/arch/x86/include/uapi/asm/hyperv.h +++ b/arch/x86/include/uapi/asm/hyperv.h @@ -187,6 +187,17 @@ #define HV_X64_MSR_SINT14 0x409E #define HV_X64_MSR_SINT15 0x409F +/* + * Synthetic Timer MSRs. Four timers per vcpu. + */ +#define HV_X64_MSR_STIMER0_CONFIG 0x40B0 +#define HV_X64_MSR_STIMER0_COUNT 0x40B1 +#define HV_X64_MSR_STIMER1_CONFIG 0x40B2 +#define HV_X64_MSR_STIMER1_COUNT 0x40B3 +#define HV_X64_MSR_STIMER2_CONFIG 0x40B4 +#define HV_X64_MSR_STIMER2_COUNT 0x40B5 +#define HV_X64_MSR_STIMER3_CONFIG 0x40B6 +#define HV_X64_MSR_STIMER3_COUNT 0x40B7 #define HV_X64_MSR_HYPERCALL_ENABLE0x0001 #define HV_X64_MSR_HYPERCALL_PAGE_ADDRESS_SHIFT12 diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 3e4235c..e2749c0 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -28,7 +28,9 @@ #include #include #include +#include #include +#include #include "hyperv_vmbus.h" /* The one and only */ @@ -37,6 +39,10 @@ struct hv_context hv_context = { .hypercall_page = NULL, }; +#define HV_TIMER_FREQUENCY (10 * 1000 * 1000) /* 100ns period */ +#define HV_MAX_MAX_DELTA_TICKS 0x +#define HV_MIN_DELTA_TICKS 1 + /* * query_hypervisor_info - Get version info of the windows hypervisor */ @@ -144,6 +150,8 @@ int hv_init(void) sizeof(int) * NR_CPUS); memset(hv_context.event_dpc, 0, sizeof(void *) * NR_CPUS); + memset(hv_context.clk_evt, 0, + sizeof(void *) * NR_CPUS); max_leaf = query_hypervisor_info(); @@ -258,10 +266,63 @@ u16 hv_signal_event(void *con_id) return status; } +static int hv_ce_set_next_event(unsigned long delta, + struct clock_event_device *evt) +{ + cycle_t current_tick; + + WARN_ON(evt->mode != CLOCK_EVT_MODE_ONESHOT); + + rdmsrl(HV_X64_MSR_TIME_REF_COUNT, current_tick); + current_tick += delta; + wrmsrl(HV_X64_MSR_STIMER0_COUNT, current_tick); + return 0; +} + +static void hv_ce_setmode(enum clock_event_mode mode, + struct clock_event_device *evt) +{ + union hv_timer_config timer_cfg; + + switch (mode) { + case CLOCK_EVT_MODE_PERIODIC: + /* unsupported */ + break; + + case CLOCK_EVT_MODE_ONESHOT: + timer_cfg.enable = 1; + timer_cfg.auto_enable = 1; + timer_cfg.sintx = VMBUS_MESSAGE_SINT; + wrmsrl(HV_X64_MSR_STIMER0_CONFIG, timer_cfg.as_uint64); + break; + + case CLOCK_EVT_MODE_UNUSED: + case CLOCK_EVT_MODE_SHUTDOWN: + wrmsrl(HV_X64_MSR_STIMER0_COUNT, 0); + wrmsrl(HV_X64_MSR_STIMER0_CONFIG, 0); + break; + case CLOCK_EVT_MODE_RESUME: + break; + } +} + +static void hv_init_clockevent_device(struct clock_event_device *dev, int cpu) +{ + dev->name = "Hyper-V clockevent"; + dev->features = CLOCK_EVT_FEAT_ONESHOT; + dev->cpumask = cpumask_of(cpu); + dev->rating = 1000, + dev->owner = THIS_MODULE, + + dev->set_mode = hv_ce_setmode; + dev->set_next_event = hv_ce_set_next_event; +} + int hv_synic_alloc(void) { size_t size = sizeof(struct tasklet_struct); + size_t ced_size = sizeof(struct clock_event_device); int cpu; for_each_online_cpu(cpu) { @@ -272,6 +333,13 @@ int hv_synic_alloc(void) } tasklet_init(hv_context.event_dpc[cpu], vmbus_on_event, cpu); + hv_context.clk_evt[cpu] = kzalloc(ced_size, GFP_ATOMIC); + if (hv_context.clk_evt[cpu] == NULL) { + pr_err("Unable to allocate clock event device\n"); + goto err; + } + hv_init_clockevent_device(hv_context.clk_evt[cpu], cpu); + hv_context.synic_message_page[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); @@ -305,6 +373,7 @@ err: static void hv_synic_free_cpu(int cpu) { kfree(hv_context.event_dpc[cpu]); + kfree(hv_context.clk_evt[cpu]); if (hv_context.synic_event_pag
[PATCH 0/2] Drivers: hv: hv_balloon: Fix a deadlock in the hot-add path.
Fix a deadlock in the hot-add path in the Hyper-V balloon driver. K. Y. Srinivasan (2): Drivers: base: core: Export functions to lock/unlock device hotplug lock Drivers: hv: balloon: Fix the deadlock issue in the memory hot-add code drivers/base/core.c |2 ++ drivers/hv/hv_balloon.c |4 2 files changed, 6 insertions(+), 0 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] Drivers: hv: balloon: Fix the deadlock issue in the memory hot-add code
Andy Whitcroft initially saw this deadlock. We have seen this as well. Here is the original description of the problem (and a potential solution) from Andy: https://lkml.org/lkml/2014/3/14/451 Here is an excerpt from that mail: "We are seeing machines lockup with what appears to be an ABBA deadlock in the memory hotplug system. These are from the 3.13.6 based Ubuntu kernels. The hv_balloon driver is adding memory using add_memory() which takes the hotplug lock, and then emits a udev event, and then attempts to lock the sysfs device. In response to the udev event udev opens the sysfs device and locks it, then attempts to grab the hotplug lock to online the memory. This seems to be inverted nesting in the two cases, leading to the hangs below: [ 240.608612] INFO: task kworker/0:2:861 blocked for more than 120 seconds. [ 240.608705] INFO: task systemd-udevd:1906 blocked for more than 120 seconds. I note that the device hotplug locking allows complete retries (via ERESTARTSYS) and if we could detect this at the online stage it could be used to get us out. But before I go down this road I wanted to make sure I am reading this right. Or indeed if the hv_balloon driver is just doing this wrong." This patch is based on the suggestion from Yasuaki Ishimatsu Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv_balloon.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c index afdb0d5..f525a62 100644 --- a/drivers/hv/hv_balloon.c +++ b/drivers/hv/hv_balloon.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -649,8 +650,11 @@ static void hv_mem_hot_add(unsigned long start, unsigned long size, release_region_mutex(false); nid = memory_add_physaddr_to_nid(PFN_PHYS(start_pfn)); + + lock_device_hotplug(); ret = add_memory(nid, PFN_PHYS((start_pfn)), (HA_CHUNK << PAGE_SHIFT)); + unlock_device_hotplug(); if (ret) { pr_info("hot_add memory failed error is %d\n", ret); -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] Drivers: base: core: Export functions to lock/unlock device hotplug lock
The Hyper-V balloon driver does memory hot-add. The device_hotplug_lock is designed to address AB BA deadlock issues between the hot-add path and the sysfs path. Export the APIs to acquire and release the device_hotplug_lock for use by loadable modules that want to hot-add memory or CPU. Signed-off-by: K. Y. Srinivasan --- drivers/base/core.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 97e2baf..b3073af 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -55,11 +55,13 @@ void lock_device_hotplug(void) { mutex_lock(&device_hotplug_lock); } +EXPORT_SYMBOL_GPL(lock_device_hotplug); void unlock_device_hotplug(void) { mutex_unlock(&device_hotplug_lock); } +EXPORT_SYMBOL_GPL(unlock_device_hotplug); int lock_device_hotplug_sysfs(void) { -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 2/2] staging: media: lirc: lirc_zilog.c: keep consistency in dev functions
Em Fri, 05 Dec 2014 12:35:25 + Luis de Bethencourt escreveu: > On 5 December 2014 at 12:28, Dan Carpenter wrote: > > > On Thu, Dec 04, 2014 at 10:35:24PM +, Luis de Bethencourt wrote: > > > The previous patch switched some dev functions to move the string to a > > second > > > line. Doing this for all similar functions because it makes the driver > > easier > > > to read if all similar lines use the same criteria. > > > > > > Signed-off-by: Luis de Bethencourt > > > --- > > > drivers/staging/media/lirc/lirc_zilog.c | 155 > > +--- > > > 1 file changed, 102 insertions(+), 53 deletions(-) > > > > > > diff --git a/drivers/staging/media/lirc/lirc_zilog.c > > b/drivers/staging/media/lirc/lirc_zilog.c > > > index 8814a7e..af46827 100644 > > > --- a/drivers/staging/media/lirc/lirc_zilog.c > > > +++ b/drivers/staging/media/lirc/lirc_zilog.c > > > @@ -322,7 +322,8 @@ static int add_to_buf(struct IR *ir) > > > struct IR_tx *tx; > > > > > > if (lirc_buffer_full(rbuf)) { > > > - dev_dbg(ir->l.dev, "buffer overflow\n"); > > > + dev_dbg(ir->l.dev, > > > + "buffer overflow\n"); > > > > No. Don't do this. It's better if it is on one line. > > > > regards, > > dan carpenter > > > > > I was following Mauro's suggestions. As replied to the previous version of > the patch. > > I agree that in short uses of dev_dbg it adds unnecessary lines and > vertical length to the file. In the specific case that Dan pointed, the entire statement fits on 80 cols. We only add vertical alignments when it doesn't fit on 80 columns. > > Thanks for looking at my patch :) > > Luis -- Cheers, Mauro ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
drivers:scsi:storvsc: Fix a bug in handling ring buffer failures that may result in I/O freeze
When ring buffer returns an error indicating retry, storvsc may not return a proper error code to SCSI when bounce buffer is not used. This has introduced I/O freeze on RAID running atop storvsc devices. This patch fixes it by always returning a proper error code. Signed-off-by: Long Li Reviewed-by: K. Y. Srinivasan --- drivers/scsi/storvsc_drv.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index e3ba251..4cff0dd 100644 --- a/drivers/scsi/storvsc_drv.c +++ b/drivers/scsi/storvsc_drv.c @@ -1688,13 +1688,12 @@ static int storvsc_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scmnd) if (ret == -EAGAIN) { /* no more space */ - if (cmd_request->bounce_sgl_count) { + if (cmd_request->bounce_sgl_count) destroy_bounce_buffer(cmd_request->bounce_sgl, cmd_request->bounce_sgl_count); - ret = SCSI_MLQUEUE_DEVICE_BUSY; - goto queue_error; - } + ret = SCSI_MLQUEUE_DEVICE_BUSY; + goto queue_error; } return 0; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel