From: Andrew Morton <akpm@osdl.org>
To: takis@issaris.org
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cs53l32a: kzalloc conversion
Date: Wed, 4 Jan 2006 16:39:29 -0800 [thread overview]
Message-ID: <20060104163929.58a083d8.akpm@osdl.org> (raw)
In-Reply-To: <20060103143301.0D98E5BC3@localhost.localdomain>
takis@issaris.org (Panagiotis Issaris) wrote:
>
> From: Panagiotis Issaris <takis@issaris.org>
>
> Conversion of kmalloc+memset to kzalloc.
>
> Signed-off-by: Panagiotis Issaris <takis@issaris.org>
>
> ---
>
> drivers/media/video/cs53l32a.c | 3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
> d27ad6f2f4c46ed0b29034c413cc8f948506fdc6
> diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c
> index 780b352..f9e3b8b 100644
> --- a/drivers/media/video/cs53l32a.c
> +++ b/drivers/media/video/cs53l32a.c
> @@ -146,11 +146,10 @@ static int cs53l32a_attach(struct i2c_ad
> if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
> return 0;
>
> - client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
> + client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
> if (client == 0)
> return -ENOMEM;
>
> - memset(client, 0, sizeof(struct i2c_client));
> client->addr = address;
> client->adapter = adapter;
> client->driver = &i2c_driver;
A quick grep shows that there are ~60 kmalloc+memsets under
drivers/media/video. So I'd prefer that if we're going to do this, we do
it all in one big hit rather than merging a dribble of little patches.
If someone does this, please also remove the typecasts of the
kmalloc/kzalloc return value, such as
drivers/media/video/mxb.c: mxb = (struct mxb*)kmalloc(sizeof(struct mxb), GFP_KERNEL);
next prev parent reply other threads:[~2006-01-05 0:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-03 14:33 Panagiotis Issaris
2006-01-05 0:39 ` Andrew Morton [this message]
2006-01-05 11:57 ` Takis
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=20060104163929.58a083d8.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=takis@issaris.org \
--cc=torvalds@osdl.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®