Skip to contentSkip to conversation

Weird formatting in rtl8723bs driver code?

DISCUSSION Emily Peri 3 participants 5 messages Oct 20, 2022

lore
Share & tools
lore

Emily Peri

author
#0 lore raw

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

#1 lore raw
Quoted 6 lines · Emily Peri

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".

Quoted 1 line
        struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;

This needs some formatting in my understanding.

Quoted 6 lines
        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.

Quoted 2 lines

--Emily

Regards,

~Praveen.

author
#2 lore raw
Quoted 9 lines · Praveen Kumar
Quoted 6 lines · Emily Peri

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!

Quoted 5 lines
Quoted 2 lines
        struct cmd_priv                                 *pcmdpriv = &padapter->cmdpriv;

This needs some formatting in my understanding.

Quoted 8 lines
Quoted 6 lines
        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.

Quoted 7 lines
Quoted 2 lines

--Emily

Regards,

~Praveen.

#3 lore raw
In reply to Emily Peri
Quoted 4 lines · Emily Peri

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:

Quoted 8 lines
        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

author
#4 lore raw
Quoted 13 lines · Julia Lawall
Quoted 9 lines · Emily Peri

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;
Quoted 8 lines
Quoted 3 lines

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.