Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751532AbZLSHQT (ORCPT ); Sat, 19 Dec 2009 02:16:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751246AbZLSHQS (ORCPT ); Sat, 19 Dec 2009 02:16:18 -0500 Received: from mgw1.diku.dk ([130.225.96.91]:34248 "EHLO mgw1.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbZLSHQQ (ORCPT ); Sat, 19 Dec 2009 02:16:16 -0500 Date: Sat, 19 Dec 2009 08:16:13 +0100 (CET) From: Julia Lawall To: ecashin@coraid.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/7] drivers/block/aoe: Use kzalloc for allocating only one thing Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1592 Lines: 52 From: Julia Lawall Use kzalloc rather than kcalloc(1,...) The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ @@ - kcalloc(1, + kzalloc( ...) // Signed-off-by: Julia Lawall --- drivers/block/aoe/aoecmd.c | 2 +- drivers/block/aoe/aoedev.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -u -p a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c --- a/drivers/block/aoe/aoecmd.c 2009-12-08 20:58:27.000000000 +0100 +++ b/drivers/block/aoe/aoecmd.c 2009-12-19 07:52:28.000000000 +0100 @@ -954,7 +954,7 @@ addtgt(struct aoedev *d, char *addr, ulo "aoe: device addtgt failure; too many targets\n"); return NULL; } - t = kcalloc(1, sizeof *t, GFP_ATOMIC); + t = kzalloc(sizeof *t, GFP_ATOMIC); f = kcalloc(nframes, sizeof *f, GFP_ATOMIC); if (!t || !f) { kfree(f); diff -u -p a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c --- a/drivers/block/aoe/aoedev.c 2009-09-14 14:55:49.000000000 +0200 +++ b/drivers/block/aoe/aoedev.c 2009-12-19 07:52:28.000000000 +0100 @@ -211,7 +211,7 @@ aoedev_by_sysminor_m(ulong sysminor) break; if (d) goto out; - d = kcalloc(1, sizeof *d, GFP_ATOMIC); + d = kzalloc(sizeof *d, GFP_ATOMIC); if (!d) goto out; INIT_WORK(&d->work, aoecmd_sleepwork); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/