From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20190107105214.GA31559@kroah.com> <20190107130314.GD3200@kadam> <20190114105123.GA22496@kadam> In-Reply-To: <20190114105123.GA22496@kadam> From: Himadri Pandya Date: Mon, 14 Jan 2019 17:39:24 +0530 Message-ID: Subject: Re: rtl8192e: need help with variable naming convention Content-Type: multipart/alternative; boundary="0000000000001f12b2057f69eb45" List-ID: To: Dan Carpenter Cc: Greg KH , driverdev-devel@linuxdriverproject.org --0000000000001f12b2057f69eb45 Content-Type: text/plain; charset="UTF-8" On Mon, 14 Jan, 2019, 4:21 PM Dan Carpenter normally obvious it's an array because of the [] characters. > Okay. How about renaming it to "_list[ ]" ? But I'm not sure if calling it a list will introduce redundancy or increase readability by showing we're implementing a list with an array? - Himadri > --0000000000001f12b2057f69eb45 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, = 14 Jan, 2019, 4:21 PM Dan Carpenter <dan.carpenter@oracle.com wrote:

Naming is hard.=C2=A0 Having "_array" in the name isn't great= either.=C2=A0 It's
normally obvious it's an array because of the [] characters.

Okay. How a= bout renaming it to "_list[ ]" ? But I'm not sure if calling = it a list will introduce redundancy or increase readability by showing we&#= 39;re implementing a list with an array?=C2=A0

<= /div>
- Himadri=C2=A0
--0000000000001f12b2057f69eb45-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 14 Jan 2019 15:37:27 +0300 From: Dan Carpenter Subject: Re: rtl8192e: need help with variable naming convention Message-ID: <20190114123727.GE4504@kadam> References: <20190107105214.GA31559@kroah.com> <20190107130314.GD3200@kadam> <20190114105123.GA22496@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-ID: To: Himadri Pandya Cc: Greg KH , driverdev-devel@linuxdriverproject.org On Mon, Jan 14, 2019 at 05:39:24PM +0530, Himadri Pandya wrote: > On Mon, 14 Jan, 2019, 4:21 PM Dan Carpenter > Naming is hard. Having "_array" in the name isn't great either. It's > > normally obvious it's an array because of the [] characters. > > > > Okay. How about renaming it to "_list[ ]" ? But I'm not sure if calling it > a list will introduce redundancy or increase readability by showing we're > implementing a list with an array? _list is fine. Or _array is fine, really. Even channal_plan[] seems Ok to me. Something that mentions region, perhaps? It's all fine. So long as you're thinking about naming and trying to say something then it's probably fine. We're not trying to be ogres or to reject patches. regards, dan carpenter From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: In-Reply-To: From: Himadri Pandya Date: Mon, 7 Jan 2019 16:15:07 +0530 Message-ID: Subject: Re: rtl8192e: need help with variable naming convention Content-Type: multipart/alternative; boundary="000000000000570db4057edbedd6" List-ID: To: driverdev-devel@linuxdriverproject.org Cc: gregkh@linuxfoundation.org --000000000000570db4057edbedd6 Content-Type: text/plain; charset="UTF-8" On Mon, Jan 7, 2019 at 4:04 PM Himadri Pandya wrote: > Should I then rename the array to something like "channel_name_"? I'm > sorry for asking such a silly question. But I want to know if renaming it > in such a ways fits in the convention before I make the change. > My bad. I meant should I then rename the array to something like "channel_plan_"? --000000000000570db4057edbedd6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, Jan 7, 2019 at 4:04 PM Himadri Pandya <himadri18.07@gmail.com> wrote:
= =C2=A0Should I then rename the array to something like "channel_name_&= quot;? I'm sorry for asking such a silly question. But I want to know i= f renaming it in such a ways fits in the convention before I make the chang= e.

My bad. I meant should I the= n rename the array to something like "channel_plan_"?=C2=A0
=
--000000000000570db4057edbedd6-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 9E6B81BF5EA for ; Mon, 14 Jan 2019 10:51:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9B5A121080 for ; Mon, 14 Jan 2019 10:51:41 +0000 (UTC) Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6SEK7qoUe3-Z for ; Mon, 14 Jan 2019 10:51:41 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by silver.osuosl.org (Postfix) with ESMTPS id 009D820796 for ; Mon, 14 Jan 2019 10:51:40 +0000 (UTC) Date: Mon, 14 Jan 2019 13:51:24 +0300 From: Dan Carpenter Subject: Re: rtl8192e: need help with variable naming convention Message-ID: <20190114105123.GA22496@kadam> References: <20190107105214.GA31559@kroah.com> <20190107130314.GD3200@kadam> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Himadri Pandya Cc: Greg KH , driverdev-devel@linuxdriverproject.org On Sat, Jan 12, 2019 at 10:31:08PM -0800, Himadri Pandya wrote: > On Mon, Jan 7, 2019 at 5:04 AM Dan Carpenter > wrote: > > > > > Ending a name with an underscore is quite ugly. > > > Yeah. That's right. So renaming it to channel_array[ ] instead. > Naming is hard. Having "_array" in the name isn't great either. It's normally obvious it's an array because of the [] characters. regards, dan carpenter _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 From: Himadri Pandya Date: Mon, 7 Jan 2019 16:04:46 +0530 Message-ID: Subject: rtl8192e: need help with variable naming convention Content-Type: multipart/alternative; boundary="000000000000478f9d057edbc879" List-ID: To: driverdev-devel@linuxdriverproject.org Cc: gregkh@linuxfoundation.org --000000000000478f9d057edbc879 Content-Type: text/plain; charset="UTF-8" Hello, I'm getting started with device drivers. And as a starter, I'm working on some clean-up patches. I'm particularly targeting to rename a structure array "ChannelPlan"(in file dot11d.c) to fix a checkpatch.pl warning "Avoid CamelCase". According to the coding style, it should be converted to "channel_plan". But the code contains a function argument with the same name "channel_plan". Should I then rename the array to something like "channel_name_"? I'm sorry for asking such a silly question. But I want to know if renaming it in such a ways fits in the convention before I make the change. Thank you. - Himadri --000000000000478f9d057edbc879 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I'm getting started with dev= ice drivers. And as a starter, I'm working on some clean-up patches.=C2= =A0 I'm particularly targeting to rename a structure array "Channe= lPlan"(in file dot11d.c) to fix a che= ckpatch.pl warning "Avoid CamelCase". According to the coding= style, it should be converted to "channel_plan". But the code co= ntains a function argument with the same name "channel_plan". Sho= uld I then rename the array to something like "channel_name_"? I&= #39;m sorry for asking such a silly question. But I want to know if renamin= g it in such a ways fits in the convention before I make the change.

Thank you.

- Himadri
<= /div> --000000000000478f9d057edbc879-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20190107105214.GA31559@kroah.com> <20190107130314.GD3200@kadam> <20190114105123.GA22496@kadam> <20190114123727.GE4504@kadam> In-Reply-To: <20190114123727.GE4504@kadam> From: Himadri Pandya Date: Tue, 15 Jan 2019 13:33:08 +0530 Message-ID: Subject: Re: rtl8192e: need help with variable naming convention Content-Type: multipart/alternative; boundary="0000000000004c8db7057f7a98e9" List-ID: To: Dan Carpenter Cc: Greg KH , driverdev-devel@linuxdriverproject.org --0000000000004c8db7057f7a98e9 Content-Type: text/plain; charset="UTF-8" On Mon, Jan 14, 2019 at 6:07 PM Dan Carpenter wrote: > On Mon, Jan 14, 2019 at 05:39:24PM +0530, Himadri Pandya wrote: > > On Mon, 14 Jan, 2019, 4:21 PM Dan Carpenter wrote: > > > > Naming is hard. Having "_array" in the name isn't great either. It's > > > normally obvious it's an array because of the [] characters. > > > > > > > Okay. How about renaming it to "_list[ ]" ? But I'm not sure if calling > it > > a list will introduce redundancy or increase readability by showing we're > > implementing a list with an array? > > _list is fine. Or _array is fine, really. Even channal_plan[] seems > Ok to me. Something that mentions region, perhaps? It's all fine. > Alright. keeping it _array then. > > So long as you're thinking about naming and trying to say something > then it's probably fine. We're not trying to be ogres or to reject > patches. > It's fine. In fact, I really appreciate your remarks. It helped me in better understanding significance of meaningful variable names. Thank you. - Himadri --0000000000004c8db7057f7a98e9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Jan 14, 2019 at 6:07 PM Dan Carpenter <dan.carpenter@oracle.com> wrote= :
On Mon, Jan 14= , 2019 at 05:39:24PM +0530, Himadri Pandya wrote:
> On Mon, 14 Jan, 2019, 4:21 PM Dan Carpenter <dan.carpenter@oracle.com wrote:=
>
> Naming is hard.=C2=A0 Having "_array" in the name isn't = great either.=C2=A0 It's
> > normally obvious it's an array because of the [] characters.<= br> > >
>
> Okay. How about renaming it to "_list[ ]" ? But I'm not = sure if calling it
> a list will introduce redundancy or increase readability by showing we= 're
> implementing a list with an array?

_list is fine.=C2=A0 Or _array is fine, really.=C2=A0 Even channal_plan[] s= eems
Ok to me.=C2=A0 Something that mentions region, perhaps?=C2=A0 It's all= fine.

Alright. keeping it _array then.=
=C2=A0

So long as you're thinking about naming and trying to say something
then it's probably fine.=C2=A0 We're not trying to be ogres or to r= eject
patches.
=C2=A0
It's fine. In fact, = I really appreciate your remarks. It helped me in better understanding sign= ificance of meaningful variable names. Thank you.=C2=A0

- Himadri
--0000000000004c8db7057f7a98e9-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 635CD1C0C88 for ; Mon, 7 Jan 2019 10:52:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 601F6853C5 for ; Mon, 7 Jan 2019 10:52:19 +0000 (UTC) Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bEOMGMe4yTeS for ; Mon, 7 Jan 2019 10:52:17 +0000 (UTC) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by whitealder.osuosl.org (Postfix) with ESMTPS id 6EB3584C3C for ; Mon, 7 Jan 2019 10:52:17 +0000 (UTC) Date: Mon, 7 Jan 2019 11:52:14 +0100 From: Greg KH Subject: Re: rtl8192e: need help with variable naming convention Message-ID: <20190107105214.GA31559@kroah.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Himadri Pandya Cc: driverdev-devel@linuxdriverproject.org On Mon, Jan 07, 2019 at 04:04:46PM +0530, Himadri Pandya wrote: > Hello, > > I'm getting started with device drivers. And as a starter, I'm working on > some clean-up patches. I'm particularly targeting to rename a structure > array "ChannelPlan"(in file dot11d.c) to fix a checkpatch.pl warning "Avoid > CamelCase". According to the coding style, it should be converted to > "channel_plan". But the code contains a function argument with the same > name "channel_plan". Should I then rename the array to something like > "channel_name_"? I'm sorry for asking such a silly question. But I want to > know if renaming it in such a ways fits in the convention before I make the > change. A structure name is different from a function name, so odds are you can just do this with no problems. Try it and find out! greg k-h _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20190107105214.GA31559@kroah.com> In-Reply-To: <20190107105214.GA31559@kroah.com> From: Himadri Pandya Date: Sat, 12 Jan 2019 22:26:55 -0800 Message-ID: Subject: Re: rtl8192e: need help with variable naming convention Content-Type: multipart/alternative; boundary="0000000000006c0207057f5104c9" List-ID: To: Greg KH Cc: driverdev-devel@linuxdriverproject.org --0000000000006c0207057f5104c9 Content-Type: text/plain; charset="UTF-8" Tried but it resulted in a compilation error. So renaming it with a different name (channel_array[ ]) instead. Thank you. - Himadri On Mon, Jan 7, 2019 at 2:52 AM Greg KH wrote: > On Mon, Jan 07, 2019 at 04:04:46PM +0530, Himadri Pandya wrote: > > Hello, > > > > I'm getting started with device drivers. And as a starter, I'm working on > > some clean-up patches. I'm particularly targeting to rename a structure > > array "ChannelPlan"(in file dot11d.c) to fix a checkpatch.pl warning > "Avoid > > CamelCase". According to the coding style, it should be converted to > > "channel_plan". But the code contains a function argument with the same > > name "channel_plan". Should I then rename the array to something like > > "channel_name_"? I'm sorry for asking such a silly question. But I want > to > > know if renaming it in such a ways fits in the convention before I make > the > > change. > > A structure name is different from a function name, so odds are you can > just do this with no problems. Try it and find out! > > greg k-h > --0000000000006c0207057f5104c9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Tried but it resulted in a compilation error. So renaming= =C2=A0it with a different name (channel_array[ ]) instead.

Thank you.

- Himadri=C2=A0

<= div class=3D"gmail_quote">
On Mon, Jan 7, 2019 at 2:52 AM G= reg KH <gregkh@linuxfounda= tion.org> wrote:
On Mon, Jan 07, 2019 at 04:04:46PM +0530, Himadri Pandya wrote:
> Hello,
>
> I'm getting started with device drivers. And as a starter, I'm= working on
> some clean-up patches.=C2=A0 I'm particularly targeting to rename = a structure
> array "ChannelPlan"(in file dot11d.c) to fix a checkpatch.pl = warning "Avoid
> CamelCase". According to the coding style, it should be converted= to
> "channel_plan". But the code contains a function argument wi= th the same
> name "channel_plan". Should I then rename the array to somet= hing like
> "channel_name_"? I'm sorry for asking such a silly quest= ion. But I want to
> know if renaming it in such a ways fits in the convention before I mak= e the
> change.

A structure name is different from a function name, so odds are you can
just do this with no problems.=C2=A0 Try it and find out!

greg k-h
--0000000000006c0207057f5104c9-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 References: <20190107105214.GA31559@kroah.com> <20190107130314.GD3200@kadam> In-Reply-To: <20190107130314.GD3200@kadam> From: Himadri Pandya Date: Sat, 12 Jan 2019 22:31:08 -0800 Message-ID: Subject: Re: rtl8192e: need help with variable naming convention Content-Type: multipart/alternative; boundary="000000000000801b95057f511348" List-ID: To: Dan Carpenter Cc: Greg KH , driverdev-devel@linuxdriverproject.org --000000000000801b95057f511348 Content-Type: text/plain; charset="UTF-8" On Mon, Jan 7, 2019 at 5:04 AM Dan Carpenter wrote: > > Ending a name with an underscore is quite ugly. Yeah. That's right. So renaming it to channel_array[ ] instead. > Feel free to get more > creative with the naming scheme. Rethink things as much as you can, > don't assume the original code is something to copy. > I wasn't sure if I'm allowed to do so. Thank you for letting me know. - Himadri --000000000000801b95057f511348 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Mon, Jan 7, 2019 at 5:04 AM Dan Carpenter <dan.carpenter@oracle.com> wrote:
<= /div>

Ending a name with an underscore is quite ugly.=C2=A0

=
Yeah. That's right. So renaming it to channel_array[ ] inste= ad.
=C2=A0
Feel free to get more
creative with the naming scheme.=C2=A0 Rethink things as much as you can, don't assume the original code is something to copy.

I wasn't sure if I'm allowed to do so. Thank you = for letting me know.

- Himadri=C2=A0
--000000000000801b95057f511348-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 040311C1604 for ; Mon, 7 Jan 2019 13:04:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 01CBD85933 for ; Mon, 7 Jan 2019 13:04:14 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G+WycN+awmLx for ; Mon, 7 Jan 2019 13:04:13 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by hemlock.osuosl.org (Postfix) with ESMTPS id 52CE585803 for ; Mon, 7 Jan 2019 13:04:13 +0000 (UTC) Date: Mon, 7 Jan 2019 16:03:14 +0300 From: Dan Carpenter Subject: Re: rtl8192e: need help with variable naming convention Message-ID: <20190107130314.GD3200@kadam> References: <20190107105214.GA31559@kroah.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190107105214.GA31559@kroah.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Greg KH Cc: driverdev-devel@linuxdriverproject.org On Mon, Jan 07, 2019 at 11:52:14AM +0100, Greg KH wrote: > On Mon, Jan 07, 2019 at 04:04:46PM +0530, Himadri Pandya wrote: > > Hello, > > > > I'm getting started with device drivers. And as a starter, I'm working on > > some clean-up patches. I'm particularly targeting to rename a structure > > array "ChannelPlan"(in file dot11d.c) to fix a checkpatch.pl warning "Avoid > > CamelCase". According to the coding style, it should be converted to > > "channel_plan". But the code contains a function argument with the same > > name "channel_plan". Should I then rename the array to something like > > "channel_name_"? Ending a name with an underscore is quite ugly. Feel free to get more creative with the naming scheme. Rethink things as much as you can, don't assume the original code is something to copy. regards, dan carpenter _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel