Re: [PATCH] drivers: staging: rtl8192u: Fix "space required before the open parenthesis '('" errors
On Mon, Jun 22, 2015 at 06:25:11AM -0500, Greg Donald wrote: > Umm.. you have to fix more than one error if there's more than one > error on or very near the same line you are already fixing, else > checkpatch.pl complains that your patch has errors. Not to mention > Greg KH has never complained: > > http://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/log/?qt=grep&q=gdonald > Actually, Greg complains about these all the time. And here is a useless URL that you can look at: http://slashdot.org I'm sure it supports my argument. But seriously, he does complain about these. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging patch not in staging tree (was: Re: [PATCH 1/2] staging: ft1000-usb: fixed table alignment)
On Tue, Jun 23, 2015 at 11:03:34AM +0530, Sudip Mukherjee wrote: > On Mon, Jun 22, 2015 at 07:06:49PM +0530, Sudip Mukherjee wrote: > > On Mon, Jun 22, 2015 at 03:02:37PM +0200, Peter Karlsson wrote: > > > On 2015-06-22 06:29, Sudip Mukherjee wrote: > > > > which tree have you been using? > > > > Greg will have three staging tree, use staging-testing > > > > > > I have used linux-next tree :/ > > well, I am now confused why linux-next is not having this struct. > > at line 415 of drivers/staging/ft1000/ft1000-usb/ft1000_debug.c > > struct timeval tv; is there in staging-next. And today's linux-next > > has merged staging-next. Then how that struct timeval is not there in > > linux-next ? > > I was doing a bisect to see why the files are differing in staging-next > and linux-next. And it turns out to be: > 8b37bf430656 ("staging: ft1000: Replace timeval and time_t with time64_t") > > which didn't go through the staging tree. > It's going through Arnd's tree since he does time stuff. He should have sent it for an Ack or something. Maybe he is planning to do that later. The patch is very old. Not a big deal? regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: staging patch not in staging tree (was: Re: [PATCH 1/2] staging: ft1000-usb: fixed table alignment)
On Tue, Jun 23, 2015 at 11:05:47AM +0300, Dan Carpenter wrote: > On Tue, Jun 23, 2015 at 11:03:34AM +0530, Sudip Mukherjee wrote: > > On Mon, Jun 22, 2015 at 07:06:49PM +0530, Sudip Mukherjee wrote: > > > On Mon, Jun 22, 2015 at 03:02:37PM +0200, Peter Karlsson wrote: > > > > On 2015-06-22 06:29, Sudip Mukherjee wrote: > > > > > which tree have you been using? > > > > > Greg will have three staging tree, use staging-testing > > > > > > > > I have used linux-next tree :/ > > > well, I am now confused why linux-next is not having this struct. > > > at line 415 of drivers/staging/ft1000/ft1000-usb/ft1000_debug.c > > > struct timeval tv; is there in staging-next. And today's linux-next > > > has merged staging-next. Then how that struct timeval is not there in > > > linux-next ? > > > > I was doing a bisect to see why the files are differing in staging-next > > and linux-next. And it turns out to be: > > 8b37bf430656 ("staging: ft1000: Replace timeval and time_t with time64_t") > > > > which didn't go through the staging tree. > > > > It's going through Arnd's tree since he does time stuff. He should have > sent it for an Ack or something. Maybe he is planning to do that later. > > The patch is very old. > > Not a big deal? there was no patch in ft1000 so its not a big deal. But will it not be merge conflict when Linus tries to merge staging tree and Arnd's tree? regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 04/10] Drivers: hv: vmbus: add special kexec handler
On Thu, Jun 04, K. Y. Srinivasan wrote: > +++ b/arch/x86/kernel/cpu/mshyperv.c > @@ -18,6 +18,9 @@ > #include > #include > #include > +#ifdef CONFIG_KEXEC > +#include > +#endif Is this #ifdef required? Olaf ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
On 2015/06/20, 10:58 AM, "Julia Lawall" wrote: >!x is more normal for kzalloc failure in the kernel. While "!x" might be more normal for kzalloc(), I don't see that as an improvement over explicitly checking against NULL, which is what kzalloc() and other memory-allocating functions return on error. I've found in the past that developers can introduce bugs when they treat return values as boolean when they really aren't. I'd prefer that the code is kept with explicit comparisons against NULL, as it is today. Most of the cases that are now using "!x" are from your previous patches. Cheers, Andreas >Signed-off-by: Julia Lawall > >--- > drivers/staging/lustre/lustre/fid/fid_request.c |4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff -u -p a/drivers/staging/lustre/lustre/fid/fid_request.c >b/drivers/staging/lustre/lustre/fid/fid_request.c >--- a/drivers/staging/lustre/lustre/fid/fid_request.c >+++ b/drivers/staging/lustre/lustre/fid/fid_request.c >@@ -498,11 +498,11 @@ int client_fid_init(struct obd_device *o > int rc; > > cli->cl_seq = kzalloc(sizeof(*cli->cl_seq), GFP_NOFS); >- if (cli->cl_seq == NULL) >+ if (!cli->cl_seq) > return -ENOMEM; > > prefix = kzalloc(MAX_OBD_NAME + 5, GFP_NOFS); >- if (prefix == NULL) { >+ if (!prefix) { > rc = -ENOMEM; > goto out_free_seq; > } > > Cheers, Andreas -- Andreas Dilger Lustre Software Architect Intel High Performance Data Division ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: lustre: LIBCFS_ALLOC
On Jun 23, 2015, at 2:23 AM, Julia Lawall wrote: > It seems that libcfs_kvzalloc doesn't use any particular threshold or > switchingbetween kzalloc and vmalloc, so can be replaced by ths function > too? If you mean to replace all instances of LIBCFS_ALLOC with libcfs_kvzalloc (and all frees with kvfree) then yes, that could be done I think. Bye, Oleg ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: sm750fb: fix typo in debug statement
On Mon, Jun 22, 2015 at 04:48:01AM +, Gujulan Elango, Hari Prasath (H.) wrote: > From: Hari Prasath Gujulan Elango > > This patch fixes a typo in the debug statement > > Signed-off-by: Hari Prasath Gujulan Elango > --- Fold these together. It's a one line change to the same line... regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: remove unused variables
On Mon, Jun 22, 2015 at 07:26:25AM +, Gujulan Elango, Hari Prasath (H.) wrote: > @@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency) > * Sometime, the chip cannot set up the exact clock required by > User. > * Return value from calcPllValue() gives the actual possible > clock. > */ > - ulActualMxClk = calcPllValue(frequency, &pll); > + calcPllValue(frequency, &pll); Should we get rid of calcPllValue() as well? I guess I would prefer to leave the warnings until someone has the answer to this. Warnings are good because they show where the bugs are. It's not always the right thing to silence them. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 07/10] staging: wilc1000: remove ununsed variable
On Mon, Jun 22, 2015 at 01:13:58PM +, Gujulan Elango, Hari Prasath (H.) wrote: > From: Hari Prasath Gujulan Elango > > This patch removes ununsed variable 'len' > > Signed-off-by: Hari Prasath Gujulan Elango This doesn't work because it's not in the same thread as the original email. You need to use the --in-reply-to option or Greg will not be able to find it. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 6/8] Staging: sm750fb: ddk750_sii164.c: Place braces on previous lines
On Sat, Jun 20, 2015 at 12:54:02PM +0530, Sudip Mukherjee wrote: > On Fri, Jun 19, 2015 at 12:48:19PM -0700, Isaac Assegai wrote: > > Place braces on previous lines in ddk750_sii164.c to > > rectify the following checkpatch errors: > > ERROR: that open brace { should be on the previous line > > > > Signed-off-by: Isaac Assegai > > --- > > drivers/staging/sm750fb/ddk750_sii164.c | 16 +--- > > 1 file changed, 5 insertions(+), 11 deletions(-) > > > > diff --git a/drivers/staging/sm750fb/ddk750_sii164.c > > b/drivers/staging/sm750fb/ddk750_sii164.c > > index 7f58fbe..64d4291 100644 > > --- a/drivers/staging/sm750fb/ddk750_sii164.c > > +++ b/drivers/staging/sm750fb/ddk750_sii164.c > > @@ -136,8 +136,7 @@ long sii164InitChip( > > #endif > > > > /* Check if SII164 Chip exists */ > > - if ((sii164GetVendorID() == SII164_VENDOR_ID) && (sii164GetDeviceID() > > == SII164_DEVICE_ID)) > > - { > > + if ((sii164GetVendorID() == SII164_VENDOR_ID) && (sii164GetDeviceID() > > == SII164_DEVICE_ID) { > > > you have not build tested it :( > In function ‘sii164InitChip’: > error: expected ‘)’ before ‘{’ token > I never get Isaac's emails. I think gmail is still sending them to the Spam folder? I searched my spam folder and don't see them though... regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
On Tue, Jun 23, 2015 at 08:25:05AM +, Dilger, Andreas wrote: > I've found in the past that developers can introduce bugs when they treat > return values as boolean when they really aren't. I can imagine a bug like that where a function can return 0-2 and people do: if (ret) instead of: if (ret == 1) but that bug is something else besides pointers so it doesn't apply here. What someone should do is try to measure it scientifically where we flash some code on the screen and you have to press J for NULL and K for non-NULL and we time it to the hundredth of a second. I have a feeling that (NULL != foo) is the worst way to write it because of the double negative Yoda code. Yoda code is the most useless thing ever. I have actually measured this and we introduce about 2 = vs == bugs per year. It's probably less now that we have so many static checks against it. But people decided that Yoda code was a good idea based on their gut instead of using statistics and measurements and science. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
On Tue, 23 Jun 2015, Dan Carpenter wrote: > On Tue, Jun 23, 2015 at 08:25:05AM +, Dilger, Andreas wrote: > > I've found in the past that developers can introduce bugs when they treat > > return values as boolean when they really aren't. > > I can imagine a bug like that where a function can return 0-2 and people > do: > > if (ret) > > instead of: > > if (ret == 1) > > but that bug is something else besides pointers so it doesn't apply > here. > > What someone should do is try to measure it scientifically where we > flash some code on the screen and you have to press J for NULL and K for > non-NULL and we time it to the hundredth of a second. I have a feeling > that (NULL != foo) is the worst way to write it because of the double > negative Yoda code. > > Yoda code is the most useless thing ever. I have actually measured this > and we introduce about 2 = vs == bugs per year. It's probably less now > that we have so many static checks against it. But people decided that > Yoda code was a good idea based on their gut instead of using statistics > and measurements and science. In 2007, Al Viro said (https://lkml.org/lkml/2007/7/27/103): Idiomatic form for "has allocation succeeded?" is neither "if (p != 0)" nor "if (p != NULL)". It's simply "if (p)". >From the point of view of looking at kernel code, x == NULL for the result of kmalloc etc looks verbose and distracting. julia ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 6/8] Staging: sm750fb: ddk750_sii164.c: Place braces on previous lines
On Tue, Jun 23, 2015 at 11:55:48AM +0300, Dan Carpenter wrote: > On Sat, Jun 20, 2015 at 12:54:02PM +0530, Sudip Mukherjee wrote: > > On Fri, Jun 19, 2015 at 12:48:19PM -0700, Isaac Assegai wrote: > > I never get Isaac's emails. I think gmail is still sending them to the > Spam folder? I searched my spam folder and don't see them though... maybe you need to create filters. I have filters and sometimes for some mails I will get "this was not sent to spam because of a filter you created" regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
Yes. I know Al's thoughts and kernel style. But Alan Cox and Andreas have both said they think (x == NULL) can help you avoid some kind of boolean vs pointer bugs. I've had co-workers who did massive seds changing !foo to foo == NULL on our code base. But I've never seen a real life example of a bug this fixes. To be honest, I've never seen a real life proof that (!foo) code is less buggy. I should look through the kbuild mailbox... Hm... But my other idea of setting up code style readability testing website is also a good one. Linux kernel style is based on Joe Perches finding that 80% of the code prefers one way or the other. That's a valid method for determining code style. I bet it normally picks the more readable style but it would be interesting to measure it more formally. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: remove unused variables
On Tue, Jun 23, 2015 at 11:46:13AM +0300, Dan Carpenter wrote: > On Mon, Jun 22, 2015 at 07:26:25AM +, Gujulan Elango, Hari Prasath (H.) > wrote: > > @@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency) > > * Sometime, the chip cannot set up the exact clock required by > > User. > > * Return value from calcPllValue() gives the actual possible > > clock. > > */ > > - ulActualMxClk = calcPllValue(frequency, &pll); > > + calcPllValue(frequency, &pll); > > Should we get rid of calcPllValue() as well? I guess I would prefer to > leave the warnings until someone has the answer to this. > > Warnings are good because they show where the bugs are. It's not always > the right thing to silence them. I think it should be kept, atleast for now. some members of pll are modified in the function. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments
On Sunday 21 June 2015 19:12:09 Gaston Gonzalez wrote: > /* WMM spec P.11: The minimum value for AIFSN shall be 2 */ > qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? > 2:qos_param->aifs[aci]; > > - qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F; > + qos_param->cw_min[aci] = > + cpu_to_le16(ac_params->ecw_min_max & 0x0F); > > - qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 4; > + qos_param->cw_max[aci] = > + cpu_to_le16((ac_params->ecw_min_max & 0xF0) >> 4); > > qos_param->flag[aci] = > (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00; > - qos_param->tx_op_limit[aci] = > le16_to_cpu(ac_params->tx_op_limit); > + qos_param->tx_op_limit[aci] = ac_params->tx_op_limit; > } > return 0; This certainly needs a more thorough description of how you determined that the byte swaps that you add are in fact required. Did you test it on a big-endian machine? Arnd ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
On Tue, 23 Jun 2015, Dan Carpenter wrote: > Yes. I know Al's thoughts and kernel style. > > But Alan Cox and Andreas have both said they think (x == NULL) can help > you avoid some kind of boolean vs pointer bugs. I've had co-workers who > did massive seds changing !foo to foo == NULL on our code base. But > I've never seen a real life example of a bug this fixes. > > To be honest, I've never seen a real life proof that (!foo) code is less > buggy. I should look through the kbuild mailbox... Hm... But my other > idea of setting up code style readability testing website is also a good > one. > > Linux kernel style is based on Joe Perches finding that 80% of the code > prefers one way or the other. That's a valid method for determining > code style. I bet it normally picks the more readable style but it > would be interesting to measure it more formally. On today's linux-next, I find 3218 tests on the result of kmalloc etc using NULL and 14429 without, making 82% without. The complete semantic patch is shown below. julia @initialize:ocaml@ @@ let withnull = ref 0 let withoutnull = ref 0 @r1 disable is_null, isnt_null1 exists@ expression x,e; position p; statement S1,S2; @@ x = \(kmalloc\|kzalloc\|kcalloc\|devm_kmalloc\|devm_kzalloc\)(...) ... when != x = e when != &x if@p (<+...\(x == NULL\|x != NULL\|NULL == x\|NULL != x\)...+>) S1 else S2 @r2 disable not_ptr1, not_ptr2 exists@ expression x,e; position p; statement S1,S2; @@ x = \(kmalloc\|kzalloc\|kcalloc\|devm_kmalloc\|devm_kzalloc\)(...) ... when != x = e when != &x if@p (<+...\(!x\|x && ...\|x || ...\)...+>) S1 else S2 @script:ocaml@ _p << r1.p; @@ withnull := !withnull + 1 @script:ocaml@ _p << r2.p; @@ withoutnull := !withoutnull + 1 @finalize:ocaml@ @@ Printf.printf "withnull %d withoutnull %d\n" !withnull !withoutnull ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/4] staging: wilc1000: wilc_wfi_netdevice.c: remove commented codes
On Tue, Jun 23, 2015 at 09:17:44AM +0900, Chaehyun Lim wrote: > Remove commented codes. > > Signed-off-by: Chaehyun Lim > --- > drivers/staging/wilc1000/wilc_wfi_netdevice.c | 21 - > 1 file changed, 21 deletions(-) > > diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.c > b/drivers/staging/wilc1000/wilc_wfi_netdevice.c > index 170ca65..478cd2b 100644 > --- a/drivers/staging/wilc1000/wilc_wfi_netdevice.c > +++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.c > @@ -931,10 +914,6 @@ int WILC_WFI_InitModule(void) > > WILC_memset(priv[0]->au8AssociatedBss, 0xFF, ETH_ALEN); > > - > - /* ret = host_int_init(&priv[0]->hWILCWFIDrv); */ > - /*copy handle to the other driver*/ > - /* priv[1]->hWILCWFIDrv = priv[0]->hWILCWFIDrv; */ > if (ret) > PRINT_ER("Error Init Driver\n"); This is not applying. My file is having here: if (ret) { PRINT_ER("Error Init Driver\n"); } is this patch dependent on some prior patch which is not yet applied to staging? regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: sm750fb: convert pr_err to pr_info
On Monday 22 June 2015 08:46 PM, Dan Carpenter wrote: > On Thu, Jun 18, 2015 at 12:56:54PM +, Gujulan Elango, Hari Prasath (H.) > wrote: >> From: Hari Prasath Gujulan Elango >> >> This patch modifies few debug prints from pr_err() to pr_info() as they >> fall under that category. >> > > They should be dbg or removed. > > regards, > dan carpenter > > Thanks Dan.I shall send a v2 addressing the same. -- thanks & regards, Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: dgnc: free memory allocated
On Monday 22 June 2015 10:45 PM, Dan Carpenter wrote: > You should have CC'd Mark on these. Use ./scripts/get_maintainer.pl > > regards, > dan carpenter > Thanks Dan.I did use the get_maintainer.pl as I do always. I missed Marks email ID. It was my mistake.Thanks for adding him.Greg has already added this patch.I will ensure not to miss him next time. > On Thu, Jun 18, 2015 at 01:27:28PM +, Gujulan Elango, Hari Prasath (H.) > wrote: >> From: Hari Prasath Gujulan Elango >> >> The memory allocated in dgnc_tty_register() for two objects is not freed >> anywhere.This patch addresses this by freeing the memory in >> dgnc_tty_uninit. >> >> Signed-off-by: Hari Prasath Gujulan Elango >> --- >> drivers/staging/dgnc/dgnc_tty.c | 4 >> 1 file changed, 4 insertions(+) >> >> diff --git a/drivers/staging/dgnc/dgnc_tty.c >> b/drivers/staging/dgnc/dgnc_tty.c >> index 5c5c4b7..fbfe79a 100644 >> --- a/drivers/staging/dgnc/dgnc_tty.c >> +++ b/drivers/staging/dgnc/dgnc_tty.c >> @@ -422,8 +422,12 @@ void dgnc_tty_uninit(struct dgnc_board *brd) >> >> kfree(brd->SerialDriver.ttys); >> brd->SerialDriver.ttys = NULL; >> +kfree(brd->SerialDriver.termios); >> +brd->SerialDriver.termios = NULL; >> kfree(brd->PrintDriver.ttys); >> brd->PrintDriver.ttys = NULL; >> +kfree(brd->PrintDriver.termios); >> +brd->PrintDriver.termios = NULL; >> } >> >> /*=== >> -- >> 1.9.1 >> ___ >> devel mailing list >> de...@linuxdriverproject.org >> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel > -- thanks & regards, Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/9] staging: vme_user: allow large read()/write()
This changes large master transfers to do shorter read/write rather than return -EINVAL. User space will now be able to optimistically request a large transfer and get at least some data. This also removes comments suggesting on how to implement large transfers. Current vme_master_* read and write implementations use CPU copies that don't produce burst PCI accesses and subsequently no block transfer on VME bus. In the end overall performance is quiet low and it can't be fixed by doing direct copy to user space. Much easier solution would be to just reuse kernel buffer. Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 67 -- 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index db5f890..52cd638 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -132,63 +132,44 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, ssize_t retval; ssize_t copied = 0; - if (count <= image[minor].size_buf) { - /* We copy to kernel buffer */ - copied = vme_master_read(image[minor].resource, - image[minor].kern_buf, count, *ppos); - if (copied < 0) - return (int)copied; - - retval = __copy_to_user(buf, image[minor].kern_buf, - (unsigned long)copied); - if (retval != 0) { - copied = (copied - retval); - pr_info("User copy failed\n"); - return -EINVAL; - } + if (count > image[minor].size_buf) + count = image[minor].size_buf; - } else { - /* XXX Need to write this */ - pr_info("Currently don't support large transfers\n"); - /* Map in pages from userspace */ + /* We copy to kernel buffer */ + copied = vme_master_read(image[minor].resource, image[minor].kern_buf, +count, *ppos); + if (copied < 0) + return (int)copied; - /* Call vme_master_read to do the transfer */ + retval = __copy_to_user(buf, image[minor].kern_buf, + (unsigned long)copied); + if (retval != 0) { + copied = (copied - retval); + pr_info("User copy failed\n"); return -EINVAL; } return copied; } -/* - * We are going to alloc a page during init per window for small transfers. - * Small transfers will go user space -> buffer -> VME. Larger (more than a - * page) transfers will lock the user space buffer into memory and then - * transfer the data directly from the user space buffers out to VME. - */ static ssize_t resource_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { ssize_t retval; ssize_t copied = 0; - if (count <= image[minor].size_buf) { - retval = __copy_from_user(image[minor].kern_buf, buf, - (unsigned long)count); - if (retval != 0) - copied = (copied - retval); - else - copied = count; - - copied = vme_master_write(image[minor].resource, - image[minor].kern_buf, copied, *ppos); - } else { - /* XXX Need to write this */ - pr_info("Currently don't support large transfers\n"); - /* Map in pages from userspace */ - - /* Call vme_master_write to do the transfer */ - return -EINVAL; - } + if (count > image[minor].size_buf) + count = image[minor].size_buf; + + retval = __copy_from_user(image[minor].kern_buf, buf, + (unsigned long)count); + if (retval != 0) + copied = (copied - retval); + else + copied = count; + + copied = vme_master_write(image[minor].resource, image[minor].kern_buf, + copied, *ppos); return copied; } -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 4/9] staging: vme_user: fix kmalloc style
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index b6d81e5..db5f890 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -526,7 +526,7 @@ static int vme_user_master_mmap(unsigned int minor, struct vm_area_struct *vma) return err; } - vma_priv = kmalloc(sizeof(struct vme_user_vma_priv), GFP_KERNEL); + vma_priv = kmalloc(sizeof(*vma_priv), GFP_KERNEL); if (!vma_priv) { mutex_unlock(&image[minor].mutex); return -ENOMEM; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/9] staging: vme_user: fix code alignment
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 5ff44fb..285e00e 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -128,7 +128,7 @@ struct vme_user_vma_priv { * transfer the data directly into the user space buffers. */ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, - loff_t *ppos) + loff_t *ppos) { ssize_t retval; ssize_t copied = 0; @@ -167,7 +167,7 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, * transfer the data directly from the user space buffers out to VME. */ static ssize_t resource_from_user(unsigned int minor, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { ssize_t retval; ssize_t copied = 0; @@ -195,7 +195,7 @@ static ssize_t resource_from_user(unsigned int minor, const char __user *buf, } static ssize_t buffer_to_user(unsigned int minor, char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { void *image_ptr; ssize_t retval; @@ -214,7 +214,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf, } static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { void *image_ptr; size_t retval; @@ -233,7 +233,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, } static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, - loff_t *ppos) +loff_t *ppos) { unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; @@ -279,7 +279,7 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, } static ssize_t vme_user_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; @@ -354,7 +354,7 @@ static loff_t vme_user_llseek(struct file *file, loff_t off, int whence) * already been defined. */ static int vme_user_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) + unsigned int cmd, unsigned long arg) { struct vme_master master; struct vme_slave slave; @@ -390,12 +390,13 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, * to userspace as they are */ retval = vme_master_get(image[minor].resource, - &master.enable, &master.vme_addr, - &master.size, &master.aspace, - &master.cycle, &master.dwidth); + &master.enable, + &master.vme_addr, + &master.size, &master.aspace, + &master.cycle, &master.dwidth); copied = copy_to_user(argp, &master, - sizeof(struct vme_master)); + sizeof(struct vme_master)); if (copied != 0) { pr_warn("Partial copy to userspace\n"); return -EFAULT; @@ -435,12 +436,12 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, * to userspace as they are */ retval = vme_slave_get(image[minor].resource, - &slave.enable, &slave.vme_addr, - &slave.size, &pci_addr, &slave.aspace, - &slave.cycle); + &slave.enable, &slave.vme_addr, + &slave.size, &pci_addr, + &slave.aspace, &slave.cycle); copied = copy_to_user(argp, &slave, - sizeof(struct vme_slave)); + sizeof(struct vme_slave)); if (copied != 0) { pr_warn("Partial copy to userspace\n"); return -EFAULT; @@ -606,7 +607,7 @@ static int vme_user_probe(struct vme_dev *vdev)
[PATCH 0/9] vme_user checkpatch fixes and read()/write() rework
First four patches are fixes for various checpatch warnings. Next there is a change to drop large read()/write() stub followed by a change to rework user copy error codes. Last three changes are refactorings. Dmitry Kalinkin (9): staging: vme_user: fix code alignment staging: vme_user: fix blank lines staging: vme_user: fix NULL comparison style staging: vme_user: fix kmalloc style staging: vme_user: allow large read()/write() staging: vme_user: return -EFAULT on __copy_*_user errors staging: vme_user: remove unused variable staging: vme_user: remove distracting comment staging: vme_user: remove okcount variable drivers/staging/vme/devices/vme_user.c | 158 +++-- 1 file changed, 51 insertions(+), 107 deletions(-) -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 9/9] staging: vme_user: remove okcount variable
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 6f5bbc4..14f9554 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -188,7 +188,6 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; size_t image_size; - size_t okcount; if (minor == CONTROL_MINOR) return 0; @@ -206,16 +205,14 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, /* Ensure not reading past end of the image */ if (*ppos + count > image_size) - okcount = image_size - *ppos; - else - okcount = count; + count = image_size - *ppos; switch (type[minor]) { case MASTER_MINOR: - retval = resource_to_user(minor, buf, okcount, ppos); + retval = resource_to_user(minor, buf, count, ppos); break; case SLAVE_MINOR: - retval = buffer_to_user(minor, buf, okcount, ppos); + retval = buffer_to_user(minor, buf, count, ppos); break; default: retval = -EINVAL; @@ -234,7 +231,6 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf, unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; size_t image_size; - size_t okcount; if (minor == CONTROL_MINOR) return 0; @@ -251,16 +247,14 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf, /* Ensure not reading past end of the image */ if (*ppos + count > image_size) - okcount = image_size - *ppos; - else - okcount = count; + count = image_size - *ppos; switch (type[minor]) { case MASTER_MINOR: - retval = resource_from_user(minor, buf, okcount, ppos); + retval = resource_from_user(minor, buf, count, ppos); break; case SLAVE_MINOR: - retval = buffer_from_user(minor, buf, okcount, ppos); + retval = buffer_from_user(minor, buf, count, ppos); break; default: retval = -EINVAL; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/9] staging: vme_user: fix blank lines
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 285e00e..1f00ad7 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -101,13 +101,13 @@ struct image_desc { struct vme_resource *resource; /* VME resource */ int mmap_count; /* Number of current mmap's */ }; + static struct image_desc image[VME_DEVS]; static struct cdev *vme_user_cdev; /* Character device */ static struct class *vme_user_sysfs_class; /* Sysfs class */ static struct vme_dev *vme_user_bridge;/* Pointer to user device */ - static const int type[VME_DEVS] = {MASTER_MINOR, MASTER_MINOR, MASTER_MINOR, MASTER_MINOR, SLAVE_MINOR,SLAVE_MINOR, @@ -120,7 +120,6 @@ struct vme_user_vma_priv { atomic_t refcnt; }; - /* * We are going ot alloc a page during init per window for small transfers. * Small transfers will go VME -> buffer -> user space. Larger (more than a @@ -836,7 +835,6 @@ static void __exit vme_user_exit(void) vme_unregister_driver(&vme_user_driver); } - MODULE_PARM_DESC(bus, "Enumeration of VMEbus to which the driver is connected"); module_param_array(bus, int, &bus_num, 0); -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/9] staging: vme_user: fix NULL comparison style
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 1f00ad7..b6d81e5 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -527,7 +527,7 @@ static int vme_user_master_mmap(unsigned int minor, struct vm_area_struct *vma) } vma_priv = kmalloc(sizeof(struct vme_user_vma_priv), GFP_KERNEL); - if (vma_priv == NULL) { + if (!vma_priv) { mutex_unlock(&image[minor].mutex); return -ENOMEM; } @@ -588,7 +588,7 @@ static int vme_user_probe(struct vme_dev *vdev) char *name; /* Save pointer to the bridge device */ - if (vme_user_bridge != NULL) { + if (vme_user_bridge) { dev_err(&vdev->dev, "Driver can only be loaded for 1 device\n"); err = -EINVAL; goto err_dev; @@ -636,7 +636,7 @@ static int vme_user_probe(struct vme_dev *vdev) */ image[i].resource = vme_slave_request(vme_user_bridge, VME_A24, VME_SCT); - if (image[i].resource == NULL) { + if (!image[i].resource) { dev_warn(&vdev->dev, "Unable to allocate slave resource\n"); err = -ENOMEM; @@ -645,7 +645,7 @@ static int vme_user_probe(struct vme_dev *vdev) image[i].size_buf = PCI_BUF_SIZE; image[i].kern_buf = vme_alloc_consistent(image[i].resource, image[i].size_buf, &image[i].pci_buf); - if (image[i].kern_buf == NULL) { + if (!image[i].kern_buf) { dev_warn(&vdev->dev, "Unable to allocate memory for buffer\n"); image[i].pci_buf = 0; @@ -663,7 +663,7 @@ static int vme_user_probe(struct vme_dev *vdev) /* XXX Need to properly request attributes */ image[i].resource = vme_master_request(vme_user_bridge, VME_A32, VME_SCT, VME_D32); - if (image[i].resource == NULL) { + if (!image[i].resource) { dev_warn(&vdev->dev, "Unable to allocate master resource\n"); err = -ENOMEM; @@ -671,7 +671,7 @@ static int vme_user_probe(struct vme_dev *vdev) } image[i].size_buf = PCI_BUF_SIZE; image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL); - if (image[i].kern_buf == NULL) { + if (!image[i].kern_buf) { err = -ENOMEM; vme_master_free(image[i].resource); goto err_master; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 47 -- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 52cd638..85eb6ee 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -129,7 +129,6 @@ struct vme_user_vma_priv { static ssize_t resource_to_user(int minor, char __user *buf, size_t count, loff_t *ppos) { - ssize_t retval; ssize_t copied = 0; if (count > image[minor].size_buf) @@ -141,13 +140,8 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, if (copied < 0) return (int)copied; - retval = __copy_to_user(buf, image[minor].kern_buf, - (unsigned long)copied); - if (retval != 0) { - copied = (copied - retval); - pr_info("User copy failed\n"); - return -EINVAL; - } + if (__copy_to_user(buf, image[minor].kern_buf, (unsigned long)copied)) + return -EFAULT; return copied; } @@ -155,21 +149,16 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, static ssize_t resource_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { - ssize_t retval; ssize_t copied = 0; if (count > image[minor].size_buf) count = image[minor].size_buf; - retval = __copy_from_user(image[minor].kern_buf, buf, - (unsigned long)count); - if (retval != 0) - copied = (copied - retval); - else - copied = count; + if (__copy_from_user(image[minor].kern_buf, buf, (unsigned long)count)) + return -EFAULT; copied = vme_master_write(image[minor].resource, image[minor].kern_buf, - copied, *ppos); + count, *ppos); return copied; } @@ -178,38 +167,24 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf, size_t count, loff_t *ppos) { void *image_ptr; - ssize_t retval; image_ptr = image[minor].kern_buf + *ppos; + if (__copy_to_user(buf, image_ptr, (unsigned long)count)) + return -EINVAL; - retval = __copy_to_user(buf, image_ptr, (unsigned long)count); - if (retval != 0) { - retval = (count - retval); - pr_warn("Partial copy to userspace\n"); - } else - retval = count; - - /* Return number of bytes successfully read */ - return retval; + return count; } static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { void *image_ptr; - size_t retval; image_ptr = image[minor].kern_buf + *ppos; + if (__copy_from_user(image_ptr, buf, (unsigned long)count)) + return -EINVAL; - retval = __copy_from_user(image_ptr, buf, (unsigned long)count); - if (retval != 0) { - retval = (count - retval); - pr_warn("Partial copy to userspace\n"); - } else - retval = count; - - /* Return number of bytes successfully read */ - return retval; + return count; } static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 8/9] staging: vme_user: remove distracting comment
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 28a70f4..6f5bbc4 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -134,7 +134,6 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, if (count > image[minor].size_buf) count = image[minor].size_buf; - /* We copy to kernel buffer */ copied = vme_master_read(image[minor].resource, image[minor].kern_buf, count, *ppos); if (copied < 0) -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 7/9] staging: vme_user: remove unused variable
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 85eb6ee..28a70f4 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -149,18 +149,14 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, static ssize_t resource_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { - ssize_t copied = 0; - if (count > image[minor].size_buf) count = image[minor].size_buf; if (__copy_from_user(image[minor].kern_buf, buf, (unsigned long)count)) return -EFAULT; - copied = vme_master_write(image[minor].resource, image[minor].kern_buf, - count, *ppos); - - return copied; + return vme_master_write(image[minor].resource, image[minor].kern_buf, + count, *ppos); } static ssize_t buffer_to_user(unsigned int minor, char __user *buf, -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8192u: bool tests don't need comparisons
Remove explicit true/false comparations to bool variables. Signed-off-by: Luis de Bethencourt --- drivers/staging/rtl8192u/r8192U_core.c | 7 --- drivers/staging/rtl8192u/r8192U_dm.c | 21 +++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index a4795af..c53d670 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev) struct r8192_priv *priv = ieee80211_priv(dev); struct ieee80211_device *ieee = priv->ieee80211; - if (ieee->bHalfWirelessN24GMode == true) + if (ieee->bHalfWirelessN24GMode) Reval = true; else Reval = false; @@ -2762,7 +2762,7 @@ static bool rtl8192_adapter_start(struct net_device *dev) // #ifdef TO_DO_LIST if (Adapter->ResetProgress == RESET_TYPE_NORESET) { - if (pMgntInfo->RegRfOff == true) { /* User disable RF via registry. */ + if (pMgntInfo->RegRfOff) { /* User disable RF via registry. */ RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff --\n")); MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW); // Those actions will be discard in MgntActSet_RF_State because of the same state @@ -4406,7 +4406,8 @@ static void query_rxdesc_status(struct sk_buff *skb, /* RTL8190 set this bit to indicate that Hw does not decrypt packet */ stats->Decrypted = !desc->SWDec; - if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) + if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) && + (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) stats->bHwError = false; else stats->bHwError = stats->bCRC|stats->bICV; diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 12dd19e..9946615 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable) return; - if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) { /* If send packets in 40 Mhz in 20/40 */ + if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If send packets in 40 Mhz in 20/40 */ if (priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; } else { /* in force send packets in 20 Mhz in 20/40 */ @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) break; } } - if (viviflag == true) { + if (viviflag) { write_nic_byte(dev, 0x1ba, 0); viviflag = false; RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n"); @@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work) struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq); struct net_device *dev = priv->ieee80211->dev; - if (priv->bDcut == true) + if (priv->bDcut) dm_TXPowerTrackingCallback_TSSI(dev); else dm_TXPowerTrackingCallback_ThermalMeter(dev); @@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); - if (priv->bDcut == true) + if (priv->bDcut) dm_InitializeTXPowerTracking_TSSI(dev); else dm_InitializeTXPowerTracking_ThermalMeter(dev); @@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device *dev) #ifdef RTL8190P dm_CheckTXPowerTracking_TSSI(dev); #else - if (priv->bDcut == true) + if (priv->bDcut) dm_CheckTXPowerTracking_TSSI(dev); else dm_CheckTXPowerTracking_ThermalMeter(dev); @@ -1467,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14) { /* dm_CCKTxPowerAdjust */ struct r8192_priv *priv = ieee80211_priv(dev); - if (priv->bDcut == true) + if (priv->bDcut) dm_CCKTxPowerAdjust_TSSI(dev, binch14); else dm_CCKTxPowerAdjust_ThermalMeter(dev, binch14); @@ -1731,7 +1731,7 @@ static void dm
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt wrote: > Remove explicit true/false comparations to bool variables. > > Signed-off-by: Luis de Bethencourt > --- > drivers/staging/rtl8192u/r8192U_core.c | 7 --- > drivers/staging/rtl8192u/r8192U_dm.c | 21 +++-- > 2 files changed, 15 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c > b/drivers/staging/rtl8192u/r8192U_core.c > index a4795af..c53d670 100644 > --- a/drivers/staging/rtl8192u/r8192U_core.c > +++ b/drivers/staging/rtl8192u/r8192U_core.c > @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct > net_device *dev) > struct r8192_priv *priv = ieee80211_priv(dev); > struct ieee80211_device *ieee = priv->ieee80211; > > - if (ieee->bHalfWirelessN24GMode == true) > + if (ieee->bHalfWirelessN24GMode) > Reval = true; > else > Reval = false; With this one I'd go as far as saying that Reval = ieee->bHalfWirelessN24GMode; Frans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 02:56:38PM +0200, Frans Klaver wrote: > On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt > wrote: > > Remove explicit true/false comparations to bool variables. > > > > Signed-off-by: Luis de Bethencourt > > --- > > drivers/staging/rtl8192u/r8192U_core.c | 7 --- > > drivers/staging/rtl8192u/r8192U_dm.c | 21 +++-- > > 2 files changed, 15 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c > > b/drivers/staging/rtl8192u/r8192U_core.c > > index a4795af..c53d670 100644 > > --- a/drivers/staging/rtl8192u/r8192U_core.c > > +++ b/drivers/staging/rtl8192u/r8192U_core.c > > @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct > > net_device *dev) > > struct r8192_priv *priv = ieee80211_priv(dev); > > struct ieee80211_device *ieee = priv->ieee80211; > > > > - if (ieee->bHalfWirelessN24GMode == true) > > + if (ieee->bHalfWirelessN24GMode) > > Reval = true; > > else > > Reval = false; > > With this one I'd go as far as saying that > > Reval = ieee->bHalfWirelessN24GMode; > > Frans Completely missed that. Good catch. Thanks for the review! Sending an updated version now. Luis ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/2] staging: sm750fb: fix typo in debug statement
On Tuesday 23 June 2015 02:07 PM, Dan Carpenter wrote: > On Mon, Jun 22, 2015 at 04:48:01AM +, Gujulan Elango, Hari Prasath (H.) > wrote: >> From: Hari Prasath Gujulan Elango >> >> This patch fixes a typo in the debug statement >> >> Signed-off-by: Hari Prasath Gujulan Elango >> --- > > Fold these together. It's a one line change to the same line... > > regards, > dan carpenter > > sorry,I went by the 'Do one thing per patch' rule.I was actually confused while sending this.I shall resend both as single patch. Thanks for the review. -- thanks & regards, Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt wrote: > Remove explicit true/false comparations to bool variables. > > Signed-off-by: Luis de Bethencourt > --- > drivers/staging/rtl8192u/r8192U_core.c | 7 --- > drivers/staging/rtl8192u/r8192U_dm.c | 21 +++-- > 2 files changed, 15 insertions(+), 13 deletions(-) > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c > b/drivers/staging/rtl8192u/r8192U_core.c > index a4795af..c53d670 100644 > --- a/drivers/staging/rtl8192u/r8192U_core.c > +++ b/drivers/staging/rtl8192u/r8192U_core.c > @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct > net_device *dev) > struct r8192_priv *priv = ieee80211_priv(dev); > struct ieee80211_device *ieee = priv->ieee80211; > > - if (ieee->bHalfWirelessN24GMode == true) > + if (ieee->bHalfWirelessN24GMode) > Reval = true; > else > Reval = false; > @@ -2762,7 +2762,7 @@ static bool rtl8192_adapter_start(struct net_device > *dev) > // > #ifdef TO_DO_LIST > if (Adapter->ResetProgress == RESET_TYPE_NORESET) { > - if (pMgntInfo->RegRfOff == true) { /* User disable RF via > registry. */ > + if (pMgntInfo->RegRfOff) { /* User disable RF via registry. */ > RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, > ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff --\n")); > MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW); > // Those actions will be discard in > MgntActSet_RF_State because of the same state > @@ -4406,7 +4406,8 @@ static void query_rxdesc_status(struct sk_buff *skb, > /* RTL8190 set this bit to indicate that Hw does not decrypt packet */ > stats->Decrypted = !desc->SWDec; > > - if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && > (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) > + if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) && > + (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) > stats->bHwError = false; > else > stats->bHwError = stats->bCRC|stats->bICV; > diff --git a/drivers/staging/rtl8192u/r8192U_dm.c > b/drivers/staging/rtl8192u/r8192U_dm.c > index 12dd19e..9946615 100644 > --- a/drivers/staging/rtl8192u/r8192U_dm.c > +++ b/drivers/staging/rtl8192u/r8192U_dm.c > @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device > *dev) > > if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || > !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable) > return; > - if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) > { /* If send packets in 40 Mhz in 20/40 */ > + if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If > send packets in 40 Mhz in 20/40 */ > if (priv->undecorated_smoothed_pwdb <= > priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) > > priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; > } else { /* in force send packets in 20 Mhz in 20/40 */ > @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct > net_device *dev) > break; > } > } > - if (viviflag == true) { > + if (viviflag) { > write_nic_byte(dev, 0x1ba, 0); > viviflag = false; > RT_TRACE(COMP_POWER_TRACKING, "we filtered > the data\n"); > @@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work) > struct r8192_priv *priv = container_of(dwork, struct r8192_priv, > txpower_tracking_wq); > struct net_device *dev = priv->ieee80211->dev; > > - if (priv->bDcut == true) > + if (priv->bDcut) > dm_TXPowerTrackingCallback_TSSI(dev); > else > dm_TXPowerTrackingCallback_ThermalMeter(dev); > @@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device > *dev) > { > struct r8192_priv *priv = ieee80211_priv(dev); > > - if (priv->bDcut == true) > + if (priv->bDcut) > dm_InitializeTXPowerTracking_TSSI(dev); > else > dm_InitializeTXPowerTracking_ThermalMeter(dev); > @@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device > *dev) > #ifdef RTL8190P > dm_CheckTXPowerTracking_TSSI(dev); > #else > - if (priv->bDcut == true) > + if (priv->bDcut) > dm_CheckTXPowerTracking_TSSI(dev); > else > dm_CheckTXPowerTracking_ThermalMeter(dev); > @@ -1467,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool > binch14) > { /* dm_CCKTxPowerAdjust */ > s
[PATCH v2] staging: rtl8192u: bool tests don't need comparisons
Remove explicit true/false comparations to bool variables. Signed-off-by: Luis de Bethencourt --- drivers/staging/rtl8192u/r8192U_core.c | 13 - drivers/staging/rtl8192u/r8192U_dm.c | 21 +++-- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index a4795af..9e144ae 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -2043,16 +2043,10 @@ static bool GetNmodeSupportBySecCfg8192(struct net_device *dev) static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev) { - boolReval; struct r8192_priv *priv = ieee80211_priv(dev); struct ieee80211_device *ieee = priv->ieee80211; - if (ieee->bHalfWirelessN24GMode == true) - Reval = true; - else - Reval = false; - - return Reval; + return ieee->bHalfWirelessN24GMode; } static void rtl8192_refresh_supportrate(struct r8192_priv *priv) @@ -2762,7 +2756,7 @@ static bool rtl8192_adapter_start(struct net_device *dev) // #ifdef TO_DO_LIST if (Adapter->ResetProgress == RESET_TYPE_NORESET) { - if (pMgntInfo->RegRfOff == true) { /* User disable RF via registry. */ + if (pMgntInfo->RegRfOff) { /* User disable RF via registry. */ RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff --\n")); MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW); // Those actions will be discard in MgntActSet_RF_State because of the same state @@ -4406,7 +4400,8 @@ static void query_rxdesc_status(struct sk_buff *skb, /* RTL8190 set this bit to indicate that Hw does not decrypt packet */ stats->Decrypted = !desc->SWDec; - if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) + if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) && + (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) stats->bHwError = false; else stats->bHwError = stats->bCRC|stats->bICV; diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 12dd19e..9946615 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable) return; - if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) { /* If send packets in 40 Mhz in 20/40 */ + if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If send packets in 40 Mhz in 20/40 */ if (priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; } else { /* in force send packets in 20 Mhz in 20/40 */ @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) break; } } - if (viviflag == true) { + if (viviflag) { write_nic_byte(dev, 0x1ba, 0); viviflag = false; RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n"); @@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work) struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq); struct net_device *dev = priv->ieee80211->dev; - if (priv->bDcut == true) + if (priv->bDcut) dm_TXPowerTrackingCallback_TSSI(dev); else dm_TXPowerTrackingCallback_ThermalMeter(dev); @@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); - if (priv->bDcut == true) + if (priv->bDcut) dm_InitializeTXPowerTracking_TSSI(dev); else dm_InitializeTXPowerTracking_ThermalMeter(dev); @@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device *dev) #ifdef RTL8190P dm_CheckTXPowerTracking_TSSI(dev); #else - if (priv->bDcut == true) + if (priv->bDcut) dm_CheckTXPowerTracking_TSSI(dev); else dm_CheckTXPowerTracking_ThermalMeter(dev); @@ -1467,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14) { /* dm_CCKTxPowerAdjust */ struct r8192_priv *priv = ieee80211_priv(dev); - if (
Re: [PATCH] staging: sm750fb: remove unused variables
On Tuesday 23 June 2015 02:16 PM, Dan Carpenter wrote: > On Mon, Jun 22, 2015 at 07:26:25AM +, Gujulan Elango, Hari Prasath (H.) > wrote: >> @@ -122,7 +121,7 @@ void setChipClock(unsigned int frequency) >> * Sometime, the chip cannot set up the exact clock required by >> User. >> * Return value from calcPllValue() gives the actual possible >> clock. >> */ >> -ulActualMxClk = calcPllValue(frequency, &pll); >> +calcPllValue(frequency, &pll); > > Should we get rid of calcPllValue() as well? I guess I would prefer to > leave the warnings until someone has the answer to this. > > Warnings are good because they show where the bugs are. It's not always > the right thing to silence them. > > regards, > dan carpenter > > Okay.Let us drop this patch and leave the warning as it is. Sudip,I saw your e-mail on the same topic. Thank you both for reviewing. -- thanks & regards, Hari Prasath ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: rtl8192u: bool tests don't need comparisons
Remove explicit true/false comparations to bool variables. Signed-off-by: Luis de Bethencourt --- drivers/staging/rtl8192u/r8192U_core.c | 13 - drivers/staging/rtl8192u/r8192U_dm.c | 21 +++-- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index a4795af..9e144ae 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -2043,16 +2043,10 @@ static bool GetNmodeSupportBySecCfg8192(struct net_device *dev) static bool GetHalfNmodeSupportByAPs819xUsb(struct net_device *dev) { - boolReval; struct r8192_priv *priv = ieee80211_priv(dev); struct ieee80211_device *ieee = priv->ieee80211; - if (ieee->bHalfWirelessN24GMode == true) - Reval = true; - else - Reval = false; - - return Reval; + return ieee->bHalfWirelessN24GMode; } static void rtl8192_refresh_supportrate(struct r8192_priv *priv) @@ -2762,7 +2756,7 @@ static bool rtl8192_adapter_start(struct net_device *dev) // #ifdef TO_DO_LIST if (Adapter->ResetProgress == RESET_TYPE_NORESET) { - if (pMgntInfo->RegRfOff == true) { /* User disable RF via registry. */ + if (pMgntInfo->RegRfOff) { /* User disable RF via registry. */ RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff --\n")); MgntActSet_RF_State(Adapter, eRfOff, RF_CHANGE_BY_SW); // Those actions will be discard in MgntActSet_RF_State because of the same state @@ -4406,7 +4400,8 @@ static void query_rxdesc_status(struct sk_buff *skb, /* RTL8190 set this bit to indicate that Hw does not decrypt packet */ stats->Decrypted = !desc->SWDec; - if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) + if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) && + (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) stats->bHwError = false; else stats->bHwError = stats->bCRC|stats->bICV; diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c index 12dd19e..9946615 100644 --- a/drivers/staging/rtl8192u/r8192U_dm.c +++ b/drivers/staging/rtl8192u/r8192U_dm.c @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device *dev) if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable) return; - if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) { /* If send packets in 40 Mhz in 20/40 */ + if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If send packets in 40 Mhz in 20/40 */ if (priv->undecorated_smoothed_pwdb <= priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; } else { /* in force send packets in 20 Mhz in 20/40 */ @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct net_device *dev) break; } } - if (viviflag == true) { + if (viviflag) { write_nic_byte(dev, 0x1ba, 0); viviflag = false; RT_TRACE(COMP_POWER_TRACKING, "we filtered the data\n"); @@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct *work) struct r8192_priv *priv = container_of(dwork, struct r8192_priv, txpower_tracking_wq); struct net_device *dev = priv->ieee80211->dev; - if (priv->bDcut == true) + if (priv->bDcut) dm_TXPowerTrackingCallback_TSSI(dev); else dm_TXPowerTrackingCallback_ThermalMeter(dev); @@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device *dev) { struct r8192_priv *priv = ieee80211_priv(dev); - if (priv->bDcut == true) + if (priv->bDcut) dm_InitializeTXPowerTracking_TSSI(dev); else dm_InitializeTXPowerTracking_ThermalMeter(dev); @@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct net_device *dev) #ifdef RTL8190P dm_CheckTXPowerTracking_TSSI(dev); #else - if (priv->bDcut == true) + if (priv->bDcut) dm_CheckTXPowerTracking_TSSI(dev); else dm_CheckTXPowerTracking_ThermalMeter(dev); @@ -1467,7 +1467,7 @@ void dm_cck_txpower_adjust(struct net_device *dev, bool binch14) { /* dm_CCKTxPowerAdjust */ struct r8192_priv *priv = ieee80211_priv(dev); - if (
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 03:04:32PM +0200, Frans Klaver wrote: > On Tue, Jun 23, 2015 at 2:52 PM, Luis de Bethencourt > wrote: > > Remove explicit true/false comparations to bool variables. > > > > Signed-off-by: Luis de Bethencourt > > --- > > drivers/staging/rtl8192u/r8192U_core.c | 7 --- > > drivers/staging/rtl8192u/r8192U_dm.c | 21 +++-- > > 2 files changed, 15 insertions(+), 13 deletions(-) > > > > diff --git a/drivers/staging/rtl8192u/r8192U_core.c > > b/drivers/staging/rtl8192u/r8192U_core.c > > index a4795af..c53d670 100644 > > --- a/drivers/staging/rtl8192u/r8192U_core.c > > +++ b/drivers/staging/rtl8192u/r8192U_core.c > > @@ -2047,7 +2047,7 @@ static bool GetHalfNmodeSupportByAPs819xUsb(struct > > net_device *dev) > > struct r8192_priv *priv = ieee80211_priv(dev); > > struct ieee80211_device *ieee = priv->ieee80211; > > > > - if (ieee->bHalfWirelessN24GMode == true) > > + if (ieee->bHalfWirelessN24GMode) > > Reval = true; > > else > > Reval = false; > > @@ -2762,7 +2762,7 @@ static bool rtl8192_adapter_start(struct net_device > > *dev) > > // > > #ifdef TO_DO_LIST > > if (Adapter->ResetProgress == RESET_TYPE_NORESET) { > > - if (pMgntInfo->RegRfOff == true) { /* User disable RF via > > registry. */ > > + if (pMgntInfo->RegRfOff) { /* User disable RF via registry. > > */ > > RT_TRACE((COMP_INIT|COMP_RF), DBG_LOUD, > > ("InitializeAdapter819xUsb(): Turn off RF for RegRfOff --\n")); > > MgntActSet_RF_State(Adapter, eRfOff, > > RF_CHANGE_BY_SW); > > // Those actions will be discard in > > MgntActSet_RF_State because of the same state > > @@ -4406,7 +4406,8 @@ static void query_rxdesc_status(struct sk_buff *skb, > > /* RTL8190 set this bit to indicate that Hw does not decrypt packet > > */ > > stats->Decrypted = !desc->SWDec; > > > > - if ((priv->ieee80211->pHTInfo->bCurrentHTSupport == true) && > > (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) > > + if ((priv->ieee80211->pHTInfo->bCurrentHTSupport) && > > + (priv->ieee80211->pairwise_key_type == KEY_TYPE_CCMP)) > > stats->bHwError = false; > > else > > stats->bHwError = stats->bCRC|stats->bICV; > > diff --git a/drivers/staging/rtl8192u/r8192U_dm.c > > b/drivers/staging/rtl8192u/r8192U_dm.c > > index 12dd19e..9946615 100644 > > --- a/drivers/staging/rtl8192u/r8192U_dm.c > > +++ b/drivers/staging/rtl8192u/r8192U_dm.c > > @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device > > *dev) > > > > if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || > > !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable) > > return; > > - if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == > > false) { /* If send packets in 40 Mhz in 20/40 */ > > + if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* > > If send packets in 40 Mhz in 20/40 */ > > if (priv->undecorated_smoothed_pwdb <= > > priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) > > > > priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz = true; > > } else { /* in force send packets in 20 Mhz in 20/40 */ > > @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct > > net_device *dev) > > break; > > } > > } > > - if (viviflag == true) { > > + if (viviflag) { > > write_nic_byte(dev, 0x1ba, 0); > > viviflag = false; > > RT_TRACE(COMP_POWER_TRACKING, "we filtered > > the data\n"); > > @@ -766,7 +766,7 @@ void dm_txpower_trackingcallback(struct work_struct > > *work) > > struct r8192_priv *priv = container_of(dwork, struct r8192_priv, > > txpower_tracking_wq); > > struct net_device *dev = priv->ieee80211->dev; > > > > - if (priv->bDcut == true) > > + if (priv->bDcut) > > dm_TXPowerTrackingCallback_TSSI(dev); > > else > > dm_TXPowerTrackingCallback_ThermalMeter(dev); > > @@ -1301,7 +1301,7 @@ void dm_initialize_txpower_tracking(struct net_device > > *dev) > > { > > struct r8192_priv *priv = ieee80211_priv(dev); > > > > - if (priv->bDcut == true) > > + if (priv->bDcut) > > dm_InitializeTXPowerTracking_TSSI(dev); > > else > > dm_InitializeTXPowerTracking_ThermalMeter(dev); > > @@ -1357,7 +1357,7 @@ static void dm_check_txpower_tracking(struct > > net_device *dev) > > #ifdef RTL8190P > > dm_CheckTXPowerTracking_TSSI(dev); > > #else > > - if (priv->bDcut == true) >
Re: [PATCH 1/9] staging: vme_user: fix code alignment
On Tue, Jun 23, 2015 at 2:42 PM, Dmitry Kalinkin wrote: > Signed-off-by: Dmitry Kalinkin You left one in the function declarations (vme_user_write). > --- > drivers/staging/vme/devices/vme_user.c | 33 + > 1 file changed, 17 insertions(+), 16 deletions(-) > > diff --git a/drivers/staging/vme/devices/vme_user.c > b/drivers/staging/vme/devices/vme_user.c > index 5ff44fb..285e00e 100644 > --- a/drivers/staging/vme/devices/vme_user.c > +++ b/drivers/staging/vme/devices/vme_user.c > @@ -128,7 +128,7 @@ struct vme_user_vma_priv { > * transfer the data directly into the user space buffers. > */ > static ssize_t resource_to_user(int minor, char __user *buf, size_t count, > - loff_t *ppos) > + loff_t *ppos) > { > ssize_t retval; > ssize_t copied = 0; > @@ -167,7 +167,7 @@ static ssize_t resource_to_user(int minor, char __user > *buf, size_t count, > * transfer the data directly from the user space buffers out to VME. > */ > static ssize_t resource_from_user(unsigned int minor, const char __user *buf, > - size_t count, loff_t *ppos) > + size_t count, loff_t *ppos) > { > ssize_t retval; > ssize_t copied = 0; > @@ -195,7 +195,7 @@ static ssize_t resource_from_user(unsigned int minor, > const char __user *buf, > } > > static ssize_t buffer_to_user(unsigned int minor, char __user *buf, > - size_t count, loff_t *ppos) > + size_t count, loff_t *ppos) > { > void *image_ptr; > ssize_t retval; > @@ -214,7 +214,7 @@ static ssize_t buffer_to_user(unsigned int minor, char > __user *buf, > } > > static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, > - size_t count, loff_t *ppos) > + size_t count, loff_t *ppos) > { > void *image_ptr; > size_t retval; > @@ -233,7 +233,7 @@ static ssize_t buffer_from_user(unsigned int minor, const > char __user *buf, > } > > static ssize_t vme_user_read(struct file *file, char __user *buf, size_t > count, > - loff_t *ppos) > +loff_t *ppos) > { > unsigned int minor = MINOR(file_inode(file)->i_rdev); > ssize_t retval; > @@ -279,7 +279,7 @@ static ssize_t vme_user_read(struct file *file, char > __user *buf, size_t count, > } > > static ssize_t vme_user_write(struct file *file, const char __user *buf, > - size_t count, loff_t *ppos) > + size_t count, loff_t *ppos) > { > unsigned int minor = MINOR(file_inode(file)->i_rdev); > ssize_t retval; > @@ -354,7 +354,7 @@ static loff_t vme_user_llseek(struct file *file, loff_t > off, int whence) > * already been defined. > */ > static int vme_user_ioctl(struct inode *inode, struct file *file, > - unsigned int cmd, unsigned long arg) > + unsigned int cmd, unsigned long arg) > { > struct vme_master master; > struct vme_slave slave; > @@ -390,12 +390,13 @@ static int vme_user_ioctl(struct inode *inode, struct > file *file, > * to userspace as they are > */ > retval = vme_master_get(image[minor].resource, > - &master.enable, &master.vme_addr, > - &master.size, &master.aspace, > - &master.cycle, &master.dwidth); > + &master.enable, > + &master.vme_addr, > + &master.size, &master.aspace, > + &master.cycle, > &master.dwidth); > > copied = copy_to_user(argp, &master, > - sizeof(struct vme_master)); > + sizeof(struct vme_master)); > if (copied != 0) { > pr_warn("Partial copy to userspace\n"); > return -EFAULT; > @@ -435,12 +436,12 @@ static int vme_user_ioctl(struct inode *inode, struct > file *file, > * to userspace as they are > */ > retval = vme_slave_get(image[minor].resource, > - &slave.enable, &slave.vme_addr, > - &slave.size, &pci_addr, &slave.aspace, > - &slave.cycle); > + &slave.enable, &slave.vme_addr, > + &slave.size, &pci_addr, > + &slave.aspace, &slave.cycle); > > copied = copy_to_user(argp, &slave, > -
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt wrote: >> > if (dm_digtable.dig_algorithm_switch) { >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device >> > *dev) >> > priv->bDynamicTxLowPower = false; >> > } else { >> > /* high power state check */ >> > - if (priv->undecorated_smoothed_pwdb < >> > txlowpower_threshold && priv->bDynamicTxHighPower == true) >> > + if (priv->undecorated_smoothed_pwdb < >> > + txlowpower_threshold && >> > priv->bDynamicTxHighPower) >> > priv->bDynamicTxHighPower = false; >> >> Oh, this has a misleading air hanging over it. It focuses the eyes on >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that >> probably isn't the intent. >> >> Frans > > I agree, and wasn't sure what the best way to deal with was. > > The following doesn't mislead but goes above 80 characters. > if (priv->undecorated_smoothed_pwdb < > txlowpower_threshold && > priv->bDynamicTxHighPower == true) > > It is better than the original but it doesn't completely fix it. > > If this is a better compromise I can update the patch. If we keep people's internal parsers working properly, I think having a line of three characters too long is a fair compromise. Besides that, there are a lot more lines of code in that file that need to be brought back to under 80 characters. If you really care about that line length, precede with a patch (or two) that changes those insanely long (local!) variable names, so that you can break up the line right away. Have fun, Frans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/9] staging: vme_user: fix code alignment
> On 23 Jun 2015, at 16:21, Frans Klaver wrote: > > You left one in the function declarations (vme_user_write). If you mean forward declarations, they are already gone in Greg’s tree: https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/vme/devices/vme_user.c?h=staging-testing&id=e4aea6aa03267b496c21abefe170bb0d77192882 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/9] staging: vme_user: fix code alignment
On Tue, Jun 23, 2015 at 3:44 PM, Dmitry Kalinkin wrote: > >> On 23 Jun 2015, at 16:21, Frans Klaver wrote: >> >> You left one in the function declarations (vme_user_write). > > If you mean forward declarations, they are already gone in Greg’s tree: > https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/commit/drivers/staging/vme/devices/vme_user.c?h=staging-testing&id=e4aea6aa03267b496c21abefe170bb0d77192882 Yea, I meant those. Never mind then :) Frans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v3] staging: rtl8192u: bool tests don't need comparisons
Remove explicit true/false comparations to bool variables. Signed-off-by: Luis de Bethencourt --- drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++-- .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +- drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 4 ++-- drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c | 12 ++-- drivers/staging/rtl8192u/ieee80211/rtl819x_HTProc.c | 14 +++--- drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +- drivers/staging/rtl8192u/r8192U_core.c | 13 - drivers/staging/rtl8192u/r8192U_dm.c| 21 +++-- 8 files changed, 34 insertions(+), 38 deletions(-) diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c index 9fbb53d..7b6c8d6 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c @@ -1014,7 +1014,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, goto rx_dropped; // if QoS enabled, should check the sequence for each of the AC - if( (ieee->pHTInfo->bCurRxReorderEnable == false) || !ieee->current_network.qos_data.active|| !IsDataFrame(skb->data) || IsLegacyDataFrame(skb->data)){ + if ((!ieee->pHTInfo->bCurRxReorderEnable) || !ieee->current_network.qos_data.active|| !IsDataFrame(skb->data) || IsLegacyDataFrame(skb->data)) { if (is_duplicate_packet(ieee, hdr)) goto rx_dropped; @@ -1307,7 +1307,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, } //added by amy for reorder - if(ieee->pHTInfo->bCurRxReorderEnable == false ||pTS == NULL){ + if (!ieee->pHTInfo->bCurRxReorderEnable || pTS == NULL){ //added by amy for reorder for(i = 0; inr_subframes; i++) { struct sk_buff *sub_skb = rxb->subframes[i]; diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c index c238881..bd5159c 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c @@ -1963,7 +1963,7 @@ static void ieee80211_check_auth_response(struct ieee80211_device *ieee, } if (ieee->current_network.mode == IEEE_N_24G && - bHalfSupportNmode == true) { + bHalfSupportNmode) { netdev_dbg(ieee->dev, "enter half N mode\n"); ieee->bHalfWirelessN24GMode = true; } else diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c index 9f68c65..c23d9d9 100644 --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c @@ -336,12 +336,12 @@ static void ieee80211_tx_query_agg_cap(struct ieee80211_device *ieee, printk("===>can't get TS\n"); return; } - if (pTxTs->TxAdmittedBARecord.bValid == false) + if (!pTxTs->TxAdmittedBARecord.bValid) { TsStartAddBaProcess(ieee, pTxTs); goto FORCED_AGG_SETTING; } - else if (pTxTs->bUsingBa == false) + else if (!pTxTs->bUsingBa) { if (SN_LESS(pTxTs->TxAdmittedBARecord.BaStartSeqCtrl.field.SeqNum, (pTxTs->TxCurSeq+1)%4096)) pTxTs->bUsingBa = true; diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c index 618d2cb..2523cbb 100644 --- a/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_BAProc.c @@ -364,8 +364,8 @@ int ieee80211_rx_ADDBAReq(struct ieee80211_device *ieee, struct sk_buff *skb) printk(">rx ADDBAREQ from :%pM\n", dst); //some other capability is not ready now. if ((ieee->current_network.qos_data.active == 0) || - (ieee->pHTInfo->bCurrentHTSupport == false)) //|| - // (ieee->pStaQos->bEnableRxImmBA == false)) + (!ieee->pHTInfo->bCurrentHTSupport)) //|| + // (!ieee->pStaQos->bEnableRxImmBA)) { rc = ADDBA_STATUS_REFUSED; IEEE80211_DEBUG(IEEE80211_DL_ERR, "Failed to reply on ADDBA_REQ as some capability is not ready(%d, %d)\n", ieee->current_network.qos_data.active, ieee->pHTInfo->bCurrentHTSupport); @@ -462,8 +462,8 @@ int ieee80211_rx_ADDBARsp(struct ieee80211_device *ieee, struct sk_buff *skb) // Check the capability // Since we can always receive A-MPDU, we just check if it is und
Re: [PATCH 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors
On Tue, Jun 23, 2015 at 03:42:30PM +0300, Dmitry Kalinkin wrote: > @@ -178,38 +167,24 @@ static ssize_t buffer_to_user(unsigned int minor, char > __user *buf, > size_t count, loff_t *ppos) > { > void *image_ptr; > - ssize_t retval; > > image_ptr = image[minor].kern_buf + *ppos; > + if (__copy_to_user(buf, image_ptr, (unsigned long)count)) > + return -EINVAL; s/EINVAL/EFAULT/ > > - retval = __copy_to_user(buf, image_ptr, (unsigned long)count); > - if (retval != 0) { > - retval = (count - retval); > - pr_warn("Partial copy to userspace\n"); > - } else > - retval = count; > - > - /* Return number of bytes successfully read */ > - return retval; > + return count; > } > > static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, > size_t count, loff_t *ppos) > { > void *image_ptr; > - size_t retval; > > image_ptr = image[minor].kern_buf + *ppos; > + if (__copy_from_user(image_ptr, buf, (unsigned long)count)) > + return -EINVAL; s/EINVAL/EFAULT/ > > - retval = __copy_from_user(image_ptr, buf, (unsigned long)count); > - if (retval != 0) { > - retval = (count - retval); > - pr_warn("Partial copy to userspace\n"); > - } else > - retval = count; > - > - /* Return number of bytes successfully read */ > - return retval; > + return count; > } regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 03:37:20PM +0200, Frans Klaver wrote: > On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt > wrote: > > >> > if (dm_digtable.dig_algorithm_switch) { > >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device > >> > *dev) > >> > priv->bDynamicTxLowPower = false; > >> > } else { > >> > /* high power state check */ > >> > - if (priv->undecorated_smoothed_pwdb < > >> > txlowpower_threshold && priv->bDynamicTxHighPower == true) > >> > + if (priv->undecorated_smoothed_pwdb < > >> > + txlowpower_threshold && > >> > priv->bDynamicTxHighPower) > >> > priv->bDynamicTxHighPower = false; > >> > >> Oh, this has a misleading air hanging over it. It focuses the eyes on > >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that > >> probably isn't the intent. > >> > >> Frans > > > > I agree, and wasn't sure what the best way to deal with was. > > > > The following doesn't mislead but goes above 80 characters. > > if (priv->undecorated_smoothed_pwdb < > > txlowpower_threshold && > > priv->bDynamicTxHighPower == true) > > > > It is better than the original but it doesn't completely fix it. > > > > If this is a better compromise I can update the patch. > > If we keep people's internal parsers working properly, I think having > a line of three characters too long is a fair compromise. Besides > that, there are a lot more lines of code in that file that need to be > brought back to under 80 characters. > > If you really care about that line length, precede with a patch (or > two) that changes those insanely long (local!) variable names, so that > you can break up the line right away. > > Have fun, > Frans Very true. There are a *lot* of massively long lines. This has been a learning experience. I wasn't sure how strict the rules for submissions were. There are other things besides line lengths that I want to fix in rtl8192u. Related to that, I just sent a 3rd version which includes fixes for these bool comparisons for the rest of the files in drivers/staging/rtl8192u/ Thanks so much for taking the time to review. Appreciated. Luis ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 3:59 PM, Luis de Bethencourt wrote: > On Tue, Jun 23, 2015 at 03:37:20PM +0200, Frans Klaver wrote: >> On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt >> wrote: >> >> >> > if (dm_digtable.dig_algorithm_switch) { >> >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct net_device >> >> > *dev) >> >> > priv->bDynamicTxLowPower = false; >> >> > } else { >> >> > /* high power state check */ >> >> > - if (priv->undecorated_smoothed_pwdb < >> >> > txlowpower_threshold && priv->bDynamicTxHighPower == true) >> >> > + if (priv->undecorated_smoothed_pwdb < >> >> > + txlowpower_threshold && >> >> > priv->bDynamicTxHighPower) >> >> > priv->bDynamicTxHighPower = false; >> >> >> >> Oh, this has a misleading air hanging over it. It focuses the eyes on >> >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that >> >> probably isn't the intent. >> >> >> >> Frans >> > >> > I agree, and wasn't sure what the best way to deal with was. >> > >> > The following doesn't mislead but goes above 80 characters. >> > if (priv->undecorated_smoothed_pwdb < >> > txlowpower_threshold && >> > priv->bDynamicTxHighPower == true) >> > >> > It is better than the original but it doesn't completely fix it. >> > >> > If this is a better compromise I can update the patch. >> >> If we keep people's internal parsers working properly, I think having >> a line of three characters too long is a fair compromise. Besides >> that, there are a lot more lines of code in that file that need to be >> brought back to under 80 characters. >> >> If you really care about that line length, precede with a patch (or >> two) that changes those insanely long (local!) variable names, so that >> you can break up the line right away. >> >> Have fun, >> Frans > > Very true. There are a *lot* of massively long lines. > > This has been a learning experience. I wasn't sure how strict the rules for > submissions were. Well, as far as I know "Don't break internal parsers" wins over "Checkpatch complains". However, checkpatch usually does have a nose for smelly code (as does sparse, btw), so it pays to look around a bit if it complains. In the end the maintainer decides whether a patch passes the criteria. > There are other things besides line lengths that I want to fix in > rtl8192u. Related to that, I just sent a 3rd version which includes fixes for > these bool comparisons for the rest of the files in drivers/staging/rtl8192u/ > > Thanks so much for taking the time to review. Appreciated. No problem. Was waiting for a yocto build to finish anyway. Frans ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors
> On 23 Jun 2015, at 16:51, Dan Carpenter wrote: > > On Tue, Jun 23, 2015 at 03:42:30PM +0300, Dmitry Kalinkin wrote: >> @@ -178,38 +167,24 @@ static ssize_t buffer_to_user(unsigned int minor, char >> __user *buf, >>size_t count, loff_t *ppos) >> { >> void *image_ptr; >> -ssize_t retval; >> >> image_ptr = image[minor].kern_buf + *ppos; >> +if (__copy_to_user(buf, image_ptr, (unsigned long)count)) >> +return -EINVAL; > > s/EINVAL/EFAULT/ Right. Will fix in v2. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 03:59:41PM +0200, Frans Klaver wrote: > On Tue, Jun 23, 2015 at 3:59 PM, Luis de Bethencourt > wrote: > > On Tue, Jun 23, 2015 at 03:37:20PM +0200, Frans Klaver wrote: > >> On Tue, Jun 23, 2015 at 3:21 PM, Luis de Bethencourt > >> wrote: > >> > >> >> > if (dm_digtable.dig_algorithm_switch) { > >> >> > @@ -3062,7 +3062,8 @@ static void dm_dynamic_txpower(struct > >> >> > net_device *dev) > >> >> > priv->bDynamicTxLowPower = false; > >> >> > } else { > >> >> > /* high power state check */ > >> >> > - if (priv->undecorated_smoothed_pwdb < > >> >> > txlowpower_threshold && priv->bDynamicTxHighPower == true) > >> >> > + if (priv->undecorated_smoothed_pwdb < > >> >> > + txlowpower_threshold && > >> >> > priv->bDynamicTxHighPower) > >> >> > priv->bDynamicTxHighPower = false; > >> >> > >> >> Oh, this has a misleading air hanging over it. It focuses the eyes on > >> >> "txlowpower_threshold && priv->bDynamicTxHighPower", while that > >> >> probably isn't the intent. > >> >> > >> >> Frans > >> > > >> > I agree, and wasn't sure what the best way to deal with was. > >> > > >> > The following doesn't mislead but goes above 80 characters. > >> > if (priv->undecorated_smoothed_pwdb < > >> > txlowpower_threshold && > >> > priv->bDynamicTxHighPower == true) > >> > > >> > It is better than the original but it doesn't completely fix it. > >> > > >> > If this is a better compromise I can update the patch. > >> > >> If we keep people's internal parsers working properly, I think having > >> a line of three characters too long is a fair compromise. Besides > >> that, there are a lot more lines of code in that file that need to be > >> brought back to under 80 characters. > >> > >> If you really care about that line length, precede with a patch (or > >> two) that changes those insanely long (local!) variable names, so that > >> you can break up the line right away. > >> > >> Have fun, > >> Frans > > > > Very true. There are a *lot* of massively long lines. > > > > This has been a learning experience. I wasn't sure how strict the rules for > > submissions were. > > Well, as far as I know "Don't break internal parsers" wins over > "Checkpatch complains". However, checkpatch usually does have a nose > for smelly code (as does sparse, btw), so it pays to look around a bit > if it complains. In the end the maintainer decides whether a patch > passes the criteria. > Even if analyzers miss things and give false positives, they are interesting tools to find interesting code to read and maybe double-check things before submitting. > > There are other things besides line lengths that I want to fix in > > rtl8192u. Related to that, I just sent a 3rd version which includes fixes > > for > > these bool comparisons for the rest of the files in > > drivers/staging/rtl8192u/ > > > > Thanks so much for taking the time to review. Appreciated. > > No problem. Was waiting for a yocto build to finish anyway. > > Frans Have fun with yocto! Luis ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: mgc: no need to compare bool value
Inverting the value of eof is a more direct way of passing to the debugging function if eof is false or not. Signed-off-by: Luis de Bethencourt --- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 7947aec..cd3ce40 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1406,7 +1406,7 @@ again: eof = res->mcr_offset == res->mcr_size; CDEBUG(D_INFO, "Latest version %lld, more %d.\n", - res->mcr_offset, eof == false); + res->mcr_offset, !eof); ealen = sptlrpc_cli_unwrap_bulk_read(req, req->rq_bulk, 0); if (ealen < 0) { -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/6] Remove redundant spi driver bus initialization
This cleanup was already completed between end 2011 and early 2012 with a patch series from Lars-Peter Clausen: https://lkml.org/lkml/2011/11/24/190 Later on new redundant initialization re-appeared here and there. Time to cleanup again. And, yes, I'm lazy! I copy-paste the exact same commit message from Lars-Peter; only minor reformat to stay in 75 char/line and fix the name of spi_register_driver(). Regards, Antonio Antonio Borneo (6): ASoC: wm0010: Remove redundant spi driver bus initialization iio: ssp_sensors: Remove redundant spi driver bus initialization staging: mt29f_spinand: Remove redundant spi driver bus initialization net: ieee802154: Remove redundant spi driver bus initialization wireless: cw1200: Remove redundant spi driver bus initialization [media] s5c73m3: Remove redundant spi driver bus initialization drivers/iio/common/ssp_sensors/ssp_dev.c | 1 - drivers/media/i2c/s5c73m3/s5c73m3-spi.c | 1 - drivers/net/ieee802154/cc2520.c | 1 - drivers/net/ieee802154/mrf24j40.c | 1 - drivers/net/wireless/cw1200/cw1200_spi.c | 1 - drivers/staging/mt29f_spinand/mt29f_spinand.c | 1 - sound/soc/codecs/wm0010.c | 1 - 7 files changed, 7 deletions(-) -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 3/6] staging: mt29f_spinand: Remove redundant spi driver bus initialization
In ancient times it was necessary to manually initialize the bus field of an spi_driver to spi_bus_type. These days this is done in spi_register_driver(), so we can drop the manual assignment. Signed-off-by: Antonio Borneo To: Greg Kroah-Hartman To: de...@driverdev.osuosl.org Cc: linux-ker...@vger.kernel.org --- drivers/staging/mt29f_spinand/mt29f_spinand.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c index 7285c64..ad30ce4 100644 --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c @@ -948,7 +948,6 @@ static const struct of_device_id spinand_dt[] = { static struct spi_driver spinand_driver = { .driver = { .name = "mt29f", - .bus= &spi_bus_type, .owner = THIS_MODULE, .of_match_table = spinand_dt, }, -- 2.4.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 1/9] staging: vme_user: fix code alignment
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 33 + 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 9cca97a..ccf9602 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -128,7 +128,7 @@ struct vme_user_vma_priv { * transfer the data directly into the user space buffers. */ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, - loff_t *ppos) + loff_t *ppos) { ssize_t retval; ssize_t copied = 0; @@ -167,7 +167,7 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, * transfer the data directly from the user space buffers out to VME. */ static ssize_t resource_from_user(unsigned int minor, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { ssize_t retval; ssize_t copied = 0; @@ -195,7 +195,7 @@ static ssize_t resource_from_user(unsigned int minor, const char __user *buf, } static ssize_t buffer_to_user(unsigned int minor, char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { void *image_ptr; ssize_t retval; @@ -214,7 +214,7 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf, } static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { void *image_ptr; size_t retval; @@ -233,7 +233,7 @@ static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, } static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, - loff_t *ppos) +loff_t *ppos) { unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; @@ -279,7 +279,7 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, } static ssize_t vme_user_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) + size_t count, loff_t *ppos) { unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; @@ -354,7 +354,7 @@ static loff_t vme_user_llseek(struct file *file, loff_t off, int whence) * already been defined. */ static int vme_user_ioctl(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg) + unsigned int cmd, unsigned long arg) { struct vme_master master; struct vme_slave slave; @@ -390,12 +390,13 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, * to userspace as they are */ retval = vme_master_get(image[minor].resource, - &master.enable, &master.vme_addr, - &master.size, &master.aspace, - &master.cycle, &master.dwidth); + &master.enable, + &master.vme_addr, + &master.size, &master.aspace, + &master.cycle, &master.dwidth); copied = copy_to_user(argp, &master, - sizeof(struct vme_master)); + sizeof(struct vme_master)); if (copied != 0) { pr_warn("Partial copy to userspace\n"); return -EFAULT; @@ -435,12 +436,12 @@ static int vme_user_ioctl(struct inode *inode, struct file *file, * to userspace as they are */ retval = vme_slave_get(image[minor].resource, - &slave.enable, &slave.vme_addr, - &slave.size, &pci_addr, &slave.aspace, - &slave.cycle); + &slave.enable, &slave.vme_addr, + &slave.size, &pci_addr, + &slave.aspace, &slave.cycle); copied = copy_to_user(argp, &slave, - sizeof(struct vme_slave)); + sizeof(struct vme_slave)); if (copied != 0) { pr_warn("Partial copy to userspace\n"); return -EFAULT; @@ -606,7 +607,7 @@ static int vme_user_probe(struct vme_dev *vdev)
[PATCHv2 2/9] staging: vme_user: fix blank lines
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index ccf9602..494655a 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -101,13 +101,13 @@ struct image_desc { struct vme_resource *resource; /* VME resource */ int mmap_count; /* Number of current mmap's */ }; + static struct image_desc image[VME_DEVS]; static struct cdev *vme_user_cdev; /* Character device */ static struct class *vme_user_sysfs_class; /* Sysfs class */ static struct vme_dev *vme_user_bridge;/* Pointer to user device */ - static const int type[VME_DEVS] = {MASTER_MINOR, MASTER_MINOR, MASTER_MINOR, MASTER_MINOR, SLAVE_MINOR,SLAVE_MINOR, @@ -120,7 +120,6 @@ struct vme_user_vma_priv { atomic_t refcnt; }; - /* * We are going ot alloc a page during init per window for small transfers. * Small transfers will go VME -> buffer -> user space. Larger (more than a @@ -836,7 +835,6 @@ static void __exit vme_user_exit(void) vme_unregister_driver(&vme_user_driver); } - MODULE_PARM_DESC(bus, "Enumeration of VMEbus to which the driver is connected"); module_param_array(bus, int, &bus_num, 0); -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 0/9] vme_user checkpatch fixes and read()/write() rework
First four patches are fixes for various checpatch warnings. Next there is a change to drop large read()/write() stub followed by a change to rework user copy error codes. Last three changes are refactorings. v2 fixes ("vme_user: return -EFAULT on __copy_*_user errors") that had EINVAL instead of EFAULT in a couple of places. Dmitry Kalinkin (9): staging: vme_user: fix code alignment staging: vme_user: fix blank lines staging: vme_user: fix NULL comparison style staging: vme_user: fix kmalloc style staging: vme_user: allow large read()/write() staging: vme_user: return -EFAULT on __copy_*_user errors staging: vme_user: remove unused variable staging: vme_user: remove distracting comment staging: vme_user: remove okcount variable drivers/staging/vme/devices/vme_user.c | 158 +++-- 1 file changed, 51 insertions(+), 107 deletions(-) -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 3/9] staging: vme_user: fix NULL comparison style
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 494655a..2ff15f0 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -527,7 +527,7 @@ static int vme_user_master_mmap(unsigned int minor, struct vm_area_struct *vma) } vma_priv = kmalloc(sizeof(struct vme_user_vma_priv), GFP_KERNEL); - if (vma_priv == NULL) { + if (!vma_priv) { mutex_unlock(&image[minor].mutex); return -ENOMEM; } @@ -588,7 +588,7 @@ static int vme_user_probe(struct vme_dev *vdev) char *name; /* Save pointer to the bridge device */ - if (vme_user_bridge != NULL) { + if (vme_user_bridge) { dev_err(&vdev->dev, "Driver can only be loaded for 1 device\n"); err = -EINVAL; goto err_dev; @@ -636,7 +636,7 @@ static int vme_user_probe(struct vme_dev *vdev) */ image[i].resource = vme_slave_request(vme_user_bridge, VME_A24, VME_SCT); - if (image[i].resource == NULL) { + if (!image[i].resource) { dev_warn(&vdev->dev, "Unable to allocate slave resource\n"); err = -ENOMEM; @@ -645,7 +645,7 @@ static int vme_user_probe(struct vme_dev *vdev) image[i].size_buf = PCI_BUF_SIZE; image[i].kern_buf = vme_alloc_consistent(image[i].resource, image[i].size_buf, &image[i].pci_buf); - if (image[i].kern_buf == NULL) { + if (!image[i].kern_buf) { dev_warn(&vdev->dev, "Unable to allocate memory for buffer\n"); image[i].pci_buf = 0; @@ -663,7 +663,7 @@ static int vme_user_probe(struct vme_dev *vdev) /* XXX Need to properly request attributes */ image[i].resource = vme_master_request(vme_user_bridge, VME_A32, VME_SCT, VME_D32); - if (image[i].resource == NULL) { + if (!image[i].resource) { dev_warn(&vdev->dev, "Unable to allocate master resource\n"); err = -ENOMEM; @@ -671,7 +671,7 @@ static int vme_user_probe(struct vme_dev *vdev) } image[i].size_buf = PCI_BUF_SIZE; image[i].kern_buf = kmalloc(image[i].size_buf, GFP_KERNEL); - if (image[i].kern_buf == NULL) { + if (!image[i].kern_buf) { err = -ENOMEM; vme_master_free(image[i].resource); goto err_master; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 8/9] staging: vme_user: remove distracting comment
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index cf47649..de9eda5 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -134,7 +134,6 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, if (count > image[minor].size_buf) count = image[minor].size_buf; - /* We copy to kernel buffer */ copied = vme_master_read(image[minor].resource, image[minor].kern_buf, count, *ppos); if (copied < 0) -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 5/9] staging: vme_user: allow large read()/write()
This changes large master transfers to do shorter read/write rather than return -EINVAL. User space will now be able to optimistically request a large transfer and get at least some data. This also removes comments suggesting on how to implement large transfers. Current vme_master_* read and write implementations use CPU copies that don't produce burst PCI accesses and subsequently no block transfer on VME bus. In the end overall performance is quiet low and it can't be fixed by doing direct copy to user space. Much easier solution would be to just reuse kernel buffer. Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 67 -- 1 file changed, 24 insertions(+), 43 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 3467cde..101f7b9 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -132,63 +132,44 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, ssize_t retval; ssize_t copied = 0; - if (count <= image[minor].size_buf) { - /* We copy to kernel buffer */ - copied = vme_master_read(image[minor].resource, - image[minor].kern_buf, count, *ppos); - if (copied < 0) - return (int)copied; - - retval = __copy_to_user(buf, image[minor].kern_buf, - (unsigned long)copied); - if (retval != 0) { - copied = (copied - retval); - pr_info("User copy failed\n"); - return -EINVAL; - } + if (count > image[minor].size_buf) + count = image[minor].size_buf; - } else { - /* XXX Need to write this */ - pr_info("Currently don't support large transfers\n"); - /* Map in pages from userspace */ + /* We copy to kernel buffer */ + copied = vme_master_read(image[minor].resource, image[minor].kern_buf, +count, *ppos); + if (copied < 0) + return (int)copied; - /* Call vme_master_read to do the transfer */ + retval = __copy_to_user(buf, image[minor].kern_buf, + (unsigned long)copied); + if (retval != 0) { + copied = (copied - retval); + pr_info("User copy failed\n"); return -EINVAL; } return copied; } -/* - * We are going to alloc a page during init per window for small transfers. - * Small transfers will go user space -> buffer -> VME. Larger (more than a - * page) transfers will lock the user space buffer into memory and then - * transfer the data directly from the user space buffers out to VME. - */ static ssize_t resource_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { ssize_t retval; ssize_t copied = 0; - if (count <= image[minor].size_buf) { - retval = __copy_from_user(image[minor].kern_buf, buf, - (unsigned long)count); - if (retval != 0) - copied = (copied - retval); - else - copied = count; - - copied = vme_master_write(image[minor].resource, - image[minor].kern_buf, copied, *ppos); - } else { - /* XXX Need to write this */ - pr_info("Currently don't support large transfers\n"); - /* Map in pages from userspace */ - - /* Call vme_master_write to do the transfer */ - return -EINVAL; - } + if (count > image[minor].size_buf) + count = image[minor].size_buf; + + retval = __copy_from_user(image[minor].kern_buf, buf, + (unsigned long)count); + if (retval != 0) + copied = (copied - retval); + else + copied = count; + + copied = vme_master_write(image[minor].resource, image[minor].kern_buf, + copied, *ppos); return copied; } -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 4/9] staging: vme_user: fix kmalloc style
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 2ff15f0..3467cde 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -526,7 +526,7 @@ static int vme_user_master_mmap(unsigned int minor, struct vm_area_struct *vma) return err; } - vma_priv = kmalloc(sizeof(struct vme_user_vma_priv), GFP_KERNEL); + vma_priv = kmalloc(sizeof(*vma_priv), GFP_KERNEL); if (!vma_priv) { mutex_unlock(&image[minor].mutex); return -ENOMEM; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 7/9] staging: vme_user: remove unused variable
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 070e63f..cf47649 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -149,18 +149,14 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, static ssize_t resource_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { - ssize_t copied = 0; - if (count > image[minor].size_buf) count = image[minor].size_buf; if (__copy_from_user(image[minor].kern_buf, buf, (unsigned long)count)) return -EFAULT; - copied = vme_master_write(image[minor].resource, image[minor].kern_buf, - count, *ppos); - - return copied; + return vme_master_write(image[minor].resource, image[minor].kern_buf, + count, *ppos); } static ssize_t buffer_to_user(unsigned int minor, char __user *buf, -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 6/9] staging: vme_user: return -EFAULT on __copy_*_user errors
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 47 -- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index 101f7b9..070e63f 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -129,7 +129,6 @@ struct vme_user_vma_priv { static ssize_t resource_to_user(int minor, char __user *buf, size_t count, loff_t *ppos) { - ssize_t retval; ssize_t copied = 0; if (count > image[minor].size_buf) @@ -141,13 +140,8 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, if (copied < 0) return (int)copied; - retval = __copy_to_user(buf, image[minor].kern_buf, - (unsigned long)copied); - if (retval != 0) { - copied = (copied - retval); - pr_info("User copy failed\n"); - return -EINVAL; - } + if (__copy_to_user(buf, image[minor].kern_buf, (unsigned long)copied)) + return -EFAULT; return copied; } @@ -155,21 +149,16 @@ static ssize_t resource_to_user(int minor, char __user *buf, size_t count, static ssize_t resource_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { - ssize_t retval; ssize_t copied = 0; if (count > image[minor].size_buf) count = image[minor].size_buf; - retval = __copy_from_user(image[minor].kern_buf, buf, - (unsigned long)count); - if (retval != 0) - copied = (copied - retval); - else - copied = count; + if (__copy_from_user(image[minor].kern_buf, buf, (unsigned long)count)) + return -EFAULT; copied = vme_master_write(image[minor].resource, image[minor].kern_buf, - copied, *ppos); + count, *ppos); return copied; } @@ -178,38 +167,24 @@ static ssize_t buffer_to_user(unsigned int minor, char __user *buf, size_t count, loff_t *ppos) { void *image_ptr; - ssize_t retval; image_ptr = image[minor].kern_buf + *ppos; + if (__copy_to_user(buf, image_ptr, (unsigned long)count)) + return -EFAULT; - retval = __copy_to_user(buf, image_ptr, (unsigned long)count); - if (retval != 0) { - retval = (count - retval); - pr_warn("Partial copy to userspace\n"); - } else - retval = count; - - /* Return number of bytes successfully read */ - return retval; + return count; } static ssize_t buffer_from_user(unsigned int minor, const char __user *buf, size_t count, loff_t *ppos) { void *image_ptr; - size_t retval; image_ptr = image[minor].kern_buf + *ppos; + if (__copy_from_user(image_ptr, buf, (unsigned long)count)) + return -EFAULT; - retval = __copy_from_user(image_ptr, buf, (unsigned long)count); - if (retval != 0) { - retval = (count - retval); - pr_warn("Partial copy to userspace\n"); - } else - retval = count; - - /* Return number of bytes successfully read */ - return retval; + return count; } static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCHv2 9/9] staging: vme_user: remove okcount variable
Signed-off-by: Dmitry Kalinkin --- drivers/staging/vme/devices/vme_user.c | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c index de9eda5..efed9c7 100644 --- a/drivers/staging/vme/devices/vme_user.c +++ b/drivers/staging/vme/devices/vme_user.c @@ -188,7 +188,6 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; size_t image_size; - size_t okcount; if (minor == CONTROL_MINOR) return 0; @@ -206,16 +205,14 @@ static ssize_t vme_user_read(struct file *file, char __user *buf, size_t count, /* Ensure not reading past end of the image */ if (*ppos + count > image_size) - okcount = image_size - *ppos; - else - okcount = count; + count = image_size - *ppos; switch (type[minor]) { case MASTER_MINOR: - retval = resource_to_user(minor, buf, okcount, ppos); + retval = resource_to_user(minor, buf, count, ppos); break; case SLAVE_MINOR: - retval = buffer_to_user(minor, buf, okcount, ppos); + retval = buffer_to_user(minor, buf, count, ppos); break; default: retval = -EINVAL; @@ -234,7 +231,6 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf, unsigned int minor = MINOR(file_inode(file)->i_rdev); ssize_t retval; size_t image_size; - size_t okcount; if (minor == CONTROL_MINOR) return 0; @@ -251,16 +247,14 @@ static ssize_t vme_user_write(struct file *file, const char __user *buf, /* Ensure not reading past end of the image */ if (*ppos + count > image_size) - okcount = image_size - *ppos; - else - okcount = count; + count = image_size - *ppos; switch (type[minor]) { case MASTER_MINOR: - retval = resource_from_user(minor, buf, okcount, ppos); + retval = resource_from_user(minor, buf, count, ppos); break; case SLAVE_MINOR: - retval = buffer_from_user(minor, buf, okcount, ppos); + retval = buffer_from_user(minor, buf, count, ppos); break; default: retval = -EINVAL; -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 04/10] Drivers: hv: vmbus: add special kexec handler
Olaf Hering writes: > On Thu, Jun 04, K. Y. Srinivasan wrote: > >> +++ b/arch/x86/kernel/cpu/mshyperv.c >> @@ -18,6 +18,9 @@ >> #include >> #include >> #include >> +#ifdef CONFIG_KEXEC >> +#include >> +#endif > > Is this #ifdef required? > No, it's not, but other parts of the same patch do (e.g. there is no kexec_in_progress without CONFIG_KEXEC). We can probably omit #ifdef here but I'm not sure it makes sense. -- Vitaly ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
RE: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
> -Original Message- > From: K. Y. Srinivasan [mailto:k...@microsoft.com] > Sent: Sunday, June 21, 2015 7:56 PM > To: gre...@linuxfoundation.org; linux-ker...@vger.kernel.org; > de...@linuxdriverproject.org; mi...@kernel.org; pet...@infradead.org; > rafael.j.wyso...@intel.com; t...@linutronix.de > Cc: Vitaly Kuznetsov; KY Srinivasan > Subject: [PATCH 1/1] cpu-hotplug: export > cpu_hotplug_enable/cpu_hotplug_disable > > From: Vitaly Kuznetsov > > Loaded Hyper-V module will use these functions to disable CPU > hotplug under certain circumstances. Convert cpu_hotplug_disabled > to a counter (protected by cpu_add_remove_lock) to support e.g. > disable -> disable -> enable call sequences. Greg is willing to take this patch through his tree if gets an ack. Please provide your feedback. Regards, K. Y > > Signed-off-by: Vitaly Kuznetsov > Signed-off-by: K. Y. Srinivasan > --- > Documentation/power/suspend-and-cpuhotplug.txt |6 +++--- > kernel/cpu.c | 13 - > 2 files changed, 11 insertions(+), 8 deletions(-) > > diff --git a/Documentation/power/suspend-and-cpuhotplug.txt > b/Documentation/power/suspend-and-cpuhotplug.txt > index 2850df3..2fc9095 100644 > --- a/Documentation/power/suspend-and-cpuhotplug.txt > +++ b/Documentation/power/suspend-and-cpuhotplug.txt > @@ -72,7 +72,7 @@ More details follow: > | > v > Disable regular cpu hotplug > -by setting cpu_hotplug_disabled=1 > +by increasing cpu_hotplug_disabled > | > v > Release cpu_add_remove_lock > @@ -89,7 +89,7 @@ Resuming back is likewise, with the counterparts being > (in the order of > execution during resume): > * enable_nonboot_cpus() which involves: > | Acquire cpu_add_remove_lock > - | Reset cpu_hotplug_disabled to 0, thereby enabling regular cpu hotplug > + | Decrease cpu_hotplug_disabled, thereby enabling regular cpu hotplug > | Call _cpu_up() [for all those cpus in the frozen_cpus mask, in a loop] > | Release cpu_add_remove_lock > v > @@ -120,7 +120,7 @@ after the entire cycle is complete (i.e., suspend + > resume). > Acquire cpu_add_remove_lock > | > v > - If cpu_hotplug_disabled is 1 > + If cpu_hotplug_disabled > 0 > return gracefully > | > | > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 94bbe46..8f35ee6 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -190,17 +190,19 @@ void cpu_hotplug_done(void) > void cpu_hotplug_disable(void) > { > cpu_maps_update_begin(); > - cpu_hotplug_disabled = 1; > + cpu_hotplug_disabled++; > cpu_maps_update_done(); > } > +EXPORT_SYMBOL_GPL(cpu_hotplug_disable); > > void cpu_hotplug_enable(void) > { > cpu_maps_update_begin(); > - cpu_hotplug_disabled = 0; > + if (cpu_hotplug_disabled) > + cpu_hotplug_disabled--; > cpu_maps_update_done(); > } > - > +EXPORT_SYMBOL_GPL(cpu_hotplug_enable); > #endif /* CONFIG_HOTPLUG_CPU */ > > /* Need to know about CPUs going up/down? */ > @@ -600,7 +602,7 @@ int disable_nonboot_cpus(void) > if (!error) { > BUG_ON(num_online_cpus() > 1); > /* Make sure the CPUs won't be enabled by someone else > */ > - cpu_hotplug_disabled = 1; > + cpu_hotplug_disabled++; > } else { > pr_err("Non-boot CPUs are not disabled\n"); > } > @@ -622,7 +624,8 @@ void __ref enable_nonboot_cpus(void) > > /* Allow everyone to use the CPU hotplug again */ > cpu_maps_update_begin(); > - cpu_hotplug_disabled = 0; > + if (cpu_hotplug_disabled) > + cpu_hotplug_disabled--; > if (cpumask_empty(frozen_cpus)) > goto out; > > -- > 1.7.4.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Contact Him Immediately.
Dear Sir, The Central Bank of Nigeria (CBN) , Fact Finding & Special Duties office on foreign contract (FFSDO), has been given order to effect your contract and inheritance payment with reference number (LM-07-4918) amounting to the tune of (US$12,800.000.00) (Twelve Million Eight hundred thousand United State Dollars) through a Financial Consulting firm ,PATRICK COLEMAN & ASSOCIATES, who specializes in funds diplomatic delivery all over the world depends where your funds is routed to be delivered. This arrangement was made possible as a result of the inability of the former Governor of Central Bank of Nigeria ,Mallam Sanusi Lamido Sanusi to effect a positive change at the apex bank and corruption in the system which led to his indefinite suspension and also made a way for GODWIN EMEFILE the new Governor to emerge for a positive change to take place,hence this arrangement was made possible.. Based on the above, you are advised to contact the DEPUTY GOVERNOR, FOREIGN OPERATIONS DEPT. ALHAJI SULEIMAN BARAU through his email address: suleimanng...@outlook.com, quoting reference no: SB/CBN/FCPC/00215 to know the status of your payment which will be delivered to you in cash through a diplomatic means via UNITED ARAB EMIRATE (UAE) OR NETHERLAND( HOLLAND)/ FRANCE, depends where you choose. You are advised to send your CONTRACT INTERNATIONAL SCREEN NO (CISN) YOUR PERSONAL IDENTIFICATION and your direct Telephone no. for easy communication. It's pertinent you note that the funds will be packed in a two diplomatic security proof boxes weighing 50kg each padded with synthetic nylon containing coded dollars at 100 % mint stage for security reasons. You are therefore advised to contact ALHAJI SULEIMAN BARAU as said above to obtain necessary information concerning the arrangement if it's ok by you. PATRICK COLEMAN THE FINANCIAL CONSULTING FIRM has a diplomatic immunity to carry any consignment such as this. You are advised to respond urgently because this is second quarter payment of the year. We will be glad in seeing your response to this message within 72hrs or else we your payment file will be cancelled as one of the fraudulent one's in the system, also do feel free to ask questions where you don't understand. Finally,you are advised to stop further communication with any person or persons who ascribe to him or her self positions of authority they did not rising to,to avoid regrets. If you choose to have your funds via bank to bank transfer do not hesitate to let us know urgently in case you don't like cash payment. Yours Sincerely, Donald Douglas.. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/1] cpu-hotplug: export cpu_hotplug_enable/cpu_hotplug_disable
On Tue, Jun 23, 2015 at 04:57:05PM +, KY Srinivasan wrote: > > diff --git a/kernel/cpu.c b/kernel/cpu.c > > index 94bbe46..8f35ee6 100644 > > --- a/kernel/cpu.c > > +++ b/kernel/cpu.c > > @@ -190,17 +190,19 @@ void cpu_hotplug_done(void) > > void cpu_hotplug_disable(void) > > { > > cpu_maps_update_begin(); > > - cpu_hotplug_disabled = 1; > > + cpu_hotplug_disabled++; > > cpu_maps_update_done(); > > } > > +EXPORT_SYMBOL_GPL(cpu_hotplug_disable); > > > > void cpu_hotplug_enable(void) > > { > > cpu_maps_update_begin(); > > - cpu_hotplug_disabled = 0; > > + if (cpu_hotplug_disabled) > > + cpu_hotplug_disabled--; No that just papers over bugs. > > cpu_maps_update_done(); > > } ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
, [PATCH 2/2] staging : Comedi : comedi_fops : Fixed the return error, code, try_module_get fails when the reference count of the module is not, allowed to be incremented ,and hence -ENXIO is returne
___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: speakup: replace simple_strtoul() with kstrtoint()
Use the newer and nicer kstrtoint(), because simple_strtoul() is now obsolete. Signed-off-by: Luis de Bethencourt --- drivers/staging/speakup/varhandlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/speakup/varhandlers.c b/drivers/staging/speakup/varhandlers.c index 1b0d1c0..131da42 100644 --- a/drivers/staging/speakup/varhandlers.c +++ b/drivers/staging/speakup/varhandlers.c @@ -324,7 +324,7 @@ char *spk_s2uchar(char *start, char *dest) { int val = 0; - val = simple_strtoul(skip_spaces(start), &start, 10); + kstrtoint(skip_spaces(start), 10, &val); if (*start == ',') start++; *dest = (u_char)val; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] defines modified to match the 80-char rule
Defines have been written in more than one line to match the 80-character rule. This error has been fixed 6 times in this file. The file is fully compliant with respect to the coding rules now. Signed-off-by: Mario Bambagini --- .../lustre/include/linux/libcfs/libcfs_debug.h | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h index 8251ac9..aa44311 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h @@ -233,14 +233,20 @@ do { \ #define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a) #define CEMERG(format, ...)CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__) -#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__) -#define LCONSOLE_INFO(format, ...) CDEBUG_LIMIT(D_CONSOLE, format, ## __VA_ARGS__) -#define LCONSOLE_WARN(format, ...) CDEBUG_LIMIT(D_CONSOLE | D_WARNING, format, ## __VA_ARGS__) -#define LCONSOLE_ERROR_MSG(errnum, format, ...) CDEBUG_LIMIT(D_CONSOLE | D_ERROR, \ - "%x-%x: " format, errnum, LERRCHKSUM(errnum), ## __VA_ARGS__) -#define LCONSOLE_ERROR(format, ...) LCONSOLE_ERROR_MSG(0x00, format, ## __VA_ARGS__) +#define LCONSOLE(mask, format, ...)\ + CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__) +#define LCONSOLE_INFO(format, ...) \ + CDEBUG_LIMIT(D_CONSOLE, format, ## __VA_ARGS__) +#define LCONSOLE_WARN(format, ...) \ + CDEBUG_LIMIT(D_CONSOLE | D_WARNING, format, ## __VA_ARGS__) +#define LCONSOLE_ERROR_MSG(errnum, format, ...) \ + CDEBUG_LIMIT(D_CONSOLE | D_ERROR, "%x-%x: " format, \ + errnum, LERRCHKSUM(errnum), ## __VA_ARGS__) +#define LCONSOLE_ERROR(format, ...)\ + LCONSOLE_ERROR_MSG(0x00, format, ## __VA_ARGS__) -#define LCONSOLE_EMERG(format, ...) CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__) +#define LCONSOLE_EMERG(format, ...)\ + CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__) int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata, const char *format1, ...) -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
On Tue, 2015-06-23 at 12:57 +0300, Dan Carpenter wrote: > I've never seen a real life proof that (!foo) code is less > buggy. Nor have I. > I should look through the kbuild mailbox... Hm... But my other > idea of setting up code style readability testing website is also a good > one. > > Linux kernel style is based on Joe Perches finding that 80% of the code > prefers one way or the other. That's a valid method for determining > code style. I bet it normally picks the more readable style but it > would be interesting to measure it more formally. That might be hard to do well. A code readability testing website is going to be fundamentally biased by the experiences of the coder that is tested. Flashing code for millisecond type readability tests has more correlation to quantity of white to black than code content does of correctness to memorability. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 01/12] staging: lustre: fid: Use !x to check for kzalloc failure
On Tue, 2015-06-23 at 12:23 +0300, Dan Carpenter wrote: > people decided that > Yoda code was a good idea based on their gut instead of using statistics > and measurements and science. I think that style exists because compilers disallow CONST = val assignment typos. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] drivers: staging: rtl8192u: Fix "space required before the open parenthesis '('" errors
On Tue, Jun 23, 2015 at 3:01 AM, Dan Carpenter wrote: > Actually, Greg complains about these all the time. All I know is he's yet to turn away a single one of my patches. > And here is a useless URL that you can look at: http://slashdot.org > I'm sure it supports my argument. > > But seriously, he does complain about these. I've fixed more than one error on the same line many times. My useless URL supports that fact quite well. And I'll be perfectly happy to send 5 separate patches for 5 individual errors, all for the same line of code, if that's what will make you and Sudip stop complaining.. just as soon as you fix checkpatch.pl to know an existing error from a new one. -- Greg Donald ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: speakup: replace simple_strtoul() with kstrtoint()
Nope. Your patch is totally wrong (buggy). Please be more careful in the future. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: speakup: replace simple_strtoul() with kstrtoint()
On Wed, Jun 24, 2015 at 01:53:33AM +0300, Dan Carpenter wrote: > Nope. Your patch is totally wrong (buggy). Please be more careful in > the future. > > regards, > dan carpenter > I saw other commits replace the obsolete simple_strtoul() this way and the documentation makes it look like it is a 1 to 1 replacement. Sorry about this. I will investigate further to understand why this is buggy and be more careful in the future. Thanks for the review, Luis ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: , [PATCH 2/2] staging : Comedi : comedi_fops : Fixed the return error, code, try_module_get fails when the reference count of the module is not, allowed to be incremented ,and hence -ENXIO is ret
On Tue, Jun 23, 2015 at 11:48:31PM +0530, Santosh wrote: > > ___ > devel mailing list > de...@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel Your email did not get through properly :( ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH V2 04/10] Drivers: hv: vmbus: add special kexec handler
On Tue, Jun 23, 2015 at 06:28:36PM +0200, Vitaly Kuznetsov wrote: > Olaf Hering writes: > > > On Thu, Jun 04, K. Y. Srinivasan wrote: > > > >> +++ b/arch/x86/kernel/cpu/mshyperv.c > >> @@ -18,6 +18,9 @@ > >> #include > >> #include > >> #include > >> +#ifdef CONFIG_KEXEC > >> +#include > >> +#endif > > > > Is this #ifdef required? > > > > No, it's not, but other parts of the same patch do (e.g. there is no > kexec_in_progress without CONFIG_KEXEC). We can probably omit #ifdef > here but I'm not sure it makes sense. No #ifdef should be in a .c file if at all possible, so please remove them all if you can. If not, then work to fix up the .h file properly so that you can. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: speakup: replace simple_strtoul() with kstrtoint()
On Wed, Jun 24, 2015 at 12:15:52AM +0100, Luis de Bethencourt wrote: > On Wed, Jun 24, 2015 at 01:53:33AM +0300, Dan Carpenter wrote: > > Nope. Your patch is totally wrong (buggy). Please be more careful in > > the future. > > > > regards, > > dan carpenter > > > > I saw other commits replace the obsolete simple_strtoul() this way and the > documentation makes it look like it is a 1 to 1 replacement. > > Sorry about this. I will investigate further to understand why this is buggy > and be more careful in the future. simple_strtoul returns unsigned long and kstrtoint gives int. documentation says to use kstrtoul. regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: rtl8188eu: don't duplicate ieee80211 WLAN_EID_* constants
linux/ieee80211.h already defines constants for information element IDs. Include it where needed, resolve discrepancies in naming, and remove the duplicated definitions. While at it, wrap a line that was too long and remove extra parentheses in an expression that mixes only equality and logical operators. Signed-off-by: Jakub Sitnicki --- This patch depends on commit 04fbf979b39b ("rtl8188eu: don't duplicate ieee80211 constants for status/reason") in staging-next branch. drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 4 ++- drivers/staging/rtl8188eu/include/ieee80211.h | 38 -- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 3 +- 3 files changed, 5 insertions(+), 40 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c index 11b780d..c3c5828 100644 --- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c @@ -19,6 +19,8 @@ **/ #define _IEEE80211_C +#include + #include #include #include @@ -1042,7 +1044,7 @@ enum parse_res rtw_ieee802_11_parse_elems(u8 *start, uint len, elems->timeout_int = pos; elems->timeout_int_len = elen; break; - case WLAN_EID_HT_CAP: + case WLAN_EID_HT_CAPABILITY: elems->ht_capabilities = pos; elems->ht_capabilities_len = elen; break; diff --git a/drivers/staging/rtl8188eu/include/ieee80211.h b/drivers/staging/rtl8188eu/include/ieee80211.h index b129ad1..611877c 100644 --- a/drivers/staging/rtl8188eu/include/ieee80211.h +++ b/drivers/staging/rtl8188eu/include/ieee80211.h @@ -496,44 +496,6 @@ struct ieee80211_snap_hdr { /* Non standard? Not in */ #define WLAN_REASON_EXPIRATION_CHK 65535 -/* Information Element IDs */ -#define WLAN_EID_SSID 0 -#define WLAN_EID_SUPP_RATES 1 -#define WLAN_EID_FH_PARAMS 2 -#define WLAN_EID_DS_PARAMS 3 -#define WLAN_EID_CF_PARAMS 4 -#define WLAN_EID_TIM 5 -#define WLAN_EID_IBSS_PARAMS 6 -#define WLAN_EID_CHALLENGE 16 -/* EIDs defined by IEEE 802.11h - START */ -#define WLAN_EID_PWR_CONSTRAINT 32 -#define WLAN_EID_PWR_CAPABILITY 33 -#define WLAN_EID_TPC_REQUEST 34 -#define WLAN_EID_TPC_REPORT 35 -#define WLAN_EID_SUPPORTED_CHANNELS 36 -#define WLAN_EID_CHANNEL_SWITCH 37 -#define WLAN_EID_MEASURE_REQUEST 38 -#define WLAN_EID_MEASURE_REPORT 39 -#define WLAN_EID_QUITE 40 -#define WLAN_EID_IBSS_DFS 41 -/* EIDs defined by IEEE 802.11h - END */ -#define WLAN_EID_ERP_INFO 42 -#define WLAN_EID_HT_CAP 45 -#define WLAN_EID_RSN 48 -#define WLAN_EID_EXT_SUPP_RATES 50 -#define WLAN_EID_MOBILITY_DOMAIN 54 -#define WLAN_EID_FAST_BSS_TRANSITION 55 -#define WLAN_EID_TIMEOUT_INTERVAL 56 -#define WLAN_EID_RIC_DATA 57 -#define WLAN_EID_HT_OPERATION 61 -#define WLAN_EID_SECONDARY_CHANNEL_OFFSET 62 -#define WLAN_EID_20_40_BSS_COEXISTENCE 72 -#define WLAN_EID_20_40_BSS_INTOLERANT 73 -#define WLAN_EID_OVERLAPPING_BSS_SCAN_PARAMS 74 -#define WLAN_EID_MMIE 76 -#define WLAN_EID_VENDOR_SPECIFIC 221 -#define WLAN_EID_GENERIC (WLAN_EID_VENDOR_SPECIFIC) - #define IEEE80211_MGMT_HDR_LEN 24 #define IEEE80211_DATA_HDR3_LEN 24 #define IEEE80211_DATA_HDR4_LEN 30 diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 0bde2887..3aeb00a 100644 --- a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +++ b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c @@ -2666,7 +2666,8 @@ static int rtw_get_sta_wpaie(struct net_device *dev, struct ieee_param *param) psta = rtw_get_stainfo(pstapriv, param->sta_addr); if (psta) { - if ((psta->wpa_ie[0] == WLAN_EID_RSN) || (psta->wpa_ie[0] == WLAN_EID_GENERIC)) { + if (psta->wpa_ie[0] == WLAN_EID_RSN || + psta->wpa_ie[0] == WLAN_EID_VENDOR_SPECIFIC) { int wpa_ie_len; int copy_len; -- 2.1.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: rtl8192u: bool tests don't need comparisons
On Tue, Jun 23, 2015 at 03:10:56PM +0200, Luis de Bethencourt wrote: > Remove explicit true/false comparations to bool variables. > > Signed-off-by: Luis de Bethencourt > --- > diff --git a/drivers/staging/rtl8192u/r8192U_dm.c > b/drivers/staging/rtl8192u/r8192U_dm.c > index 12dd19e..9946615 100644 > --- a/drivers/staging/rtl8192u/r8192U_dm.c > +++ b/drivers/staging/rtl8192u/r8192U_dm.c > @@ -438,7 +438,7 @@ static void dm_bandwidth_autoswitch(struct net_device > *dev) > > if (priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 || > !priv->ieee80211->bandwidth_auto_switch.bautoswitch_enable) > return; > - if (priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz == false) { > /* If send packets in 40 Mhz in 20/40 */ > + if (!priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz) { /* If > send packets in 40 Mhz in 20/40 */ > if (priv->undecorated_smoothed_pwdb <= > priv->ieee80211->bandwidth_auto_switch.threshold_40Mhzto20Mhz) > priv->ieee80211->bandwidth_auto_switch.bforced_tx20Mhz > = true; > } else { /* in force send packets in 20 Mhz in 20/40 */ > @@ -563,7 +563,7 @@ static void dm_TXPowerTrackingCallback_TSSI(struct > net_device *dev) > break; > } > } > - if (viviflag == true) { > + if (viviflag) { I think you need to refresh your tree. This change has already been done by: c40753b5c7ee ("staging: rtl8192u: Removed redundant bool comparisons in r8192U_dm.c") regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RFC][PATCH 1/1] staging:vt6655: Remove checks around dev_kfree_skb
dev_kfree_skb checks for NULL pointer itself. Signed-off-by: Maninder Singh Reviewed-by: Akhilesh Kumar --- drivers/staging/vt6655/device_main.c |6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index ca578d6..0c4b0de 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -767,8 +767,7 @@ static void device_free_td0_ring(struct vnt_private *pDevice) dma_unmap_single(&pDevice->pcid->dev, pTDInfo->skb_dma, pTDInfo->skb->len, DMA_TO_DEVICE); - if (pTDInfo->skb) - dev_kfree_skb(pTDInfo->skb); + dev_kfree_skb(pTDInfo->skb); kfree(pDesc->pTDInfo); } @@ -786,8 +785,7 @@ static void device_free_td1_ring(struct vnt_private *pDevice) dma_unmap_single(&pDevice->pcid->dev, pTDInfo->skb_dma, pTDInfo->skb->len, DMA_TO_DEVICE); - if (pTDInfo->skb) - dev_kfree_skb(pTDInfo->skb); + dev_kfree_skb(pTDInfo->skb); kfree(pDesc->pTDInfo); } -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel