From: Julia Lawall <julia@diku.dk>
To: Mike Miller <mike.miller@hp.com>,
iss_storagedev@hp.com, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH 1/2] drivers/block: drop unnecesary memset
Date: Sat, 19 Dec 2009 08:30:10 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.0912190829470.30546@ask.diku.dk> (raw)
From: Julia Lawall <julia@diku.dk>
memset of 0 is not needed after kzalloc
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
// <smpl>
@@
expression x;
statement S;
@@
x = kzalloc(...);
if (x == NULL) S
... when != x
-memset(x,0,...);// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
---
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);
next reply other threads:[~2009-12-19 7:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-19 7:30 Julia Lawall [this message]
2010-01-04 16:14 ` Miller, Mike (OS Dev)
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=Pine.LNX.4.64.0912190829470.30546@ask.diku.dk \
--to=julia@diku.dk \
--cc=iss_storagedev@hp.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.miller@hp.com \
/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®