Jesper Juhl | 22 Jun 2012 02:28
Favicon
Gravatar

[PATCH] staging: vt6656: Correct a few assignments to be compares in iwctl_siwencodeext()

The result of "foo = bar" is true, so in statements such as
  ...
  if((pDevice->bwextstep0 = TRUE)&&(param->u.wpa_key.key_index ==1))
  ...
an assignment  is most likely not what was intended - a comparison was. As in:
  ...
  if ((pDevice->bwextstep0 == TRUE) && (param->u.wpa_key.key_index == 1))
  ...

There are a 3 such mistakes in the iwctl_siwencodeext() function.
This patch fixes them all.

Signed-off-by: Jesper Juhl <jj <at> chaosbits.net>
---
 drivers/staging/vt6656/iwctl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

  The file could also do with a serious style cleanup, but that's a 
  different (set of) patches. This one just fixes the bug.

diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index b24e531..5740438 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
 <at>  <at>  -1708,15 +1708,15  <at>  <at>  if(param->u.wpa_key.alg_name == WPA_ALG_NONE) {
    if(param->u.wpa_key.key_index ==0) {
      pDevice->bwextstep0 = TRUE;
     }
-   if((pDevice->bwextstep0 = TRUE)&&(param->u.wpa_key.key_index ==1)) {
+   if ((pDevice->bwextstep0 == TRUE) && (param->u.wpa_key.key_index == 1)) {
(Continue reading)

Dan Carpenter | 24 Jun 2012 14:08
Picon
Favicon

Re: [PATCH] staging: vt6656: Correct a few assignments to be compares in iwctl_siwencodeext()

On Fri, Jun 22, 2012 at 02:28:12AM +0200, Jesper Juhl wrote:
> The result of "foo = bar" is true, so in statements such as
>   ...
>   if((pDevice->bwextstep0 = TRUE)&&(param->u.wpa_key.key_index ==1))
>   ...
> an assignment  is most likely not what was intended - a comparison was. As in:
>   ...
>   if ((pDevice->bwextstep0 == TRUE) && (param->u.wpa_key.key_index == 1))
>   ...
> 
> There are a 3 such mistakes in the iwctl_siwencodeext() function.
> This patch fixes them all.
> 
> Signed-off-by: Jesper Juhl <jj <at> chaosbits.net>
> ---
>  drivers/staging/vt6656/iwctl.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
>   The file could also do with a serious style cleanup, but that's a 
>   different (set of) patches. This one just fixes the bug.
> 
> diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
> index b24e531..5740438 100644
> --- a/drivers/staging/vt6656/iwctl.c
> +++ b/drivers/staging/vt6656/iwctl.c
>  <at>  <at>  -1708,15 +1708,15  <at>  <at>  if(param->u.wpa_key.alg_name == WPA_ALG_NONE) {
>     if(param->u.wpa_key.key_index ==0) {
>       pDevice->bwextstep0 = TRUE;
>      }
> -   if((pDevice->bwextstep0 = TRUE)&&(param->u.wpa_key.key_index ==1)) {
(Continue reading)


Gmane