linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@gmail.com>
To: Benoit PAPILLAULT <benoit.papillault@free.fr>
Cc: rt2x00 Users List <users@rt2x00.serialmonkey.com>,
	linux-wireless@vger.kernel.org
Subject: Re: [rt2x00-users] [PATCH 4/9] rt2x00: Remove rt2800 version	constants.
Date: Sat, 10 Apr 2010 10:57:57 +0200	[thread overview]
Message-ID: <4BC03D95.8060801@gmail.com> (raw)
In-Reply-To: <4BBFA1BD.70900@free.fr>

On 04/09/10 23:53, Benoit PAPILLAULT wrote:
> Ivo van Doorn a écrit :
>> On Thursday 08 April 2010, Gertjan van Wingerde wrote:
>>  
>>> The rt2800 version constants are inconsistent, and the version number
>>> don't
>>> mean a lot of things anyway. Use the literal values in the code
>>> instead of
>>> some sort of fabricated version name macro.
>>>
>>> Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
>>>     
>>
>> Perhaps a more elegant way of using and defining needs to be found.
>> But at least the defined show what the purpose for the values is
>> rather then having magical values spread around the code.
>>
>> Ivo
>>
>>   
> Agreed, it's a lot better to avoid hardcoded value. #define adds a
> meaning to the numeric value and if such define needs to be changed,
> there's only one place to change, avoiding bugs by duplicating hardcoded
> values and only changing one instance.
> 
> Even, #define MCS_0 0 is useful :-)
> 

To be honest, I don't think that constants with meaningless names are better
or useful.

If a constant is used it should have a meaningful name, otherwise it is just
as bad as using a magical value. The only change is that it now is a magical
name. IMHO that actually worsens the situation as code readers will start
thinking about what that name actually means.

However, I think I found some sort of scheme that can be used for the version
numbers. See my other email to the mailing list.

---
Gertjan.

  reply	other threads:[~2010-04-10  8:57 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-08 21:50 [PATCH 0/9] rt2x00: Align with vendor driver and add support for rt3070/rt3071/rt3090/rt3390 Gertjan van Wingerde
2010-04-08 21:50 ` [PATCH 1/9] rt2x00: Let RF chipset decide the RF channel switch method to use in rt2800 Gertjan van Wingerde
2010-04-08 22:17   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 2/9] rt2x00: Update rt2800 register definitions towards latest definitions Gertjan van Wingerde
2010-04-08 22:17   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 3/9] rt2x00: Align RT chipset definitions with vendor driver Gertjan van Wingerde
2010-04-08 22:28   ` Felix Fietkau
2010-04-09  5:10     ` Gertjan van Wingerde
2010-04-09  5:38       ` Gertjan van Wingerde
2010-04-09  7:42         ` Helmut Schaa
2010-04-09  5:43       ` Felix Fietkau
2010-04-09 11:32         ` Helmut Schaa
2010-04-09 11:52           ` Felix Fietkau
2010-04-09 12:23             ` Helmut Schaa
2010-04-09 12:26               ` Felix Fietkau
2010-04-09 12:30                 ` Luis Correia
2010-04-09 14:01                   ` Gabor Juhos
2010-04-09 12:32                 ` Helmut Schaa
2010-04-09 17:23                   ` Gertjan van Wingerde
2010-04-08 22:33   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 4/9] rt2x00: Remove rt2800 version constants Gertjan van Wingerde
2010-04-08 22:32   ` Ivo van Doorn
2010-04-08 23:53     ` Julian Calaby
2010-04-09  6:54       ` Ivo Van Doorn
2010-04-09  7:00         ` Julian Calaby
2010-04-10  8:57           ` Gertjan van Wingerde
2010-04-10  9:16             ` Ivo van Doorn
2010-04-10 11:20             ` Julian Calaby
2010-04-09 21:53     ` [rt2x00-users] " Benoit PAPILLAULT
2010-04-10  8:57       ` Gertjan van Wingerde [this message]
2010-04-08 21:50 ` [PATCH 5/9] rt2x00: Align rt2800 register initialization with vendor driver Gertjan van Wingerde
2010-04-08 22:33   ` Ivo van Doorn
2010-04-10 19:14     ` Gertjan van Wingerde
2010-04-10 20:58       ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 6/9] rt2x00: Finish rt3070 support in rt2800 register initialization Gertjan van Wingerde
2010-04-08 22:33   ` Ivo van Doorn
2010-04-10 20:52     ` Gertjan van Wingerde
2010-04-08 21:50 ` [PATCH 7/9] rt2x00: Add rt3071 " Gertjan van Wingerde
2010-04-08 22:38   ` Ivo van Doorn
2010-04-10 21:30     ` Gertjan van Wingerde
2010-04-08 21:50 ` [PATCH 8/9] rt2x00: Add rt3090 " Gertjan van Wingerde
2010-04-08 22:39   ` Ivo van Doorn
2010-04-08 21:50 ` [PATCH 9/9] rt2x00: Add rt3390 " Gertjan van Wingerde
2010-04-08 22:39   ` Ivo van Doorn
2010-04-08 22:16 ` [PATCH 0/9] rt2x00: Align with vendor driver and add support for rt3070/rt3071/rt3090/rt3390 Ivo van Doorn
2010-04-10  9:01   ` Gertjan van Wingerde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BC03D95.8060801@gmail.com \
    --to=gwingerde@gmail.com \
    --cc=benoit.papillault@free.fr \
    --cc=linux-wireless@vger.kernel.org \
    --cc=users@rt2x00.serialmonkey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).