All of lore.kernel.org
 help / color / mirror / Atom feed
* Weird formatting in rtl8723bs driver code?
@ 2022-10-20  2:43 Emily Peri
  2022-10-20  4:01 ` Praveen Kumar
  2022-10-20  5:13 ` Julia Lawall
  0 siblings, 2 replies; 5+ messages in thread
From: Emily Peri @ 2022-10-20  2:43 UTC (permalink / raw)
  To: outreachy

I'm working on cleaning up the rtl8723bs driver with checkpatch, but I
noticed that some of the variable declarations have differnt amounts of
whitespace, like this:

        struct cmd_obj  *ph2c;
        struct sitesurvey_parm  *psurveyPara;
        struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;
        struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;

At first I thought this was intentional, but now I'm wondering if this
is an accident. It's normal to just use one space between the type and
the variable name, right?


--Emily

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird formatting in rtl8723bs driver code?
  2022-10-20  2:43 Weird formatting in rtl8723bs driver code? Emily Peri
@ 2022-10-20  4:01 ` Praveen Kumar
  2022-10-20  5:15   ` Emily Peri
  2022-10-20  5:13 ` Julia Lawall
  1 sibling, 1 reply; 5+ messages in thread
From: Praveen Kumar @ 2022-10-20  4:01 UTC (permalink / raw)
  To: Emily Peri, outreachy

On 20-10-2022 08:13, Emily Peri wrote:
> I'm working on cleaning up the rtl8723bs driver with checkpatch, but I
> noticed that some of the variable declarations have differnt amounts of
> whitespace, like this:
> 
>         struct cmd_obj  *ph2c;
>         struct sitesurvey_parm  *psurveyPara;

Addition to white-spaces you can also rework on making variable names to Linux standards, something like "psurveyPara" to "psurvey_para".


>         struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;

This needs some formatting in my understanding. 

>         struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
> 
> At first I thought this was intentional, but now I'm wondering if this
> is an accident. It's normal to just use one space between the type and
> the variable name, right?
> 

In my understanding and what I've observed we use one space between the data type and variable name, but would let others to comment on this. Thanks.

> 
> --Emily


Regards,

~Praveen.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird formatting in rtl8723bs driver code?
  2022-10-20  2:43 Weird formatting in rtl8723bs driver code? Emily Peri
  2022-10-20  4:01 ` Praveen Kumar
@ 2022-10-20  5:13 ` Julia Lawall
  2022-10-20  5:17   ` Emily Peri
  1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2022-10-20  5:13 UTC (permalink / raw)
  To: Emily Peri; +Cc: outreachy



On Wed, 19 Oct 2022, Emily Peri wrote:

> I'm working on cleaning up the rtl8723bs driver with checkpatch, but I
> noticed that some of the variable declarations have differnt amounts of
> whitespace, like this:
>
>         struct cmd_obj  *ph2c;
>         struct sitesurvey_parm  *psurveyPara;
>         struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;
>         struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
>
> At first I thought this was intentional, but now I'm wondering if this
> is an accident. It's normal to just use one space between the type and
> the variable name, right?

One space should be fine.  People may like to line up the variable names
in some cases, but this is clearly not lined up either.

julia

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird formatting in rtl8723bs driver code?
  2022-10-20  4:01 ` Praveen Kumar
@ 2022-10-20  5:15   ` Emily Peri
  0 siblings, 0 replies; 5+ messages in thread
From: Emily Peri @ 2022-10-20  5:15 UTC (permalink / raw)
  To: Praveen Kumar; +Cc: outreachy

On Thu, Oct 20, 2022 at 09:31:33AM +0530, Praveen Kumar wrote:
> On 20-10-2022 08:13, Emily Peri wrote:
> > I'm working on cleaning up the rtl8723bs driver with checkpatch, but I
> > noticed that some of the variable declarations have differnt amounts of
> > whitespace, like this:
> > 
> >         struct cmd_obj  *ph2c;
> >         struct sitesurvey_parm  *psurveyPara;
> 
> Addition to white-spaces you can also rework on making variable names to Linux standards, something like "psurveyPara" to "psurvey_para".

Great suggestion, thanks!

> 
> >         struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;
> 
> This needs some formatting in my understanding. 
> 
> >         struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
> > 
> > At first I thought this was intentional, but now I'm wondering if this
> > is an accident. It's normal to just use one space between the type and
> > the variable name, right?
> > 
> 
> In my understanding and what I've observed we use one space between the data type and variable name, but would let others to comment on this. Thanks.

Okay good to know I'm not alone in this line of thinking haha. If I
continue working on this driver (probaly won't get to it until Friday)
I'll clean up the spacing.

> > 
> > --Emily
> 
> 
> Regards,
> 
> ~Praveen.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Weird formatting in rtl8723bs driver code?
  2022-10-20  5:13 ` Julia Lawall
@ 2022-10-20  5:17   ` Emily Peri
  0 siblings, 0 replies; 5+ messages in thread
From: Emily Peri @ 2022-10-20  5:17 UTC (permalink / raw)
  To: Julia Lawall; +Cc: outreachy

On Thu, Oct 20, 2022 at 07:13:58AM +0200, Julia Lawall wrote:
> 
> 
> On Wed, 19 Oct 2022, Emily Peri wrote:
> 
> > I'm working on cleaning up the rtl8723bs driver with checkpatch, but I
> > noticed that some of the variable declarations have differnt amounts of
> > whitespace, like this:
> >
> >         struct cmd_obj  *ph2c;
> >         struct sitesurvey_parm  *psurveyPara;
> >         struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;
> >         struct mlme_ext_priv    *pmlmeext = &padapter->mlmeextpriv;
> >
> > At first I thought this was intentional, but now I'm wondering if this
> > is an accident. It's normal to just use one space between the type and
> > the variable name, right?
> 
> One space should be fine.  People may like to line up the variable names
> in some cases, but this is clearly not lined up either.
> 
> julia

Oh, that makes more sense! I'll keep that in mind.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-20  5:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-20  2:43 Weird formatting in rtl8723bs driver code? Emily Peri
2022-10-20  4:01 ` Praveen Kumar
2022-10-20  5:15   ` Emily Peri
2022-10-20  5:13 ` Julia Lawall
2022-10-20  5:17   ` Emily Peri

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.