All of lore.kernel.org
 help / color / mirror / Atom feed
From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: Are the cast necessary in function "kfree"?
Date: Wed, 20 May 2009 12:18:07 +0000	[thread overview]
Message-ID: <4A13F4FF.5090501@bfs.de> (raw)
In-Reply-To: <5c43c2d40905200330p5b14be2ey567bc493374e09b3@mail.gmail.com>



Paul Mundt schrieb:
> On Wed, May 20, 2009 at 11:30:21AM +0100, Andr? Lopes wrote:
>> Hi. This is my first post :-)
>>
>> I was reading this doc (/linux-2.6/Documentation/scsi/ChangeLog.lpfc),
>> when I found this phrase: "Replace some kfree((void*)ptr) with
>> kfree(ptr)."
>>
> [snip]
> 
>> These casts are not necessary...I think so. If it's yes, can we apply
>> patch's to clean-up this?
>>
> The key thing here is "ptr", as long as these are pointers, then the cast
> is superfluous. In the case of casting from a non-pointer type, the cast
> is necessary, particularly if the data type and pointer size vary.

i think the problem is clear,

since he ask for advice..
IMHO i would start with identifying adding a marker
like /* cast needed ...*/, perhaps creating a  myfree(propper type).

that would document the use and prevent other people from converting.

just my 2 cents,
re,
 wh




      parent reply	other threads:[~2009-05-20 12:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-20 10:30 Are the cast necessary in function "kfree"? André Lopes
2009-05-20 10:30 ` André Lopes
2009-05-20 10:38 ` Christian Bornträger
2009-05-20 10:38   ` Christian Bornträger
2009-05-20 11:16 ` Paul Mundt
2009-05-20 11:16   ` Paul Mundt
2009-05-20 12:18 ` walter harms [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=4A13F4FF.5090501@bfs.de \
    --to=wharms@bfs.de \
    --cc=kernel-janitors@vger.kernel.org \
    /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.