linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Sylvain Munaut <tnt@246tNt.com>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>,
	Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH v2] powerpc: change rheap functions to use ulongs instead of pointers
Date: Tue, 10 Apr 2007 21:42:45 +0200	[thread overview]
Message-ID: <461BE8B5.7000903@246tNt.com> (raw)
In-Reply-To: <DF53284F-75DF-4077-BAC2-41F69093F755@kernel.crashing.org>

Kumar Gala wrote:
>
> On Apr 10, 2007, at 2:09 PM, Timur Tabi wrote:
>
>> Kumar Gala wrote:
>>
>>> What's the specific problem you are fixing?  Its not obvious that
>>> this patch is addressing a bug.
>>
>> problem != bug
>>
>> The problem is that a pointer implies something you can dereference. 
>> But the return value from rh_alloc() is only a pointer in a specific
>> circumstance which is not actually used in any current code.  So
>> *all* of the callers of rh_alloc() cast the return value to an
>> integer type anyway.
>>
>> In other words, it's wrong to use a pointer.  The value is a generic
>> number, and so the type needs to match that.  The code is just better
>> using ulongs.  Also, two redundant macros (IS_MURAM_ERR, etc) have
>> been removed and replaced with their generic counterpart (IS_ERR_VALUE).
>
> I consider this all code cleanup at this point since the code is
> functional at this point.  I don't disagree with any of your points,
> but this is cleanup.  We should take this all the way if we are going
> to do it.
I like this patch, I think the conversion to ulong does make sense (a
whole lot more than void * ...).

And I don't really agree that we need to "take it all the way" at once
... Even if later it's interesting to make it more global, the work that
is done here won't be lost so I'm in favor of merging that now.
Moving it to /lib is most likely going to take quite some time and that
should not prevent local cleaning of arch/powerpc

Removing all those cast make the core more readable imho. And writing
new code that use rheap is a whole lot more clear without having to
bother casting to/from void* each time you use a rh_ function ...


    Sylvain

      reply	other threads:[~2007-04-10 19:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04 22:07 [PATCH v2] powerpc: change rheap functions to use ulongs instead of pointers Timur Tabi
2007-04-09 21:25 ` Timur Tabi
2007-04-10 18:31   ` Kumar Gala
2007-04-10 18:46     ` Timur Tabi
2007-04-10 19:04       ` Kumar Gala
2007-04-10 19:09         ` Timur Tabi
2007-04-10 19:32           ` Kumar Gala
2007-04-10 19:42             ` Sylvain Munaut [this message]

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=461BE8B5.7000903@246tNt.com \
    --to=tnt@246tnt.com \
    --cc=galak@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=timur@freescale.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).