public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: JAILLET <jaillet.christophe@wanadoo.fr>
To: petero2@telia.com, linux <linux-kernel@vger.kernel.org>,
	cj <jaillet.christophe@wanadoo.fr>
Subject: [PATCH 1/1] drivers/block/pktcdvd.c : avoid useless memset
Date: Sun, 22 Jun 2008 15:34:19 +0200	[thread overview]
Message-ID: <485E54DB.6060804@wanadoo.fr> (raw)

From: Christophe Jaillet <jaillet.christophe@wanadoo.fr>

Hi, here is a patch against linux/drivers/block/pktcdvd.c which :

1) Avoid to 'memset(...,0, ...)' before calling 'init_cdrom_command' 
because this function already does it.


Signed-off-by: Christophe Jaillet <jaillet.christophe@wanadoo.fr>

---
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 3ba1df9..8369ebc 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -2079,7 +2079,6 @@ static noinline_for_stack int 
pkt_write_caching(struct pktcdvd_device *pd,
unsigned char buf[64];
int ret;

- memset(buf, 0, sizeof(buf));
init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_READ);
cgc.sense = &sense;
cgc.buflen = pd->mode_offset + 12;
@@ -2126,7 +2125,6 @@ static noinline_for_stack int 
pkt_get_max_speed(struct pktcdvd_device *pd,
unsigned char *cap_buf;
int ret, offset;

- memset(buf, 0, sizeof(buf));
cap_buf = &buf[sizeof(struct mode_page_header) + pd->mode_offset];
init_cdrom_command(&cgc, buf, sizeof(buf), CGC_DATA_UNKNOWN);
cgc.sense = &sense;



             reply	other threads:[~2008-06-22 13:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-22 13:34 JAILLET [this message]
2008-06-22 16:26 ` [PATCH 1/1] drivers/block/pktcdvd.c : avoid useless memset Randy Dunlap
2008-06-22 20:21   ` JAILLET Christophe
  -- strict thread matches above, loose matches on Subject: below --
2008-06-22 21:37 JAILLET Christophe

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=485E54DB.6060804@wanadoo.fr \
    --to=jaillet.christophe@wanadoo.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petero2@telia.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