From: Wei Yongjun <weiyj.lk@gmail.com>
To: mike.miller@hp.com
Cc: yongjun_wei@trendmicro.com.cn, iss_storagedev@hp.com,
linux-kernel@vger.kernel.org
Subject: [PATCH] cciss: remove useless set memory to zero use memset()
Date: Mon, 27 Aug 2012 15:06:42 +0800 [thread overview]
Message-ID: <CAPgLHd-SUWNg=wHWeJNjUNjkN1ZRQe2ibXPdzEmytb3EfWEEPg@mail.gmail.com> (raw)
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
The memory return by kzalloc() or kmem_cache_zalloc() has already
be set to zero, so remove useless memset(0).
spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
drivers/block/cciss.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index b0f553b..ca83f96 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -5205,7 +5205,6 @@ static void cciss_shutdown(struct pci_dev *pdev)
return;
}
/* write all data in the battery backed cache to disk */
- memset(flush_buf, 0, 4);
return_code = sendcmd_withirq(h, CCISS_CACHE_FLUSH, flush_buf,
4, 0, CTLR_LUNID, TYPE_CMD);
kfree(flush_buf);
reply other threads:[~2012-08-27 7:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAPgLHd-SUWNg=wHWeJNjUNjkN1ZRQe2ibXPdzEmytb3EfWEEPg@mail.gmail.com' \
--to=weiyj.lk@gmail.com \
--cc=iss_storagedev@hp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mike.miller@hp.com \
--cc=yongjun_wei@trendmicro.com.cn \
/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;
as well as URLs for NNTP newsgroup(s).