Re: [PATCH RESEND 00/28] staging: unisys: fix visorbus & visorinput issues raised by tglx
On Fri, 10 Jun 2016, David Kershner wrote: > Resending due to imcomplete distribution list. > > This patchset comprises the first 26 patches of the previously-submitted > patchset (but retracted): > > [PATCH v4 00/29] Fixed issues raised by tglx, then move visorbus to >drivers/virt > > then adds 2 patches to visorinput that: > * fixes a device initialization race condition > * converts a semaphore to a mutex > > As described in the email NAKing the previously-submitted patchset, > the reason we are re-submitting this now is to make things a bit > cleaner by separating the fixes we need to make to the code in > staging from the patchset that actually moves the code out of staging. > > The intent of this patchset is to fix all known outstanding > issues with code in drivers/staging/unisys/, so that subsequent > patchsets can move these drivers out of staging. > > tglx: The following patchset fixes issues you raised during your > code review of visorbus on 5/18, and visorinput on 6/1. > > Converts visorbus to use a kernel timer for periodic device-specific > callbacks instead of a workqueue, making the implementation in > periodic_work.c and periodic_work.h no longer necessary. These files > are then deleted. > > The visordriver_callback_lock has been switched to a mutex. > > Several module parameters and structures were removed that were no > longer being used. My comments are addressed and the driver looks halfways reasonable now. Reviewed-by: Thomas Gleixner ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: iio: ad5933: fix order of cycle conditions
On 01/06/16 20:25, Luis de Bethencourt wrote: > Correctly handle the settling time cycles value. The else branch is an > impossible condition, > 1022 in the else branch of > 511. Flipping the order. > > Based on the Table 13 at the bottom of Page 25 of the Data Sheet: > http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf > > Signed-off-by: Luis de Bethencourt > Reviewed-by: Lars-Peter Clausen While Lars did review, it I'm not seeing an email where he gave this tag (my inbox may well have eaten it). Lars, could you confirm that you are happy with the patch as it now stands. Certainly looks right to me! Thanks, Jonathan > --- > drivers/staging/iio/impedance-analyzer/ad5933.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c > b/drivers/staging/iio/impedance-analyzer/ad5933.c > index 9f43976..170ac98 100644 > --- a/drivers/staging/iio/impedance-analyzer/ad5933.c > +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c > @@ -444,10 +444,10 @@ static ssize_t ad5933_store(struct device *dev, > st->settling_cycles = val; > > /* 2x, 4x handling, see datasheet */ > - if (val > 511) > - val = (val >> 1) | (1 << 9); > - else if (val > 1022) > + if (val > 1022) > val = (val >> 2) | (3 << 9); > + else if (val > 511) > + val = (val >> 1) | (1 << 9); > > dat = cpu_to_be16(val); > ret = ad5933_i2c_write(st->client, > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: iio: fix ad7606_spi regression
On 30/05/16 14:54, Geert Uytterhoeven wrote: > On Mon, May 30, 2016 at 3:50 PM, Arnd Bergmann wrote: >> As pointed out by Geert Uytterhoeven, the patch was incorrect >> and breaks the driver, which was fortunately pointed out by >> this gcc warning: >> >> drivers/staging/iio/adc/ad7606_spi.c: In function ‘ad7606_spi_read_block’: >> drivers/staging/iio/adc/ad7606_spi.c:34: warning: ‘data’ is used >> uninitialized in this function >> >> The effect of the patch is that the data is copied into >> a random memory location (from the uninitialized pointer) >> instead of being byteswapped in place. >> >> This adds the initialization for the 'data' variable back >> to restore the original behavior. >> >> Cc: Geert Uytterhoeven >> Cc: Ksenija Stanojevic >> Fixes: 87787e5ef727 ("Staging: iio: Fix sparse endian warning") >> Signed-off-by: Arnd Bergmann > > Acked-by: Geert Uytterhoeven Applied to the fixes-togreg branch of iio.git Thanks, Jonathan > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- > ge...@linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like > that. > -- Linus Torvalds > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: iio: ad5933: fix order of cycle conditions
On 06/11/2016 06:50 PM, Jonathan Cameron wrote: > On 01/06/16 20:25, Luis de Bethencourt wrote: >> Correctly handle the settling time cycles value. The else branch is an >> impossible condition, > 1022 in the else branch of > 511. Flipping the order. >> >> Based on the Table 13 at the bottom of Page 25 of the Data Sheet: >> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf >> >> Signed-off-by: Luis de Bethencourt >> Reviewed-by: Lars-Peter Clausen > While Lars did review, it I'm not seeing an email where he > gave this tag (my inbox may well have eaten it). > > Lars, could you confirm that you are happy with the > patch as it now stands. > All good, thanks. > Certainly looks right to me! > > Thanks, > Jonathan >> --- >> drivers/staging/iio/impedance-analyzer/ad5933.c | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c >> b/drivers/staging/iio/impedance-analyzer/ad5933.c >> index 9f43976..170ac98 100644 >> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c >> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c >> @@ -444,10 +444,10 @@ static ssize_t ad5933_store(struct device *dev, >> st->settling_cycles = val; >> >> /* 2x, 4x handling, see datasheet */ >> -if (val > 511) >> -val = (val >> 1) | (1 << 9); >> -else if (val > 1022) >> +if (val > 1022) >> val = (val >> 2) | (3 << 9); >> +else if (val > 511) >> +val = (val >> 1) | (1 << 9); >> >> dat = cpu_to_be16(val); >> ret = ad5933_i2c_write(st->client, >> > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: iio: ad5933: fix order of cycle conditions
On 11/06/16 18:25, Lars-Peter Clausen wrote: > On 06/11/2016 06:50 PM, Jonathan Cameron wrote: >> On 01/06/16 20:25, Luis de Bethencourt wrote: >>> Correctly handle the settling time cycles value. The else branch is an >>> impossible condition, > 1022 in the else branch of > 511. Flipping the >>> order. >>> >>> Based on the Table 13 at the bottom of Page 25 of the Data Sheet: >>> http://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf >>> >>> Signed-off-by: Luis de Bethencourt >>> Reviewed-by: Lars-Peter Clausen >> While Lars did review, it I'm not seeing an email where he >> gave this tag (my inbox may well have eaten it). >> >> Lars, could you confirm that you are happy with the >> patch as it now stands. >> > > All good, thanks. Applied to the fixes-togreg branch. Thanks, Jonathan > >> Certainly looks right to me! >> >> Thanks, >> Jonathan >>> --- >>> drivers/staging/iio/impedance-analyzer/ad5933.c | 6 +++--- >>> 1 file changed, 3 insertions(+), 3 deletions(-) >>> >>> diff --git a/drivers/staging/iio/impedance-analyzer/ad5933.c >>> b/drivers/staging/iio/impedance-analyzer/ad5933.c >>> index 9f43976..170ac98 100644 >>> --- a/drivers/staging/iio/impedance-analyzer/ad5933.c >>> +++ b/drivers/staging/iio/impedance-analyzer/ad5933.c >>> @@ -444,10 +444,10 @@ static ssize_t ad5933_store(struct device *dev, >>> st->settling_cycles = val; >>> >>> /* 2x, 4x handling, see datasheet */ >>> - if (val > 511) >>> - val = (val >> 1) | (1 << 9); >>> - else if (val > 1022) >>> + if (val > 1022) >>> val = (val >> 2) | (3 << 9); >>> + else if (val > 511) >>> + val = (val >> 1) | (1 << 9); >>> >>> dat = cpu_to_be16(val); >>> ret = ad5933_i2c_write(st->client, >>> >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH net-next,v2] tools: hv: Add a script to help bonding synthetic and VF NICs
> -Original Message- > From: David Miller [mailto:da...@davemloft.net] > Sent: Friday, June 10, 2016 9:14 PM > To: Haiyang Zhang > Cc: net...@vger.kernel.org; KY Srinivasan ; > o...@aepfle.de; vkuzn...@redhat.com; linux-ker...@vger.kernel.org; > driverdev-devel@linuxdriverproject.org > Subject: Re: [PATCH net-next,v2] tools: hv: Add a script to help bonding > synthetic and VF NICs > > From: Haiyang Zhang > Date: Fri, 10 Jun 2016 14:23:12 -0700 > > > This script helps to create bonding network devices based on synthetic NIC > > (the virtual network adapter usually provided by Hyper-V) and the > matching > > VF NIC (SRIOV virtual function). So the synthetic NIC and VF NIC can > > function as one network device, and fail over to the synthetic NIC if VF is > > down. > > > > Signed-off-by: Haiyang Zhang > > Reviewed-by: K. Y. Srinivasan > > --- > > v2: Make it to be distro neutral. > > This tool doesn't configure anything. > > It fishes information out of sysfs and prints it out. > > I don't think this is useful, not appropriate for the kernel > tools subdirectory at all. > > When I said make it distro neutral, that meant if you wanted to submit > this again you were expected to do the hard work of making it > configure things properly on all major distributions. The major distros supported by Hyper-V include RHEL, SLES, and Ubuntu. I will put them into the configuration scripts -- is this sufficient? Thanks, - Haiyang ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging:vt6656:card.c:Fix comment block issue
Fix "Block comments use * on subsequent lines" and "Block comments use */ on trailing lines" warnings thrown by checkpatch.pl Signed-off-by: Rithvik Patibandla --- drivers/staging/vt6656/card.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index a382fc6..607834c 100644 --- a/drivers/staging/vt6656/card.c +++ b/drivers/staging/vt6656/card.c @@ -47,7 +47,8 @@ #include "usbpipe.h" /* const u16 cwRXBCNTSFOff[MAX_RATE] = - {17, 34, 96, 192, 34, 23, 17, 11, 8, 5, 4, 3}; */ + * {17, 34, 96, 192, 34, 23, 17, 11, 8, 5, 4, 3}; + */ static const u16 cwRXBCNTSFOff[MAX_RATE] = { 192, 96, 34, 17, 34, 23, 17, 11, 8, 5, 4, 3 -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] staging: i4l: icn: do not use return as a function
return is not a function so no need to use the parenthesis. Signed-off-by: Sudip Mukherjee --- drivers/staging/i4l/icn/icn.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index 46d957c..c5dd572 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -1246,7 +1246,7 @@ icn_command(isdn_ctrl *c, icn_card *card) dev.firstload = 0; } icn_stopcard(card); - return (icn_loadboot(arg, card)); + return icn_loadboot(arg, card); case ICN_IOCTL_LOADPROTO: icn_stopcard(card); if ((i = (icn_loadproto(arg, card @@ -1262,7 +1262,7 @@ icn_command(isdn_ctrl *c, icn_card *card) arg, sizeof(cdef))) return -EFAULT; - return (icn_addcard(cdef.port, cdef.id1, cdef.id2)); + return icn_addcard(cdef.port, cdef.id1, cdef.id2); break; case ICN_IOCTL_LEASEDCFG: if (a) { @@ -1458,7 +1458,7 @@ if_command(isdn_ctrl *c) icn_card *card = icn_findcard(c->driver); if (card) - return (icn_command(c, card)); + return icn_command(c, card); printk(KERN_ERR "icn: if_command %d called with invalid driverId %d!\n", c->command, c->driver); @@ -1473,7 +1473,7 @@ if_writecmd(const u_char __user *buf, int len, int id, int channel) if (card) { if (!(card->flags & ICN_FLAGS_RUNNING)) return -ENODEV; - return (icn_writecmd(buf, len, 1, card)); + return icn_writecmd(buf, len, 1, card); } printk(KERN_ERR "icn: if_writecmd called with invalid driverId!\n"); @@ -1488,7 +1488,7 @@ if_readstatus(u_char __user *buf, int len, int id, int channel) if (card) { if (!(card->flags & ICN_FLAGS_RUNNING)) return -ENODEV; - return (icn_readstatus(buf, len, card)); + return icn_readstatus(buf, len, card); } printk(KERN_ERR "icn: if_readstatus called with invalid driverId!\n"); @@ -1503,7 +1503,7 @@ if_sendbuf(int id, int channel, int ack, struct sk_buff *skb) if (card) { if (!(card->flags & ICN_FLAGS_RUNNING)) return -ENODEV; - return (icn_sendbuf(channel, ack, skb, card)); + return icn_sendbuf(channel, ack, skb, card); } printk(KERN_ERR "icn: if_sendbuf called with invalid driverId!\n"); @@ -1617,7 +1617,7 @@ icn_setup(char *line) icn_id2 = sid2; } } - return (1); + return 1; } __setup("icn=", icn_setup); #endif /* MODULE */ @@ -1644,7 +1644,7 @@ static int __init icn_init(void) strcpy(rev, " ??? "); printk(KERN_NOTICE "ICN-ISDN-driver Rev%smem=0x%08lx\n", rev, dev.memaddr); - return (icn_addcard(portbase, icn_id, icn_id2)); + return icn_addcard(portbase, icn_id, icn_id2); } static void __exit icn_exit(void) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/6] staging: i4l: icn: remove braces
Braces are not required in a single statement block. Signed-off-by: Sudip Mukherjee --- drivers/staging/i4l/icn/icn.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index abc6599..ff0fb6c6 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -883,9 +883,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card) SLEEP(1); OUTB_P(0xff, ICN_RUN); /* Start Boot-Code */ ret = icn_check_loader(card->doubleS0 ? 2 : 1); - if (ret) { + if (ret) goto out_kfree; - } if (!card->doubleS0) { ret = 0; goto out_kfree; @@ -1274,9 +1273,8 @@ icn_command(isdn_ctrl *c, icn_card *card) if (a) { if (!card->leased) { card->leased = 1; - while (card->ptype == ISDN_PTYPE_UNKNOWN) { + while (card->ptype == ISDN_PTYPE_UNKNOWN) msleep_interruptible(ICN_BOOT_TIMEOUT1); - } msleep_interruptible(ICN_BOOT_TIMEOUT1); sprintf(cbuf, "00;FV2ON\n01;EAZ%c\n02;EAZ%c\n", (a & 1) ? '1' : 'C', (a & 2) ? '2' : 'C'); @@ -1576,9 +1574,8 @@ icn_addcard(int port, char *id1, char *id2) icn_card *card2; card = icn_initcard(port, id1); - if (!card) { + if (!card) return -EIO; - } if (!strlen(id2)) { printk(KERN_INFO "icn: (%s) ICN-2B, port 0x%x added\n", -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: i4l: icn: donot assign in if statement
It is not the kernel coding style to make assignments in the if statement and checkpatch was warning us about it. Signed-off-by: Sudip Mukherjee --- drivers/staging/i4l/icn/icn.c | 33 ++--- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index c5dd572..c92f9cdf 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -62,7 +62,8 @@ icn_free_queue(icn_card *card, int channel) skb_queue_purge(queue); card->xlen[channel] = 0; card->sndcount[channel] = 0; - if ((skb = card->xskb[channel])) { + skb = card->xskb[channel]; + if (skb) { card->xskb[channel] = NULL; dev_kfree_skb(skb); } @@ -272,8 +273,10 @@ icn_pollbchan_receive(int channel, icn_card *card) rbnext; icn_maprelease_channel(card, mch & 2); if (!eflag) { - if ((cnt = card->rcvidx[channel])) { - if (!(skb = dev_alloc_skb(cnt))) { + cnt = card->rcvidx[channel]; + if (cnt) { + skb = dev_alloc_skb(cnt); + if (!skb) { printk(KERN_WARNING "icn: receive out of memory\n"); break; } @@ -807,7 +810,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card) #ifdef BOOT_DEBUG printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer); #endif - if (!(codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL))) { + codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL); + if (!codebuf) { printk(KERN_WARNING "icn: Could not allocate code buffer\n"); ret = -ENOMEM; goto out; @@ -878,7 +882,8 @@ icn_loadboot(u_char __user *buffer, icn_card *card) } SLEEP(1); OUTB_P(0xff, ICN_RUN); /* Start Boot-Code */ - if ((ret = icn_check_loader(card->doubleS0 ? 2 : 1))) { + ret = icn_check_loader(card->doubleS0 ? 2 : 1); + if (ret) { goto out_kfree; } if (!card->doubleS0) { @@ -1249,7 +1254,8 @@ icn_command(isdn_ctrl *c, icn_card *card) return icn_loadboot(arg, card); case ICN_IOCTL_LOADPROTO: icn_stopcard(card); - if ((i = (icn_loadproto(arg, card + i = (icn_loadproto(arg, card)); + if (i) return i; if (card->doubleS0) i = icn_loadproto(arg + ICN_CODE_STAGE2, card->other); @@ -1520,7 +1526,8 @@ icn_initcard(int port, char *id) icn_card *card; int i; - if (!(card = kzalloc(sizeof(icn_card), GFP_KERNEL))) { + card = kzalloc(sizeof(icn_card), GFP_KERNEL); + if (!card) { printk(KERN_WARNING "icn: (%s) Could not allocate card-struct.\n", id); return (icn_card *) 0; @@ -1568,7 +1575,8 @@ icn_addcard(int port, char *id1, char *id2) icn_card *card; icn_card *card2; - if (!(card = icn_initcard(port, id1))) { + card = icn_initcard(port, id1); + if (!card) { return -EIO; } if (!strlen(id2)) { @@ -1577,7 +1585,8 @@ icn_addcard(int port, char *id1, char *id2) card->interface.id, port); return 0; } - if (!(card2 = icn_initcard(port, id2))) { + card2 = icn_initcard(port, id2); + if (!card2) { printk(KERN_INFO "icn: (%s) half ICN-4B, port 0x%x added\n", id2, port); return 0; @@ -1611,7 +1620,8 @@ icn_setup(char *line) if (str && *str) { strlcpy(sid, str, sizeof(sid)); icn_id = sid; - if ((p = strchr(sid, ','))) { + p = strchr(sid, ','); + if (p) { *p++ = 0; strcpy(sid2, p); icn_id2 = sid2; @@ -1634,7 +1644,8 @@ static int __init icn_init(void) dev.firstload = 1; spin_lock_init(&dev.devlock); - if ((p = strchr(revision, ':'))) { + p = strchr(revision, ':'); + if (p) { strncpy(rev, p + 1, 20); rev[20] = '\0'; p = strchr(rev, '$'); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: i4l: icn: fix incorrect type of arguments
sparse was warning about incorrect type of argument: drivers/staging/i4l/icn/icn.c:1048:49: warning: incorrect type in argument 2 (different address spaces) drivers/staging/i4l/icn/icn.c:1048:49: expected void const [noderef] *from drivers/staging/i4l/icn/icn.c:1048:49: got unsigned char const [usertype] *buf drivers/staging/i4l/icn/icn.c:1476:38: warning: incorrect type in argument 1 (different address spaces) drivers/staging/i4l/icn/icn.c:1476:38: expected unsigned char const [usertype] *buf drivers/staging/i4l/icn/icn.c:1476:38: got unsigned char const [noderef] [usertype] *buf The function icn_writecmd() was used to copy from userspace and also from the kernelspace. Add another argument to the function to have two separate pointers, one for the userspace and one for the kernelspace. Based on the value of user as passed from the caller we use one of the two pointers. Signed-off-by: Sudip Mukherjee --- drivers/staging/i4l/icn/icn.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index 6991259..5e3821b 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -1023,7 +1023,8 @@ icn_readstatus(u_char __user *buf, int len, icn_card *card) /* Put command-strings into the command-queue of the Interface */ static int -icn_writecmd(const u_char *buf, int len, int user, icn_card *card) +icn_writecmd(const u_char __user *ubuf, const u_char *kbuf, int len, +int user, icn_card *card) { int mch = card->secondhalf ? 2 : 0; int pp; @@ -1046,10 +1047,10 @@ icn_writecmd(const u_char *buf, int len, int user, icn_card *card) if (count > len) count = len; if (user) { - if (copy_from_user(msg, buf, count)) + if (copy_from_user(msg, ubuf, count)) return -EFAULT; } else - memcpy(msg, buf, count); + memcpy(msg, kbuf, count); spin_lock_irqsave(&dev.devlock, flags); lastmap_card = dev.mcard; @@ -1275,7 +1276,9 @@ icn_command(isdn_ctrl *c, icn_card *card) msleep_interruptible(ICN_BOOT_TIMEOUT1); sprintf(cbuf, "00;FV2ON\n01;EAZ%c\n02;EAZ%c\n", (a & 1) ? '1' : 'C', (a & 2) ? '2' : 'C'); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, +strlen(cbuf), +0, card); printk(KERN_INFO "icn: (%s) Leased-line mode enabled\n", CID); @@ -1288,7 +1291,9 @@ icn_command(isdn_ctrl *c, icn_card *card) if (card->leased) { card->leased = 0; sprintf(cbuf, "00;FV2OFF\n"); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, +strlen(cbuf), +0, card); printk(KERN_INFO "icn: (%s) Leased-line mode disabled\n", CID); @@ -1325,7 +1330,7 @@ icn_command(isdn_ctrl *c, icn_card *card) "%02d;D%s_R%s,%02d,%02d,%s\n", (int)(a + 1), dcode, p, c->parm.setup.si1, c->parm.setup.si2, c->parm.setup.eazmsn); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, strlen(cbuf), 0, card); } break; case ISDN_CMD_ACCEPTD: @@ -1342,10 +1347,12 @@ icn_command(isdn_ctrl *c, icn_card *card) sprintf(cbuf, "%02d;BTRA\n", (int)a); break; } - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, +strlen(cbuf), 0, +card); } sprintf(cbuf, "%02d;DCON_R\n", (int)a); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, strlen(cbuf), 0, card);
[PATCH 5/6] staging: i4l: icn: remove blank lines
Blank lines are not needed after starting brace or before a closing brace. Signed-off-by: Sudip Mukherjee --- drivers/staging/i4l/icn/icn.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index ff0fb6c6..6991259 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -82,7 +82,6 @@ icn_shiftout(unsigned short port, int firstbit, int bitcount) { - register u_char s; register u_char c; @@ -475,7 +474,6 @@ icn_parse_status(u_char *status, int channel, icn_card *card) if (card->flags & ((channel) ? ICN_FLAGS_B2ACTIVE : ICN_FLAGS_B1ACTIVE)) { - isdn_ctrl ncmd; card->flags &= ~((channel) ? @@ -661,7 +659,6 @@ icn_polldchan(unsigned long data) vstr[3] = '\0'; card->fw_rev = (int)simple_strtoul(vstr, NULL, 10); continue; - } } } else { -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] staging: i4l: icn: space not needed after cast
No need provide a space after a typecast. Signed-off-by: Sudip Mukherjee --- drivers/staging/i4l/icn/icn.c | 70 +-- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index c92f9cdf..abc6599 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -87,7 +87,7 @@ icn_shiftout(unsigned short port, register u_char c; for (s = firstbit, c = bitcount; c > 0; s--, c--) - OUTB_P((u_char) ((val >> s) & 1) ? 0xff : 0, port); + OUTB_P((u_char)((val >> s) & 1) ? 0xff : 0, port); } /* @@ -385,7 +385,7 @@ icn_pollbchan_send(int channel, icn_card *card) static void icn_pollbchan(unsigned long data) { - icn_card *card = (icn_card *) data; + icn_card *card = (icn_card *)data; unsigned long flags; if (card->flags & ICN_FLAGS_B1ACTIVE) { @@ -547,7 +547,7 @@ icn_parse_status(u_char *status, int channel, icn_card *card) break; case 6: snprintf(cmd.parm.num, sizeof(cmd.parm.num), "%d", -(int) simple_strtoul(status + 7, NULL, 16)); +(int)simple_strtoul(status + 7, NULL, 16)); break; case 7: status += 3; @@ -607,7 +607,7 @@ icn_putmsg(icn_card *card, unsigned char c) static void icn_polldchan(unsigned long data) { - icn_card *card = (icn_card *) data; + icn_card *card = (icn_card *)data; int mch = card->secondhalf ? 2 : 0; int avail = 0; int left; @@ -659,7 +659,7 @@ icn_polldchan(unsigned long data) *q = '\0'; strcat(vstr, "000"); vstr[3] = '\0'; - card->fw_rev = (int) simple_strtoul(vstr, NULL, 10); + card->fw_rev = (int)simple_strtoul(vstr, NULL, 10); continue; } @@ -686,7 +686,7 @@ icn_polldchan(unsigned long data) card->flags |= ICN_FLAGS_RBTIMER; del_timer(&card->rb_timer); card->rb_timer.function = icn_pollbchan; - card->rb_timer.data = (unsigned long) card; + card->rb_timer.data = (unsigned long)card; card->rb_timer.expires = jiffies + ICN_TIMER_BCREAD; add_timer(&card->rb_timer); } @@ -808,7 +808,7 @@ icn_loadboot(u_char __user *buffer, icn_card *card) unsigned long flags; #ifdef BOOT_DEBUG - printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong) buffer); + printk(KERN_DEBUG "icn_loadboot called, buffaddr=%08lx\n", (ulong)buffer); #endif codebuf = kmalloc(ICN_CODE_STAGE1, GFP_KERNEL); if (!codebuf) { @@ -988,14 +988,14 @@ icn_loadproto(u_char __user *buffer, icn_card *card) init_timer(&card->st_timer); card->st_timer.expires = jiffies + ICN_TIMER_DCREAD; card->st_timer.function = icn_polldchan; - card->st_timer.data = (unsigned long) card; + card->st_timer.data = (unsigned long)card; add_timer(&card->st_timer); card->flags |= ICN_FLAGS_RUNNING; if (card->doubleS0) { init_timer(&card->other->st_timer); card->other->st_timer.expires = jiffies + ICN_TIMER_DCREAD; card->other->st_timer.function = icn_polldchan; - card->other->st_timer.data = (unsigned long) card->other; + card->other->st_timer.data = (unsigned long)card->other; add_timer(&card->other->st_timer); card->other->flags |= ICN_FLAGS_RUNNING; } @@ -1195,28 +1195,28 @@ icn_command(isdn_ctrl *c, icn_card *card) } break; case ICN_IOCTL_GETMMIO: - return (long) dev.memaddr; + return (long)dev.memaddr; case ICN_IOCTL_SETPORT: if (a == 0x300 || a == 0x310 || a == 0x320 || a == 0x330 || a == 0x340 || a == 0x350 || a == 0x360 || a == 0x308 || a == 0x318 || a == 0x328 || a == 0x338 || a == 0x348 || a == 0x358 || a == 0x368) { -
[PATCH 6/6 v2] staging: i4l: icn: fix incorrect type of arguments
sparse was warning about incorrect type of argument: drivers/staging/i4l/icn/icn.c:1048:49: warning: incorrect type in argument 2 (different address spaces) drivers/staging/i4l/icn/icn.c:1048:49: expected void const [noderef] *from drivers/staging/i4l/icn/icn.c:1048:49: got unsigned char const [usertype] *buf drivers/staging/i4l/icn/icn.c:1476:38: warning: incorrect type in argument 1 (different address spaces) drivers/staging/i4l/icn/icn.c:1476:38: expected unsigned char const [usertype] *buf drivers/staging/i4l/icn/icn.c:1476:38: got unsigned char const [noderef] [usertype] *buf The function icn_writecmd() was used to copy from userspace and also from the kernelspace. Add another argument to the function to have two separate pointers, one for the userspace and one for the kernelspace. Based on the value of user as passed from the caller we use one of the two pointers. Signed-off-by: Sudip Mukherjee --- Wrong Signed-off in v1. drivers/staging/i4l/icn/icn.c | 35 +-- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/drivers/staging/i4l/icn/icn.c b/drivers/staging/i4l/icn/icn.c index 6991259..5e3821b 100644 --- a/drivers/staging/i4l/icn/icn.c +++ b/drivers/staging/i4l/icn/icn.c @@ -1023,7 +1023,8 @@ icn_readstatus(u_char __user *buf, int len, icn_card *card) /* Put command-strings into the command-queue of the Interface */ static int -icn_writecmd(const u_char *buf, int len, int user, icn_card *card) +icn_writecmd(const u_char __user *ubuf, const u_char *kbuf, int len, +int user, icn_card *card) { int mch = card->secondhalf ? 2 : 0; int pp; @@ -1046,10 +1047,10 @@ icn_writecmd(const u_char *buf, int len, int user, icn_card *card) if (count > len) count = len; if (user) { - if (copy_from_user(msg, buf, count)) + if (copy_from_user(msg, ubuf, count)) return -EFAULT; } else - memcpy(msg, buf, count); + memcpy(msg, kbuf, count); spin_lock_irqsave(&dev.devlock, flags); lastmap_card = dev.mcard; @@ -1275,7 +1276,9 @@ icn_command(isdn_ctrl *c, icn_card *card) msleep_interruptible(ICN_BOOT_TIMEOUT1); sprintf(cbuf, "00;FV2ON\n01;EAZ%c\n02;EAZ%c\n", (a & 1) ? '1' : 'C', (a & 2) ? '2' : 'C'); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, +strlen(cbuf), +0, card); printk(KERN_INFO "icn: (%s) Leased-line mode enabled\n", CID); @@ -1288,7 +1291,9 @@ icn_command(isdn_ctrl *c, icn_card *card) if (card->leased) { card->leased = 0; sprintf(cbuf, "00;FV2OFF\n"); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, +strlen(cbuf), +0, card); printk(KERN_INFO "icn: (%s) Leased-line mode disabled\n", CID); @@ -1325,7 +1330,7 @@ icn_command(isdn_ctrl *c, icn_card *card) "%02d;D%s_R%s,%02d,%02d,%s\n", (int)(a + 1), dcode, p, c->parm.setup.si1, c->parm.setup.si2, c->parm.setup.eazmsn); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, strlen(cbuf), 0, card); } break; case ISDN_CMD_ACCEPTD: @@ -1342,10 +1347,12 @@ icn_command(isdn_ctrl *c, icn_card *card) sprintf(cbuf, "%02d;BTRA\n", (int)a); break; } - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, +strlen(cbuf), 0, +card); } sprintf(cbuf, "%02d;DCON_R\n", (int)a); - i = icn_writecmd(cbuf, strlen(cbuf), 0, card); + i = icn_writecmd(NULL, cbuf, strlen
Allegacy Federal Credit Union
From Allegacy Federal Credit Union Bank Address: 700 Highland Oaks Drive Winston-Salem, North Carolina 27103 Phone number: +13057202822 Hours: 8:30 am – 5:00 pm May 04 2016 Beneficiary: This bank received your mail sent to our payment center concerning the payment order of $4,500,000.00 received in your name on your behalf to be paid to you by our bank which has been approved in your favor, Thanks for your mail sent to us with your personal details and we acknowledge the receipt of payment instructions received on your behalf from the aforementioned offices and person as your name is on the list of people we have been mandated to credit with their outstanding funds valued for the sum of $USD4,500,00 only. First, we would like to inform you that we are not just BANK rather an integrated financial clearing / offshore payment scheme. Our duty includes repurchasing and liquidation of bank drafts / checks and escrow bank account management and resolving of long time funds claim problem within the United States and outside the Country at low cost. USAA Federal Saving Bank have been given order to coordinates the remittance sum of US$4,500,000.00 (Four Million Five Hundred Thousand US Dollars only) to your bank account through their offshore escrow bank account with this reputable bank located here in the United States. We also received an Irrevocable Foreign Exchange Approval Order from the the mentioned offices through the fiscal revenue implications of the prospective economic partnership agreement / policy with our commission on debt liquidation statistics for remittance of the above sum to you without any delay or bottlenecks as your transfer with us has already been approved on your behalf and this reliable bank with five star standard services will effectively complete your total funds credit to your bank account of your choice as soon as you meet up with the international and local crediting requirement inline with the International and Local Banking Laws. At this juncture, we urge you to fill out in capital letters the attached Wire Transfer Processing Form below and return the information,s along with a copy of your valid photo identification id for identification purpose; preferably driver’s license or passport to enable us commence the payment implementation processes, such as evaluation, appraisal, certification and validation exercise prior to remittance of your fund to your personal bank account as approved. Beneficiary First Name:.. . Last Name: .. .. Home Address: .. Country: Your City: .. . Your Home/ Cell Phone No: .. ... Your Occupation:.Company Name if Any. ..Annual Income: .. Furnish your bank details as requested below. Bank Name: .A/C NO: ...Account Name:... Routing Code: .Account Balance: Bank Address: ……….. Bank Tel: . Fax: Your Valid Id for identification purpose: Marital Status: . . Religion: . .. Thanks and if you have questions, we encourage you to email us immediately as we operate 24/7 online banking services to our local and international customers/clients. I, ,. . Hereby attest that the information given above is correct and is given in good faith. As soon as this details is received your transactions at our bank will be processed without any delay. Thanks and if you have questions, You are encouraged to email us as this operates 24/7 online banking services to our local and international customers. Respectfully in Services, MR. Brown Bank name: Allegacy Federal Credit Union Phone number: +13057202822 Email: onlineallegacyfederalcreditun...@citromail.hu ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel