From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: "Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Cc: <linux-aio@kvack.org>
Subject: Redundant memset in AIO read_events
Date: Tue, 8 Jul 2003 16:17:12 -0700 [thread overview]
Message-ID: <41F331DBE1178346A6F30D7CF124B24B2A4889@fmsmsx409.fm.intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 379 bytes --]
OK, here is another one. In the top level read_events() function in
fs/aio.c, a struct io_event is instantiated on the stack (variable ent).
It calls aio_read_evt() function which will fill the entire io_event
structure into variable ent. What's the point of zeroing when copy
covers the same memory area? Possible a debug code left around?
- Ken
<<aio.ent.patch>>
[-- Attachment #2: aio.ent.patch --]
[-- Type: application/octet-stream, Size: 418 bytes --]
diff -Nur linux-2.5.74/fs/aio.c linux-2.5.74.aio/fs/aio.c
--- linux-2.5.74/fs/aio.c Sun Jun 22 11:32:43 2003
+++ linux-2.5.74.aio/fs/aio.c Tue Jul 8 16:11:50 2003
@@ -805,10 +805,6 @@
struct io_event ent;
struct timeout to;
- /* needed to zero any padding within an entry (there shouldn't be
- * any, but C is fun!
- */
- memset(&ent, 0, sizeof(ent));
ret = 0;
while (likely(i < nr)) {
next reply other threads:[~2003-07-08 23:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-08 23:17 Chen, Kenneth W [this message]
2003-07-09 12:55 ` Mikulas Patocka
2003-07-09 15:43 Luck, Tony
2003-07-09 16:13 ` Dan Kegel
2003-07-09 22:41 Chen, Kenneth W
2003-07-09 22:43 Chen, Kenneth W
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=41F331DBE1178346A6F30D7CF124B24B2A4889@fmsmsx409.fm.intel.com \
--to=kenneth.w.chen@intel.com \
--cc=linux-aio@kvack.org \
--cc=linux-kernel@vger.kernel.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®