Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752590AbZLSHaS (ORCPT ); Sat, 19 Dec 2009 02:30:18 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752060AbZLSHaQ (ORCPT ); Sat, 19 Dec 2009 02:30:16 -0500 Received: from mgw2.diku.dk ([130.225.96.92]:46920 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751489AbZLSHaN (ORCPT ); Sat, 19 Dec 2009 02:30:13 -0500 Date: Sat, 19 Dec 2009 08:30:10 +0100 (CET) From: Julia Lawall To: Mike Miller , iss_storagedev@hp.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2] drivers/block: drop unnecesary memset 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: 1046 Lines: 40 From: Julia Lawall memset of 0 is not needed after kzalloc The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // @@ expression x; statement S; @@ x = kzalloc(...); if (x == NULL) S ... when != x -memset(x,0,...);// Signed-off-by: Julia Lawall --- drivers/block/cciss.c | 1 - 1 file changed, 1 deletion(-) diff -u -p a/drivers/block/cciss.c b/drivers/block/cciss.c --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c @@ -4379,7 +4379,6 @@ static void cciss_shutdown(struct pci_de return; } /* write all data in the battery backed cache to disk */ - memset(flush_buf, 0, 4); return_code = sendcmd_withirq(CCISS_CACHE_FLUSH, h->ctlr, flush_buf, 4, 0, CTLR_LUNID, TYPE_CMD); kfree(flush_buf); -- 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/