Re: [PATCH 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor
>>> On 27.08.13 at 01:42, "K. Y. Srinivasan" wrote: > Hyper-V supports a mechanism for retrieving the local API frequency. "APIC"? > @@ -27,6 +27,13 @@ > #define HV_X64_MSR_VP_RUNTIME_AVAILABLE (1 << 0) > /* Partition Reference Counter (HV_X64_MSR_TIME_REF_COUNT) available*/ > #define HV_X64_MSR_TIME_REF_COUNT_AVAILABLE (1 << 1) > + > +/* Local APIC timer frequency MSR (HV_X64_MSR_APIC_FREQUENCY) is available */ > +#define HV_X64_MSR_APIC_FREQUENCY_AVAILABLE (1 << 11) > + > +/* TSC frequency MSR (HV_X64_MSR_TSC_FREQUENCY) is available */ > +#define HV_X64_MSR_TSC_FREQUENCY_AVAILABLE (1 << 11) Are these two really the same bit? If so, why two different names? > @@ -136,6 +143,12 @@ > /* MSR used to read the per-partition time reference counter */ > #define HV_X64_MSR_TIME_REF_COUNT0x4020 > > +/* MSR used to retrive the TSC frequency */ > +#define HV_X64_MSR_TSC_FREQUENCY 0x4022 > + > +/* MSR used to retrive the local APIC timer frequency */ > +#define HV_X64_MSR_APIC_FREQUENCY0x4023 "retrieve" (twice)? > @@ -76,6 +77,22 @@ static void __init ms_hyperv_init_platform(void) > printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n", > ms_hyperv.features, ms_hyperv.hints); > > + if (ms_hyperv.features & HV_X64_MSR_APIC_FREQUENCY_AVAILABLE) { > + /* > + * There is no need to calibrate APIC timer frequency; > + * nor is there a need to calibrate timer. > + */ > + legacy_pic = &null_legacy_pic; This clearly disables more than just the calibration, so the comment may be misleading to future readers. > + > + /* > + * Get the APIC frequency. > + */ > + rdmsrl(HV_X64_MSR_APIC_FREQUENCY, lapic_timer_frequency); > + lapic_timer_frequency /= HZ; Is this safe? I.e. are the high 32 bits of the MSR guaranteed to be zero, now and forever? > + printk(KERN_INFO "HyperV: LAPIC Timer Frequency: 0x%x\n", > + lapic_timer_frequency); As a minor note, I generally recommend using %#x as being one byte shorter than the spelled out 0x%x. Jan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/4] staging: comedi: drivers: more users of comedi_dio_insn_config()
On 2013-08-26 23:27, H Hartley Sweeten wrote: These drivers all improperly implement the (*insn_config) for a DIO subdevice. They all treat the data[0] value as a flag to configure the channel in insn->chanspec as either an output or an input. The data[0] value is actually the 'instruction' to be performed on the channel. Use the comedi_dio_insn_config() helper to properly handle instructions. H Hartley Sweeten (4): staging: comedi: dt2817: fix dt2817_dio_insn_config() staging: comedi: dt282x: fix dt282x_dio_insn_config() staging: comedi: dmm32at: fix dmm32at_dio_insn_config() staging: comedi: ni_atmio16d: fix atmio16d_dio_insn_config() drivers/staging/comedi/drivers/dmm32at.c | 35 +++- drivers/staging/comedi/drivers/dt2817.c | 30 +++- drivers/staging/comedi/drivers/dt282x.c | 25 +++- drivers/staging/comedi/drivers/ni_atmio16d.c | 22 ++--- 4 files changed, 60 insertions(+), 52 deletions(-) This changes the behaviour of some oddball drivers in favour of consistency, which isn't a bad thing. The affected drivers now support INSN_CONFIG_DIO_QUERY properly instead of treating it like INSN_CONFIG_DIO_OUTPUT (basically, anything other than INSN_CONFIG_DIO_INPUT was treated like INSN_CONFIG_DIO_OUTPUT). (The "ni_atmio16d" driver tried to be clever in allowing several channels to be configured at once.) Looks good! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 13/15] staging: comedi: comedi_bond: handle base channel for insn_bits
On 2013-08-23 16:01, hartl...@visionengravers.com wrote: Ian, I have not had a chance to look this series over yet but I had an off topic comment about kcomedilib. Is it too late to rename the exports from that driver? It would be a lot clearer if the "core" exports were prefixed with "comedi_" and the exports provided to the kernel by kcomedilib where prefixed differently, maybe as "kcomedi_" or even "komedi_". Right now I think the only driver using kcomedilib is the comedi_bond driver. I like to think of kcomedilib as an extended offshoot of the comedi core. At one time it was used heavily by RTAI (www.rtai.org) applications running at kernel level, but now it has been stripped down to the bare minimum and is only currently used to support the comedi_bond driver. Because it was originally a kernel-level equivalent of the user-space comedilib library, the function names were chosen to match. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/4] staging: comedi: drivers: more users of comedi_dio_insn_config()
On 2013-08-27 11:16, Ian Abbott wrote: (The "ni_atmio16d" driver tried to be clever in allowing several channels to be configured at once.) Actually it wasn't, but what it was doing was pretty silly. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/24] Staging: winbond: Fixed some coding style issues
On Mon, 26 Aug 2013 19:43:06 +0300 Dan Carpenter wrote: > Btw, all the white space nit-pick I pointed out were pretty minor. I > don't like making people redo stuff so you can fix anything you want to > in later patches. > > regards, > dan carpenter > I write it down for the next series of patches but I will wait to start them until the previous are accepted. -- Regards, Iker Pedrosa ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: tty.c: updates uart_struct declaration for sparse
This patch edits the type casts neo_uart_struct and cls_uart_struct. A previous patch added the marker __iomem to these structs. This patch ensures that the change to the marker is consistent. This also removes these sparse warnings: warning: incorrect type in assignment (different address spaces) expected struct neo_uart_struct [noderef] *ch_neo_uart got struct neo_uart_struct * warning: incorrect type in assignment (different address spaces) expected struct cls_uart_struct [noderef] *ch_cls_uart got struct cls_uart_struct * Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index a54b829..a36fae8 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -403,9 +403,9 @@ int dgnc_tty_init(struct board_t *brd) ch->ch_pun.un_dev = i + 128; if (brd->bd_uart_offset == 0x200) - ch->ch_neo_uart = (struct neo_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); + ch->ch_neo_uart = (struct __iomem neo_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); else - ch->ch_cls_uart = (struct cls_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); + ch->ch_cls_uart = (struct __iomem cls_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); ch->ch_bd = brd; ch->ch_portnum = i; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: driver.c and .h: changes kzmalloc param for sparse
This patch changes the dgnc_driver_kzmalloc declaration. The kernel's kmalloc function previously took an int priority. That's been replaced with gfp_t flags. The warning was caught by sparse. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_driver.c | 4 ++-- drivers/staging/dgnc/dgnc_driver.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 8032368..2812453 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -901,9 +901,9 @@ static void dgnc_init_globals(void) * * Malloc and clear memory, */ -void *dgnc_driver_kzmalloc(size_t size, int priority) +void *dgnc_driver_kzmalloc(size_t size, gfp_t flags) { - void *p = kmalloc(size, priority); + void *p = kmalloc(size, flags); if(p) memset(p, 0, size); return(p); diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index e77303c..6d9b86e 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -542,7 +542,7 @@ struct channel_t { */ extern int dgnc_ms_sleep(ulong ms); -extern void*dgnc_driver_kzmalloc(size_t size, int priority); +extern void*dgnc_driver_kzmalloc(size_t size, gfp_t flags); extern char*dgnc_ioctl_name(int cmd); /* -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: ozwpan: Increase ISOC IN buffer depth
Increase ISOC IN buffer depth to 100 units. Signed-off-by: Rupesh Gujare --- drivers/staging/ozwpan/ozhcd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c index 3548860..b0398c5 100644 --- a/drivers/staging/ozwpan/ozhcd.c +++ b/drivers/staging/ozwpan/ozhcd.c @@ -39,7 +39,7 @@ * Number of units of buffering to capture for an isochronous IN endpoint before * allowing data to be indicated up. */ -#define OZ_IN_BUFFERING_UNITS 50 +#define OZ_IN_BUFFERING_UNITS 100 /* Name of our platform device. */ -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: ozwpan: Add debounce time before unregistering.
Fixes following error caused during unloading driver. [ 1127.542888] usb 5-1: USB disconnect, device number 2 [ 1127.542909] ozwpan ozwpan: remove, state 1 [ 1127.542933] usb usb5: USB disconnect, device number 1 [ 1127.618634] hub 5-0:1.0: hub_port_status failed (err = -19) [ 1127.618647] hub_port_connect_change: 45 callbacks suppressed [ 1127.618657] hub 5-0:1.0: connect-debounce failed, port 1 disabled [ 1127.618668] hub 5-0:1.0: cannot disable port 1 (err = -19) Signed-off-by: Rupesh Gujare --- drivers/staging/ozwpan/ozhcd.c |5 + 1 file changed, 5 insertions(+) diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c index 39f5066..d9c43c3 100644 --- a/drivers/staging/ozwpan/ozhcd.c +++ b/drivers/staging/ozwpan/ozhcd.c @@ -57,6 +57,10 @@ */ #define EP0_TIMEOUT_COUNTER 13 +/* Debounce time HCD driver should wait before unregistering. + */ +#define OZ_HUB_DEBOUNCE_TIMEOUT 1500 + /* * Used to link urbs together and also store some status information for each * urb. @@ -2355,6 +2359,7 @@ error: */ void oz_hcd_term(void) { + msleep(OZ_HUB_DEBOUNCE_TIMEOUT); tasklet_kill(&g_urb_process_tasklet); tasklet_kill(&g_urb_cancel_tasklet); platform_device_unregister(g_plat_dev); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 1/1] X86: Hyper-V: Get the local APIC timer frequency from the hypervisor
> -Original Message- > From: Jan Beulich [mailto:jbeul...@suse.com] > Sent: Tuesday, August 27, 2013 12:26 AM > To: KY Srinivasan > Cc: o...@aepfle.de; a...@canonical.com; x...@kernel.org; > de...@linuxdriverproject.org; gre...@linuxfoundation.org; > jasow...@redhat.com; linux-ker...@vger.kernel.org; h...@zytor.com > Subject: Re: [PATCH 1/1] X86: Hyper-V: Get the local APIC timer frequency from > the hypervisor > > >>> On 27.08.13 at 01:42, "K. Y. Srinivasan" wrote: > > Hyper-V supports a mechanism for retrieving the local API frequency. > > "APIC"? > > > @@ -27,6 +27,13 @@ > > #define HV_X64_MSR_VP_RUNTIME_AVAILABLE(1 << 0) > > /* Partition Reference Counter (HV_X64_MSR_TIME_REF_COUNT) available*/ > > #define HV_X64_MSR_TIME_REF_COUNT_AVAILABLE(1 << 1) > > + > > +/* Local APIC timer frequency MSR (HV_X64_MSR_APIC_FREQUENCY) is > available */ > > +#define HV_X64_MSR_APIC_FREQUENCY_AVAILABLE (1 << 11) > > + > > +/* TSC frequency MSR (HV_X64_MSR_TSC_FREQUENCY) is available */ > > +#define HV_X64_MSR_TSC_FREQUENCY_AVAILABLE (1 << 11) > > Are these two really the same bit? If so, why two different names? > > > @@ -136,6 +143,12 @@ > > /* MSR used to read the per-partition time reference counter */ > > #define HV_X64_MSR_TIME_REF_COUNT 0x4020 > > > > +/* MSR used to retrive the TSC frequency */ > > +#define HV_X64_MSR_TSC_FREQUENCY 0x4022 > > + > > +/* MSR used to retrive the local APIC timer frequency */ > > +#define HV_X64_MSR_APIC_FREQUENCY 0x4023 > > "retrieve" (twice)? > > > @@ -76,6 +77,22 @@ static void __init ms_hyperv_init_platform(void) > > printk(KERN_INFO "HyperV: features 0x%x, hints 0x%x\n", > >ms_hyperv.features, ms_hyperv.hints); > > > > + if (ms_hyperv.features & HV_X64_MSR_APIC_FREQUENCY_AVAILABLE) { > > + /* > > +* There is no need to calibrate APIC timer frequency; > > +* nor is there a need to calibrate timer. > > +*/ > > + legacy_pic = &null_legacy_pic; > > This clearly disables more than just the calibration, so the comment > may be misleading to future readers. > > > + > > + /* > > +* Get the APIC frequency. > > +*/ > > + rdmsrl(HV_X64_MSR_APIC_FREQUENCY, > lapic_timer_frequency); > > + lapic_timer_frequency /= HZ; > > Is this safe? I.e. are the high 32 bits of the MSR guaranteed to > be zero, now and forever? > > > + printk(KERN_INFO "HyperV: LAPIC Timer Frequency: 0x%x\n", > > + lapic_timer_frequency); > > As a minor note, I generally recommend using %#x as being one > byte shorter than the spelled out 0x%x. > > Jan Thanks Jan. I will fix the issues you have pointed out and resubmit the patch. Regards, K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: ozwpan: Reset PORT_ENABLE bit.
Reset PORT_ENABLE bit of port status on loosing PD. Signed-off-by: Rupesh Gujare --- drivers/staging/ozwpan/ozhcd.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/ozwpan/ozhcd.c b/drivers/staging/ozwpan/ozhcd.c index b0398c5..39f5066 100644 --- a/drivers/staging/ozwpan/ozhcd.c +++ b/drivers/staging/ozwpan/ozhcd.c @@ -756,7 +756,7 @@ void oz_hcd_pd_departed(struct oz_port *port) port->config_num = 0; port->flags &= ~(OZ_PORT_F_PRESENT | OZ_PORT_F_DYING); port->flags |= OZ_PORT_F_CHANGED; - port->status &= ~USB_PORT_STAT_CONNECTION; + port->status &= ~(USB_PORT_STAT_CONNECTION | USB_PORT_STAT_ENABLE); port->status |= (USB_PORT_STAT_C_CONNECTION << 16); /* If there is an endpont 0 then clear the pointer while we hold * the spinlock be we deallocate it after releasing the lock. -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: ozwpan: Return error, if PD is not connected.
Return error if we receive write(), while PD is not connected. Signed-off-by: Rupesh Gujare --- drivers/staging/ozwpan/ozcdev.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c index 03b41ee..22cb2ae 100644 --- a/drivers/staging/ozwpan/ozcdev.c +++ b/drivers/staging/ozwpan/ozcdev.c @@ -162,6 +162,8 @@ static ssize_t oz_cdev_write(struct file *filp, const char __user *buf, spin_unlock_bh(&g_cdev.lock); if (pd == NULL) return -1; + if (!(pd->state & OZ_PD_S_CONNECTED)) + return -ENXIO; eb = &pd->elt_buff; ei = oz_elt_info_alloc(eb); if (ei == NULL) { -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/12] staging: dgap: tty.c: fixes ioctl param list
On Fri, Aug 23, 2013 at 4:23 PM, Dan Carpenter wrote: > On Wed, Aug 21, 2013 at 09:48:38PM -0400, Lidza Louina wrote: >> -static int dgap_tty_ioctl(struct tty_struct *tty, struct file *file, >> unsigned int cmd, >> +static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, >> unsigned long arg) > > Btw, now that this file compiles I see it in my static checker runs. > > dgap_tty_ioctl() takes a lock but always returns before unlocking. > >> { >> struct board_t *bd; >> @@ -3423,41 +3423,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, >> struct file *file, unsigned in >> >> return(-ENOIOCTLCMD); > > In other words, these return statements should be breaks so we hit > the call to: > > DGNC_UNLOCK(ch->ch_lock, lock_flags); Hmm, I looked thru the code a few times, and it seems like it unlocks before every return. Can you paste an example where it does this? Thanks, Lidza ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/12] staging: dgap: tty.c: fixes ioctl param list
On 08/27/2013 01:20 PM, Lidza Louina wrote: On Fri, Aug 23, 2013 at 4:23 PM, Dan Carpenter wrote: On Wed, Aug 21, 2013 at 09:48:38PM -0400, Lidza Louina wrote: -static int dgap_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, +static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) Btw, now that this file compiles I see it in my static checker runs. dgap_tty_ioctl() takes a lock but always returns before unlocking. { struct board_t *bd; @@ -3423,41 +3423,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned in return(-ENOIOCTLCMD); In other words, these return statements should be breaks so we hit the call to: DGNC_UNLOCK(ch->ch_lock, lock_flags); Hmm, I looked thru the code a few times, and it seems like it unlocks before every return. Can you paste an example where it does this? FYI, there is no DGNC_UNLOCK in the dgap driver? Maybe he was looking at the dgnc while commenting on the dgap??? Just a guess. Mark ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 4/4] staging: ozwpan: Return error, if PD is not connected.
Hello. On 08/27/2013 07:53 PM, Rupesh Gujare wrote: Return error if we receive write(), while PD is not connected. Signed-off-by: Rupesh Gujare --- drivers/staging/ozwpan/ozcdev.c |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c index 03b41ee..22cb2ae 100644 --- a/drivers/staging/ozwpan/ozcdev.c +++ b/drivers/staging/ozwpan/ozcdev.c @@ -162,6 +162,8 @@ static ssize_t oz_cdev_write(struct file *filp, const char __user *buf, spin_unlock_bh(&g_cdev.lock); if (pd == NULL) return -1; Note that returning -EPERM here is hardly correct. + if (!(pd->state & OZ_PD_S_CONNECTED)) + return -ENXIO; WBR, Sergei ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/12] staging: dgap: tty.c: fixes ioctl param list
On Tue, Aug 27, 2013 at 1:25 PM, Mark Hounschell wrote: > On 08/27/2013 01:20 PM, Lidza Louina wrote: >> >> On Fri, Aug 23, 2013 at 4:23 PM, Dan Carpenter >> wrote: >>> >>> On Wed, Aug 21, 2013 at 09:48:38PM -0400, Lidza Louina wrote: -static int dgap_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, +static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg) >>> >>> >>> Btw, now that this file compiles I see it in my static checker runs. >>> >>> dgap_tty_ioctl() takes a lock but always returns before unlocking. >>> { struct board_t *bd; @@ -3423,41 +3423,6 @@ static int dgap_tty_ioctl(struct tty_struct *tty, struct file *file, unsigned in return(-ENOIOCTLCMD); >>> >>> >>> In other words, these return statements should be breaks so we hit >>> the call to: >>> >>> DGNC_UNLOCK(ch->ch_lock, lock_flags); >> >> >> Hmm, I looked thru the code a few times, and it seems like >> it unlocks before every return. Can you paste an example >> where it does this? >> > > FYI, there is no DGNC_UNLOCK in the dgap driver? Maybe he was looking at the > dgnc while commenting on the dgap??? Just a guess. > > Mark Ah, ok, I don't see anything unusual in that file either. I'll wait to see what he was talking about. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: tty.c: updates uart_struct declaration for sparse
Could you redo this one? On Tue, Aug 27, 2013 at 11:12:16AM -0400, Lidza Louina wrote: > This patch edits the type casts neo_uart_struct and > cls_uart_struct. A previous patch added the marker __iomem > to these structs. This patch ensures that the change to > the marker is consistent. This also removes these > sparse warnings: > > warning: incorrect type in assignment (different address spaces) > expected struct neo_uart_struct [noderef] *ch_neo_uart > got struct neo_uart_struct * > warning: incorrect type in assignment (different address spaces) > expected struct cls_uart_struct [noderef] *ch_cls_uart > got struct cls_uart_struct * > > Signed-off-by: Lidza Louina > --- > drivers/staging/dgnc/dgnc_tty.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c > index a54b829..a36fae8 100644 > --- a/drivers/staging/dgnc/dgnc_tty.c > +++ b/drivers/staging/dgnc/dgnc_tty.c > @@ -403,9 +403,9 @@ int dgnc_tty_init(struct board_t *brd) > ch->ch_pun.un_dev = i + 128; > > if (brd->bd_uart_offset == 0x200) > - ch->ch_neo_uart = (struct neo_uart_struct *) ((ulong) > vaddr + (brd->bd_uart_offset * i)); > + ch->ch_neo_uart = (struct __iomem neo_uart_struct *) > ((ulong) vaddr + (brd->bd_uart_offset * i)); ^ ^ Don't put spaces here. Leaving the space out helps the reader remember that casting is a high priority operation in C. Casting should be relatively uncommon in good code. If you see it that means something complicated is going on and it's a red flag. Here is how I imagine they came up with that code: Code #1: ch->ch_neo_uart = vaddr + (brd->bd_uart_offset * i); Problem: Compile warning. Code #2: ch->ch_neo_uart = (struct __iomem neo_uart_struct *) vaddr + (brd->bd_uart_offset * i); Problem: The pointer math doesn't work, because they forgot casting has high precedence. Code #3: ch->ch_neo_uart = (struct __iomem neo_uart_struct *) (ulong) vaddr + (brd->bd_uart_offset * i); Problem: The pointer math doesn't work, because they forgot casting has still has high precedence. If only they had followed the no spaces with casting rule, it would have been obvious. :) Code #4: ch->ch_neo_uart = (struct __iomem neo_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); Problem: It works but it's ugly as pants. Anyway, just declare vaddr like this: void __iomem *vaddr; And remove all the casting: ch->ch_neo_uart = vaddr + (brd->bd_uart_offset * i); regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: driver.c and .h: changes kzmalloc param for sparse
On Tue, Aug 27, 2013 at 11:20:06AM -0400, Lidza Louina wrote: > This patch changes the dgnc_driver_kzmalloc declaration. > The kernel's kmalloc function previously took an int > priority. That's been replaced with gfp_t flags. > > The warning was caught by sparse. > Don't bother fixing these... Just replace them all with kzalloc() instead. They probably did it for compatability with Windows or something. We don't care about that in linux. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/12] staging: dgap: tty.c: fixes ioctl param list
On Tue, Aug 27, 2013 at 01:50:35PM -0400, Lidza Louina wrote: > Ah, ok, I don't see anything unusual in that file either. I'll wait > to see what he was talking about. Yeah. You're both right. I was looking at the wrong file and there is no locking problem. My bad. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] staging: ozwpan: Increase ISOC IN buffer depth
On Tue, Aug 27, 2013 at 04:53:40PM +0100, Rupesh Gujare wrote: > Increase ISOC IN buffer depth to 100 units. > This change log is not useful. What are the user visible effects of this bug? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: tty.c: updates uart_struct declaration for sparse
On Tue, Aug 27, 2013 at 2:39 PM, Dan Carpenter wrote: > Could you redo this one? > > On Tue, Aug 27, 2013 at 11:12:16AM -0400, Lidza Louina wrote: >> This patch edits the type casts neo_uart_struct and >> cls_uart_struct. A previous patch added the marker __iomem >> to these structs. This patch ensures that the change to >> the marker is consistent. This also removes these >> sparse warnings: >> >> warning: incorrect type in assignment (different address spaces) >> expected struct neo_uart_struct [noderef] *ch_neo_uart >> got struct neo_uart_struct * >> warning: incorrect type in assignment (different address spaces) >> expected struct cls_uart_struct [noderef] *ch_cls_uart >> got struct cls_uart_struct * >> >> Signed-off-by: Lidza Louina >> --- >> drivers/staging/dgnc/dgnc_tty.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/dgnc/dgnc_tty.c >> b/drivers/staging/dgnc/dgnc_tty.c >> index a54b829..a36fae8 100644 >> --- a/drivers/staging/dgnc/dgnc_tty.c >> +++ b/drivers/staging/dgnc/dgnc_tty.c >> @@ -403,9 +403,9 @@ int dgnc_tty_init(struct board_t *brd) >> ch->ch_pun.un_dev = i + 128; >> >> if (brd->bd_uart_offset == 0x200) >> - ch->ch_neo_uart = (struct neo_uart_struct *) ((ulong) >> vaddr + (brd->bd_uart_offset * i)); >> + ch->ch_neo_uart = (struct __iomem neo_uart_struct *) >> ((ulong) vaddr + (brd->bd_uart_offset * i)); > ^ >^ > > Don't put spaces here. Leaving the space out helps the reader remember > that casting is a high priority operation in C. > > Casting should be relatively uncommon in good code. If you see it that > means something complicated is going on and it's a red flag. Here is > how I imagine they came up with that code: > > Code #1: > ch->ch_neo_uart = vaddr + (brd->bd_uart_offset * i); > Problem: Compile warning. > > Code #2: > ch->ch_neo_uart = (struct __iomem neo_uart_struct *) vaddr + > (brd->bd_uart_offset * i); > Problem: The pointer math doesn't work, because they forgot casting has > high precedence. > > Code #3: > ch->ch_neo_uart = (struct __iomem neo_uart_struct *) (ulong) vaddr + > (brd->bd_uart_offset * i); > Problem: The pointer math doesn't work, because they forgot casting has > still has high precedence. If only they had followed the no > spaces with casting rule, it would have been obvious. :) > > Code #4: > ch->ch_neo_uart = (struct __iomem neo_uart_struct *) ((ulong) vaddr + > (brd->bd_uart_offset * i)); > Problem: It works but it's ugly as pants. > > Anyway, just declare vaddr like this: > > void __iomem *vaddr; > > And remove all the casting: > > ch->ch_neo_uart = vaddr + (brd->bd_uart_offset * i); Alrighty, thank you. There are a lot of type casts in this code. I'll work on them. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: tty.c: updates uart_struct declaration for sparse
This patch edits the type casts neo_uart_struct and cls_uart_struct. A previous patch added the marker __iomem to these structs. This patch ensures that the change to the marker is consistent. This also removes these sparse warnings: warning: incorrect type in assignment (different address spaces) expected struct neo_uart_struct [noderef] *ch_neo_uart got struct neo_uart_struct * warning: incorrect type in assignment (different address spaces) expected struct cls_uart_struct [noderef] *ch_cls_uart got struct cls_uart_struct * Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index a54b829..b4fa29f 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -344,7 +344,7 @@ int dgnc_tty_register(struct board_t *brd) int dgnc_tty_init(struct board_t *brd) { int i; - u8 __iomem *vaddr; + void __iomem *vaddr; struct channel_t *ch; if (!brd) @@ -403,9 +403,9 @@ int dgnc_tty_init(struct board_t *brd) ch->ch_pun.un_dev = i + 128; if (brd->bd_uart_offset == 0x200) - ch->ch_neo_uart = (struct neo_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); + ch->ch_neo_uart = vaddr + (brd->bd_uart_offset * i); else - ch->ch_cls_uart = (struct cls_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); + ch->ch_cls_uart = vaddr + (brd->bd_uart_offset * i); ch->ch_bd = brd; ch->ch_portnum = i; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: driver.c and .h: changes kzmalloc param for sparse
On Tue, Aug 27, 2013 at 2:46 PM, Dan Carpenter wrote: > On Tue, Aug 27, 2013 at 11:20:06AM -0400, Lidza Louina wrote: >> This patch changes the dgnc_driver_kzmalloc declaration. >> The kernel's kmalloc function previously took an int >> priority. That's been replaced with gfp_t flags. >> >> The warning was caught by sparse. >> > > Don't bother fixing these... Just replace them all with kzalloc() > instead. They probably did it for compatability with Windows or > something. We don't care about that in linux. Alrighty. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc
This patch replaces dgnc_driver_kzmalloc with kzalloc. A previous patch removed that function from the code. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_driver.c | 6 +++--- drivers/staging/dgnc/dgnc_tty.c| 20 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index b8a7597..8828dc9 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -501,7 +501,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) /* get the board structure and prep it */ brd = dgnc_Board[dgnc_NumBoards] = - (struct board_t *) dgnc_driver_kzmalloc(sizeof(struct board_t), GFP_KERNEL); + (struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL); if (!brd) { APR(("memory allocation for board structure failed\n")); return(-ENOMEM); @@ -509,7 +509,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) /* make a temporary message buffer for the boot messages */ brd->msgbuf = brd->msgbuf_head = - (char *) dgnc_driver_kzmalloc(sizeof(char) * 8192, GFP_KERNEL); + (char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL); if (!brd->msgbuf) { kfree(brd); APR(("memory allocation for board msgbuf failed\n")); @@ -727,7 +727,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) * Okay to malloc with GFP_KERNEL, we are not at interrupt * context, and there are no locks held. */ - brd->flipbuf = dgnc_driver_kzmalloc(MYFLIPLEN, GFP_KERNEL); + brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL); wake_up_interruptible(&brd->state_wait); diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index b4fa29f..a7bb6bc 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -230,7 +230,7 @@ int dgnc_tty_register(struct board_t *brd) * The kernel wants space to store pointers to * tty_struct's and termios's. */ - brd->SerialDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); + brd->SerialDriver.ttys = kzalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); if (!brd->SerialDriver.ttys) return(-ENOMEM); @@ -240,12 +240,12 @@ int dgnc_tty_register(struct board_t *brd) kref_init(&brd->SerialDriver.kref); #endif - brd->SerialDriver.termios = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->SerialDriver.termios = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->SerialDriver.termios) return(-ENOMEM); #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) - brd->SerialDriver.termios_locked = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->SerialDriver.termios_locked = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->SerialDriver.termios_locked) return(-ENOMEM); #endif @@ -289,7 +289,7 @@ int dgnc_tty_register(struct board_t *brd) * tty_struct's and termios's. Must be seperate from * the Serial Driver so we don't get confused */ - brd->PrintDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); + brd->PrintDriver.ttys = kzalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); if (!brd->PrintDriver.ttys) return(-ENOMEM); @@ -299,12 +299,12 @@ int dgnc_tty_register(struct board_t *brd) kref_init(&brd->PrintDriver.kref); #endif - brd->PrintDriver.termios = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->PrintDriver.termios = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->PrintDriver.termios) return(-ENOMEM); #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) - brd->PrintDriver.termios_locked = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->PrintDriver.termios_locked = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->PrintDriver.termios_locked) return(-ENOMEM); #endif @@ -371,7 +371,7 @@ int dgnc_tty_init(struct board_t *brd) * Okay to malloc with GFP_KERNEL, we are not at * interrupt context, and there are no locks held. */ - brd->channels[i] = dgnc_driver_kzmalloc(sizeof(struct channel_t), GFP_KERNEL); + brd->channels[i] = kzalloc(sizeof(struct channel_t), GFP_KERNEL); if (!brd->channels[i]) { DPR_CORE(("%s:%d Unable to all
[PATCH 1/2] staging: dgnc: driver.c: removes dgnc_driver_kzmalloc func
This patch removes the dgnc_driver_kzmalloc function from driver.c. The patch that follows replaces all dgnc_driver_kzmalloc functions calls with kzalloc. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_driver.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 8032368..b8a7597 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -895,21 +895,6 @@ static void dgnc_init_globals(void) * / - -/* - * dgnc_driver_kzmalloc() - * - * Malloc and clear memory, - */ -void *dgnc_driver_kzmalloc(size_t size, int priority) -{ - void *p = kmalloc(size, priority); - if(p) - memset(p, 0, size); - return(p); -} - - /* * dgnc_mbuf() * -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: dgnc: driver.c: removes dgnc_driver_kzmalloc func
On Tue, Aug 27, 2013 at 06:19:43PM -0400, Lidza Louina wrote: > This patch removes the dgnc_driver_kzmalloc function from > driver.c. The patch that follows replaces all > dgnc_driver_kzmalloc functions calls with kzalloc. > You can't do it in this order. The first patch will break the compile. Also you'll want to delete it from the .h file as well. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 08/24] Staging: winbond: reg: changed sleep function from msleep to usleep
On Mon, Aug 26, 2013 at 05:10:07PM +0200, Iker Pedrosa wrote: > According to the documentation it is not recommended to use msleep for 1ms - > 20ms because it may sleep longer than 20ms. So, it is recommended to use > usleep instead. > > Signed-off-by: Iker Pedrosa > --- > drivers/staging/winbond/reg.c | 52 > +-- > 1 file changed, 26 insertions(+), 26 deletions(-) > > diff --git a/drivers/staging/winbond/reg.c b/drivers/staging/winbond/reg.c > index 80b4b34..61916f5 100644 > --- a/drivers/staging/winbond/reg.c > +++ b/drivers/staging/winbond/reg.c > @@ -890,9 +890,9 @@ void Uxx_power_on_procedure(struct hw_data *pHwData) > else { > Wb35Reg_WriteSync(pHwData, 0x03f4, 0xFF5807FF); > Wb35Reg_WriteSync(pHwData, 0x03d4, 0x80); /* regulator on only > */ > - msleep(10); > + usleep(1); This breaks the build :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 20/24] Staging: winbond: wb35tx: changed sleep function from msleep to usleep
On Mon, Aug 26, 2013 at 05:10:19PM +0200, Iker Pedrosa wrote: > According to the documentation it is not recommended to use msleep for 1ms - > 20ms because it may sleep longer than 20ms. So, it is recommended to use > usleep instead. > > Signed-off-by: Iker Pedrosa > --- > drivers/staging/winbond/wb35tx.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/winbond/wb35tx.c > b/drivers/staging/winbond/wb35tx.c > index 30a77cc..8c25cbd 100644 > --- a/drivers/staging/winbond/wb35tx.c > +++ b/drivers/staging/winbond/wb35tx.c > @@ -166,9 +166,9 @@ void Wb35Tx_destroy(struct hw_data *pHwData) > > /* Wait for VM stop */ > do { > - msleep(10); /* Delay for waiting function enter 940623.1.a */ > + usleep(1); /* Delay for waiting function enter 940623.1.a */ It looks like you didn't try to build this patch, as it breaks the build for me here :( greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 05/24] Staging: winbond: phy_calibration: fixed some lines over 80 characters
On Mon, Aug 26, 2013 at 05:10:04PM +0200, Iker Pedrosa wrote: > Second of the patches that fixes the lines over 80 characters in > phy_calibration.c > > Signed-off-by: Iker Pedrosa This Subject: is identical to the previous patch, not good. You also do that for 4 other patches in this series :( Can you please redo all of these, fixing the subjects, and the build errors (which wasn't good at all), and resend them? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: dgnc: driver.c: removes dgnc_driver_kzmalloc func
On Tue, Aug 27, 2013 at 06:19:43PM -0400, Lidza Louina wrote: > This patch removes the dgnc_driver_kzmalloc function from > driver.c. The patch that follows replaces all > dgnc_driver_kzmalloc functions calls with kzalloc. Yes, but this patch just broke the build, right? Do this in the opposite order, then all will be good. As you sent a number of patches for this driver today, I don't know which to apply and which not to. Can you fix this up, and resend all of them that you want me to apply? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: dgnc: driver.c: removes dgnc_driver_kzmalloc func
On Tue, Aug 27, 2013 at 7:29 PM, Dan Carpenter wrote: > On Tue, Aug 27, 2013 at 06:19:43PM -0400, Lidza Louina wrote: >> This patch removes the dgnc_driver_kzmalloc function from >> driver.c. The patch that follows replaces all >> dgnc_driver_kzmalloc functions calls with kzalloc. >> > > You can't do it in this order. The first patch will break the compile. > Also you'll want to delete it from the .h file as well. Oop, yes it does, I'll resend it in order. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] staging: dgnc: driver.c: removes dgnc_driver_kzmalloc func
On Tue, Aug 27, 2013 at 7:48 PM, Greg KH wrote: > On Tue, Aug 27, 2013 at 06:19:43PM -0400, Lidza Louina wrote: >> This patch removes the dgnc_driver_kzmalloc function from >> driver.c. The patch that follows replaces all >> dgnc_driver_kzmalloc functions calls with kzalloc. > > Yes, but this patch just broke the build, right? Yes, it does. >_< Sorry. > Do this in the opposite order, then all will be good. > > As you sent a number of patches for this driver today, I don't know > which to apply and which not to. Can you fix this up, and resend all of > them that you want me to apply? Yes, I will do that. =] ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/3] staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc
This patch replaces dgnc_driver_kzmalloc with kzalloc. A patch that follows removes the dgnc_driver_kzmalloc function. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_driver.c | 6 +++--- drivers/staging/dgnc/dgnc_tty.c| 20 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 8032368..4226f09 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -501,7 +501,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) /* get the board structure and prep it */ brd = dgnc_Board[dgnc_NumBoards] = - (struct board_t *) dgnc_driver_kzmalloc(sizeof(struct board_t), GFP_KERNEL); + (struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL); if (!brd) { APR(("memory allocation for board structure failed\n")); return(-ENOMEM); @@ -509,7 +509,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) /* make a temporary message buffer for the boot messages */ brd->msgbuf = brd->msgbuf_head = - (char *) dgnc_driver_kzmalloc(sizeof(char) * 8192, GFP_KERNEL); + (char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL); if (!brd->msgbuf) { kfree(brd); APR(("memory allocation for board msgbuf failed\n")); @@ -727,7 +727,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) * Okay to malloc with GFP_KERNEL, we are not at interrupt * context, and there are no locks held. */ - brd->flipbuf = dgnc_driver_kzmalloc(MYFLIPLEN, GFP_KERNEL); + brd->flipbuf = kzalloc(MYFLIPLEN, GFP_KERNEL); wake_up_interruptible(&brd->state_wait); diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index b4fa29f..a7bb6bc 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -230,7 +230,7 @@ int dgnc_tty_register(struct board_t *brd) * The kernel wants space to store pointers to * tty_struct's and termios's. */ - brd->SerialDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); + brd->SerialDriver.ttys = kzalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); if (!brd->SerialDriver.ttys) return(-ENOMEM); @@ -240,12 +240,12 @@ int dgnc_tty_register(struct board_t *brd) kref_init(&brd->SerialDriver.kref); #endif - brd->SerialDriver.termios = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->SerialDriver.termios = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->SerialDriver.termios) return(-ENOMEM); #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) - brd->SerialDriver.termios_locked = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->SerialDriver.termios_locked = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->SerialDriver.termios_locked) return(-ENOMEM); #endif @@ -289,7 +289,7 @@ int dgnc_tty_register(struct board_t *brd) * tty_struct's and termios's. Must be seperate from * the Serial Driver so we don't get confused */ - brd->PrintDriver.ttys = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); + brd->PrintDriver.ttys = kzalloc(brd->maxports * sizeof(struct tty_struct *), GFP_KERNEL); if (!brd->PrintDriver.ttys) return(-ENOMEM); @@ -299,12 +299,12 @@ int dgnc_tty_register(struct board_t *brd) kref_init(&brd->PrintDriver.kref); #endif - brd->PrintDriver.termios = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->PrintDriver.termios = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->PrintDriver.termios) return(-ENOMEM); #if LINUX_VERSION_CODE < KERNEL_VERSION(3,0,0) - brd->PrintDriver.termios_locked = dgnc_driver_kzmalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); + brd->PrintDriver.termios_locked = kzalloc(brd->maxports * sizeof(struct ktermios *), GFP_KERNEL); if (!brd->PrintDriver.termios_locked) return(-ENOMEM); #endif @@ -371,7 +371,7 @@ int dgnc_tty_init(struct board_t *brd) * Okay to malloc with GFP_KERNEL, we are not at * interrupt context, and there are no locks held. */ - brd->channels[i] = dgnc_driver_kzmalloc(sizeof(struct channel_t), GFP_KERNEL); + brd->channels[i] = kzalloc(sizeof(struct channel_t), GFP_KERNEL); if (!brd->channels[i]) { DPR_CORE(("%s:%d Una
[PATCH v2 3/3] staging: dgnc: driver.c and .h: removes dgnc_driver_kzmalloc func
This patch removes the dgnc_driver_kzmalloc function from driver.c and driver.h. A previous patch replaced all dgnc_driver_kzmalloc function calls with kzalloc. Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_driver.c | 15 --- drivers/staging/dgnc/dgnc_driver.h | 1 - 2 files changed, 16 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c index 4226f09..8828dc9 100644 --- a/drivers/staging/dgnc/dgnc_driver.c +++ b/drivers/staging/dgnc/dgnc_driver.c @@ -895,21 +895,6 @@ static void dgnc_init_globals(void) * / - -/* - * dgnc_driver_kzmalloc() - * - * Malloc and clear memory, - */ -void *dgnc_driver_kzmalloc(size_t size, int priority) -{ - void *p = kmalloc(size, priority); - if(p) - memset(p, 0, size); - return(p); -} - - /* * dgnc_mbuf() * diff --git a/drivers/staging/dgnc/dgnc_driver.h b/drivers/staging/dgnc/dgnc_driver.h index e77303c..218b15d 100644 --- a/drivers/staging/dgnc/dgnc_driver.h +++ b/drivers/staging/dgnc/dgnc_driver.h @@ -542,7 +542,6 @@ struct channel_t { */ extern int dgnc_ms_sleep(ulong ms); -extern void*dgnc_driver_kzmalloc(size_t size, int priority); extern char*dgnc_ioctl_name(int cmd); /* -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] staging: dgnc: tty.c: updates uart_struct declaration for sparse
This patch edits the type casts neo_uart_struct and cls_uart_struct. A previous patch added the marker __iomem to these structs. This patch ensures that the change to the marker is consistent. This also removes these sparse warnings: warning: incorrect type in assignment (different address spaces) expected struct neo_uart_struct [noderef] *ch_neo_uart got struct neo_uart_struct * warning: incorrect type in assignment (different address spaces) expected struct cls_uart_struct [noderef] *ch_cls_uart got struct cls_uart_struct * Signed-off-by: Lidza Louina --- drivers/staging/dgnc/dgnc_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index a54b829..b4fa29f 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -344,7 +344,7 @@ int dgnc_tty_register(struct board_t *brd) int dgnc_tty_init(struct board_t *brd) { int i; - u8 __iomem *vaddr; + void __iomem *vaddr; struct channel_t *ch; if (!brd) @@ -403,9 +403,9 @@ int dgnc_tty_init(struct board_t *brd) ch->ch_pun.un_dev = i + 128; if (brd->bd_uart_offset == 0x200) - ch->ch_neo_uart = (struct neo_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); + ch->ch_neo_uart = vaddr + (brd->bd_uart_offset * i); else - ch->ch_cls_uart = (struct cls_uart_struct *) ((ulong) vaddr + (brd->bd_uart_offset * i)); + ch->ch_cls_uart = vaddr + (brd->bd_uart_offset * i); ch->ch_bd = brd; ch->ch_portnum = i; -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 3/3] staging: dgnc: driver.c and .h: removes dgnc_driver_kzmalloc func
On Tue, Aug 27, 2013 at 10:13:28PM -0400, Lidza Louina wrote: > This patch removes the dgnc_driver_kzmalloc function from > driver.c and driver.h. A previous patch replaced all > dgnc_driver_kzmalloc function calls with kzalloc. > > Signed-off-by: Lidza Louina > --- > drivers/staging/dgnc/dgnc_driver.c | 15 --- > drivers/staging/dgnc/dgnc_driver.h | 1 - > 2 files changed, 16 deletions(-) This patch had to be edited by hand, due to some fuzz in it when applying to my tree. That means I think we are out of sync again with what you have sent, and what I have applied. Can you resync on my tree again and resend anything I haven't applied, and then work from there, to make sure I didn't accidentally drop something you thought I applied? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 2/3] staging: dgnc: driver.c and tty.c: replaces dgnc_driver_kzmalloc with kzalloc
On Tue, Aug 27, 2013 at 10:13:27PM -0400, Lidza Louina wrote: > This patch replaces dgnc_driver_kzmalloc with kzalloc. > A patch that follows removes the dgnc_driver_kzmalloc > function. > > Signed-off-by: Lidza Louina > --- > drivers/staging/dgnc/dgnc_driver.c | 6 +++--- > drivers/staging/dgnc/dgnc_tty.c| 20 ++-- > 2 files changed, 13 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/dgnc/dgnc_driver.c > b/drivers/staging/dgnc/dgnc_driver.c > index 8032368..4226f09 100644 > --- a/drivers/staging/dgnc/dgnc_driver.c > +++ b/drivers/staging/dgnc/dgnc_driver.c > @@ -501,7 +501,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id) > > /* get the board structure and prep it */ > brd = dgnc_Board[dgnc_NumBoards] = > - (struct board_t *) dgnc_driver_kzmalloc(sizeof(struct board_t), > GFP_KERNEL); > + (struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL); I'll take this for now, but all of these casts of the kzalloc() call need to go away, as they are pointless (kzalloc() returns a void *, which automatically can be assigned to any pointer type, no need to be explicit about it.) So that means you'll get another patch accepted modifying these same lines now :) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/4] staging: dgap: Include version.h header in dgap_kcompat.h
Include version.h header file as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_kcompat.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/dgap/dgap_kcompat.h b/drivers/staging/dgap/dgap_kcompat.h index 8ebf4b7..f21c8d7 100644 --- a/drivers/staging/dgap/dgap_kcompat.h +++ b/drivers/staging/dgap/dgap_kcompat.h @@ -28,6 +28,8 @@ #ifndef __DGAP_KCOMPAT_H #define __DGAP_KCOMPAT_H +#include + # ifndef KERNEL_VERSION # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) # endif -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/4] staging: dgap: Remove version.h header inclusion in dgap_parse.c
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_parse.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgap/dgap_parse.c b/drivers/staging/dgap/dgap_parse.c index d6d507b..5497e6d 100644 --- a/drivers/staging/dgap/dgap_parse.c +++ b/drivers/staging/dgap/dgap_parse.c @@ -36,7 +36,6 @@ * */ #include -#include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] staging: dgap: Include version.h header in dgap_kcompat.h
On Wed, Aug 28, 2013 at 10:16:06AM +0530, Sachin Kamat wrote: > Include version.h header file as detected by versioncheck. > > Signed-off-by: Sachin Kamat > --- > drivers/staging/dgap/dgap_kcompat.h |2 ++ > 1 file changed, 2 insertions(+) Please use the scripts/get_maintainer.pl tool to determine who to cc: on your patches. All of these should have been cc:ed to at least one other person. Care to resend them with that cc: on them? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/4] staging: dgap: Remove version.h header inclusion in dgap_sysfs.c
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_sysfs.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgap/dgap_sysfs.c b/drivers/staging/dgap/dgap_sysfs.c index d4300ce..94da06f 100644 --- a/drivers/staging/dgap/dgap_sysfs.c +++ b/drivers/staging/dgap/dgap_sysfs.c @@ -34,7 +34,6 @@ #include -#include #include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] staging: dgap: Include version.h header in dgap_kcompat.h
On 28 August 2013 10:40, Greg KH wrote: > On Wed, Aug 28, 2013 at 10:16:06AM +0530, Sachin Kamat wrote: >> Include version.h header file as detected by versioncheck. >> >> Signed-off-by: Sachin Kamat >> --- >> drivers/staging/dgap/dgap_kcompat.h |2 ++ >> 1 file changed, 2 insertions(+) > > Please use the scripts/get_maintainer.pl tool to determine who to cc: on > your patches. All of these should have been cc:ed to at least one other > person. > > Care to resend them with that cc: on them? Sure. Sorry for the trouble. -- With warm regards, Sachin ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH Resend 1/4] staging: dgap: Include version.h header in dgap_kcompat.h
Include version.h header file as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_kcompat.h |2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/dgap/dgap_kcompat.h b/drivers/staging/dgap/dgap_kcompat.h index 8ebf4b7..f21c8d7 100644 --- a/drivers/staging/dgap/dgap_kcompat.h +++ b/drivers/staging/dgap/dgap_kcompat.h @@ -28,6 +28,8 @@ #ifndef __DGAP_KCOMPAT_H #define __DGAP_KCOMPAT_H +#include + # ifndef KERNEL_VERSION # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) # endif -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH Resend 4/4] staging: dgap: Remove version.h header inclusion in dgap_trace.c
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_trace.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgap/dgap_trace.c b/drivers/staging/dgap/dgap_trace.c index 1761002..0f9a956 100644 --- a/drivers/staging/dgap/dgap_trace.c +++ b/drivers/staging/dgap/dgap_trace.c @@ -32,7 +32,6 @@ /* $Id: dgap_trace.c,v 1.1 2009/10/23 14:01:57 markh Exp $ */ #include -#include #include/* For jiffies, task states */ #include/* For tasklet and interrupt structs/defines */ #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH Resend 3/4] staging: dgap: Remove version.h header inclusion in dgap_sysfs.c
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_sysfs.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgap/dgap_sysfs.c b/drivers/staging/dgap/dgap_sysfs.c index d4300ce..94da06f 100644 --- a/drivers/staging/dgap/dgap_sysfs.c +++ b/drivers/staging/dgap/dgap_sysfs.c @@ -34,7 +34,6 @@ #include -#include #include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/4] staging: dgap: Remove version.h header inclusion in dgap_trace.c
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_trace.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgap/dgap_trace.c b/drivers/staging/dgap/dgap_trace.c index 1761002..0f9a956 100644 --- a/drivers/staging/dgap/dgap_trace.c +++ b/drivers/staging/dgap/dgap_trace.c @@ -32,7 +32,6 @@ /* $Id: dgap_trace.c,v 1.1 2009/10/23 14:01:57 markh Exp $ */ #include -#include #include/* For jiffies, task states */ #include/* For tasklet and interrupt structs/defines */ #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH Resend 2/4] staging: dgap: Remove version.h header inclusion in dgap_parse.c
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/dgap/dgap_parse.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/dgap/dgap_parse.c b/drivers/staging/dgap/dgap_parse.c index d6d507b..5497e6d 100644 --- a/drivers/staging/dgap/dgap_parse.c +++ b/drivers/staging/dgap/dgap_parse.c @@ -36,7 +36,6 @@ * */ #include -#include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] staging: gdm724x: Remove version.h header inclusion in netlink_k.c
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/gdm724x/netlink_k.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gdm724x/netlink_k.c b/drivers/staging/gdm724x/netlink_k.c index 9e8be6a..77fc64e 100644 --- a/drivers/staging/gdm724x/netlink_k.c +++ b/drivers/staging/gdm724x/netlink_k.c @@ -13,7 +13,6 @@ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -#include #include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/3] staging: rtl8188eu: Include version.h header in xmit_linux.c
Include version.h header file as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/rtl8188eu/os_dep/xmit_linux.c |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c index 1e2c8ab..2e586c0 100644 --- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c @@ -19,6 +19,7 @@ **/ #define _XMIT_OSDEP_C_ +#include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: rtl8188eu: Remove version.h inclusion in osdep_service.h
version.h header inclusion is not necessary as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/rtl8188eu/include/osdep_service.h |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging/rtl8188eu/include/osdep_service.h index 1be33b7..44f24fa 100644 --- a/drivers/staging/rtl8188eu/include/osdep_service.h +++ b/drivers/staging/rtl8188eu/include/osdep_service.h @@ -26,7 +26,6 @@ #define _SUCCESS 1 #define RTW_RX_HANDLED 2 -#include #include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging: rtl8188eu: Include version.h in usb_ops.h
Include version.h header file as detected by versioncheck. Signed-off-by: Sachin Kamat --- drivers/staging/rtl8188eu/include/usb_ops.h |1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8188eu/include/usb_ops.h b/drivers/staging/rtl8188eu/include/usb_ops.h index c23de7b..df34237 100644 --- a/drivers/staging/rtl8188eu/include/usb_ops.h +++ b/drivers/staging/rtl8188eu/include/usb_ops.h @@ -20,6 +20,7 @@ #ifndef __USB_OPS_H_ #define __USB_OPS_H_ +#include #include #include #include -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: rtl8188eu: Remove duplicate header inclusion in ioctl_linux.c
Removed the header files included twice. Signed-off-by: Sachin Kamat Cc: Larry Finger --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index d438256..cd4100f 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -29,13 +29,11 @@ #include #include #include -#include #include #include #include #include -#include #include #define RTL_IOCTL_WPA_SUPPLICANT (SIOCIWFIRSTPRIV + 30) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel