From: walter harms <wharms@bfs.de>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] cris/arch-v32: Remove unnecessary cast of return
Date: Wed, 04 Jul 2007 09:01:00 +0000 [thread overview]
Message-ID: <468B61CC.8040205@bfs.de> (raw)
In-Reply-To: <46857CC8020000F40000AA4A@lucius.provo.novell.com>
Suresh Jayaraman wrote:
> On Tue, 2007-07-03 at 12:32 +0000, walter harms wrote:
>> Suresh Jayaraman wrote:
>>> Remove unnecessary cast of return value of kmalloc() in
>>> cris/arch-v32/mm/intmem.c
>>>
>>> Signed-off-by: Suresh Jayaraman <sjayaraman@novell.com>
>>> ---
>>>
>>> diff --git a/arch/cris/arch-v32/mm/intmem.c b/arch/cris/arch-v32/mm/intmem.c
>>> index 41ee7f7..d1e0bf4 100644
>>> --- a/arch/cris/arch-v32/mm/intmem.c
>>> +++ b/arch/cris/arch-v32/mm/intmem.c
>>> @@ -27,8 +27,8 @@ static void crisv32_intmem_init(void)
>>> {
>>> static int initiated = 0;
>>> if (!initiated) {
>>> - struct intmem_allocation* alloc >>> - (struct intmem_allocation*)kmalloc(sizeof *alloc, GFP_KERNEL);
>>> + struct intmem_allocation *alloc = kmalloc(sizeof *alloc,
>>> + GFP_KERNEL);
>> IMHO every kmalloc() should check if it worked at all
>>
>> if (!alloc) {
>> kprintf("no memory panic !\n");
>> return;
>
>> }
>
> If we all agree that kmalloc() checks should be done everwhere, this
> probably can be a separate Kernel Janitor task.
>
you are right, normaly it would better to have two patches. IMHO for this special case
(since removing a case is small change) you add the check.
The important point is to look not only for "the task" - like removing the cast - but also
for other errors. i may take some time before the next will check that file again.
re,
wh
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
next prev parent reply other threads:[~2007-07-04 9:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-29 16:12 [KJ] [PATCH] cris/arch-v32: Remove unnecessary cast of return value Suresh Jayaraman
2007-07-03 12:28 ` [KJ] [PATCH] cris/arch-v32: Remove unnecessary cast of return walter harms
2007-07-04 5:02 ` [KJ] [PATCH] cris/arch-v32: Remove unnecessary cast of Suresh Jayaraman
2007-07-04 9:01 ` walter harms [this message]
2007-07-04 10:43 ` Suresh Jayaraman
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=468B61CC.8040205@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.