lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2186059.xkuF2sVEJi@localhost.localdomain>
Date:   Sat, 10 Apr 2021 15:02:39 +0200
From:   "Fabio M. De Francesco" <fmdefrancesco@...il.com>
To:     Julia Lawall <julia.lawall@...ia.fr>
Cc:     Greg KH <gregkh@...uxfoundation.org>,
        outreachy-kernel@...glegroups.com, linux-staging@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [Outreachy kernel] [PATCH 4/4] staging: rtl8723bs: Change the type and use of a variable

On Saturday, April 10, 2021 2:12:28 PM CEST Julia Lawall wrote:
> On Sat, 10 Apr 2021, Fabio M. De Francesco wrote:
> > On Saturday, April 10, 2021 1:37:30 PM CEST Julia Lawall wrote:
> > > > That variable has global scope and is assigned at least in:
> > > What do you mean by global scope?  None of the following look like
> > > references to global variables.
> > > 
> > > julia
> > 
> > I just mean that fw_current_in_ps_mode is a field of a struct in a .h
> > file included everywhere in this driver and that the functions whom
> > the following assignments belong to have not the "static" type
> > modifier.
> OK, but a field in a structure is not a variable, and this is not what
> scope means.
>
You're right, a field in a structure is not a variable.
> 
> int x;
> 
> outside of anything is a global variable (global scope).
> 
> int foo() {
>   int x;
>   ...
> }
> 
> Here x is a local variable.  Its scope is the body of the function.
> 
> int foo() {
>   if (abc) {
>     int x;
>     ...
>   }
> }
> 
> Here x is a local variable, but its scope is only in the if branch.
>
And you're right again: I needed a little refresh of my knowledge of C.

I've searched again in the code for the purpose of finding out if that 
struct is initialized with global scope but I didn't find anything. I 
didn't even find any dynamic allocation within functions that returns 
pointers to that struct.

Therefore, according to Greg's request, I'll delete that stupid 'if' 
statement in the patch series v2 that I'm about to submit.

I've really appreciated your help.

Thanks,

Fabio
> 
> julia
> 
> > Thanks,
> > 
> > Fabio
> > 
> > > > drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:368:
> > > > pwrpriv->fw_current_in_ps_mode = false;
> > > > 
> > > > drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:380:
> > > > pwrpriv->fw_current_in_ps_mode = true;
> > > > 
> > > > drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c:433:
> > > > adapter_to_pwrctl(padapter)->fw_current_in_ps_mode = false;
> > > > 
> > > > drivers/staging/rtl8723bs/core/rtw_pwrctrl.c:981:
> > > > pwrctrlpriv->fw_current_in_ps_mode = false;




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ