From: "Jesper Juhl" <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: mm-commits@vger.kernel.org, alan@lxorguk.ukuu.org.uk, alan@redhat.com
Subject: Re: + tty-trivial-kzalloc-opportunity.patch added to -mm tree
Date: Wed, 16 Aug 2006 23:53:24 +0200 [thread overview]
Message-ID: <9a8748490608161453y58c48fa8s5a64528d01192a84@mail.gmail.com> (raw)
In-Reply-To: <200608162142.k7GLgMYB013117@shell0.pdx.osdl.net>
On 16/08/06, akpm@osdl.org <akpm@osdl.org> wrote:
>
> The patch titled
>
> tty: trivial kzalloc opportunity
>
> has been added to the -mm tree. Its filename is
>
> tty-trivial-kzalloc-opportunity.patch
>
> See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
> out what to do about this
>
> ------------------------------------------------------
> Subject: tty: trivial kzalloc opportunity
> From: Alan Cox <alan@lxorguk.ukuu.org.uk>
>
> Signed-off-by: Alan Cox <alan@redhat.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
>
> drivers/char/tty_io.c | 8 +-------
> 1 files changed, 1 insertion(+), 7 deletions(-)
>
> diff -puN drivers/char/tty_io.c~tty-trivial-kzalloc-opportunity drivers/char/tty_io.c
> --- a/drivers/char/tty_io.c~tty-trivial-kzalloc-opportunity
> +++ a/drivers/char/tty_io.c
> @@ -160,17 +160,11 @@ static void release_mem(struct tty_struc
> * been initialized in any way but has been zeroed
> *
> * Locking: none
> - * FIXME: use kzalloc
> */
>
> static struct tty_struct *alloc_tty_struct(void)
> {
> - struct tty_struct *tty;
> -
> - tty = kmalloc(sizeof(struct tty_struct), GFP_KERNEL);
> - if (tty)
> - memset(tty, 0, sizeof(struct tty_struct));
> - return tty;
> + return (struct tty_struct *)kzalloc(sizeof(struct tty_struct), GFP_KERNEL);
> }
Let's get rid of the typecast - eh?
Might as well also make the function inline given that all that's left
of it is a single call to kzalloc() - and why not simply replace all
calls to this function with a call to kzalloc()?
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
next parent reply other threads:[~2006-08-16 21:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200608162142.k7GLgMYB013117@shell0.pdx.osdl.net>
2006-08-16 21:53 ` Jesper Juhl [this message]
2006-08-17 0:29 ` Alan Cox
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=9a8748490608161453y58c48fa8s5a64528d01192a84@mail.gmail.com \
--to=jesper.juhl@gmail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=alan@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®