[PATCH] staging: rtl8712: remove useless printing line
This patch removes an unneeded call to printk. Signed-off-by: Heba Aamer --- drivers/staging/rtl8712/usb_intf.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c index 7d0d171..f1fd7e8 100644 --- a/drivers/staging/rtl8712/usb_intf.c +++ b/drivers/staging/rtl8712/usb_intf.c @@ -366,7 +366,6 @@ static int r871xu_drv_init(struct usb_interface *pusb_intf, struct net_device *pnetdev; struct usb_device *udev; - printk(KERN_INFO "r8712u: Staging version\n"); /* In this probe function, O.S. will provide the usb interface pointer * to driver. We have to increase the reference count of the usb device * structure by using the usb_get_dev function. -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[Patch v2 01/22] ACPICA: Resources: Provide common part for struct acpi_resource_address structures.
From: Lv Zheng struct acpi_resource_address and struct acpi_resource_extended_address64 share substracts just at different offsets. To unify the parsing functions, OSPMs like Linux need a new ACPI_ADDRESS64_ATTRIBUTE as their substructs, so they can extract the shared data. This patch also synchronizes the structure changes to the Linux kernel. The usages are searched by matching the following keywords: 1. acpi_resource_address 2. acpi_resource_extended_address 3. ACPI_RESOURCE_TYPE_ADDRESS 4. ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS And we found and fixed the usages in the following files: arch/ia64/kernel/acpi-ext.c arch/ia64/pci/pci.c arch/x86/pci/acpi.c arch/x86/pci/mmconfig-shared.c drivers/xen/xen-acpi-memhotplug.c drivers/acpi/acpi_memhotplug.c drivers/acpi/pci_root.c drivers/acpi/resource.c drivers/char/hpet.c drivers/pnp/pnpacpi/rsparser.c drivers/hv/vmbus_drv.c Build tests are passed with defconfig/allnoconfig/allyesconfig and defconfig+CONFIG_ACPI=n. Original-by: Thomas Gleixner Original-by: Jiang Liu Signed-off-by: Lv Zheng Signed-off-by: Jiang Liu --- arch/ia64/kernel/acpi-ext.c |6 ++-- arch/ia64/pci/pci.c | 14 - arch/x86/pci/acpi.c | 26 arch/x86/pci/mmconfig-shared.c|6 ++-- drivers/acpi/acpi_memhotplug.c|8 ++--- drivers/acpi/acpica/rsaddr.c |9 +++--- drivers/acpi/acpica/rsdumpinfo.c | 59 +++-- drivers/acpi/acpica/rsxface.c | 10 +++ drivers/acpi/pci_root.c |6 ++-- drivers/acpi/resource.c | 24 +++ drivers/char/hpet.c |4 +-- drivers/hv/vmbus_drv.c|4 +-- drivers/pnp/pnpacpi/rsparser.c| 16 +- drivers/xen/xen-acpi-memhotplug.c |8 ++--- include/acpi/acrestyp.h | 40 +++-- 15 files changed, 125 insertions(+), 115 deletions(-) diff --git a/arch/ia64/kernel/acpi-ext.c b/arch/ia64/kernel/acpi-ext.c index 8b9318d311a0..bd09bf74f187 100644 --- a/arch/ia64/kernel/acpi-ext.c +++ b/arch/ia64/kernel/acpi-ext.c @@ -69,10 +69,10 @@ static acpi_status find_csr_space(struct acpi_resource *resource, void *data) status = acpi_resource_to_address64(resource, &addr); if (ACPI_SUCCESS(status) && addr.resource_type == ACPI_MEMORY_RANGE && - addr.address_length && + addr.address.address_length && addr.producer_consumer == ACPI_CONSUMER) { - space->base = addr.minimum; - space->length = addr.address_length; + space->base = addr.address.minimum; + space->length = addr.address.address_length; return AE_CTRL_TERMINATE; } return AE_OK; /* keep looking */ diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 900cc93e5409..48cc65705db4 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -188,12 +188,12 @@ static u64 add_io_space(struct pci_root_info *info, name = (char *)(iospace + 1); - min = addr->minimum; - max = min + addr->address_length - 1; + min = addr->address.minimum; + max = min + addr->address.address_length - 1; if (addr->info.io.translation_type == ACPI_SPARSE_TRANSLATION) sparse = 1; - space_nr = new_space(addr->translation_offset, sparse); + space_nr = new_space(addr->address.translation_offset, sparse); if (space_nr == ~0) goto free_resource; @@ -247,7 +247,7 @@ static acpi_status resource_to_window(struct acpi_resource *resource, if (ACPI_SUCCESS(status) && (addr->resource_type == ACPI_MEMORY_RANGE || addr->resource_type == ACPI_IO_RANGE) && - addr->address_length && + addr->address.address_length && addr->producer_consumer == ACPI_PRODUCER) return AE_OK; @@ -284,7 +284,7 @@ static acpi_status add_window(struct acpi_resource *res, void *data) if (addr.resource_type == ACPI_MEMORY_RANGE) { flags = IORESOURCE_MEM; root = &iomem_resource; - offset = addr.translation_offset; + offset = addr.address.translation_offset; } else if (addr.resource_type == ACPI_IO_RANGE) { flags = IORESOURCE_IO; root = &ioport_resource; @@ -297,8 +297,8 @@ static acpi_status add_window(struct acpi_resource *res, void *data) resource = &info->res[info->res_num]; resource->name = info->name; resource->flags = flags; - resource->start = addr.minimum + offset; - resource->end = resource->start + addr.address_length - 1; + resource->start = addr.address.minimum + offset; + resource->end = resource->start + addr.address.address_length - 1; info->res_offset[info->res_num] = offset; if (insert_resource(root, resource)) { diff --git
[patch added to the 3.12 stable tree] x86, hyperv: Mark the Hyper-V clocksource as being continuous
From: "K. Y. Srinivasan" This patch has been added to the 3.12 stable tree. If you have any objections, please let us know. === commit 32c6590d126836a062b3140ed52d898507987017 upstream. The Hyper-V clocksource is continuous; mark it accordingly. Signed-off-by: K. Y. Srinivasan Acked-by: jasow...@redhat.com Cc: gre...@linuxfoundation.org Cc: de...@linuxdriverproject.org Cc: o...@aepfle.de Cc: a...@canonical.com Link: http://lkml.kernel.org/r/1421108762-3331-1-git-send-email-...@microsoft.com Signed-off-by: Thomas Gleixner Signed-off-by: Jiri Slaby --- arch/x86/kernel/cpu/mshyperv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 71a39f3621ba..647480716ff1 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -63,6 +63,7 @@ static struct clocksource hyperv_cs = { .rating = 400, /* use this when running on Hyperv*/ .read = read_hv_clock, .mask = CLOCKSOURCE_MASK(64), + .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; static void __init ms_hyperv_init_platform(void) -- 2.2.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/5] Fix fbtft/fb_pcd8544.c coding style errors and warnings
This patch set fixes most of the checkpatch.pl coding style errors and warnings found in drivers/staging/fbtft/fb_pcd8544.c Regarding the spaces fixes the git diff -w showed no difference, and the objdiff was empty. Heba Aamer (5): staging: fbtft: fix Macros with complex values should be enclosed in parentheses staging: fbtft: fix do not initialise statics to 0 or NULL staging: fbtft: fix horizontal spaces errors staging: fbtft: fix trailing whitespace staging: fbtft: fix braces {} are not necessary for single statement blocks drivers/staging/fbtft/fb_pcd8544.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/5] staging: fbtft: fix Macros with complex values should be enclosed in parentheses
This patch fixes the following checkpatch.pl error: fix Macros with complex values should be enclosed in parentheses Signed-off-by: Heba Aamer --- drivers/staging/fbtft/fb_pcd8544.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c index 678ab8e..87ca96e 100644 --- a/drivers/staging/fbtft/fb_pcd8544.c +++ b/drivers/staging/fbtft/fb_pcd8544.c @@ -33,7 +33,7 @@ #define DRVNAME "fb_pcd8544" #define WIDTH 84 #define HEIGHT 48 -#define TXBUFLEN 84*6 +#define TXBUFLEN (84*6) #define DEFAULT_GAMMA "40" /* gamma is used to control contrast in this driver */ static unsigned tc = 0; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/5] staging: fbtft: fix do not initialise statics to 0 or NULL
This patch fixes the following checkpatch.pl error: fix do not initialise statics to 0 or NULL Signed-off-by: Heba Aamer --- drivers/staging/fbtft/fb_pcd8544.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c index 87ca96e..d0e5892 100644 --- a/drivers/staging/fbtft/fb_pcd8544.c +++ b/drivers/staging/fbtft/fb_pcd8544.c @@ -36,7 +36,7 @@ #define TXBUFLEN (84*6) #define DEFAULT_GAMMA "40" /* gamma is used to control contrast in this driver */ -static unsigned tc = 0; +static unsigned tc; module_param(tc, uint, 0); MODULE_PARM_DESC(tc, "TC[1:0] Temperature coefficient: 0-3 (default: 0)"); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/5] staging: fbtft: fix horizontal spaces errors
This patch fixes the following checkpatch.pl errors: spaces required around that '=' space required after that ';' spaces required around that '<' Signed-off-by: Heba Aamer --- drivers/staging/fbtft/fb_pcd8544.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c index d0e5892..0510547 100644 --- a/drivers/staging/fbtft/fb_pcd8544.c +++ b/drivers/staging/fbtft/fb_pcd8544.c @@ -117,10 +117,10 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s()\n", __func__); - for (x=0;x<84;x++) { - for (y=0;y<6;y++) { + for (x = 0; x < 84; x++) { + for (y = 0; y < 6; y++) { *buf = 0x00; - for (i=0;i<8;i++) { + for (i = 0; i < 8; i++) { *buf |= (vmem16[(y*8+i)*84+x] ? 1 : 0) << i; } buf++; -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/5] staging: fbtft: fix trailing whitespace
This patch fixes the following checkpatch.pl error: trailing whitespace Signed-off-by: Heba Aamer --- drivers/staging/fbtft/fb_pcd8544.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c index 0510547..8b9ebfb 100644 --- a/drivers/staging/fbtft/fb_pcd8544.c +++ b/drivers/staging/fbtft/fb_pcd8544.c @@ -59,14 +59,14 @@ static int init_display(struct fbtft_par *par) */ /* H=1 Temperature control */ - write_reg(par, 0x04 | (tc & 0x3)); /* + write_reg(par, 0x04 | (tc & 0x3)); /* 2:1 1 1:x TC1 - Temperature Coefficient: 0x10 0:x TC0 */ /* H=1 Bias system */ - write_reg(par, 0x10 | (bs & 0x7)); /* + write_reg(par, 0x10 | (bs & 0x7)); /* 4:1 1 3:0 0 2:x BS2 - Bias System @@ -82,7 +82,7 @@ static int init_display(struct fbtft_par *par) */ /* H=0 Display control */ - write_reg(par, 0x08 | 4); /* + write_reg(par, 0x08 | 4); /* 3:1 1 2:1 D - DE: 10=normal mode 1:0 0 -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/5] staging: fbtft: fix braces {} are not necessary for single statement blocks
This patch fixes the following checkpatch.pl warning: braces {} are not necessary for single statement blocks Signed-off-by: Heba Aamer --- drivers/staging/fbtft/fb_pcd8544.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c index 8b9ebfb..5e08a70 100644 --- a/drivers/staging/fbtft/fb_pcd8544.c +++ b/drivers/staging/fbtft/fb_pcd8544.c @@ -120,9 +120,8 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) for (x = 0; x < 84; x++) { for (y = 0; y < 6; y++) { *buf = 0x00; - for (i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) *buf |= (vmem16[(y*8+i)*84+x] ? 1 : 0) << i; - } buf++; } } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Tuesday, January 20, 2015 23:45 PM > To: KY Srinivasan; de...@linuxdriverproject.org > Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Jason Wang; > Radim Krčmář; Dan Carpenter > Subject: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer > > Commit 4b2f9abea52a ("staging: hv: convert channel_mgmt.c to not call > osd_schedule_callback")' was written under an assumption that we never > receive > Rescind offer while we're still processing the initial Offer request. However, > the issue we fixed in 04a258c162a8 could be caused by this assumption not > always being true. > > In particular, we need to protect against the following: > 1) Receiving a Rescind offer after we do queue_work() for processing an > Offer >request and before we actually enter vmbus_process_offer(). work.func > points >to vmbus_process_offer() at this moment and in vmbus_onoffer_rescind() > we do >another queue_work() without a check so we'll enter > vmbus_process_offer() >twice. > 2) Receiving a Rescind offer after we enter vmbus_process_offer() and >especially after we set >state = CHANNEL_OPEN_STATE. Many things can go >wrong in that case, e.g. we can call free_channel() while we're still using >it. > > Implement the required protection by changing work->func at the very end > of > vmbus_process_offer() and checking work->func in vmbus_onoffer_rescind(). > In > case we receive rescind offer during or before vmbus_process_offer() is > done > we set rescind flag to true and we check it at the end of > vmbus_process_offer() > so such offer will not get lost. > > Suggested-by: Radim Krčmář > Signed-off-by: Vitaly Kuznetsov > --- > drivers/hv/channel_mgmt.c | 30 ++ > 1 file changed, 22 insertions(+), 8 deletions(-) > > diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c > index c6fdd74..877a944 100644 > --- a/drivers/hv/channel_mgmt.c > +++ b/drivers/hv/channel_mgmt.c > @@ -279,9 +279,6 @@ static void vmbus_process_offer(struct work_struct > *work) > int ret; > unsigned long flags; > > - /* The next possible work is rescind handling */ > - INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); > - > /* Make sure this is a new offer */ > spin_lock_irqsave(&vmbus_connection.channel_lock, flags); > > @@ -341,7 +338,7 @@ static void vmbus_process_offer(struct work_struct > *work) > if (channel->sc_creation_callback != NULL) > channel->sc_creation_callback(newchannel); > > - goto out; > + goto done_init_rescind; > } > > goto err_free_chan; > @@ -382,7 +379,14 @@ static void vmbus_process_offer(struct work_struct > *work) > kfree(newchannel->device_obj); > goto err_free_chan; > } > -out: > +done_init_rescind: > + spin_lock_irqsave(&newchannel->lock, flags); > + /* The next possible work is rescind handling */ > + INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); > + /* Check if rescind offer was already received */ > + if (newchannel->rescind) > + queue_work(newchannel->controlwq, &newchannel->work); > + spin_unlock_irqrestore(&newchannel->lock, flags); > return; > err_free_chan: > free_channel(newchannel); > @@ -520,6 +524,7 @@ static void vmbus_onoffer_rescind(struct > vmbus_channel_message_header *hdr) > { > struct vmbus_channel_rescind_offer *rescind; > struct vmbus_channel *channel; > + unsigned long flags; > > rescind = (struct vmbus_channel_rescind_offer *)hdr; > channel = relid2channel(rescind->child_relid); > @@ -528,11 +533,20 @@ static void vmbus_onoffer_rescind(struct > vmbus_channel_message_header *hdr) > /* Just return here, no channel found */ > return; > > + spin_lock_irqsave(&channel->lock, flags); > channel->rescind = true; > + /* > + * channel->work.func != vmbus_process_rescind_offer means we > are still > + * processing offer request and the rescind offer processing should > be > + * postponed. It will be done at the very end of > vmbus_process_offer() > + * as rescind flag is being checked there. > + */ > + if (channel->work.func == vmbus_process_rescind_offer) > + /* work is initialized for vmbus_process_rescind_offer() from > + * vmbus_process_offer() where the channel got created */ > + queue_work(channel->controlwq, &channel->work); > > - /* work is initialized for vmbus_process_rescind_offer() from > - * vmbus_process_offer() where the channel got created */ > - queue_work(channel->controlwq, &channel->work); > + spin_unlock_irqrestore(&channel->lock, flags); > } > > /* > -- Hi Vitaly and all, I have 2 questions: In
Re: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Tuesday, January 20, 2015 23:45 PM >> To: KY Srinivasan; de...@linuxdriverproject.org >> Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Jason Wang; >> Radim Krčmář; Dan Carpenter >> Subject: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer >> >> Commit 4b2f9abea52a ("staging: hv: convert channel_mgmt.c to not call >> osd_schedule_callback")' was written under an assumption that we never >> receive >> Rescind offer while we're still processing the initial Offer request. >> However, >> the issue we fixed in 04a258c162a8 could be caused by this assumption not >> always being true. >> >> In particular, we need to protect against the following: >> 1) Receiving a Rescind offer after we do queue_work() for processing an >> Offer >>request and before we actually enter vmbus_process_offer(). work.func >> points >>to vmbus_process_offer() at this moment and in vmbus_onoffer_rescind() >> we do >>another queue_work() without a check so we'll enter >> vmbus_process_offer() >>twice. >> 2) Receiving a Rescind offer after we enter vmbus_process_offer() and >>especially after we set >state = CHANNEL_OPEN_STATE. Many things can go >>wrong in that case, e.g. we can call free_channel() while we're still >> using >>it. >> >> Implement the required protection by changing work->func at the very end >> of >> vmbus_process_offer() and checking work->func in vmbus_onoffer_rescind(). >> In >> case we receive rescind offer during or before vmbus_process_offer() is >> done >> we set rescind flag to true and we check it at the end of >> vmbus_process_offer() >> so such offer will not get lost. >> >> Suggested-by: Radim Krčmář >> Signed-off-by: Vitaly Kuznetsov >> --- >> drivers/hv/channel_mgmt.c | 30 ++ >> 1 file changed, 22 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c >> index c6fdd74..877a944 100644 >> --- a/drivers/hv/channel_mgmt.c >> +++ b/drivers/hv/channel_mgmt.c >> @@ -279,9 +279,6 @@ static void vmbus_process_offer(struct work_struct >> *work) >> int ret; >> unsigned long flags; >> >> -/* The next possible work is rescind handling */ >> -INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); >> - >> /* Make sure this is a new offer */ >> spin_lock_irqsave(&vmbus_connection.channel_lock, flags); >> >> @@ -341,7 +338,7 @@ static void vmbus_process_offer(struct work_struct >> *work) >> if (channel->sc_creation_callback != NULL) >> channel->sc_creation_callback(newchannel); >> >> -goto out; >> +goto done_init_rescind; >> } >> >> goto err_free_chan; >> @@ -382,7 +379,14 @@ static void vmbus_process_offer(struct work_struct >> *work) >> kfree(newchannel->device_obj); >> goto err_free_chan; >> } >> -out: >> +done_init_rescind: >> +spin_lock_irqsave(&newchannel->lock, flags); >> +/* The next possible work is rescind handling */ >> +INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); >> +/* Check if rescind offer was already received */ >> +if (newchannel->rescind) >> +queue_work(newchannel->controlwq, &newchannel->work); >> +spin_unlock_irqrestore(&newchannel->lock, flags); >> return; >> err_free_chan: >> free_channel(newchannel); >> @@ -520,6 +524,7 @@ static void vmbus_onoffer_rescind(struct >> vmbus_channel_message_header *hdr) >> { >> struct vmbus_channel_rescind_offer *rescind; >> struct vmbus_channel *channel; >> +unsigned long flags; >> >> rescind = (struct vmbus_channel_rescind_offer *)hdr; >> channel = relid2channel(rescind->child_relid); >> @@ -528,11 +533,20 @@ static void vmbus_onoffer_rescind(struct >> vmbus_channel_message_header *hdr) >> /* Just return here, no channel found */ >> return; >> >> +spin_lock_irqsave(&channel->lock, flags); >> channel->rescind = true; >> +/* >> + * channel->work.func != vmbus_process_rescind_offer means we >> are still >> + * processing offer request and the rescind offer processing should >> be >> + * postponed. It will be done at the very end of >> vmbus_process_offer() >> + * as rescind flag is being checked there. >> + */ >> +if (channel->work.func == vmbus_process_rescind_offer) >> +/* work is initialized for vmbus_process_rescind_offer() from >> + * vmbus_process_offer() where the channel got created */ >> +queue_work(channel->controlwq, &channel->work); >> >> -/* work is initialized for vmbus_process_rescind_offer() from >> - * vmbus_process_offer() where the channel got created */ >> -queue_work(channel->controlwq, &channel->work); >> +spin_
RE: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer
> -Original Message- > From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > Sent: Wednesday, January 28, 2015 20:09 PM > To: Dexuan Cui > Cc: KY Srinivasan; de...@linuxdriverproject.org; Haiyang Zhang; linux- > ker...@vger.kernel.org; Jason Wang; Radim Krčmář; Dan Carpenter > Subject: Re: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind > offer > > Dexuan Cui writes: > > >> -Original Message- > >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] > >> Sent: Tuesday, January 20, 2015 23:45 PM > >> To: KY Srinivasan; de...@linuxdriverproject.org > >> Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Jason Wang; > >> Radim Krčmář; Dan Carpenter > >> Subject: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind > offer > ... > > > > Hi Vitaly and all, > > I have 2 questions: > > In vmbus_process_offer(), in the cases of "goto err_free_chan", > > should we consider the possibility a rescind message could be pending for > > the new channel? > > In the cases, because we don't run > > "INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); ", > > vmbus_onoffer_rescind() will do nothing and as a result, > > vmbus_process_rescind_offer() won't be invoked. > > Yes, but processing the rescind offer results in freeing the channel > (and this processing supposes the channel wasn't freed before) so > there is no difference... or is it? > > > > > Question 2: in vmbus_process_offer(), in the case > > vmbus_device_register() fails, we'll run > > "list_del(&newchannel->listentry);" -- just after this line, > > what will happen at this time if relid2channel() returns NULL > > in vmbus_onoffer_rescind()? > > > > I think we'll lose the rescind message. > > > > Yes, but same logic applies - we already freed the channes so no rescind > proccessing required. free_channel() and vmbus_process_rescind_offer() are different, because the latter does more work, e.g., sending the host a message CHANNELMSG_RELID_RELEASED. In the cases of "goto err_free_chan" + "a pending rescind message", the host may expect the message CHANNELMSG_RELID_RELEASED and could reoffer the channel once the message is received. It would be better if the VM doesn't lose the rescind message here. :-) > If we still need to do something we need to > add support for already freed channel to the rescind offer processing path. > Thanks, -- Dexuan ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind offer
Dexuan Cui writes: >> -Original Message- >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> Sent: Wednesday, January 28, 2015 20:09 PM >> To: Dexuan Cui >> Cc: KY Srinivasan; de...@linuxdriverproject.org; Haiyang Zhang; linux- >> ker...@vger.kernel.org; Jason Wang; Radim Krčmář; Dan Carpenter >> Subject: Re: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind >> offer >> >> Dexuan Cui writes: >> >> >> -Original Message- >> >> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com] >> >> Sent: Tuesday, January 20, 2015 23:45 PM >> >> To: KY Srinivasan; de...@linuxdriverproject.org >> >> Cc: Haiyang Zhang; linux-ker...@vger.kernel.org; Dexuan Cui; Jason Wang; >> >> Radim Krčmář; Dan Carpenter >> >> Subject: [PATCH v3 3/3] Drivers: hv: vmbus: serialize Offer and Rescind >> offer >> ... >> > >> > Hi Vitaly and all, >> > I have 2 questions: >> > In vmbus_process_offer(), in the cases of "goto err_free_chan", >> > should we consider the possibility a rescind message could be pending for >> > the new channel? >> > In the cases, because we don't run >> > "INIT_WORK(&newchannel->work, vmbus_process_rescind_offer); ", >> > vmbus_onoffer_rescind() will do nothing and as a result, >> > vmbus_process_rescind_offer() won't be invoked. >> >> Yes, but processing the rescind offer results in freeing the channel >> (and this processing supposes the channel wasn't freed before) so >> there is no difference... or is it? >> >> > >> > Question 2: in vmbus_process_offer(), in the case >> > vmbus_device_register() fails, we'll run >> > "list_del(&newchannel->listentry);" -- just after this line, >> > what will happen at this time if relid2channel() returns NULL >> > in vmbus_onoffer_rescind()? >> > >> > I think we'll lose the rescind message. >> > >> >> Yes, but same logic applies - we already freed the channes so no rescind >> proccessing required. > free_channel() and vmbus_process_rescind_offer() are different, because > the latter does more work, e.g., sending the host a message > CHANNELMSG_RELID_RELEASED. > > In the cases of "goto err_free_chan" + "a pending rescind message", > the host may expect the message CHANNELMSG_RELID_RELEASED and > could reoffer the channel once the message is received. > > It would be better if the VM doesn't lose the rescind message > here. :-) Ah, I see, CHANNELMSG_RELID_RELEASED is expected from us in any case. I'll doing that in a separate patch is noone objects. Thanks for the review, > >> If we still need to do something we need to >> add support for already freed channel to the rescind offer processing path. >> > > Thanks, > -- Dexuan -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: fbtft: remove redundant .owner
This patch fixes the following coccicheck warning: No need to set .owner here. The core will do it. Signed-off-by: Heba Aamer --- drivers/staging/fbtft/flexfb.c |1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/fbtft/flexfb.c b/drivers/staging/fbtft/flexfb.c index 45574a0..3f21cd2 100644 --- a/drivers/staging/fbtft/flexfb.c +++ b/drivers/staging/fbtft/flexfb.c @@ -559,7 +559,6 @@ static const struct platform_device_id flexfb_platform_ids[] = { static struct platform_driver flexfb_platform_driver = { .driver = { .name = DRVNAME, - .owner = THIS_MODULE, }, .id_table = flexfb_platform_ids, .probe = flexfb_probe_pdev, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: lustre: osc: fix Prefer seq_puts to seq_printf
This patch fixes the following checkpatch.pl warning: Prefer seq_puts to seq_printf Signed-off-by: Heba Aamer --- drivers/staging/lustre/lustre/osc/lproc_osc.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index 8e22e45..4da837e 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -364,7 +364,7 @@ static int osc_checksum_type_seq_show(struct seq_file *m, void *v) else seq_printf(m, "%s ", cksum_name[i]); } - seq_printf(m, "\n"); + seq_puts(m, "\n"); return 0; } @@ -601,7 +601,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) seq_printf(seq, "pending read pages: %d\n", atomic_read(&cli->cl_pending_r_pages)); - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n"); + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n"); seq_printf(seq, "pages per rpc rpcs %% cum %% |"); seq_printf(seq, " rpcs %% cum %%\n"); @@ -624,7 +624,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) break; } - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n"); + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n"); seq_printf(seq, "rpcs in flight rpcs %% cum %% |"); seq_printf(seq, " rpcs %% cum %%\n"); @@ -647,7 +647,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v) break; } - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n"); + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n"); seq_printf(seq, "offset rpcs %% cum %% |"); seq_printf(seq, " rpcs %% cum %%\n"); -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3.12 156/176] x86, hyperv: Mark the Hyper-V clocksource as being continuous
From: "K. Y. Srinivasan" 3.12-stable review patch. If anyone has any objections, please let me know. === commit 32c6590d126836a062b3140ed52d898507987017 upstream. The Hyper-V clocksource is continuous; mark it accordingly. Signed-off-by: K. Y. Srinivasan Acked-by: jasow...@redhat.com Cc: gre...@linuxfoundation.org Cc: de...@linuxdriverproject.org Cc: o...@aepfle.de Cc: a...@canonical.com Link: http://lkml.kernel.org/r/1421108762-3331-1-git-send-email-...@microsoft.com Signed-off-by: Thomas Gleixner Signed-off-by: Jiri Slaby --- arch/x86/kernel/cpu/mshyperv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c index 71a39f3621ba..647480716ff1 100644 --- a/arch/x86/kernel/cpu/mshyperv.c +++ b/arch/x86/kernel/cpu/mshyperv.c @@ -63,6 +63,7 @@ static struct clocksource hyperv_cs = { .rating = 400, /* use this when running on Hyperv*/ .read = read_hv_clock, .mask = CLOCKSOURCE_MASK(64), + .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; static void __init ms_hyperv_init_platform(void) -- 2.2.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()
This patch fixes the following checkpatch.pl warning: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) I used the following coccinelle script: @@ expression E1,E2;constant E3; @@ - memcpy(E1, E2, E3) + ether_addr_copy(E1, E2) pahole showed that the used structs are aligned to u16. struct _adapter { struct dvobj_priv dvobjpriv;/* 040 */ struct mlme_priv mlmepriv; /*40 1560 */ /* --- cacheline 25 boundary (1600 bytes) --- */ struct cmd_privcmdpriv; /* 1600 136 */ /* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */ struct evt_privevtpriv; /* 173696 */ /* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- */ struct io_queue * pio_queue;/* 1832 8 */ struct xmit_priv xmitpriv; /* 1840 912 */ /* --- cacheline 43 boundary (2752 bytes) --- */ struct recv_priv recvpriv; /* 2752 1088 */ /* --- cacheline 60 boundary (3840 bytes) --- */ struct sta_privstapriv; /* 3840 672 */ /* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- */ struct security_priv securitypriv; /* 4512 4816 */ /* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- */ struct registry_priv registrypriv; /* 9328 968 */ /* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- */ struct wlan_acl_pool acl_list; /* 10296 1536 */ /* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- */ struct pwrctrl_privpwrctrlpriv; /* 11832 224 */ /* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- */ struct eeprom_priv eeprompriv; /* 12056 508 */ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- */ struct hal_privhalpriv; /* 1256888 */ /* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- */ struct led_privledpriv; /* 12656 304 */ /* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- */ struct mp_priv mppriv; /* 12960 1080 */ /* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago --- */ s32bDriverStopped; /* 14040 4 */ s32bSurpriseRemoved; /* 14044 4 */ u32IsrContent; /* 14048 4 */ u32ImrContent; /* 14052 4 */ u8 EepromAddressSize;/* 14056 1 */ u8 hw_init_completed;/* 14057 1 */ /* XXX 6 bytes hole, try to pack */ struct task_struct * cmdThread;/* 14064 8 */ pid_t evtThread;/* 14072 4 */ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 220 boundary (14080 bytes) --- */ struct task_struct * xmitThread; /* 14080 8 */ pid_t recvThread; /* 14088 4 */ /* XXX 4 bytes hole, try to pack */ uint (*dvobj_init)(struct _adapter *); /* 14096 8 */ void (*dvobj_deinit)(struct _adapter *); /* 14104 8 */ struct net_device *pnetdev; /* 14112 8 */ intbup; /* 14120 4 */ /* XXX 4 bytes hole, try to pack */ struct net_device_statsstats;/* 14128 184 */ /* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- */ struct iw_statistics iwstats; /* 1431232 */ /* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- */ intpid; /* 14344 4 */ /* XXX 4 bytes hole, try to pack */ struct work_struct wkFilterRxFF0;/* 1435232 */ u8 blnEnableRxFF0Filter; /* 14384 1 */ /* XXX 3 bytes hole, try to pack */ spinlock_t lockRxFF0Filter; /* 14388 4 */ const struct firmware * fw; /* 14392 8 */ /* --- cacheline 225 boundary (14400 bytes) --- */ struct usb_interface * pusb_intf;/* 14400 8 */ struct mutex mutex_start; /* 1440840 */ /* XXX last struct has 4 bytes of padding */ struct completion rtl8712_fw_ready; /* 14
Re: [PATCH] staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()
On 01/28/2015 09:53 AM, Heba Aamer wrote: This patch fixes the following checkpatch.pl warning: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) I used the following coccinelle script: @@ expression E1,E2;constant E3; @@ - memcpy(E1, E2, E3) + ether_addr_copy(E1, E2) pahole showed that the used structs are aligned to u16. I think you can stop here. The commit message is much too long for a 2-line patch. BTW, have you tested this patch? In particular, it needs to be tested on an architecture where alignment is important. Using x86 is not sufficient. The reason I ask is that there have been a lot of patches lately that change locking and alignment issues that are only build tested, and have never been tested with real hardware on any platform. One other thing, checkpatch only suggests that this change should be made. It is certainly not mandatory. As you have not indicated that it has been tested, NACK Larry struct _adapter { struct dvobj_priv dvobjpriv;/* 040 */ struct mlme_priv mlmepriv; /*40 1560 */ /* --- cacheline 25 boundary (1600 bytes) --- */ struct cmd_privcmdpriv; /* 1600 136 */ /* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */ struct evt_privevtpriv; /* 173696 */ /* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- */ struct io_queue * pio_queue;/* 1832 8 */ struct xmit_priv xmitpriv; /* 1840 912 */ /* --- cacheline 43 boundary (2752 bytes) --- */ struct recv_priv recvpriv; /* 2752 1088 */ /* --- cacheline 60 boundary (3840 bytes) --- */ struct sta_privstapriv; /* 3840 672 */ /* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- */ struct security_priv securitypriv; /* 4512 4816 */ /* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- */ struct registry_priv registrypriv; /* 9328 968 */ /* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- */ struct wlan_acl_pool acl_list; /* 10296 1536 */ /* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- */ struct pwrctrl_privpwrctrlpriv; /* 11832 224 */ /* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- */ struct eeprom_priv eeprompriv; /* 12056 508 */ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- */ struct hal_privhalpriv; /* 1256888 */ /* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- */ struct led_privledpriv; /* 12656 304 */ /* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- */ struct mp_priv mppriv; /* 12960 1080 */ /* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago --- */ s32bDriverStopped; /* 14040 4 */ s32bSurpriseRemoved; /* 14044 4 */ u32IsrContent; /* 14048 4 */ u32ImrContent; /* 14052 4 */ u8 EepromAddressSize;/* 14056 1 */ u8 hw_init_completed;/* 14057 1 */ /* XXX 6 bytes hole, try to pack */ struct task_struct * cmdThread;/* 14064 8 */ pid_t evtThread;/* 14072 4 */ /* XXX 4 bytes hole, try to pack */ /* --- cacheline 220 boundary (14080 bytes) --- */ struct task_struct * xmitThread; /* 14080 8 */ pid_t recvThread; /* 14088 4 */ /* XXX 4 bytes hole, try to pack */ uint (*dvobj_init)(struct _adapter *); /* 14096 8 */ void (*dvobj_deinit)(struct _adapter *); /* 14104 8 */ struct net_device *pnetdev; /* 14112 8 */ intbup; /* 14120 4 */ /* XXX 4 bytes hole, try to pack */ struct net_device_statsstats;/* 14128 184 */ /* --- cacheline 223 boundary (14272 bytes) was 40 bytes ago --- */ struct iw_statistics iwstats; /* 1431232 */ /* --- cacheline 224 boundary (14336 bytes) was 8 bytes ago --- */ intpid; /* 14344 4 */ /* XXX 4 bytes hole, try to pack */ struct w
[PATCH] staging: comedi: addi_apci_1500: fix array access out of bounds error
The private data 'pm', 'pt', and 'pp' array members hold the trigger mode parameters for ports A and B. Both ports are 8-bits and the arrays are 16-bits. Array index 0 defines the AND mode and index 1 the OR mode parameters for both ports. The valid triggers to start the async command are 0 to 3 which select the AND/OR mode for each port. The 'pb_trig' (the array index for port B) in apci1500_di_inttrig_start() is incorrect and results in an index of 0 or 2. Fix the calc so that the correct index (0/1) is used. Signed-off-by: H Hartley Sweeten Reported-by: Asaf Vertz Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/addi_apci_1500.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_1500.c b/drivers/staging/comedi/drivers/addi_apci_1500.c index fc7db1d..f15aa1f 100644 --- a/drivers/staging/comedi/drivers/addi_apci_1500.c +++ b/drivers/staging/comedi/drivers/addi_apci_1500.c @@ -296,7 +296,7 @@ static int apci1500_di_inttrig_start(struct comedi_device *dev, unsigned int pa_mode = Z8536_PAB_MODE_PMS_DISABLE; unsigned int pb_mode = Z8536_PAB_MODE_PMS_DISABLE; unsigned int pa_trig = trig_num & 0x01; - unsigned int pb_trig = trig_num & 0x02; + unsigned int pb_trig = (trig_num >> 1) & 0x01; bool valid_trig = false; unsigned int val; -- 2.0.3 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: make allyesconfig i386 build failure with next-20150122 (caused by fb_agm1264k-fl driver)
On Mon, Jan 26, 2015 at 01:59:59PM -0800, Guenter Roeck wrote: > On Thu, Jan 22, 2015 at 12:10:33PM -0700, Jim Davis wrote: > > make ARCH=i386 allyesconfig fails with > > > > drivers/staging/built-in.o: In function `reset': > > (.text+0x2ae89d): multiple definition of `reset' > > drivers/isdn/built-in.o:(.text+0x185dc2): first defined here > > make[1]: *** [drivers/built-in.o] Error 1 > > Culprit: > > commit b2ebd4be6fa1d2329b63531b044f9e25474981cb > Author: Thomas Petazzoni > Date: Wed Dec 31 10:11:10 2014 +0100 > > staging: fbtft: add fb_agm1264k-fl driver > > A global function named 'reset' isn't really a good idea. > > Not that the global function with the same name in the isdn code > is better ;-). It's been fixed in my tree for a while now :) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: comedi: comedi_fops.c: document exported functions
Add kerneldoc for exported functions `comedi_dev_put()`, `comedi_dev_get_from_minor()`, `comedi_is_subdevice_running()`, and `comedi_event()`. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 42 1 file changed, 42 insertions(+) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index bb2e796..8f65097 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -113,6 +113,18 @@ static void comedi_dev_kref_release(struct kref *kref) kfree(dev); } +/** + * comedi_dev_put - release a use of a comedi device structure + * @dev: comedi_device struct + * + * Must be called when a user of a comedi device is finished with it. + * When the last user of the comedi device calls this function, the + * comedi device is destroyed. + * + * Return 1 if the comedi device is destroyed by this call or dev is + * NULL, otherwise return 0. Callers must not assume the comedi + * device is still valid if this function returns 0. + */ int comedi_dev_put(struct comedi_device *dev) { if (dev) @@ -220,6 +232,18 @@ static struct comedi_device *comedi_dev_get_from_subdevice_minor(unsigned minor) return dev; } +/** + * comedi_dev_get_from_minor - get comedi device by minor device number + * @minor: minor device number + * + * Finds the comedi device associated by the minor device number, if any, + * and increments its reference count. The comedi device is prevented from + * being freed until a matching call is made to comedi_dev_put(). + * + * Return a pointer to the comedi device if it exists, with its usage + * reference incremented. Return NULL if no comedi device exists with the + * specified minor device number. + */ struct comedi_device *comedi_dev_get_from_minor(unsigned minor) { if (minor < COMEDI_NUM_BOARD_MINORS) @@ -600,6 +624,13 @@ static unsigned comedi_get_subdevice_runflags(struct comedi_subdevice *s) return runflags; } +/** + * comedi_is_subdevice_running - check if async command running on subdevice + * @s: comedi_subdevice struct + * + * Return true if an asynchronous comedi command is active on the comedi + * subdevice, else return false. + */ bool comedi_is_subdevice_running(struct comedi_subdevice *s) { unsigned runflags = comedi_get_subdevice_runflags(s); @@ -2584,6 +2615,17 @@ static const struct file_operations comedi_fops = { .llseek = noop_llseek, }; +/** + * comedi_event - handle events for asynchronous comedi command + * @dev: comedi_device struct + * @s: comedi_subdevice struct associated with dev + * Context: interrupt (usually), s->spin_lock spin-lock not held + * + * If an asynchronous comedi command is active on the subdevice, process + * any COMEDI_CB_... event flags that have been set, usually by an + * interrupt handler. These may change the run state of the asynchronous + * command, wake a task, and/or send a SIGIO signal. + */ void comedi_event(struct comedi_device *dev, struct comedi_subdevice *s) { struct comedi_async *async = s->async; -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/6] staging: comedi: range.c: reformat copyright comment
Use the usual block comment style. Signed-off-by: Ian Abbott --- drivers/staging/comedi/range.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c index 00e71c7..6a393b2 100644 --- a/drivers/staging/comedi/range.c +++ b/drivers/staging/comedi/range.c @@ -1,20 +1,20 @@ /* -module/range.c -comedi routines for voltage ranges - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1997-8 David A. Schleef - -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. See the -GNU General Public License for more details. -*/ + * comedi/range.c + * comedi routines for voltage ranges + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1997-8 David A. Schleef + * + * 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. See the + * GNU General Public License for more details. + */ #include #include "comedidev.h" -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] staging: comedi: comedi_fops.c: reformat copyright header
Use the usual block comment style. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 32 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 68bfe92..bb2e796 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -1,20 +1,20 @@ /* -comedi/comedi_fops.c -comedi kernel module - -COMEDI - Linux Control and Measurement Device Interface -Copyright (C) 1997-2000 David A. Schleef - -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. See the -GNU General Public License for more details. -*/ + * comedi/comedi_fops.c + * comedi kernel module + * + * COMEDI - Linux Control and Measurement Device Interface + * Copyright (C) 1997-2000 David A. Schleef + * + * 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. See the + * GNU General Public License for more details. + */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: comedi: comedi_fops.c: reformat remaining block comments
Reformat remaining block comments to use the usual block comment style. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 29 ++--- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 5403af1..727640e 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -347,8 +347,7 @@ static int resize_async_buffer(struct comedi_device *dev, return -EBUSY; } - /* make sure buffer is an integral number of pages -* (we round up) */ + /* make sure buffer is an integral number of pages (we round up) */ new_size = (new_size + PAGE_SIZE - 1) & PAGE_MASK; retval = comedi_buf_alloc(dev, s, new_size); @@ -671,7 +670,7 @@ void *comedi_alloc_spriv(struct comedi_subdevice *s, size_t size) EXPORT_SYMBOL_GPL(comedi_alloc_spriv); /* - This function restores a subdevice to an idle state. + * This function restores a subdevice to an idle state. */ static void do_become_nonbusy(struct comedi_device *dev, struct comedi_subdevice *s) @@ -1162,8 +1161,10 @@ static int check_insn_config_length(struct comedi_insn *insn, if (insn->n == 6) return 0; break; - /* by default we allow the insn since we don't have checks for -* all possible cases yet */ + /* +* by default we allow the insn since we don't have checks for +* all possible cases yet +*/ default: pr_warn("No check for data length of config insn id %i is implemented\n", data[0]); @@ -1314,9 +1315,11 @@ static int parse_insn(struct comedi_device *dev, struct comedi_insn *insn, if (insn->n != 2) { ret = -EINVAL; } else { - /* Most drivers ignore the base channel in + /* +* Most drivers ignore the base channel in * insn->chanspec. Fix this here if -* the subdevice has <= 32 channels. */ +* the subdevice has <= 32 channels. +*/ unsigned int orig_mask = data[0]; unsigned int shift = 0; @@ -1977,8 +1980,10 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd, mutex_lock(&dev->mutex); - /* Device config is special, because it must work on -* an unconfigured device. */ + /* +* Device config is special, because it must work on +* an unconfigured device. +*/ if (cmd == COMEDI_DEVCONFIG) { if (minor >= COMEDI_NUM_BOARD_MINORS) { /* Device config not appropriate on non-board minors. */ @@ -1990,8 +1995,10 @@ static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd, if (rc == 0) { if (arg == 0 && dev->minor >= comedi_num_legacy_minors) { - /* Successfully unconfigured a dynamically -* allocated device. Try and remove it. */ + /* +* Successfully unconfigured a dynamically +* allocated device. Try and remove it. +*/ if (comedi_clear_board_dev(dev)) { mutex_unlock(&dev->mutex); comedi_free_board_dev(dev); -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/6] staging: comedi: reformat comedi_fops and range comments
1) staging: comedi: comedi_fops.c: reformat copyright header 2) staging: comedi: comedi_fops.c: document exported functions 3) staging: comedi: comedi_fops.c: reformat ioctl handler comments 4) staging: comedi: range.c: reformat ioctl handler comment 5) staging: comedi: range.c: reformat copyright comment 6) staging: comedi: comedi_fops.c: reformat remaining block comments drivers/staging/comedi/comedi_fops.c | 437 +++ drivers/staging/comedi/range.c | 56 ++--- 2 files changed, 272 insertions(+), 221 deletions(-) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/6] staging: comedi: range.c: reformat ioctl handler comment
The unlocked_ioctl handler in "comedi_fops.c" calls a different function to handle each supported ioctl command code. Most of these have a block comment indicating which command code it handles, a brief description, and an informal description of the inputs and outputs. These block comments were formatted in various styles, but have been reformatted to use the usual block comment style. The block comment for the handler function for the `COMEDI_RANGEINFO` ioctl code is in "range.c". Reformat it to use the usual block command style to match the others. Reword it a bit for consistency. Signed-off-by: Ian Abbott --- drivers/staging/comedi/range.c | 24 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c index 9a1dc56..00e71c7 100644 --- a/drivers/staging/comedi/range.c +++ b/drivers/staging/comedi/range.c @@ -42,18 +42,18 @@ const struct comedi_lrange range_unknown = { 1, {{0, 100, UNIT_none} } }; EXPORT_SYMBOL_GPL(range_unknown); /* - COMEDI_RANGEINFO - range information ioctl - - arg: - pointer to rangeinfo structure - - reads: - range info structure - - writes: - n struct comedi_krange structures to rangeinfo->range_ptr -*/ + * COMEDI_RANGEINFO ioctl + * range information + * + * arg: + * pointer to comedi_rangeinfo structure + * + * reads: + * comedi_rangeinfo structure + * + * writes: + * array of comedi_krange structures to rangeinfo->range_ptr pointer + */ int do_rangeinfo_ioctl(struct comedi_device *dev, struct comedi_rangeinfo __user *arg) { -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] staging: comedi: comedi_fops.c: reformat ioctl handler comments
The unlocked_ioctl handler calls a different function to handle each supported ioctl command code. Most of these have a block comment indicating which command code it handles, a brief description, and an informal description of the inputs and outputs. These block comments are formatted in various styles. Reformat them to the usual block comment style and do a bit of rewording for consistency. The comment block for the `COMEDI_CMD` ioctl is missing, so add one. Signed-off-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 334 ++- 1 file changed, 168 insertions(+), 166 deletions(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 8f65097..5403af1 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -740,18 +740,18 @@ static int is_device_busy(struct comedi_device *dev) } /* - COMEDI_DEVCONFIG - device config ioctl - - arg: - pointer to devconfig structure - - reads: - devconfig structure at arg - - writes: - none -*/ + * COMEDI_DEVCONFIG ioctl + * attaches (and configures) or detaches a legacy device + * + * arg: + * pointer to comedi_devconfig structure (NULL if detaching) + * + * reads: + * comedi_devconfig structure (if attaching) + * + * writes: + * nothing + */ static int do_devconfig_ioctl(struct comedi_device *dev, struct comedi_devconfig __user *arg) { @@ -792,19 +792,18 @@ static int do_devconfig_ioctl(struct comedi_device *dev, } /* - COMEDI_BUFCONFIG - buffer configuration ioctl - - arg: - pointer to bufconfig structure - - reads: - bufconfig at arg - - writes: - modified bufconfig at arg - -*/ + * COMEDI_BUFCONFIG ioctl + * buffer configuration + * + * arg: + * pointer to comedi_bufconfig structure + * + * reads: + * comedi_bufconfig structure + * + * writes: + * modified comedi_bufconfig structure + */ static int do_bufconfig_ioctl(struct comedi_device *dev, struct comedi_bufconfig __user *arg) { @@ -854,19 +853,18 @@ copyback: } /* - COMEDI_DEVINFO - device info ioctl - - arg: - pointer to devinfo structure - - reads: - none - - writes: - devinfo structure - -*/ + * COMEDI_DEVINFO ioctl + * device info + * + * arg: + * pointer to comedi_devinfo structure + * + * reads: + * nothing + * + * writes: + * comedi_devinfo structure + */ static int do_devinfo_ioctl(struct comedi_device *dev, struct comedi_devinfo __user *arg, struct file *file) @@ -901,19 +899,18 @@ static int do_devinfo_ioctl(struct comedi_device *dev, } /* - COMEDI_SUBDINFO - subdevice info ioctl - - arg: - pointer to array of subdevice info structures - - reads: - none - - writes: - array of subdevice info structures at arg - -*/ + * COMEDI_SUBDINFO ioctl + * subdevices info + * + * arg: + * pointer to array of comedi_subdinfo structures + * + * reads: + * nothing + * + * writes: + * array of comedi_subdinfo structures + */ static int do_subdinfo_ioctl(struct comedi_device *dev, struct comedi_subdinfo __user *arg, void *file) { @@ -975,19 +972,19 @@ static int do_subdinfo_ioctl(struct comedi_device *dev, } /* - COMEDI_CHANINFO - subdevice info ioctl - - arg: - pointer to chaninfo structure - - reads: - chaninfo structure at arg - - writes: - arrays at elements of chaninfo structure - -*/ + * COMEDI_CHANINFO ioctl + * subdevice channel info + * + * arg: + * pointer to comedi_chaninfo structure + * + * reads: + * comedi_chaninfo structure + * + * writes: + * array of maxdata values to chaninfo->maxdata_list if requested + * array of range table lengths to chaninfo->range_table_list if requested + */ static int do_chaninfo_ioctl(struct comedi_device *dev, struct comedi_chaninfo __user *arg) { @@ -1035,20 +1032,19 @@ static int do_chaninfo_ioctl(struct comedi_device *dev, return 0; } - /* -COMEDI_BUFINFO -buffer information ioctl - -arg: -pointer to bufinfo structure - -reads: -bufinfo at arg - -writes: -modified bufinfo at arg - - */ +/* + * COMEDI_BUFINFO ioctl + * buffer information + * + * arg: + * pointer to comedi_bufinfo structure + * + * reads: + * comedi_bufinfo structure + * + * writes: + * modified comedi_bufinfo structure + */ static int do_bufinfo_ioctl(struct comedi_device *dev, struct comedi_bufinfo __user *arg, void *file) { @@ -1357,19 +1353,19 @@ out: } /* - * COMEDI_INSNLIST
Re: [RFC] ion:change ion_cma_allocate return error value
On Tue, Jan 27, 2015 at 02:04:21PM +0800, Wang, Yalin wrote: > This patch change the error return value from -1 to -ENOMEM, > so that userspace can get the correct errno, otherwise, > -1 will be -EPERM, userspace will print permission deny for allocation > failure. > > Signed-off-by: Yalin Wang > --- > drivers/staging/android/ion/ion_cma_heap.c | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) Don't you also need to now change userspace code to properly handle these errors? greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: lustre: osc: fix Prefer seq_puts to seq_printf
On Wed, Jan 28, 2015 at 04:05:33PM +0200, Heba Aamer wrote: > This patch fixes the following checkpatch.pl warning: > Prefer seq_puts to seq_printf > > Signed-off-by: Heba Aamer > --- > drivers/staging/lustre/lustre/osc/lproc_osc.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c > b/drivers/staging/lustre/lustre/osc/lproc_osc.c > index 8e22e45..4da837e 100644 > --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c > +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c > @@ -364,7 +364,7 @@ static int osc_checksum_type_seq_show(struct seq_file *m, > void *v) > else > seq_printf(m, "%s ", cksum_name[i]); > } > - seq_printf(m, "\n"); > + seq_puts(m, "\n"); I don't think this is a straight search/replace issue, but: > return 0; > } > > @@ -601,7 +601,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, > void *v) > seq_printf(seq, "pending read pages: %d\n", > atomic_read(&cli->cl_pending_r_pages)); > > - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n"); > + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n"); > seq_printf(seq, "pages per rpc rpcs %% cum %% |"); > seq_printf(seq, " rpcs %% cum %%\n"); if it were, why didn't you fix the other uses here? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] staging: rtl8188eu: core: rtw_wlan_util: Remove some unused functions
On Sun, Jan 25, 2015 at 06:44:30PM +0100, Rickard Strandqvist wrote: > Removes some functions that are not used anywhere: > CAM_empty_entry() get_bsstype() rtw_get_oper_choffset() > rtw_get_oper_bw() is_ap_in_wep() should_forbid_n_rate() > > This was partially found by using a static code analysis program called > cppcheck. > > Signed-off-by: Rickard Strandqvist > --- > drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 90 > -- > drivers/staging/rtl8188eu/include/rtw_mlme_ext.h |6 -- > 2 files changed, 96 deletions(-) Doesn't apply to my staging-testing branch at all :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3.19.0-rc5 01/03] STAGING: Fix pcl818.c coding style issue: code indent should use tabs where possible
On Mon, Jan 26, 2015 at 09:16:28PM +0800, Simon Guo wrote: > Correct one coding style problem(detected by checkpatch.pl) in pcl818.c. > - code indent should use tabs where possible > It is fixed by reformatting the comment block to usual comment style. > > Signed-off-by: Simon Guo > --- > drivers/staging/comedi/drivers/pcl818.c | 195 > > 1 file changed, 97 insertions(+), 98 deletions(-) When you resend patches, please let me know what version of the patch series this is, with a "v2" or something in the subject area. Right now I see a bunch of patches from you, but no clue as to which is the 'latest' and what changed in what version. So I'm going to drop them all, please resend. Also, you don't need the kernel version in the [PATCH] area, as we are always assuming you are making the patch against the latest kernel version, hopefully my staging-testing branch, otherwise we couldn't apply it no matter what. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/3] fix space required after that ','
On Mon, Jan 26, 2015 at 12:24:33PM +0200, Mariam Mohamed Fawzy wrote: > This patch fixes the following in checkpatch.pl error: > space required after that ',' > > Signed-off-by: Mariam Mohamed Fawzy > --- > drivers/staging/fbtft/fb_bd663474.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Please put in the subject what portion of the kernel you are changing, like you did in the 0/3 email. Can you redo these and resend? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/5] staging: fbtft: fix Macros with complex values should be enclosed in parentheses
On Wed, Jan 28, 2015 at 01:19:25PM +0200, Heba Aamer wrote: > This patch fixes the following checkpatch.pl error: > fix Macros with complex values should be enclosed in parentheses > > Signed-off-by: Heba Aamer > --- > drivers/staging/fbtft/fb_pcd8544.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/fbtft/fb_pcd8544.c > b/drivers/staging/fbtft/fb_pcd8544.c > index 678ab8e..87ca96e 100644 > --- a/drivers/staging/fbtft/fb_pcd8544.c > +++ b/drivers/staging/fbtft/fb_pcd8544.c > @@ -33,7 +33,7 @@ > #define DRVNAME "fb_pcd8544" > #define WIDTH 84 > #define HEIGHT 48 > -#define TXBUFLEN 84*6 > +#define TXBUFLEN (84*6) > #define DEFAULT_GAMMA "40" /* gamma is used to control contrast in this > driver */ > > static unsigned tc = 0; This is already in my tree, did you redo this series and not say a 'v2' in them? confused, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: speakup: Remove unnecessary space
This patch fixes the checkpath.pl warning: ERROR: space prohibited before that ',' (ctx:WxE) + MSG_FIRST_INDEX , And removes the unnecessary space. Signed-off-by: Bastian Plettner --- drivers/staging/speakup/i18n.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/i18n.h b/drivers/staging/speakup/i18n.h index 16a0871..326d086 100644 --- a/drivers/staging/speakup/i18n.h +++ b/drivers/staging/speakup/i18n.h @@ -3,7 +3,7 @@ /* Internationalization declarations */ enum msg_index_t { - MSG_FIRST_INDEX , + MSG_FIRST_INDEX, MSG_ANNOUNCEMENTS_START = MSG_FIRST_INDEX, MSG_BLANK = MSG_ANNOUNCEMENTS_START, MSG_IAM_ALIVE, -- 2.2.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 0/6] staging: comedi: reformat comedi_fops and range comments
On Wednesday, January 28, 2015 11:42 AM, Ian Abbott wrote: > 1) staging: comedi: comedi_fops.c: reformat copyright header > 2) staging: comedi: comedi_fops.c: document exported functions > 3) staging: comedi: comedi_fops.c: reformat ioctl handler comments > 4) staging: comedi: range.c: reformat ioctl handler comment > 5) staging: comedi: range.c: reformat copyright comment > 6) staging: comedi: comedi_fops.c: reformat remaining block comments > > drivers/staging/comedi/comedi_fops.c | 437 > +++ > drivers/staging/comedi/range.c | 56 ++--- > 2 files changed, 272 insertions(+), 221 deletions(-) Reviewed-by: H Hartley Sweeten ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging/fwserial: use correct vendor/version IDs
The driver was using the vendor ID 0xd00d1e from the FireWire core. However, this ID was not registered, and invalid. Instead, use the vendor/version IDs that now are officially assigned to firewire-serial: https://ieee1394.wiki.kernel.org/index.php/IEEE_OUI_Assignments Signed-off-by: Clemens Ladisch --- drivers/staging/fwserial/TODO |5 ++--- drivers/staging/fwserial/fwserial.c |4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/staging/fwserial/TODO b/drivers/staging/fwserial/TODO index 382a795..c3d1d3a 100644 --- a/drivers/staging/fwserial/TODO +++ b/drivers/staging/fwserial/TODO @@ -9,6 +9,5 @@ TODOs prior to this driver moving out of staging GUID-to-port matching/whitelist/blacklist. -- Issues with firewire stack -- -1. This driver uses the same unregistered vendor id that the firewire core does - (0xd00d1e). Perhaps this could be exposed as a define in - firewire.h? +1. This driver uses the same ids that the firewire core does (001f11:0239xx). + Perhaps this could be exposed as a define in firewire.h? diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c index 73deae3..2964366 100644 --- a/drivers/staging/fwserial/fwserial.c +++ b/drivers/staging/fwserial/fwserial.c @@ -30,8 +30,8 @@ #define be32_to_u64(hi, lo) ((u64)be32_to_cpu(hi) << 32 | be32_to_cpu(lo)) -#define LINUX_VENDOR_ID 0xd00d1eU /* same id used in card root directory */ -#define FWSERIAL_VERSION 0x00e81cU /* must be unique within LINUX_VENDOR_ID */ +#define LINUX_VENDOR_ID 0x001f11U /* same id used in card root directory */ +#define FWSERIAL_VERSION 0x023953U /* must be unique within LINUX_VENDOR_ID */ /* configurable options */ static int num_ttys = 4; /* # of std ttys to create per fw_card*/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()
On Wed, Jan 28, 2015 at 10:48:40AM -0600, Larry Finger wrote: > On 01/28/2015 09:53 AM, Heba Aamer wrote: > >This patch fixes the following checkpatch.pl warning: > >Prefer ether_addr_copy() over memcpy() > >if the Ethernet addresses are __aligned(2) > > > >I used the following coccinelle script: > > > >@@ > >expression E1,E2;constant E3; > >@@ > > > >- memcpy(E1, E2, E3) > >+ ether_addr_copy(E1, E2) > > > > > >pahole showed that the used structs are aligned to u16. > > I think you can stop here. The commit message is much too long for a 2-line > patch. > > BTW, have you tested this patch? In particular, it needs to be tested on an > architecture where alignment is important. Using x86 is not sufficient. The > reason I ask is that there have been a lot of patches lately that change > locking and alignment issues that are only build tested, and have never been > tested with real hardware on any platform. > > One other thing, checkpatch only suggests that this change should be made. > It is certainly not mandatory. As you have not indicated that it has been > tested, > > NACK > > Larry > Hello Larry, Thank you for your patience. Heba has submitted this patch as part of a workshop she currently attends. She has checked the alignment through pahole and it showed that the variables of complex structs are aligned. She has attached the output of pahole, so that the community can verify her results and hence the lengthy output. She can also cross compile the kernel and verify the output for other architectures using pahole. Kindly let us know if this suits you. And please name any specific architecture that you would to see tested. If this is still not enough from your point of view, let us know what should be done further to verify the correctness of the patch. Kind Regards, Aya Saif El-yazal Mahfouz > > > >struct _adapter { > > struct dvobj_priv dvobjpriv;/* 040 */ > > struct mlme_priv mlmepriv; /*40 1560 */ > > /* --- cacheline 25 boundary (1600 bytes) --- */ > > struct cmd_privcmdpriv; /* 1600 136 */ > > /* --- cacheline 27 boundary (1728 bytes) was 8 bytes ago --- */ > > struct evt_privevtpriv; /* 173696 */ > > /* --- cacheline 28 boundary (1792 bytes) was 40 bytes ago --- */ > > struct io_queue * pio_queue;/* 1832 8 */ > > struct xmit_priv xmitpriv; /* 1840 912 */ > > /* --- cacheline 43 boundary (2752 bytes) --- */ > > struct recv_priv recvpriv; /* 2752 1088 */ > > /* --- cacheline 60 boundary (3840 bytes) --- */ > > struct sta_privstapriv; /* 3840 672 */ > > /* --- cacheline 70 boundary (4480 bytes) was 32 bytes ago --- */ > > struct security_priv securitypriv; /* 4512 4816 */ > > /* --- cacheline 145 boundary (9280 bytes) was 48 bytes ago --- */ > > struct registry_priv registrypriv; /* 9328 968 */ > > /* --- cacheline 160 boundary (10240 bytes) was 56 bytes ago --- */ > > struct wlan_acl_pool acl_list; /* 10296 1536 */ > > /* --- cacheline 184 boundary (11776 bytes) was 56 bytes ago --- */ > > struct pwrctrl_privpwrctrlpriv; /* 11832 224 */ > > /* --- cacheline 188 boundary (12032 bytes) was 24 bytes ago --- */ > > struct eeprom_priv eeprompriv; /* 12056 508 */ > > > > /* XXX 4 bytes hole, try to pack */ > > > > /* --- cacheline 196 boundary (12544 bytes) was 24 bytes ago --- */ > > struct hal_privhalpriv; /* 1256888 */ > > /* --- cacheline 197 boundary (12608 bytes) was 48 bytes ago --- */ > > struct led_privledpriv; /* 12656 304 */ > > /* --- cacheline 202 boundary (12928 bytes) was 32 bytes ago --- */ > > struct mp_priv mppriv; /* 12960 1080 */ > > /* --- cacheline 219 boundary (14016 bytes) was 24 bytes ago --- */ > > s32bDriverStopped; /* 14040 4 */ > > s32bSurpriseRemoved; /* 14044 4 */ > > u32IsrContent; /* 14048 4 */ > > u32ImrContent; /* 14052 4 */ > > u8 EepromAddressSize;/* 14056 1 */ > > u8 hw_init_completed;/* 14057 1 */ > > > > /* XXX 6 bytes hole, try to pack */ > > > > struct task_struct * cmdThread;/* 14064 8 */ > > pid_t evtThread;/* 14072 4 */ > > > > /* XXX 4 bytes hole, try to pack */ > > > > /* --- cacheline 220 boundary (14080 bytes) --- */ > > struct task_struct * xmitThread; /* 14080 8 */ > > pid_t recvThread;
[PATCH] staging: xgifb: XGI_main_26: Change variables that is never used
Variable ar assigned a value that is never used. Instead use the struct variable of the same name. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/xgifb/XGI_main_26.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/xgifb/XGI_main_26.c b/drivers/staging/xgifb/XGI_main_26.c index 709d49e..ecfdf34 100644 --- a/drivers/staging/xgifb/XGI_main_26.c +++ b/drivers/staging/xgifb/XGI_main_26.c @@ -1233,7 +1233,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) unsigned int vtotal = 0; unsigned int drate = 0, hrate = 0; int found_mode = 0; - int refresh_rate, search_idx; + int search_idx; if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) { vtotal = var->upper_margin + var->yres + var->lower_margin @@ -1271,7 +1271,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) /* Calculation wrong for 1024x600 - force it to 60Hz */ if ((var->xres == 1024) && (var->yres == 600)) - refresh_rate = 60; + xgifb_info->refresh_rate = 60; search_idx = 0; while ((XGIbios_mode[search_idx].mode_no != 0) && -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: addi-data: hwdrv_apci1500: Change variables that is never used
Variable ar assigned a value that is never used. Instead use the struct variable of the same name. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c index bfa9228..faa71a9 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c @@ -467,8 +467,6 @@ static int apci1500_di_write(struct comedi_device *dev, unsigned int *data) { struct apci1500_private *devpriv = dev->private; - int i_Event1InterruptStatus = 0, i_Event2InterruptStatus = - 0, i_RegValue; switch (data[0]) { case START: @@ -499,11 +497,9 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xF4, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event1InterruptStatus = 1; outb(APCI1500_RW_PORT_A_SPECIFICATION, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_RegValue = inb(devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); @@ -549,7 +545,6 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xD0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event2InterruptStatus = 1; } else { dev_warn(dev->class_dev, "Event 2 not initialised\n"); @@ -592,7 +587,6 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xF4, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event1InterruptStatus = 0; } else { dev_warn(dev->class_dev, "Event 1 not initialised\n"); @@ -621,7 +615,6 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xF4, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event2InterruptStatus = 0; } else { dev_warn(dev->class_dev, @@ -1896,7 +1889,6 @@ static int apci1500_do_bits(struct comedi_device *dev, unsigned int *data) { struct apci1500_private *devpriv = dev->private; - unsigned int ui_Status; int i_RegValue; int i_Constant; @@ -2004,8 +1996,8 @@ static int apci1500_do_bits(struct comedi_device *dev, /* Enables the PCI interrupt */ outl(0x3000, devpriv->i_IobaseAmcc + 0x38); - ui_Status = inl(devpriv->i_IobaseAmcc + 0x10); - ui_Status = inl(devpriv->i_IobaseAmcc + 0x38); + inl(devpriv->i_IobaseAmcc + 0x10); + inl(devpriv->i_IobaseAmcc + 0x38); outl(0x23000, devpriv->i_IobaseAmcc + 0x38); return insn->n; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: drivers: addi-data: hwdrv_apci1500: Change variables that is never used
2015-01-28 22:42 GMT+01:00 Rickard Strandqvist : > Variable ar assigned a value that is never used. > Instead use the struct variable of the same name. > > This was found using a static code analysis program called cppcheck > > Signed-off-by: Rickard Strandqvist > --- > drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c | 12 ++-- > 1 file changed, 2 insertions(+), 10 deletions(-) > > diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c > b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c > index bfa9228..faa71a9 100644 > --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c > +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c > @@ -467,8 +467,6 @@ static int apci1500_di_write(struct comedi_device *dev, > unsigned int *data) > { > struct apci1500_private *devpriv = dev->private; > - int i_Event1InterruptStatus = 0, i_Event2InterruptStatus = > - 0, i_RegValue; > > switch (data[0]) { > case START: > @@ -499,11 +497,9 @@ static int apci1500_di_write(struct comedi_device *dev, > outb(0xF4, > devpriv->iobase + > > APCI1500_Z8536_CONTROL_REGISTER); > - i_Event1InterruptStatus = 1; > outb(APCI1500_RW_PORT_A_SPECIFICATION, > devpriv->iobase + > > APCI1500_Z8536_CONTROL_REGISTER); > - i_RegValue = > inb(devpriv->iobase + > > APCI1500_Z8536_CONTROL_REGISTER); > > @@ -549,7 +545,6 @@ static int apci1500_di_write(struct comedi_device *dev, > outb(0xD0, > devpriv->iobase + > > APCI1500_Z8536_CONTROL_REGISTER); > - i_Event2InterruptStatus = 1; > } else { > dev_warn(dev->class_dev, > "Event 2 not initialised\n"); > @@ -592,7 +587,6 @@ static int apci1500_di_write(struct comedi_device *dev, > outb(0xF4, > devpriv->iobase + > > APCI1500_Z8536_CONTROL_REGISTER); > - i_Event1InterruptStatus = 0; > } else { > dev_warn(dev->class_dev, > "Event 1 not initialised\n"); > @@ -621,7 +615,6 @@ static int apci1500_di_write(struct comedi_device *dev, > outb(0xF4, > devpriv->iobase + > > APCI1500_Z8536_CONTROL_REGISTER); > - i_Event2InterruptStatus = 0; > } else { > > dev_warn(dev->class_dev, > @@ -1896,7 +1889,6 @@ static int apci1500_do_bits(struct comedi_device *dev, > unsigned int *data) > { > struct apci1500_private *devpriv = dev->private; > - unsigned int ui_Status; > int i_RegValue; > int i_Constant; > > @@ -2004,8 +1996,8 @@ static int apci1500_do_bits(struct comedi_device *dev, > > /* Enables the PCI interrupt */ > outl(0x3000, devpriv->i_IobaseAmcc + 0x38); > - ui_Status = inl(devpriv->i_IobaseAmcc + 0x10); > - ui_Status = inl(devpriv->i_IobaseAmcc + 0x38); > + inl(devpriv->i_IobaseAmcc + 0x10); > + inl(devpriv->i_IobaseAmcc + 0x38); > outl(0x23000, devpriv->i_IobaseAmcc + 0x38); > > return insn->n; > -- > 1.7.10.4 > Hi Sorry, ignore this! Wrong commit message, sending a new patch. Kind regards Rickard Strandqvist ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c index bfa9228..faa71a9 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c @@ -467,8 +467,6 @@ static int apci1500_di_write(struct comedi_device *dev, unsigned int *data) { struct apci1500_private *devpriv = dev->private; - int i_Event1InterruptStatus = 0, i_Event2InterruptStatus = - 0, i_RegValue; switch (data[0]) { case START: @@ -499,11 +497,9 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xF4, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event1InterruptStatus = 1; outb(APCI1500_RW_PORT_A_SPECIFICATION, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_RegValue = inb(devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); @@ -549,7 +545,6 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xD0, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event2InterruptStatus = 1; } else { dev_warn(dev->class_dev, "Event 2 not initialised\n"); @@ -592,7 +587,6 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xF4, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event1InterruptStatus = 0; } else { dev_warn(dev->class_dev, "Event 1 not initialised\n"); @@ -621,7 +615,6 @@ static int apci1500_di_write(struct comedi_device *dev, outb(0xF4, devpriv->iobase + APCI1500_Z8536_CONTROL_REGISTER); - i_Event2InterruptStatus = 0; } else { dev_warn(dev->class_dev, @@ -1896,7 +1889,6 @@ static int apci1500_do_bits(struct comedi_device *dev, unsigned int *data) { struct apci1500_private *devpriv = dev->private; - unsigned int ui_Status; int i_RegValue; int i_Constant; @@ -2004,8 +1996,8 @@ static int apci1500_do_bits(struct comedi_device *dev, /* Enables the PCI interrupt */ outl(0x3000, devpriv->i_IobaseAmcc + 0x38); - ui_Status = inl(devpriv->i_IobaseAmcc + 0x10); - ui_Status = inl(devpriv->i_IobaseAmcc + 0x38); + inl(devpriv->i_IobaseAmcc + 0x10); + inl(devpriv->i_IobaseAmcc + 0x38); outl(0x23000, devpriv->i_IobaseAmcc + 0x38); return insn->n; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: addi-data: hwdrv_apci3501: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c index 339519a..24126e3 100644 --- a/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c +++ b/drivers/staging/comedi/drivers/addi-data/hwdrv_apci3501.c @@ -93,7 +93,6 @@ static int apci3501_write_insn_timer(struct comedi_device *dev, { struct apci3501_private *devpriv = dev->private; unsigned int ul_Command1 = 0; - int i_Temp; if (devpriv->b_TimerSelectMode == ADDIDATA_WATCHDOG) { @@ -135,7 +134,7 @@ static int apci3501_write_insn_timer(struct comedi_device *dev, } } - i_Temp = inl(dev->iobase + APCI3501_TIMER_STATUS_REG) & 0x1; + inl(dev->iobase + APCI3501_TIMER_STATUS_REG) & 0x1; return insn->n; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used
On Wednesday, January 28, 2015 2:49 PM, Rickard Strandqvist wrote: > Variable ar assigned a value that is never used. > I have also removed all the code that thereby serves no purpose. > > This was found using a static code analysis program called cppcheck > > Signed-off-by: Rickard Strandqvist > --- > drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c | 12 ++-- > 1 file changed, 2 insertions(+), 10 deletions(-) This file has been deleted. Please base comedi patches on the current linux-next tree. Thanks, Hartley ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH RESEND 1/8] Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors
> -Original Message- > From: K. Y. Srinivasan [mailto:k...@microsoft.com] > Sent: Tuesday, January 27, 2015 3:47 PM > To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; o...@aepfle.de; a...@canonical.com; > vkuzn...@redhat.com; t...@linutronix.de > Cc: KY Srinivasan > Subject: [PATCH RESEND 1/8] Drivers: hv: vmbus: prevent cpu offlining on > newer hypervisors > > From: Vitaly Kuznetsov > > When an SMP Hyper-V guest is running on top of 2012R2 Server and > secondary cpus are sent offline (with echo 0 > > /sys/devices/system/cpu/cpu$cpu/online) > the system freeze is observed. This happens due to the fact that on newer > hypervisors (Win8, WS2012R2, ...) vmbus channel handlers are distributed > across all cpus (see init_vp_index() function in drivers/hv/channel_mgmt.c) > and on cpu offlining nobody reassigns them to CPU0. Prevent cpu offlining > when vmbus is loaded until the issue is fixed host-side. > > This patch also disables hibernation but it is OK as it is also broken (MCE > error > is hit on resume). Suspend still works. > > Tested with WS2008R2 and WS2012R2. > > Signed-off-by: Vitaly Kuznetsov > Signed-off-by: K. Y. Srinivasan Greg, Please drop this entire series; the patch-set was based on the incorrect tree. I will resend the set shortly after rebasing them on your char-misc.git. Thank you, K. Y ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: addi_apci_3501: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/addi_apci_3501.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/addi_apci_3501.c b/drivers/staging/comedi/drivers/addi_apci_3501.c index a726efc..0cdcecc 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3501.c +++ b/drivers/staging/comedi/drivers/addi_apci_3501.c @@ -267,7 +267,6 @@ static irqreturn_t apci3501_interrupt(int irq, void *d) struct apci3501_private *devpriv = dev->private; unsigned int ui_Timer_AOWatchdog; unsigned long ul_Command1; - int i_temp; /* Disable Interrupt */ ul_Command1 = inl(dev->iobase + APCI3501_TIMER_CTRL_REG); @@ -285,7 +284,7 @@ static irqreturn_t apci3501_interrupt(int irq, void *d) ul_Command1 = inl(dev->iobase + APCI3501_TIMER_CTRL_REG); ul_Command1 = ((ul_Command1 & 0xF9FDul) | 1 << 1); outl(ul_Command1, dev->iobase + APCI3501_TIMER_CTRL_REG); - i_temp = inl(dev->iobase + APCI3501_TIMER_STATUS_REG) & 0x1; + inl(dev->iobase + APCI3501_TIMER_STATUS_REG) & 0x1; return IRQ_HANDLED; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: dt2814: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/dt2814.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c index 9805be1..d2e7a4e 100644 --- a/drivers/staging/comedi/drivers/dt2814.c +++ b/drivers/staging/comedi/drivers/dt2814.c @@ -198,21 +198,17 @@ static int dt2814_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static irqreturn_t dt2814_interrupt(int irq, void *d) { - int lo, hi; struct comedi_device *dev = d; struct dt2814_private *devpriv = dev->private; struct comedi_subdevice *s = dev->read_subdev; - int data; if (!dev->attached) { dev_err(dev->class_dev, "spurious interrupt\n"); return IRQ_HANDLED; } - hi = inb(dev->iobase + DT2814_DATA); - lo = inb(dev->iobase + DT2814_DATA); - - data = (hi << 4) | (lo >> 4); + inb(dev->iobase + DT2814_DATA); + inb(dev->iobase + DT2814_DATA); if (!(--devpriv->ntrig)) { int i; @@ -239,7 +235,6 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) struct dt2814_private *devpriv; struct comedi_subdevice *s; int ret; - int i; ret = comedi_request_region(dev, it->options[0], 0x2); if (ret) @@ -251,8 +246,8 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it) dev_err(dev->class_dev, "reset error (fatal)\n"); return -EIO; } - i = inb(dev->iobase + DT2814_DATA); - i = inb(dev->iobase + DT2814_DATA); + inb(dev->iobase + DT2814_DATA); + inb(dev->iobase + DT2814_DATA); if (it->options[1]) { ret = request_irq(it->options[1], dt2814_interrupt, 0, -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: dyna_pci10xx: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/dyna_pci10xx.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/dyna_pci10xx.c b/drivers/staging/comedi/drivers/dyna_pci10xx.c index 1b6324c..8882423 100644 --- a/drivers/staging/comedi/drivers/dyna_pci10xx.c +++ b/drivers/staging/comedi/drivers/dyna_pci10xx.c @@ -115,10 +115,9 @@ static int dyna_pci10xx_insn_write_ao(struct comedi_device *dev, { struct dyna_pci10xx_private *devpriv = dev->private; int n; - unsigned int chan, range; - chan = CR_CHAN(insn->chanspec); - range = range_codes_pci1050_ai[CR_RANGE((insn->chanspec))]; + CR_CHAN(insn->chanspec); + range_codes_pci1050_ai[CR_RANGE((insn->chanspec))]; mutex_lock(&devpriv->mutex); for (n = 0; n < insn->n; n++) { -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: dt2815: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/dt2815.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/dt2815.c b/drivers/staging/comedi/drivers/dt2815.c index a98fb66..c5c0490 100644 --- a/drivers/staging/comedi/drivers/dt2815.c +++ b/drivers/staging/comedi/drivers/dt2815.c @@ -98,12 +98,11 @@ static int dt2815_ao_insn(struct comedi_device *dev, struct comedi_subdevice *s, struct dt2815_private *devpriv = dev->private; int i; int chan = CR_CHAN(insn->chanspec); - unsigned int lo, hi; + unsigned int lo; int ret; for (i = 0; i < insn->n; i++) { lo = ((data[i] & 0x0f) << 4) | (chan << 1) | 0x01; - hi = (data[i] & 0xff0) >> 4; ret = comedi_timeout(dev, s, insn, dt2815_ao_status, 0x00); if (ret) -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: jr3_pci: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/jr3_pci.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/jr3_pci.c b/drivers/staging/comedi/drivers/jr3_pci.c index 81fab2d..5d4cca7 100644 --- a/drivers/staging/comedi/drivers/jr3_pci.c +++ b/drivers/staging/comedi/drivers/jr3_pci.c @@ -520,10 +520,9 @@ static struct jr3_pci_poll_delay jr3_pci_poll_subdevice(struct comedi_subdevice result = poll_delay_min_max(20, 100); } else { /* Set full scale */ - struct six_axis_t min_full_scale; struct six_axis_t max_full_scale; - min_full_scale = get_min_full_scales(channel); + get_min_full_scales(channel); max_full_scale = get_max_full_scales(channel); set_full_scales(channel, max_full_scale); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: comedi: drivers: addi-data: hwdrv_apci1500: Removed variables that is never used
2015-01-28 22:48 GMT+01:00 Hartley Sweeten : > On Wednesday, January 28, 2015 2:49 PM, Rickard Strandqvist wrote: >> Variable ar assigned a value that is never used. >> I have also removed all the code that thereby serves no purpose. >> >> This was found using a static code analysis program called cppcheck >> >> Signed-off-by: Rickard Strandqvist >> --- >> drivers/staging/comedi/drivers/addi-data/hwdrv_apci1500.c | 12 >> ++-- >> 1 file changed, 2 insertions(+), 10 deletions(-) > > This file has been deleted. > > Please base comedi patches on the current linux-next tree. > > Thanks, > Hartley > Hi Sorry, but I have now added a test that do a git apply on linux-next before I send a patch. Kind regards Rickard Strandqvist ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: mite: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/mite.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c index ffc9e61..8d2903b 100644 --- a/drivers/staging/comedi/drivers/mite.c +++ b/drivers/staging/comedi/drivers/mite.c @@ -494,9 +494,8 @@ EXPORT_SYMBOL_GPL(mite_bytes_read_from_memory_ub); unsigned mite_dma_tcr(struct mite_channel *mite_chan) { struct mite_struct *mite = mite_chan->mite; - int lkar; - lkar = readl(mite->mite_io_addr + MITE_LKAR(mite_chan->channel)); + readl(mite->mite_io_addr + MITE_LKAR(mite_chan->channel)); return readl(mite->mite_io_addr + MITE_TCR(mite_chan->channel)); } EXPORT_SYMBOL_GPL(mite_dma_tcr); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: ni_atmio: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/ni_atmio.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_atmio.c b/drivers/staging/comedi/drivers/ni_atmio.c index 0c5ff28..301f154 100644 --- a/drivers/staging/comedi/drivers/ni_atmio.c +++ b/drivers/staging/comedi/drivers/ni_atmio.c @@ -300,7 +300,6 @@ static int ni_atmio_attach(struct comedi_device *dev, struct comedi_devconfig *it) { const struct ni_board_struct *boardtype; - struct ni_private *devpriv; struct pnp_dev *isapnp_dev; int ret; unsigned long iobase; @@ -310,7 +309,6 @@ static int ni_atmio_attach(struct comedi_device *dev, ret = ni_alloc_private(dev); if (ret) return ret; - devpriv = dev->private; iobase = it->options[0]; irq = it->options[1]; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: ni_mio_cs: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/ni_mio_cs.c |3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c index 9b201e4..b152330 100644 --- a/drivers/staging/comedi/drivers/ni_mio_cs.c +++ b/drivers/staging/comedi/drivers/ni_mio_cs.c @@ -163,7 +163,6 @@ static int mio_cs_auto_attach(struct comedi_device *dev, { struct pcmcia_device *link = comedi_to_pcmcia_dev(dev); static const struct ni_board_struct *board; - struct ni_private *devpriv; int ret; board = ni_getboardtype(dev, link); @@ -188,8 +187,6 @@ static int mio_cs_auto_attach(struct comedi_device *dev, if (ret) return ret; - devpriv = dev->private; - return ni_E_init(dev, 0, 1); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: rtd520: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/rtd520.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index 581aa58..305631c 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -1031,8 +1031,6 @@ static int rtd_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) static int rtd_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) { struct rtd_private *devpriv = dev->private; - u32 overrun; - u16 status; /* pacer stop source: SOFTWARE */ writel(0, dev->mmio + LAS0_PACER_STOP); @@ -1040,8 +1038,8 @@ static int rtd_ai_cancel(struct comedi_device *dev, struct comedi_subdevice *s) writel(0, dev->mmio + LAS0_ADC_CONVERSION); writew(0, dev->mmio + LAS0_IT); devpriv->ai_count = 0; /* stop and don't transfer any more */ - status = readw(dev->mmio + LAS0_IT); - overrun = readl(dev->mmio + LAS0_OVERRUN) & 0x; + readw(dev->mmio + LAS0_IT); + readl(dev->mmio + LAS0_OVERRUN) & 0x; writel(0, dev->mmio + LAS0_ADC_FIFO_CLEAR); return 0; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: comedi: drivers: usbduxsigma: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/comedi/drivers/usbduxsigma.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/usbduxsigma.c b/drivers/staging/comedi/drivers/usbduxsigma.c index dc19435..7b80887 100644 --- a/drivers/staging/comedi/drivers/usbduxsigma.c +++ b/drivers/staging/comedi/drivers/usbduxsigma.c @@ -215,7 +215,6 @@ static void usbduxsigma_ai_handle_urb(struct comedi_device *dev, struct usbduxsigma_private *devpriv = dev->private; struct comedi_async *async = s->async; struct comedi_cmd *cmd = &async->cmd; - unsigned int dio_state; uint32_t val; int ret; int i; @@ -225,7 +224,7 @@ static void usbduxsigma_ai_handle_urb(struct comedi_device *dev, devpriv->ai_counter = devpriv->ai_timer; /* get the state of the dio pins to allow external trigger */ - dio_state = be32_to_cpu(devpriv->in_buf[0]); + be32_to_cpu(devpriv->in_buf[0]); /* get the data from the USB bus and hand it over to comedi */ for (i = 0; i < cmd->chanlist_len; i++) { -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: cptm1217: clearpad_tm1217: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/cptm1217/clearpad_tm1217.c | 35 +--- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/drivers/staging/cptm1217/clearpad_tm1217.c b/drivers/staging/cptm1217/clearpad_tm1217.c index 7f265ce..444d86b 100644 --- a/drivers/staging/cptm1217/clearpad_tm1217.c +++ b/drivers/staging/cptm1217/clearpad_tm1217.c @@ -320,45 +320,44 @@ exit_thread: static int cp_tm1217_init_data(struct cp_tm1217_device *ts) { - int retval; u8 req[2]; /* Read the vendor id/ fw revision etc. Ignoring return check as this is non critical info */ req[0] = TMA1217_MANUFACTURER_ID; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->vinfo.vendor_id = req[1]; req[0] = TMA1217_PRODUCT_FAMILY; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->vinfo.product_family = req[1]; req[0] = TMA1217_FIRMWARE_REVISION; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->vinfo.firmware_rev = req[1]; req[0] = TMA1217_SERIAL_NO_HIGH; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->vinfo.serial_no = (req[1] << 8); req[0] = TMA1217_SERIAL_NO_LOW; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->vinfo.serial_no = ts->vinfo.serial_no | req[1]; req[0] = TMA1217_MAX_X_HIGHER4; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->dinfo.maxX = (req[1] & 0xF) << 8; req[0] = TMA1217_MAX_X_LOWER8; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->dinfo.maxX = ts->dinfo.maxX | req[1]; req[0] = TMA1217_MAX_Y_HIGHER4; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->dinfo.maxY = (req[1] & 0xF) << 8; req[0] = TMA1217_MAX_Y_LOWER8; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); ts->dinfo.maxY = ts->dinfo.maxY | req[1]; return 0; @@ -563,13 +562,12 @@ static int cp_tm1217_suspend(struct device *dev) struct i2c_client *client = to_i2c_client(dev); struct cp_tm1217_device *ts = i2c_get_clientdata(client); u8 req[2]; - int retval; /* Put the controller to sleep */ req[0] = TMA1217_DEVICE_CTRL; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); req[1] = (req[1] & 0xF8) | 0x1; - retval = cp_tm1217_write(ts, req, 1); + cp_tm1217_write(ts, req, 1); if (device_may_wakeup(&client->dev)) enable_irq_wake(client->irq); @@ -586,13 +584,12 @@ static int cp_tm1217_resume(struct device *dev) struct i2c_client *client = to_i2c_client(dev); struct cp_tm1217_device *ts = i2c_get_clientdata(client); u8 req[2]; - int retval; /* Take the controller out of sleep */ req[0] = TMA1217_DEVICE_CTRL; - retval = cp_tm1217_read(ts, req, 1); + cp_tm1217_read(ts, req, 1); req[1] = (req[1] & 0xF8) | 0x4; - retval = cp_tm1217_write(ts, req, 1); + cp_tm1217_write(ts, req, 1); /* Restore the register settings sinc the power to the could have been cut off */ @@ -601,15 +598,15 @@ static int cp_tm1217_resume(struct device *dev) finger arrives or departs. */ req[0] = TMA1217_REPORT_MODE; req[1] = 0x02; - retval = cp_tm1217_write(ts, req, 1); + cp_tm1217_write(ts, req, 1); /* Setup the device to no sleep mode for now and make it configured */ req[0] = TMA1217_DEVICE_CTRL; req[1] = 0x84; - retval = cp_tm1217_write(ts, req, 1); + cp_tm1217_write(ts, req, 1); /* Setup the interrupt mask */ - retval = cp_tm1217_unmask_interrupt(ts); + cp_tm1217_unmask_interrupt(ts); if (device_may_wakeup(&client->dev)) disable_irq_wake(client->irq); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: drivers: mite: Removed variables that is never used
On Wed, 28 Jan 2015, Rickard Strandqvist wrote: > Variable ar assigned a value that is never used. The variable is lkar. julia > I have also removed all the code that thereby serves no purpose. > > This was found using a static code analysis program called cppcheck > > Signed-off-by: Rickard Strandqvist > --- > drivers/staging/comedi/drivers/mite.c |3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/staging/comedi/drivers/mite.c > b/drivers/staging/comedi/drivers/mite.c > index ffc9e61..8d2903b 100644 > --- a/drivers/staging/comedi/drivers/mite.c > +++ b/drivers/staging/comedi/drivers/mite.c > @@ -494,9 +494,8 @@ EXPORT_SYMBOL_GPL(mite_bytes_read_from_memory_ub); > unsigned mite_dma_tcr(struct mite_channel *mite_chan) > { > struct mite_struct *mite = mite_chan->mite; > - int lkar; > > - lkar = readl(mite->mite_io_addr + MITE_LKAR(mite_chan->channel)); > + readl(mite->mite_io_addr + MITE_LKAR(mite_chan->channel)); > return readl(mite->mite_io_addr + MITE_TCR(mite_chan->channel)); > } > EXPORT_SYMBOL_GPL(mite_dma_tcr); > -- > 1.7.10.4 > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgap: dgap: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/dgap/dgap.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c index bdb5317..f8a8c0a 100644 --- a/drivers/staging/dgap/dgap.c +++ b/drivers/staging/dgap/dgap.c @@ -3715,7 +3715,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, } else { dgap_wmove(ch, ch->ch_digi.digi_offstr, (int) ch->ch_digi.digi_offlen); - head = readw(&(bs->tx_head)) & tmask; + readw(&(bs->tx_head)) & tmask; ch->ch_flags &= ~CH_PRON; } } @@ -4586,7 +4586,6 @@ static int dgap_tty_open(struct tty_struct *tty, struct file *file) */ static void dgap_tty_close(struct tty_struct *tty, struct file *file) { - struct ktermios *ts; struct board_t *bd; struct channel_t *ch; struct un_t *un; @@ -4607,8 +4606,6 @@ static void dgap_tty_close(struct tty_struct *tty, struct file *file) if (!bd || bd->magic != DGAP_BOARD_MAGIC) return; - ts = &tty->termios; - spin_lock_irqsave(&ch->ch_lock, lock_flags); /* -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: dgnc_cls: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/dgnc/dgnc_cls.c |4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_cls.c b/drivers/staging/dgnc/dgnc_cls.c index bedc522..5fec747 100644 --- a/drivers/staging/dgnc/dgnc_cls.c +++ b/drivers/staging/dgnc/dgnc_cls.c @@ -893,10 +893,8 @@ static void cls_copy_data_from_uart_to_queue(struct channel_t *ch) * Discard character if we are ignoring the error mask. */ if (linestatus & error_mask) { - unsigned char discard; - linestatus = 0; - discard = readb(&ch->ch_cls_uart->txrx); + readb(&ch->ch_cls_uart->txrx); continue; } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: dgnc: dgnc_tty: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/dgnc/dgnc_tty.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index f81a375..bca2c07 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -1386,12 +1386,10 @@ static void dgnc_tty_hangup(struct tty_struct *tty) */ static void dgnc_tty_close(struct tty_struct *tty, struct file *file) { - struct ktermios *ts; struct dgnc_board *bd; struct channel_t *ch; struct un_t *un; unsigned long flags; - int rc = 0; if (!tty || tty->magic != TTY_MAGIC) return; @@ -1408,8 +1406,6 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file) if (!bd || bd->magic != DGNC_BOARD_MAGIC) return; - ts = &tty->termios; - spin_lock_irqsave(&ch->ch_lock, flags); /* @@ -1471,7 +1467,7 @@ static void dgnc_tty_close(struct tty_struct *tty, struct file *file) /* wait for output to drain */ /* This will also return if we take an interrupt */ - rc = bd->bd_ops->drain(tty, 0); + bd->bd_ops->drain(tty, 0); dgnc_tty_flush_buffer(tty); tty_ldisc_flush(tty); @@ -2059,7 +2055,6 @@ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout) struct dgnc_board *bd; struct channel_t *ch; struct un_t *un; - int rc; if (!tty || tty->magic != TTY_MAGIC) return; @@ -2076,7 +2071,7 @@ static void dgnc_tty_wait_until_sent(struct tty_struct *tty, int timeout) if (!bd || bd->magic != DGNC_BOARD_MAGIC) return; - rc = bd->bd_ops->drain(tty, 0); + bd->bd_ops->drain(tty, 0); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: emxx_udc: emxx_udc: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/emxx_udc/emxx_udc.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/emxx_udc/emxx_udc.c b/drivers/staging/emxx_udc/emxx_udc.c index eb178fc..b916fab 100644 --- a/drivers/staging/emxx_udc/emxx_udc.c +++ b/drivers/staging/emxx_udc/emxx_udc.c @@ -2974,10 +2974,10 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep) spin_lock_irqsave(&udc->lock, flags); if (ep->epnum == 0) { - data = _nbu2ss_readl(&preg->EP0_LENGTH) & EP0_LDATA; + _nbu2ss_readl(&preg->EP0_LENGTH) & EP0_LDATA; } else { - data = _nbu2ss_readl(&preg->EP_REGS[ep->epnum-1].EP_LEN_DCNT) + _nbu2ss_readl(&preg->EP_REGS[ep->epnum-1].EP_LEN_DCNT) & EPn_LDATA; } @@ -3264,12 +3264,11 @@ static void __init nbu2ss_drv_set_ep_info( if (isdigit(name[2])) { longnum; - int res; chartempbuf[2]; tempbuf[0] = name[2]; tempbuf[1] = '\0'; - res = kstrtol(tempbuf, 16, &num); + kstrtol(tempbuf, 16, &num); if (num == 0) ep->ep.maxpacket = EP0_PACKETSIZE; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: ft1000: ft1000-pcmcia: ft1000_hw: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c |9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c index d5475b7..3c42737 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c @@ -1230,7 +1230,6 @@ static int ft1000_parse_dpram_msg(struct net_device *dev) struct ft1000_info *info = netdev_priv(dev); u16 doorbell; u16 portid; - u16 nxtph; u16 total_len; int i = 0; unsigned long flags; @@ -1282,7 +1281,6 @@ static int ft1000_parse_dpram_msg(struct net_device *dev) if (doorbell & FT1000_DB_DPRAM_RX) { pr_debug("Got a slow queue message\n"); - nxtph = FT1000_DPRAM_RX_BASE + 2; if (info->AsicID == ELECTRABUZZ_ID) { total_len = ft1000_read_dpram(dev, FT1000_DPRAM_RX_BASE); @@ -1294,7 +1292,6 @@ static int ft1000_parse_dpram_msg(struct net_device *dev) } pr_debug("total length = %d\n", total_len); if ((total_len < MAX_CMD_SQSIZE) && (total_len > sizeof(struct pseudo_hdr))) { - total_len += nxtph; /* * ft1000_read_reg will return a value that needs to be byteswap * in order to get DSP_QID_OFFSET. @@ -1382,7 +1379,6 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) struct ft1000_info *info = netdev_priv(dev); struct ft1000_pcmcia *pcmcia = info->priv; u16 i; - u32 templong; u16 tempword; if (pcmcia->PktIntfErr > MAX_PH_ERR) { @@ -1422,8 +1418,7 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) tempword = ft1000_read_reg(dev, FT1000_REG_DFIFO_STAT); } else { - templong = - inl(dev->base_addr + FT1000_REG_MAG_DFR); + inl(dev->base_addr + FT1000_REG_MAG_DFR); tempword = inw(dev->base_addr + FT1000_REG_MAG_DFSR); } @@ -1502,7 +1497,7 @@ static void ft1000_flush_fifo(struct net_device *dev, u16 DrvErrNum) } else { pr_debug("Flushing FIFO complete = %x\n", tempword); /* Flush last word in FIFO */ - templong = inl(dev->base_addr + FT1000_REG_MAG_DFR); + inl(dev->base_addr + FT1000_REG_MAG_DFR); tempword = inw(dev->base_addr + FT1000_REG_SUP_STAT); pr_debug("FT1000_REG_SUP_STAT = 0x%x\n", tempword); tempword = inw(dev->base_addr + FT1000_REG_MAG_DFSR); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: ft1000: ft1000-usb: ft1000_debug: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c index c8d2782..c43bfdf 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c @@ -297,14 +297,13 @@ void ft1000_destroy_dev(struct net_device *netdev) */ static int ft1000_open(struct inode *inode, struct file *file) { - struct ft1000_info *info; struct ft1000_usb *dev = (struct ft1000_usb *)inode->i_private; int i, num; num = (MINOR(inode->i_rdev) & 0xf); pr_debug("minor number=%d\n", num); - info = file->private_data = netdev_priv(dev->net); + file->private_data = netdev_priv(dev->net); pr_debug("f_owner = %p number of application = %d\n", &file->f_owner, dev->appcnt); @@ -531,7 +530,6 @@ static long ft1000_ioctl(struct file *file, unsigned int command, u16 *pmsg; u16 total_len; u16 app_index; - u16 status; /* pr_debug("IOCTL_FT1000_SET_DPRAM called\n");*/ @@ -594,22 +592,22 @@ static long ft1000_ioctl(struct file *file, unsigned int command, } else { /* Put message into Slow Queue */ /* Only put a message into the DPRAM if msg doorbell is available */ - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); /* pr_debug("READ REGISTER tempword=%x\n", tempword); */ if (tempword & FT1000_DB_DPRAM_TX) { /* Suspend for 2ms and try again due to DSP doorbell busy */ mdelay(2); - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { /* Suspend for 1ms and try again due to DSP doorbell busy */ mdelay(1); - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { /* Suspend for 3ms and try again due to DSP doorbell busy */ mdelay(3); - status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL); if (tempword & FT1000_DB_DPRAM_TX) { pr_debug("Doorbell not available\n"); result = -ENOTTY; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: ft1000: ft1000-usb: ft1000_download: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- .../staging/ft1000/ft1000-usb/ft1000_download.c| 45 +--- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c index e8126325..06b21d9 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_download.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_download.c @@ -113,21 +113,20 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) { int loopcnt; u16 temp; - int status; loopcnt = 0; while (loopcnt < 10) { - status = ft1000_read_register(ft1000dev, &temp, + ft1000_read_register(ft1000dev, &temp, FT1000_REG_DOORBELL); pr_debug("read FT1000_REG_DOORBELL value is %x\n", temp); if (temp & 0x0080) { pr_debug("Got checkusb doorbell\n"); - status = ft1000_write_register(ft1000dev, 0x0080, + ft1000_write_register(ft1000dev, 0x0080, FT1000_REG_DOORBELL); - status = ft1000_write_register(ft1000dev, 0x0100, + ft1000_write_register(ft1000dev, 0x0100, FT1000_REG_DOORBELL); - status = ft1000_write_register(ft1000dev, 0x8000, + ft1000_write_register(ft1000dev, 0x8000, FT1000_REG_DOORBELL); break; } @@ -138,7 +137,7 @@ static int check_usb_db(struct ft1000_usb *ft1000dev) loopcnt = 0; while (loopcnt < 20) { - status = ft1000_read_register(ft1000dev, &temp, + ft1000_read_register(ft1000dev, &temp, FT1000_REG_DOORBELL); pr_debug("Doorbell = 0x%x\n", temp); if (temp & 0x8000) { @@ -202,18 +201,17 @@ static void put_handshake(struct ft1000_usb *ft1000dev, u16 handshake_value) { u32 tempx; u16 tempword; - int status; tempx = (u32)handshake_value; tempx = ntohl(tempx); tempword = (u16)(tempx & 0x); - status = ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, + ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, tempword, 0); tempword = (u16)(tempx >> 16); - status = ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, + ft1000_write_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, tempword, 1); - status = ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, + ft1000_write_register(ft1000dev, FT1000_DB_DNLD_TX, FT1000_REG_DOORBELL); } @@ -222,20 +220,19 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value) u16 handshake; int loopcnt; u16 temp; - int status = 0; loopcnt = 0; handshake = 0; while (loopcnt < 100) { if (ft1000dev->usbboot == 2) { - status = ft1000_read_dpram32(ft1000dev, 0, + ft1000_read_dpram32(ft1000dev, 0, (u8 *)&(ft1000dev->tempbuf[0]), 64); for (temp = 0; temp < 16; temp++) { pr_debug("tempbuf %d = 0x%x\n", temp, ft1000dev->tempbuf[temp]); } - status = ft1000_read_dpram16(ft1000dev, + ft1000_read_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1); pr_debug("handshake from read_dpram16 = 0x%x\n", @@ -248,7 +245,7 @@ static u16 get_handshake_usb(struct ft1000_usb *ft1000dev, u16 expected_value) ft1000dev->tempbuf[6]; } } else { - status = ft1000_read_dpram16(ft1000dev, + ft1000_read_dpram16(ft1000dev, DWNLD_MAG1_HANDSHAKE_LOC, (u8 *)&handshake, 1); } @@ -275,17 +272,16 @@ static void put_handshake_usb(struct ft1000_usb *ft1000dev, u16 handshake_value) static u16 get_request_type(struct ft1000_usb *ft1000dev) { u16 request_type; - int status;
[PATCH] staging: ft1000: ft1000-usb: ft1000_hw: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 84 +++-- 1 file changed, 37 insertions(+), 47 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index d12cfc9..fa76b56 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -284,36 +284,35 @@ int fix_ft1000_write_dpram32(struct ft1000_usb *ft1000dev, u16 indx, u8 *buffer) /* reset or activate the DSP */ static void card_reset_dsp(struct ft1000_usb *ft1000dev, bool value) { - int status = 0; u16 tempword; - status = ft1000_write_register(ft1000dev, HOST_INTF_BE, + ft1000_write_register(ft1000dev, HOST_INTF_BE, FT1000_REG_SUP_CTRL); - status = ft1000_read_register(ft1000dev, &tempword, + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_SUP_CTRL); if (value) { pr_debug("Reset DSP\n"); - status = ft1000_read_register(ft1000dev, &tempword, + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_RESET); tempword |= DSP_RESET_BIT; - status = ft1000_write_register(ft1000dev, tempword, + ft1000_write_register(ft1000dev, tempword, FT1000_REG_RESET); } else { pr_debug("Activate DSP\n"); - status = ft1000_read_register(ft1000dev, &tempword, + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_RESET); tempword |= DSP_ENCRYPTED; tempword &= ~DSP_UNENCRYPTED; - status = ft1000_write_register(ft1000dev, tempword, + ft1000_write_register(ft1000dev, tempword, FT1000_REG_RESET); - status = ft1000_read_register(ft1000dev, &tempword, + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_RESET); tempword &= ~EFUSE_MEM_DISABLE; tempword &= ~DSP_RESET_BIT; - status = ft1000_write_register(ft1000dev, tempword, + ft1000_write_register(ft1000dev, tempword, FT1000_REG_RESET); - status = ft1000_read_register(ft1000dev, &tempword, + ft1000_read_register(ft1000dev, &tempword, FT1000_REG_RESET); } } @@ -937,7 +936,6 @@ int ft1000_close(struct net_device *net) static int ft1000_chkcard(struct ft1000_usb *dev) { u16 tempword; - int status; if (dev->fCondResetPend) { pr_debug("Card is being reset, return FALSE\n"); @@ -946,7 +944,7 @@ static int ft1000_chkcard(struct ft1000_usb *dev) /* Mask register is used to check for device presence since it is never * set to zero. */ - status = ft1000_read_register(dev, &tempword, FT1000_REG_SUP_IMASK); + ft1000_read_register(dev, &tempword, FT1000_REG_SUP_IMASK); if (tempword == 0) { pr_debug("IMASK = 0 Card not detected\n"); return FALSE; @@ -954,7 +952,7 @@ static int ft1000_chkcard(struct ft1000_usb *dev) /* The system will return the value of 0x for the version register * if the device is not present. */ - status = ft1000_read_register(dev, &tempword, FT1000_REG_ASIC_ID); + ft1000_read_register(dev, &tempword, FT1000_REG_ASIC_ID); if (tempword != 0x1b01) { dev->status |= FT1000_STATUS_CLOSING; pr_debug("Version = 0x Card not detected\n"); @@ -972,13 +970,11 @@ static bool ft1000_receive_cmd(struct ft1000_usb *dev, u16 *pbuffer, int maxsz) { u16 size; - int ret; u16 *ppseudohdr; int i; u16 tempword; - ret = - ft1000_read_dpram16(dev, FT1000_MAG_PH_LEN, (u8 *)&size, + ft1000_read_dpram16(dev, FT1000_MAG_PH_LEN, (u8 *)&size, FT1000_MAG_PH_LEN_INDX); size = ntohs(size) + PSEUDOSZ; if (size > maxsz) { @@ -988,34 +984,28 @@ static bool ft1000_receive_cmd(struct ft1000_usb *dev, u16 *pbuffer, ppseudohdr = (u16 *)pbuffer; ft1000_write_register(dev, FT1000_DPRAM_MAG_RX_BASE, FT1000_REG_DPRAM_ADDR); - ret = - ft1000_read_register(dev, pbuffer, FT1000_REG_MAG_DPDATAH); + ft1000_read_register
[PATCH] staging: gdm724x: gdm_usb: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/gdm724x/gdm_usb.c |4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c index d2a3b35..28fa01e 100644 --- a/drivers/staging/gdm724x/gdm_usb.c +++ b/drivers/staging/gdm724x/gdm_usb.c @@ -891,14 +891,10 @@ static void gdm_usb_disconnect(struct usb_interface *intf) { struct phy_dev *phy_dev; struct lte_udev *udev; - u16 idVendor, idProduct; struct usb_device *usbdev; usbdev = interface_to_usbdev(intf); - idVendor = __le16_to_cpu(usbdev->descriptor.idVendor); - idProduct = __le16_to_cpu(usbdev->descriptor.idProduct); - phy_dev = usb_get_intfdata(intf); udev = phy_dev->priv_dev; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: fid: lproc_fid: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/lustre/lustre/fid/lproc_fid.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c index 6a21f07..feb7425 100644 --- a/drivers/staging/lustre/lustre/fid/lproc_fid.c +++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c @@ -63,7 +63,6 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count, struct lu_seq_range *range) { struct lu_seq_range tmp; - int rc; char kernbuf[MAX_FID_RANGE_STRLEN]; LASSERT(range != NULL); @@ -82,7 +81,7 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count, } /* of the form "[0x00024400 - 0x00028000400]" */ - rc = sscanf(kernbuf, "[%llx - %llx]\n", + sscanf(kernbuf, "[%llx - %llx]\n", (unsigned long long *)&tmp.lsr_start, (unsigned long long *)&tmp.lsr_end); if (!range_is_sane(&tmp) || range_is_zero(&tmp) || -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: xgifb: XGI_main_26: Change variables that is never used
Hi, On Wed, Jan 28, 2015 at 10:38:07PM +0100, Rickard Strandqvist wrote: > Variable ar assigned a value that is never used. > Instead use the struct variable of the same name. > > This was found using a static code analysis program called cppcheck > > Signed-off-by: Rickard Strandqvist > --- > drivers/staging/xgifb/XGI_main_26.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/xgifb/XGI_main_26.c > b/drivers/staging/xgifb/XGI_main_26.c > index 709d49e..ecfdf34 100644 > --- a/drivers/staging/xgifb/XGI_main_26.c > +++ b/drivers/staging/xgifb/XGI_main_26.c > @@ -1233,7 +1233,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo > *var, struct fb_info *info) > unsigned int vtotal = 0; > unsigned int drate = 0, hrate = 0; > int found_mode = 0; > - int refresh_rate, search_idx; > + int search_idx; > > if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) { > vtotal = var->upper_margin + var->yres + var->lower_margin > @@ -1271,7 +1271,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo > *var, struct fb_info *info) > > /* Calculation wrong for 1024x600 - force it to 60Hz */ > if ((var->xres == 1024) && (var->yres == 600)) > - refresh_rate = 60; > + xgifb_info->refresh_rate = 60; You are changing behaviour here. Did you test it, is it fixing something? Otherwise you could just delete the whole if block... A. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: media: vino: vino: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/media/vino/vino.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/media/vino/vino.c b/drivers/staging/media/vino/vino.c index 2c85357..f43c1ea 100644 --- a/drivers/staging/media/vino/vino.c +++ b/drivers/staging/media/vino/vino.c @@ -2375,7 +2375,6 @@ static irqreturn_t vino_interrupt(int irq, void *dev_id) next_4_desc = vino->a.next_4_desc; unsigned int line_count_2, page_index_2, - field_counter_2, start_desc_tbl_2, next_4_desc_2; #endif @@ -2421,7 +2420,6 @@ static irqreturn_t vino_interrupt(int irq, void *dev_id) #ifdef VINO_DEBUG_INT line_count_2 = vino->a.line_count; page_index_2 = vino->a.page_index; - field_counter_2 = vino->a.field_counter; start_desc_tbl_2 = vino->a.start_desc_tbl; next_4_desc_2 = vino->a.next_4_desc; -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: include: lustre_lib.h: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/lustre/lustre/include/lustre_lib.h |5 - 1 file changed, 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h b/drivers/staging/lustre/lustre/include/lustre_lib.h index bf13563..b80ae84 100644 --- a/drivers/staging/lustre/lustre/include/lustre_lib.h +++ b/drivers/staging/lustre/lustre/include/lustre_lib.h @@ -549,11 +549,6 @@ do { \ __blocked = cfs_block_sigsinv(0); \ \ for (;;) { \ - unsigned __wstate; \ - \ - __wstate = info->lwi_on_signal != NULL && \ - (__timeout == 0 || __allow_intr) ? \ - TASK_INTERRUPTIBLE : TASK_UNINTERRUPTIBLE; \ \ set_current_state(TASK_INTERRUPTIBLE); \ \ -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: netlogic: xlr_net: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/netlogic/xlr_net.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index 5ecb3e6..0d9308a 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -814,9 +814,8 @@ static void xlr_gmac_link_adjust(struct net_device *ndev) { struct xlr_net_priv *priv = netdev_priv(ndev); struct phy_device *phydev = priv->mii_bus->phy_map[priv->phy_addr]; - u32 intreg; - intreg = xlr_nae_rdreg(priv->base_addr, R_INTREG); + xlr_nae_rdreg(priv->base_addr, R_INTREG); if (phydev->link) { if (phydev->speed != priv->phy_speed) { xlr_set_gmac_speed(priv); -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: core: rtw_efuse: Removed variables that is never used
Variable ar assigned a value that is never used. I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/rtl8188eu/core/rtw_efuse.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_efuse.c b/drivers/staging/rtl8188eu/core/rtw_efuse.c index 8816d11..5a21e4a 100644 --- a/drivers/staging/rtl8188eu/core/rtw_efuse.c +++ b/drivers/staging/rtl8188eu/core/rtw_efuse.c @@ -224,7 +224,7 @@ static void efuse_read_phymap_from_txpktbuf( ) { u16 dbg_addr = 0; - u32 start = 0, passing_time = 0; + u32 start = 0; u8 reg_0x143 = 0; u32 lo32 = 0, hi32 = 0; u16 len = 0, count = 0; @@ -248,7 +248,7 @@ static void efuse_read_phymap_from_txpktbuf( usb_write8(adapter, REG_TXPKTBUF_DBG, 0); start = jiffies; while (!(reg_0x143 = usb_read8(adapter, REG_TXPKTBUF_DBG)) && - (passing_time = rtw_get_passing_time_ms(start)) < 1000) { + rtw_get_passing_time_ms(start) < 1000) { DBG_88E("%s polling reg_0x143:0x%02x, reg_0x106:0x%02x\n", __func__, reg_0x143, usb_read8(adapter, 0x106)); usleep_range(1000, 2000); } -- 1.7.10.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: xgifb: XGI_main_26: Change variables that is never used
2015-01-28 23:43 GMT+01:00 Aaro Koskinen : > Hi, > > On Wed, Jan 28, 2015 at 10:38:07PM +0100, Rickard Strandqvist wrote: >> Variable ar assigned a value that is never used. >> Instead use the struct variable of the same name. >> >> This was found using a static code analysis program called cppcheck >> >> Signed-off-by: Rickard Strandqvist >> --- >> drivers/staging/xgifb/XGI_main_26.c |4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/staging/xgifb/XGI_main_26.c >> b/drivers/staging/xgifb/XGI_main_26.c >> index 709d49e..ecfdf34 100644 >> --- a/drivers/staging/xgifb/XGI_main_26.c >> +++ b/drivers/staging/xgifb/XGI_main_26.c >> @@ -1233,7 +1233,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo >> *var, struct fb_info *info) >> unsigned int vtotal = 0; >> unsigned int drate = 0, hrate = 0; >> int found_mode = 0; >> - int refresh_rate, search_idx; >> + int search_idx; >> >> if ((var->vmode & FB_VMODE_MASK) == FB_VMODE_NONINTERLACED) { >> vtotal = var->upper_margin + var->yres + var->lower_margin >> @@ -1271,7 +1271,7 @@ static int XGIfb_check_var(struct fb_var_screeninfo >> *var, struct fb_info *info) >> >> /* Calculation wrong for 1024x600 - force it to 60Hz */ >> if ((var->xres == 1024) && (var->yres == 600)) >> - refresh_rate = 60; >> + xgifb_info->refresh_rate = 60; > > You are changing behaviour here. Did you test it, is it fixing something? > Otherwise you could just delete the whole if block... > > A. Hi Yes, thats why there is another commit message. But no, but when I check the code so it looked very much like a code miss. And that you wanted to put refresh_rate = 60, which looks to be a default value. Kind regards Rickard Strandqvist ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [HPDD-discuss] [PATCH] staging: lustre: fid: lproc_fid: Removed variables that is never used
On 01/28/2015 04:46 PM, Rickard Strandqvist wrote: Variable ar assigned a value that is never used. s/ar/rc/ I have also removed all the code that thereby serves no purpose. This was found using a static code analysis program called cppcheck Signed-off-by: Rickard Strandqvist --- drivers/staging/lustre/lustre/fid/lproc_fid.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c index 6a21f07..feb7425 100644 --- a/drivers/staging/lustre/lustre/fid/lproc_fid.c +++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c @@ -63,7 +63,6 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count, struct lu_seq_range *range) { struct lu_seq_range tmp; - int rc; char kernbuf[MAX_FID_RANGE_STRLEN]; LASSERT(range != NULL); @@ -82,7 +81,7 @@ static int lprocfs_fid_write_common(const char __user *buffer, size_t count, } /* of the form "[0x00024400 - 0x00028000400]" */ - rc = sscanf(kernbuf, "[%llx - %llx]\n", + sscanf(kernbuf, "[%llx - %llx]\n", I would test rc instead: if (rc != 2) return -EINVAL; Regards, Frank. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 0/8] Drivers: hv: vmbus: Enable unloading of vmbus driver
Windows hosts starting with Ws2012 R2 permit re-establishing the vmbus connection from the guest. This patch-set includes patches from Vitaly to cleanup the VMBUS unload path so we can potentially reload the driver. This set also includes a patch from Jake to correctly extract MMIO information on both Gen1 and Gen 2 firmware. Jake Oshins (1): drivers:hv:vmbus drivers:hv:vmbus Allow for more than one MMIO range for children Vitaly Kuznetsov (7): Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors Drivers: hv: vmbus: rename channel work queues Drivers: hv: vmbus: avoid double kfree for device_obj Drivers: hv: vmbus: teardown hv_vmbus_con workqueue and vmbus_connection pages on shutdown drivers: hv: vmbus: Teardown synthetic interrupt controllers on module unload clockevents: export clockevents_unbind_device instead of clockevents_unbind Drivers: hv: vmbus: Teardown clockevent devices on module unload drivers/hv/channel_mgmt.c |6 +- drivers/hv/connection.c | 17 +++-- drivers/hv/hv.c | 34 - drivers/hv/hyperv_vmbus.h |3 + drivers/hv/vmbus_drv.c | 150 ++- drivers/video/fbdev/hyperv_fb.c |2 +- include/linux/hyperv.h |5 +- kernel/time/clockevents.c |2 +- 8 files changed, 188 insertions(+), 31 deletions(-) -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 6/8] drivers: hv: vmbus: Teardown synthetic interrupt controllers on module unload
From: Vitaly Kuznetsov <[mailto:vkuzn...@redhat.com]> SynIC has to be switched off when we unload the module, otherwise registered memory pages can get corrupted after (as Hyper-V host still writes there) and we see the following crashes for random processes: [ 89.116774] BUG: Bad page map in process sh pte:4989c716 pmd:36f81067 [ 89.159454] addr:00437000 vm_flags:0875 anon_vma: (null) mapping:88007bba55a0 index:37 [ 89.226146] vma->vm_ops->fault: filemap_fault+0x0/0x410 [ 89.257776] vma->vm_file->f_op->mmap: generic_file_mmap+0x0/0x60 [ 89.297570] CPU: 0 PID: 215 Comm: sh Tainted: GB 3.19.0-rc5_bug923184+ #488 [ 89.353738] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012 [ 89.409138] 4e083d7b 880036e9fa18 81a68d31 [ 89.468724] 00437000 880036e9fa68 811a1e3a [ 89.519233] 4989c716 0037 ea0001edc340 00437000 [ 89.575751] Call Trace: [ 89.591060] [] dump_stack+0x45/0x57 [ 89.625164] [] print_bad_pte+0x1aa/0x250 [ 89.667234] [] vm_normal_page+0x55/0xa0 [ 89.703818] [] unmap_page_range+0x425/0x8a0 [ 89.737982] [] unmap_single_vma+0x81/0xf0 [ 89.780385] [] ? lru_deactivate_fn+0x190/0x190 [ 89.820130] [] unmap_vmas+0x51/0xa0 [ 89.860168] [] exit_mmap+0xac/0x1a0 [ 89.890588] [] mmput+0x63/0x100 [ 89.919205] [] flush_old_exec+0x3f8/0x8b0 [ 89.962135] [] load_elf_binary+0x32b/0x1260 [ 89.998581] [] ? get_user_pages+0x52/0x60 hv_synic_cleanup() function exists but noone calls it now. Do the following: - call hv_synic_cleanup() on each cpu from vmbus_exit(); - write global disable bit through MSR; - use hv_synic_free_cpu() to avoid memory leask and code duplication. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c|9 +++-- drivers/hv/vmbus_drv.c |4 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 50e51a5..39531dc 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -477,6 +477,7 @@ void hv_synic_cleanup(void *arg) union hv_synic_sint shared_sint; union hv_synic_simp simp; union hv_synic_siefp siefp; + union hv_synic_scontrol sctrl; int cpu = smp_processor_id(); if (!hv_context.synic_initialized) @@ -502,6 +503,10 @@ void hv_synic_cleanup(void *arg) wrmsrl(HV_X64_MSR_SIEFP, siefp.as_uint64); - free_page((unsigned long)hv_context.synic_message_page[cpu]); - free_page((unsigned long)hv_context.synic_event_page[cpu]); + /* Disable the global synic bit */ + rdmsrl(HV_X64_MSR_SCONTROL, sctrl.as_uint64); + sctrl.enable = 0; + wrmsrl(HV_X64_MSR_SCONTROL, sctrl.as_uint64); + + hv_synic_free_cpu(cpu); } diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index f824c08..28d19e8 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1099,11 +1099,15 @@ cleanup: static void __exit vmbus_exit(void) { + int cpu; + vmbus_connection.conn_state = DISCONNECTED; hv_remove_vmbus_irq(); vmbus_free_channels(); bus_unregister(&hv_bus); hv_cleanup(); + for_each_online_cpu(cpu) + smp_call_function_single(cpu, hv_synic_cleanup, NULL, 1); acpi_bus_unregister_driver(&vmbus_acpi_driver); hv_cpu_hotplug_quirk(false); vmbus_disconnect(); -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 1/8] Drivers: hv: vmbus: prevent cpu offlining on newer hypervisors
From: Vitaly Kuznetsov When an SMP Hyper-V guest is running on top of 2012R2 Server and secondary cpus are sent offline (with echo 0 > /sys/devices/system/cpu/cpu$cpu/online) the system freeze is observed. This happens due to the fact that on newer hypervisors (Win8, WS2012R2, ...) vmbus channel handlers are distributed across all cpus (see init_vp_index() function in drivers/hv/channel_mgmt.c) and on cpu offlining nobody reassigns them to CPU0. Prevent cpu offlining when vmbus is loaded until the issue is fixed host-side. This patch also disables hibernation but it is OK as it is also broken (MCE error is hit on resume). Suspend still works. Tested with WS2008R2 and WS2012R2. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/vmbus_drv.c | 36 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 35e3f42..90c3400 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -704,6 +705,39 @@ static void vmbus_isr(void) } } +#ifdef CONFIG_HOTPLUG_CPU +static int hyperv_cpu_disable(void) +{ + return -ENOSYS; +} + +static void hv_cpu_hotplug_quirk(bool vmbus_loaded) +{ + static void *previous_cpu_disable; + + /* +* Offlining a CPU when running on newer hypervisors (WS2012R2, Win8, +* ...) is not supported at this moment as channel interrupts are +* distributed across all of them. +*/ + + if ((vmbus_proto_version == VERSION_WS2008) || + (vmbus_proto_version == VERSION_WIN7)) + return; + + if (vmbus_loaded) { + previous_cpu_disable = smp_ops.cpu_disable; + smp_ops.cpu_disable = hyperv_cpu_disable; + pr_notice("CPU offlining is not supported by hypervisor\n"); + } else if (previous_cpu_disable) + smp_ops.cpu_disable = previous_cpu_disable; +} +#else +static void hv_cpu_hotplug_quirk(bool vmbus_loaded) +{ +} +#endif + /* * vmbus_bus_init -Main vmbus driver initialization routine. * @@ -744,6 +778,7 @@ static int vmbus_bus_init(int irq) if (ret) goto err_alloc; + hv_cpu_hotplug_quirk(true); vmbus_request_offers(); return 0; @@ -997,6 +1032,7 @@ static void __exit vmbus_exit(void) bus_unregister(&hv_bus); hv_cleanup(); acpi_bus_unregister_driver(&vmbus_acpi_driver); + hv_cpu_hotplug_quirk(false); } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 7/8] clockevents: export clockevents_unbind_device instead of clockevents_unbind
From: Vitaly Kuznetsov <[mailto:vkuzn...@redhat.com]> It looks like clockevents_unbind is being exported by mistake as: - it is static; - it is not listed in include/linux/clockchips.h; - EXPORT_SYMBOL_GPL(clockevents_unbind) follows clockevents_unbind_device() implementation. I think clockevents_unbind_device should be exported instead. This is going to be used to teardown Hyper-V clockevent devices on module unload. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- kernel/time/clockevents.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 5544990..888ecc1 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -371,7 +371,7 @@ int clockevents_unbind_device(struct clock_event_device *ced, int cpu) mutex_unlock(&clockevents_mutex); return ret; } -EXPORT_SYMBOL_GPL(clockevents_unbind); +EXPORT_SYMBOL_GPL(clockevents_unbind_device); /** * clockevents_register_device - register a clock event device -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 3/8] drivers:hv:vmbus drivers:hv:vmbus Allow for more than one MMIO range for children
From: Jake Oshins <[mailto:ja...@microsoft.com]> This set of changes finds the _CRS object in the ACPI namespace that contains memory address space descriptors, intended to convey to VMBus which ranges of memory-mapped I/O space are available for child devices, and then builds a resource list that contains all those ranges. Without this change, only some of the memory-mapped I/O space will be available for child devices, and only in some virtual BIOS configurations (Generation 2 VMs). This patch has been updated with feedback from Vitaly Kuznetsov. Cleanup is now driven by the acpi remove callback function. Signed-off-by: Jake Oshins Signed-off-by: K. Y. Srinivasan --- drivers/hv/vmbus_drv.c | 100 +-- drivers/video/fbdev/hyperv_fb.c |2 +- include/linux/hyperv.h |2 +- 3 files changed, 87 insertions(+), 17 deletions(-) diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 4e3760c..1fb8db0 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -45,10 +45,7 @@ static struct tasklet_struct msg_dpc; static struct completion probe_event; static int irq; -struct resource hyperv_mmio = { - .name = "hyperv mmio", - .flags = IORESOURCE_MEM, -}; +struct resource *hyperv_mmio; EXPORT_SYMBOL_GPL(hyperv_mmio); static int vmbus_exists(void) @@ -915,30 +912,98 @@ void vmbus_device_unregister(struct hv_device *device_obj) /* - * VMBUS is an acpi enumerated device. Get the the information we - * need from DSDT. + * VMBUS is an acpi enumerated device. Get the + * information we need from DSDT. */ static acpi_status vmbus_walk_resources(struct acpi_resource *res, void *ctx) { + resource_size_t start = 0; + resource_size_t end = 0; + struct resource *new_res; + struct resource **old_res = &hyperv_mmio; + switch (res->type) { case ACPI_RESOURCE_TYPE_IRQ: irq = res->data.irq.interrupts[0]; + return AE_OK; + + /* +* "Address" descriptors are for bus windows. Ignore +* "memory" descriptors, which are for registers on +* devices. +*/ + case ACPI_RESOURCE_TYPE_ADDRESS32: + start = res->data.address32.minimum; + end = res->data.address32.maximum; break; case ACPI_RESOURCE_TYPE_ADDRESS64: - hyperv_mmio.start = res->data.address64.minimum; - hyperv_mmio.end = res->data.address64.maximum; + start = res->data.address64.minimum; + end = res->data.address64.maximum; break; + + default: + /* Unused resource type */ + return AE_OK; } + /* +* Ignore ranges that are below 1MB, as they're not +* necessary or useful here. +*/ + if (end < 0x10) + return AE_OK; + + new_res = kzalloc(sizeof(*new_res), GFP_ATOMIC); + if (!new_res) + return AE_NO_MEMORY; + + new_res->name = "hyperv mmio"; + new_res->flags = IORESOURCE_MEM; + new_res->start = start; + new_res->end = end; + + do { + if (!*old_res) { + *old_res = new_res; + break; + } + + if ((*old_res)->start > new_res->end) { + new_res->sibling = *old_res; + *old_res = new_res; + break; + } + + old_res = &(*old_res)->sibling; + + } while (1); + return AE_OK; } +static int vmbus_acpi_remove(struct acpi_device *device) +{ + struct resource *cur_res; + struct resource *next_res; + + if (hyperv_mmio) { + release_resource(hyperv_mmio); + for (cur_res = hyperv_mmio; cur_res; cur_res = next_res) { + next_res = cur_res->sibling; + kfree(cur_res); + } + } + + return 0; +} + static int vmbus_acpi_add(struct acpi_device *device) { acpi_status result; int ret_val = -ENODEV; + struct acpi_device *ancestor; hv_acpi_dev = device; @@ -948,23 +1013,27 @@ static int vmbus_acpi_add(struct acpi_device *device) if (ACPI_FAILURE(result)) goto acpi_walk_err; /* -* The parent of the vmbus acpi device (Gen2 firmware) is the VMOD that -* has the mmio ranges. Get that. +* Some ancestor of the vmbus acpi device (Gen1 or Gen2 +* firmware) is the VMOD that has the mmio ranges. Get that. */ - if (device->parent) { - result = acpi_walk_resources(device->parent->handle, + for (ancestor = device->parent; ancestor; ancestor = ancestor->parent) { + result = acpi_walk_resources(ancestor->handle, METHOD_NAME__CRS,
[PATCH RESEND V2 4/8] Drivers: hv: vmbus: avoid double kfree for device_obj
From: Vitaly Kuznetsov <[mailto:vkuzn...@redhat.com]> On driver shutdown device_obj is being freed twice: 1) In vmbus_free_channels() 2) vmbus_device_release() (which is being triggered by device_unregister() in vmbus_device_unregister(). This double kfree leads to the following sporadic crash on driver unload: [ 23.469876] general protection fault: [#1] SMP [ 23.470036] Modules linked in: hv_vmbus(-) [ 23.470036] CPU: 2 PID: 213 Comm: rmmod Not tainted 3.19.0-rc5_bug923184+ #488 [ 23.470036] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS 090006 05/23/2012 [ 23.470036] task: 880036ef1cb0 ti: 880036ce8000 task.ti: 880036ce8000 [ 23.470036] RIP: 0010:[] [] __kmalloc_node_track_caller+0xdb/0x1e0 [ 23.470036] RSP: 0018:880036cebcc8 EFLAGS: 00010246 ... When this crash does not happen on driver unload the similar one is expected if we try to load hv_vmbus again. Remove kfree from vmbus_free_channels() as freeing it from vmbus_device_release() seems right. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index ba4b25f..36bacc7 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -262,7 +262,6 @@ void vmbus_free_channels(void) list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { vmbus_device_unregister(channel->device_obj); - kfree(channel->device_obj); free_channel(channel); } } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 5/8] Drivers: hv: vmbus: teardown hv_vmbus_con workqueue and vmbus_connection pages on shutdown
From: Vitaly Kuznetsov <[mailto:vkuzn...@redhat.com]> We need to destroy hv_vmbus_con on module shutdown, otherwise the following crash is sometimes observed: [ 76.569845] hv_vmbus: Hyper-V Host Build:9600-6.3-17-0.17039; Vmbus version:3.0 [ 82.598859] BUG: unable to handle kernel paging request at a0003480 [ 82.599287] IP: [] 0xa0003480 [ 82.599287] PGD 1f34067 PUD 1f35063 PMD 3f72d067 PTE 0 [ 82.599287] Oops: 0010 [#1] SMP [ 82.599287] Modules linked in: [last unloaded: hv_vmbus] [ 82.599287] CPU: 0 PID: 26 Comm: kworker/0:1 Not tainted 3.19.0-rc5_bug923184+ #488 [ 82.599287] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v1.0 11/26/2012 [ 82.599287] Workqueue: hv_vmbus_con 0xa0003480 [ 82.599287] task: 88007b6ddfa0 ti: 88007f8f8000 task.ti: 88007f8f8000 [ 82.599287] RIP: 0010:[] [] 0xa0003480 [ 82.599287] RSP: 0018:88007f8fbe00 EFLAGS: 00010202 ... To avoid memory leaks we need to free monitor_pages and int_page for vmbus_connection. Implement vmbus_disconnect() function by separating cleanup path from vmbus_connect(). As we use hv_vmbus_con to release channels (see free_channel() in channel_mgmt.c) we need to make sure the work was done before we remove the queue, do that with drain_workqueue(). We also need to avoid handling messages which can (potentially) create new channels, so set vmbus_connection.conn_state = DISCONNECTED at the very beginning of vmbus_exit() and check for that in vmbus_onmessage_work(). Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/connection.c | 17 - drivers/hv/hyperv_vmbus.h |1 + drivers/hv/vmbus_drv.c|6 ++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c index a63a795..c4acd1c 100644 --- a/drivers/hv/connection.c +++ b/drivers/hv/connection.c @@ -216,10 +216,21 @@ int vmbus_connect(void) cleanup: pr_err("Unable to connect to host\n"); + vmbus_connection.conn_state = DISCONNECTED; + vmbus_disconnect(); + + kfree(msginfo); + + return ret; +} - if (vmbus_connection.work_queue) +void vmbus_disconnect(void) +{ + if (vmbus_connection.work_queue) { + drain_workqueue(vmbus_connection.work_queue); destroy_workqueue(vmbus_connection.work_queue); + } if (vmbus_connection.int_page) { free_pages((unsigned long)vmbus_connection.int_page, 0); @@ -230,10 +241,6 @@ cleanup: free_pages((unsigned long)vmbus_connection.monitor_pages[1], 0); vmbus_connection.monitor_pages[0] = NULL; vmbus_connection.monitor_pages[1] = NULL; - - kfree(msginfo); - - return ret; } /* diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 44b1c94..6cf2de9 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -692,6 +692,7 @@ void vmbus_free_channels(void); /* Connection interface */ int vmbus_connect(void); +void vmbus_disconnect(void); int vmbus_post_msg(void *buffer, size_t buflen); diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 1fb8db0..f824c08 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -571,6 +571,10 @@ static void vmbus_onmessage_work(struct work_struct *work) { struct onmessage_work_context *ctx; + /* Do not process messages if we're in DISCONNECTED state */ + if (vmbus_connection.conn_state == DISCONNECTED) + return; + ctx = container_of(work, struct onmessage_work_context, work); vmbus_onmessage(&ctx->msg); @@ -1095,12 +1099,14 @@ cleanup: static void __exit vmbus_exit(void) { + vmbus_connection.conn_state = DISCONNECTED; hv_remove_vmbus_irq(); vmbus_free_channels(); bus_unregister(&hv_bus); hv_cleanup(); acpi_bus_unregister_driver(&vmbus_acpi_driver); hv_cpu_hotplug_quirk(false); + vmbus_disconnect(); } -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 2/8] Drivers: hv: vmbus: rename channel work queues
From: Vitaly Kuznetsov <[mailto:vkuzn...@redhat.com]> All channel work queues are named 'hv_vmbus_ctl', this makes them indistinguishable in ps output and makes it hard to link to the corresponding vmbus device. Rename them to hv_vmbus_ctl/N and make vmbus device names match, e.g. now vmbus_1 device is served by hv_vmbus_ctl/1 work queue. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/channel_mgmt.c |5 - drivers/hv/vmbus_drv.c|6 ++ include/linux/hyperv.h|3 +++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/hv/channel_mgmt.c b/drivers/hv/channel_mgmt.c index 3736f71..ba4b25f 100644 --- a/drivers/hv/channel_mgmt.c +++ b/drivers/hv/channel_mgmt.c @@ -139,19 +139,22 @@ EXPORT_SYMBOL_GPL(vmbus_prep_negotiate_resp); */ static struct vmbus_channel *alloc_channel(void) { + static atomic_t chan_num = ATOMIC_INIT(0); struct vmbus_channel *channel; channel = kzalloc(sizeof(*channel), GFP_ATOMIC); if (!channel) return NULL; + channel->id = atomic_inc_return(&chan_num); spin_lock_init(&channel->inbound_lock); spin_lock_init(&channel->lock); INIT_LIST_HEAD(&channel->sc_list); INIT_LIST_HEAD(&channel->percpu_list); - channel->controlwq = create_workqueue("hv_vmbus_ctl"); + channel->controlwq = alloc_workqueue("hv_vmbus_ctl/%d", WQ_MEM_RECLAIM, +1, channel->id); if (!channel->controlwq) { kfree(channel); return NULL; diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 90c3400..4e3760c 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -875,10 +875,8 @@ int vmbus_device_register(struct hv_device *child_device_obj) { int ret = 0; - static atomic_t device_num = ATOMIC_INIT(0); - - dev_set_name(&child_device_obj->device, "vmbus_0_%d", -atomic_inc_return(&device_num)); + dev_set_name(&child_device_obj->device, "vmbus_%d", +child_device_obj->channel->id); child_device_obj->device.bus = &hv_bus; child_device_obj->device.parent = &hv_acpi_dev->dev; diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index 5a2ba67..26a32b7 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h @@ -646,6 +646,9 @@ struct hv_input_signal_event_buffer { }; struct vmbus_channel { + /* Unique channel id */ + int id; + struct list_head listentry; struct hv_device *device_obj; -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH RESEND V2 8/8] Drivers: hv: vmbus: Teardown clockevent devices on module unload
From: Vitaly Kuznetsov <[mailto:vkuzn...@redhat.com]> Newly introduced clockevent devices made it impossible to unload hv_vmbus module as clockevents_config_and_register() takes additional reverence to the module. To make it possible again we do the following: - avoid setting dev->owner for clockevent devices; - implement hv_synic_clockevents_cleanup() doing clockevents_unbind_device(); - call it from vmbus_exit(). In theory hv_synic_clockevents_cleanup() can be merged with hv_synic_cleanup(), however, we call hv_synic_cleanup() from smp_call_function_single() and this doesn't work for clockevents_unbind_device() as it does such call on its own. I opted for a separate function. Signed-off-by: Vitaly Kuznetsov Signed-off-by: K. Y. Srinivasan --- drivers/hv/hv.c | 25 - drivers/hv/hyperv_vmbus.h |2 ++ drivers/hv/vmbus_drv.c|1 + 3 files changed, 27 insertions(+), 1 deletions(-) diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 39531dc..d3943bc 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -312,7 +312,11 @@ static void hv_init_clockevent_device(struct clock_event_device *dev, int cpu) dev->features = CLOCK_EVT_FEAT_ONESHOT; dev->cpumask = cpumask_of(cpu); dev->rating = 1000; - dev->owner = THIS_MODULE; + /* +* Avoid settint dev->owner = THIS_MODULE deliberately as doing so will +* result in clockevents_config_and_register() taking additional +* references to the hv_vmbus module making it impossible to unload. +*/ dev->set_mode = hv_ce_setmode; dev->set_next_event = hv_ce_set_next_event; @@ -470,6 +474,20 @@ void hv_synic_init(void *arg) } /* + * hv_synic_clockevents_cleanup - Cleanup clockevent devices + */ +void hv_synic_clockevents_cleanup(void) +{ + int cpu; + + if (!(ms_hyperv.features & HV_X64_MSR_SYNTIMER_AVAILABLE)) + return; + + for_each_online_cpu(cpu) + clockevents_unbind_device(hv_context.clk_evt[cpu], cpu); +} + +/* * hv_synic_cleanup - Cleanup routine for hv_synic_init(). */ void hv_synic_cleanup(void *arg) @@ -483,6 +501,11 @@ void hv_synic_cleanup(void *arg) if (!hv_context.synic_initialized) return; + /* Turn off clockevent device */ + if (ms_hyperv.features & HV_X64_MSR_SYNTIMER_AVAILABLE) + hv_ce_setmode(CLOCK_EVT_MODE_SHUTDOWN, + hv_context.clk_evt[cpu]); + rdmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, shared_sint.as_uint64); shared_sint.masked = 1; diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h index 6cf2de9..b055e53 100644 --- a/drivers/hv/hyperv_vmbus.h +++ b/drivers/hv/hyperv_vmbus.h @@ -572,6 +572,8 @@ extern void hv_synic_init(void *irqarg); extern void hv_synic_cleanup(void *arg); +extern void hv_synic_clockevents_cleanup(void); + /* * Host version information. */ diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 28d19e8..3cd44ae 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1102,6 +1102,7 @@ static void __exit vmbus_exit(void) int cpu; vmbus_connection.conn_state = DISCONNECTED; + hv_synic_clockevents_cleanup(); hv_remove_vmbus_irq(); vmbus_free_channels(); bus_unregister(&hv_bus); -- 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: fid: lproc_fid: Removed variables that is never used
On Wed, 2015-01-28 at 23:46 +0100, Rickard Strandqvist wrote: > Variable ar assigned a value that is never used. > I have also removed all the code that thereby serves no purpose. [] > diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c > b/drivers/staging/lustre/lustre/fid/lproc_fid.c [] > @@ -63,7 +63,6 @@ static int lprocfs_fid_write_common(const char __user > *buffer, size_t count, > struct lu_seq_range *range) > { > struct lu_seq_range tmp; > - int rc; > char kernbuf[MAX_FID_RANGE_STRLEN]; > > LASSERT(range != NULL); > @@ -82,7 +81,7 @@ static int lprocfs_fid_write_common(const char __user > *buffer, size_t count, > } > > /* of the form "[0x00024400 - 0x00028000400]" */ > - rc = sscanf(kernbuf, "[%llx - %llx]\n", > + sscanf(kernbuf, "[%llx - %llx]\n", > (unsigned long long *)&tmp.lsr_start, > (unsigned long long *)&tmp.lsr_end); > if (!range_is_sane(&tmp) || range_is_zero(&tmp) || Better to make this test use rc rather than ignore the return from sscanf if (rc != 2 || !range_is_sane(etc...)) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [RFC] ion:change ion_cma_allocate return error value
> -Original Message- > From: 'gre...@linuxfoundation.org' [mailto:gre...@linuxfoundation.org] > Sent: Thursday, January 29, 2015 2:45 AM > To: Wang, Yalin > Cc: 'tranmanph...@gmail.com'; 'fabio.este...@freescale.com'; > 'prime.z...@huawei.com'; 'de...@driverdev.osuosl.org'; 'linux- > ker...@vger.kernel.org'; Gao, Neil > Subject: Re: [RFC] ion:change ion_cma_allocate return error value > > On Tue, Jan 27, 2015 at 02:04:21PM +0800, Wang, Yalin wrote: > > This patch change the error return value from -1 to -ENOMEM, so that > > userspace can get the correct errno, otherwise, > > -1 will be -EPERM, userspace will print permission deny for allocation > > failure. > > > > Signed-off-by: Yalin Wang > > --- > > drivers/staging/android/ion/ion_cma_heap.c | 6 ++ > > 1 file changed, 2 insertions(+), 4 deletions(-) > > Don't you also need to now change userspace code to properly handle these > errors? > No, because userspace use strerror() to print errno, It will print correct error string depending on kernel return Errno. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: lustre: osc: fix Prefer seq_puts to seq_printf
On Wed, 2015-01-28 at 16:05 +0200, Heba Aamer wrote: > This patch fixes the following checkpatch.pl warning: > Prefer seq_puts to seq_printf checkpatch is pretty stupid. Please don't just do what it says. Look further and see what else can be improved. > diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c > b/drivers/staging/lustre/lustre/osc/lproc_osc.c [] > @@ -364,7 +364,7 @@ static int osc_checksum_type_seq_show(struct seq_file *m, > void *v) > else > seq_printf(m, "%s ", cksum_name[i]); > } > - seq_printf(m, "\n"); > + seq_puts(m, "\n"); This could be seq_putc > @@ -601,7 +601,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, > void *v) > seq_printf(seq, "pending read pages: %d\n", > atomic_read(&cli->cl_pending_r_pages)); > > - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n"); > + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n"); > seq_printf(seq, "pages per rpc rpcs %% cum %% |"); > seq_printf(seq, " rpcs %% cum %%\n"); The seq_printf uses with %% could also be seq_puts > @@ -624,7 +624,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, > void *v) > break; > } > > - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n"); > + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n"); > seq_printf(seq, "rpcs in flight rpcs %% cum %% |"); > seq_printf(seq, " rpcs %% cum %%\n"); seq_puts here too > @@ -647,7 +647,7 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, > void *v) > break; > } > > - seq_printf(seq, "\n\t\t\tread\t\t\twrite\n"); > + seq_puts(seq, "\n\t\t\tread\t\t\twrite\n"); > seq_printf(seq, "offset rpcs %% cum %% |"); > seq_printf(seq, " rpcs %% cum %%\n"); > and here ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: emxx_udc: emxx_udc: Removed variables that is never used
On Wed, Jan 28, 2015 at 4:42 PM, Rickard Strandqvist wrote: > Variable ar assigned a value that is never used. > I have also removed all the code that thereby serves no purpose. Each of these changes adds a warning ... > diff --git a/drivers/staging/emxx_udc/emxx_udc.c > b/drivers/staging/emxx_udc/emxx_udc.c > index eb178fc..b916fab 100644 > --- a/drivers/staging/emxx_udc/emxx_udc.c > +++ b/drivers/staging/emxx_udc/emxx_udc.c > @@ -2974,10 +2974,10 @@ static int nbu2ss_ep_fifo_status(struct usb_ep *_ep) > spin_lock_irqsave(&udc->lock, flags); > > if (ep->epnum == 0) { > - data = _nbu2ss_readl(&preg->EP0_LENGTH) & EP0_LDATA; > + _nbu2ss_readl(&preg->EP0_LENGTH) & EP0_LDATA; .../linux/drivers/staging/emxx_udc/emxx_udc.c:2977:36: warning: value computed is not used [-Wunused-value] _nbu2ss_readl(&preg->EP0_LENGTH) & EP0_LDATA; ^ > } else { > - data = _nbu2ss_readl(&preg->EP_REGS[ep->epnum-1].EP_LEN_DCNT) > + _nbu2ss_readl(&preg->EP_REGS[ep->epnum-1].EP_LEN_DCNT) > & EPn_LDATA; .../linux/drivers/staging/emxx_udc/emxx_udc.c:2981:4: warning: value computed is not used [-Wunused-value] & EPn_LDATA; ^ > } > > @@ -3264,12 +3264,11 @@ static void __init nbu2ss_drv_set_ep_info( > if (isdigit(name[2])) { > > longnum; > - int res; > chartempbuf[2]; > > tempbuf[0] = name[2]; > tempbuf[1] = '\0'; > - res = kstrtol(tempbuf, 16, &num); > + kstrtol(tempbuf, 16, &num); .../linux/drivers/staging/emxx_udc/emxx_udc.c:3271:3: warning: ignoring return value of ‘kstrtol’, declared with attribute warn_unused_result [-Wunused-result] kstrtol(tempbuf, 16, &num); ^ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 01/02] STAGING: Fix pcl818.c coding style issue: code indent should use tabs where possible
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c. - code indent should use tabs where possible It is fixed by reformatting the comment block to usual comment style. And with the reformatting, following coding style problem is also fixed: - please, no space before tabs Signed-off-by: Simon Guo --- drivers/staging/comedi/drivers/pcl818.c | 189 +++- 1 file changed, 91 insertions(+), 98 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index ba2e137..5d9050c 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -1,102 +1,95 @@ /* - comedi/drivers/pcl818.c - - Author: Michal Dobes - - hardware driver for Advantech cards: -card: PCL-818L, PCL-818H, PCL-818HD, PCL-818HG, PCL-818, PCL-718 -driver: pcl818l, pcl818h, pcl818hd, pcl818hg, pcl818, pcl718 -*/ -/* -Driver: pcl818 -Description: Advantech PCL-818 cards, PCL-718 -Author: Michal Dobes -Devices: [Advantech] PCL-818L (pcl818l), PCL-818H (pcl818h), - PCL-818HD (pcl818hd), PCL-818HG (pcl818hg), PCL-818 (pcl818), - PCL-718 (pcl718) -Status: works - -All cards have 16 SE/8 DIFF ADCs, one or two DACs, 16 DI and 16 DO. -Differences are only at maximal sample speed, range list and FIFO -support. -The driver support AI mode 0, 1, 3 other subdevices (AO, DI, DO) support -only mode 0. If DMA/FIFO/INT are disabled then AI support only mode 0. -PCL-818HD and PCL-818HG support 1kword FIFO. Driver support this FIFO -but this code is untested. -A word or two about DMA. Driver support DMA operations at two ways: -1) DMA uses two buffers and after one is filled then is generated - INT and DMA restart with second buffer. With this mode I'm unable run - more that 80Ksamples/secs without data dropouts on K6/233. -2) DMA uses one buffer and run in autoinit mode and the data are - from DMA buffer moved on the fly with 2kHz interrupts from RTC. - This mode is used if the interrupt 8 is available for allocation. - If not, then first DMA mode is used. With this I can run at - full speed one card (100ksamples/secs) or two cards with - 60ksamples/secs each (more is problem on account of ISA limitations). - To use this mode you must have compiled kernel with disabled - "Enhanced Real Time Clock Support". - Maybe you can have problems if you use xntpd or similar. - If you've data dropouts with DMA mode 2 then: -a) disable IDE DMA -b) switch text mode console to fb. - - Options for PCL-818L: -[0] - IO Base -[1] - IRQ (0=disable, 2, 3, 4, 5, 6, 7) -[2] - DMA (0=disable, 1, 3) -[3] - 0, 10=10MHz clock for 8254 - 1= 1MHz clock for 8254 -[4] - 0, 5=A/D input -5V.. +5V - 1, 10=A/D input -10V..+10V -[5] - 0, 5=D/A output 0-5V (internal reference -5V) - 1, 10=D/A output 0-10V (internal reference -10V) - 2=D/A output unknown (external reference) - - Options for PCL-818, PCL-818H: -[0] - IO Base -[1] - IRQ (0=disable, 2, 3, 4, 5, 6, 7) -[2] - DMA (0=disable, 1, 3) -[3] - 0, 10=10MHz clock for 8254 - 1= 1MHz clock for 8254 -[4] - 0, 5=D/A output 0-5V (internal reference -5V) - 1, 10=D/A output 0-10V (internal reference -10V) - 2=D/A output unknown (external reference) - - Options for PCL-818HD, PCL-818HG: -[0] - IO Base -[1] - IRQ (0=disable, 2, 3, 4, 5, 6, 7) -[2] - DMA/FIFO (-1=use FIFO, 0=disable both FIFO and DMA, - 1=use DMA ch 1, 3=use DMA ch 3) -[3] - 0, 10=10MHz clock for 8254 - 1= 1MHz clock for 8254 -[4] - 0, 5=D/A output 0-5V (internal reference -5V) - 1, 10=D/A output 0-10V (internal reference -10V) - 2=D/A output unknown (external reference) - - Options for PCL-718: -[0] - IO Base -[1] - IRQ (0=disable, 2, 3, 4, 5, 6, 7) -[2] - DMA (0=disable, 1, 3) -[3] - 0, 10=10MHz clock for 8254 - 1= 1MHz clock for 8254 -[4] - 0=A/D Range is +/-10V - 1= +/-5V - 2= +/-2.5V - 3= +/-1V - 4= +/-0.5V - 5= user defined bipolar - 6= 0-10V - 7= 0-5V - 8= 0-2V - 9= 0-1V -10= user defined unipolar -[5] - 0, 5=D/A outputs 0-5V (internal reference -5V) - 1, 10=D/A outputs 0-10V (internal reference -10V) - 2=D/A outputs unknown (external reference) -[6] - 0, 60=max 60kHz A/D sampling - 1,100=max 100kHz A/D sampling (PCL-718 with Option 001 installed) - -*/ + * comedi/drivers/pcl818.c + * + * Driver: pcl818 + * Description: Advantech PCL-818 cards, PCL-718 + * Author: Michal Dobes + * Devices: [Advantech] PCL-818L (pcl818l), PCL-818H (pcl818h), + * PCL-818HD (pcl81
[PATCH v2 02/02] STAGING: Fix pcl818.c coding style issue: line over 80 characters
Correct one coding style problem(detected by checkpatch.pl) in pcl818.c. - line over 80 characters Signed-off-by: Simon Guo --- drivers/staging/comedi/drivers/pcl818.c | 15 ++- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c index 5d9050c..2b8a05e 100644 --- a/drivers/staging/comedi/drivers/pcl818.c +++ b/drivers/staging/comedi/drivers/pcl818.c @@ -297,9 +297,11 @@ static const struct pcl818_board boardtypes[] = { struct pcl818_private { struct comedi_isadma *dma; - unsigned int ns_min;/* manimal allowed delay between samples (in us) for actual card */ + /* manimal allowed delay between samples (in us) for actual card */ + unsigned int ns_min; int i8253_osc_base; /* 1/frequency of on board oscilator in ns */ - unsigned int act_chanlist[16]; /* MUX setting for actual AI operations */ + /* MUX setting for actual AI operations */ + unsigned int act_chanlist[16]; unsigned int act_chanlist_len; /* how long is actual MUX list */ unsigned int act_chanlist_pos; /* actual position in MUX list */ unsigned int divisor1; @@ -641,7 +643,8 @@ static int check_channel_list(struct comedi_device *dev, break; nowmustbechan = (CR_CHAN(chansegment[i - 1]) + 1) % s->n_chan; - if (nowmustbechan != CR_CHAN(chanlist[i])) {/* channel list isn't continuous :-( */ + if (nowmustbechan != CR_CHAN(chanlist[i])) { + /* channel list isn't continuous :-( */ dev_dbg(dev->class_dev, "channel list must be continuous! chanlist[%i]=%d but must be %d or %d!\n", i, CR_CHAN(chanlist[i]), nowmustbechan, @@ -1147,8 +1150,10 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it) devpriv->ns_min = board->ns_min; if (!board->is_818) { - if ((it->options[6] == 1) || (it->options[6] == 100)) - devpriv->ns_min = 1;/* extended PCL718 to 100kHz DAC */ + if ((it->options[6] == 1) || (it->options[6] == 100)) { + /* extended PCL718 to 100kHz DAC */ + devpriv->ns_min = 1; + } } pcl818_reset(dev); -- 1.8.1.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/3] staging/nvec: reimplement on top of tegra i2c driver
Remove i2c controller related code and use tegra i2c driver in slave mode. Signed-off-by: Andrey Danin --- drivers/staging/nvec/nvec.c | 379 ++-- drivers/staging/nvec/nvec.h | 17 +- 2 files changed, 122 insertions(+), 274 deletions(-) diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c index 120b70d..d645c58 100644 --- a/drivers/staging/nvec/nvec.c +++ b/drivers/staging/nvec/nvec.c @@ -25,8 +25,8 @@ #include #include #include +#include #include -#include #include #include #include @@ -39,25 +39,12 @@ #include "nvec.h" -#define I2C_CNFG 0x00 -#define I2C_CNFG_PACKET_MODE_EN(1<<10) -#define I2C_CNFG_NEW_MASTER_SFM(1<<11) -#define I2C_CNFG_DEBOUNCE_CNT_SHIFT12 - -#define I2C_SL_CNFG0x20 -#define I2C_SL_NEWSL (1<<2) -#define I2C_SL_NACK(1<<1) -#define I2C_SL_RESP(1<<0) -#define I2C_SL_IRQ (1<<3) -#define END_TRANS (1<<4) -#define RCVD (1<<2) -#define RNW(1<<1) - -#define I2C_SL_RCVD0x24 -#define I2C_SL_STATUS 0x28 -#define I2C_SL_ADDR1 0x2c -#define I2C_SL_ADDR2 0x30 -#define I2C_SL_DELAY_COUNT 0x3c + +#define I2C_SL_ST_END_TRANS(1<<4) +#define I2C_SL_ST_IRQ (1<<3) +#define I2C_SL_ST_RCVD (1<<2) +#define I2C_SL_ST_RNW (1<<1) + /** * enum nvec_msg_category - Message categories for nvec_msg_alloc() @@ -327,6 +314,7 @@ struct nvec_msg *nvec_write_sync(struct nvec_chip *nvec, mutex_unlock(&nvec->sync_write_mutex); + return msg; } EXPORT_SYMBOL(nvec_write_sync); @@ -475,11 +463,13 @@ static void nvec_tx_completed(struct nvec_chip *nvec) { /* We got an END_TRANS, let's skip this, maybe there's an event */ if (nvec->tx->pos != nvec->tx->size) { - dev_err(nvec->dev, "premature END_TRANS, resending\n"); + dev_err(nvec->dev, "premature END_TRANS, resending: pos:%u, size:%u\n", + nvec->tx->pos, nvec->tx->size); nvec->tx->pos = 0; nvec_gpio_set_value(nvec, 0); } else { - nvec->state = 0; + nvec->state = ST_NONE; + nvec->tx->pos = 0; } } @@ -497,7 +487,7 @@ static void nvec_rx_completed(struct nvec_chip *nvec) (uint) nvec->rx->pos); nvec_msg_free(nvec, nvec->rx); - nvec->state = 0; + nvec->state = ST_NONE; /* Battery quirk - Often incomplete, and likes to crash */ if (nvec->rx->data[0] == NVEC_BAT) @@ -514,7 +504,7 @@ static void nvec_rx_completed(struct nvec_chip *nvec) spin_unlock(&nvec->rx_lock); - nvec->state = 0; + nvec->state = ST_NONE; if (!nvec_msg_is_event(nvec->rx)) complete(&nvec->ec_transfer); @@ -523,21 +513,6 @@ static void nvec_rx_completed(struct nvec_chip *nvec) } /** - * nvec_invalid_flags - Send an error message about invalid flags and jump - * @nvec: The nvec device - * @status: The status flags - * @reset: Whether we shall jump to state 0. - */ -static void nvec_invalid_flags(struct nvec_chip *nvec, unsigned int status, - bool reset) -{ - dev_err(nvec->dev, "unexpected status flags 0x%02x during state %i\n", - status, nvec->state); - if (reset) - nvec->state = 0; -} - -/** * nvec_tx_set - Set the message to transfer (nvec->tx) * @nvec: A &struct nvec_chip * @@ -566,150 +541,85 @@ static void nvec_tx_set(struct nvec_chip *nvec) (uint)nvec->tx->size, nvec->tx->data[1]); } + /** - * nvec_interrupt - Interrupt handler - * @irq: The IRQ - * @dev: The nvec device + * nvec_slave_cb - I2C slave callback * - * Interrupt handler that fills our RX buffers and empties our TX - * buffers. This uses a finite state machine with ridiculous amounts - * of error checking, in order to be fairly reliable. + * This callback fills our RX buffers and empties our TX + * buffers. This uses a finite state machine. */ -static irqreturn_t nvec_interrupt(int irq, void *dev) +static int nvec_slave_cb(struct i2c_client *client, + enum i2c_slave_event event, u8 *val) { - unsigned long status; - unsigned int received = 0; - unsigned char to_send = 0xff; - const unsigned long irq_mask = I2C_SL_IRQ | END_TRANS | RCVD | RNW; - struct nvec_chip *nvec = dev; - unsigned int state = nvec->state; - - status = readl(nvec->base + I2C_SL_STATUS); - - /* Filter out some errors */ - if ((status & irq_mask) == 0 && (status & ~irq_mask) != 0) { - dev_err(nvec->dev, "unexpected irq mask %lx\n", status); - return IRQ_HANDLE