All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 5/6] ARM: tegra: MASK_BITS_ no longer needs specific values
Date: Fri, 24 Jan 2014 10:09:51 -0700	[thread overview]
Message-ID: <52E29E5F.5@wwwdotorg.org> (raw)
In-Reply-To: <20140124135011.GC25720@ulmo.nvidia.com>

On 01/24/2014 06:50 AM, Thierry Reding wrote:
> On Wed, Jan 22, 2014 at 01:20:35PM -0700, Stephen Warren wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Since all code that sets or interprets MASK_BITS_* now uses the enums
>> to define/compare the values, there is no need for MASK_BITS_* to have
>> a specific integer value. In fact, having a specific integer value may
>> encourage people to hard-code those values, or interpret the values in
>> incorrect ways.
>>
>> As such, remove the logic that assigns a specific value to the enum
>> values in order to make it completely clear that it's just an enum, not
>> something that directly represents some integer value.
> 
> Ah yes, that's a nice way to clean it up as well, so my earlier comment
> about turning these into defines can be considered obsolete.

I guess I should read all the replies first:-)

>> diff --git a/arch/arm/include/asm/arch-tegra/clock.h b/arch/arm/include/asm/arch-tegra/clock.h

>>  enum {
>> -	MASK_BITS_31_30	= 2,	/* num of bits used to specify clock source */
>> +	MASK_BITS_31_30,	/* num of bits used to specify clock source */
> 
> Should the comment not be removed as well now?

Well, it the enum name still defines the position (and size), just not
the value any more:-)

But yes, it's obvious enough without the commment, so I'll remove that.

  reply	other threads:[~2014-01-24 17:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 20:20 [U-Boot] [PATCH 1/6] ARM: tegra: deduplicate MASK_BITS_xxx clock mux enum Stephen Warren
2014-01-22 20:20 ` [U-Boot] [PATCH 2/6] ARM: tegra: rename MASK_BITS_29_28 to MASK_BITS_31_28 Stephen Warren
2014-01-24 13:44   ` Thierry Reding
2014-01-24 17:08     ` Stephen Warren
2014-01-22 20:20 ` [U-Boot] [PATCH 3/6] ARM: tegra: rename OUT_CLK_SOURCE_* Stephen Warren
2014-01-24 13:47   ` Thierry Reding
2014-01-24 17:08     ` Stephen Warren
2014-01-22 20:20 ` [U-Boot] [PATCH 4/6] ARM: tegra: use MASK_BITS_* macros everywhere Stephen Warren
2014-01-22 20:20 ` [U-Boot] [PATCH 5/6] ARM: tegra: MASK_BITS_ no longer needs specific values Stephen Warren
2014-01-24 13:50   ` Thierry Reding
2014-01-24 17:09     ` Stephen Warren [this message]
2014-01-22 20:20 ` [U-Boot] [PATCH 6/6] ARM: tegra: implement MASK_BITS_31_29 Stephen Warren
2014-01-22 21:35 ` [U-Boot] [PATCH 1/6] ARM: tegra: deduplicate MASK_BITS_xxx clock mux enum Tom Warren
2014-01-22 21:54   ` Stephen Warren
2014-01-22 22:05     ` Tom Warren
2014-01-24 13:54 ` Thierry Reding
2014-01-24 17:15   ` Stephen Warren

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=52E29E5F.5@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=u-boot@lists.denx.de \
    /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 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.