* [PATCH 1/1] drivers/block/pktcdvd.c : avoid useless memset
@ 2008-06-22 13:34 JAILLET
2008-06-22 16:26 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: JAILLET @ 2008-06-22 13:34 UTC (permalink / raw)
To: petero2, linux, cj
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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] drivers/block/pktcdvd.c : avoid useless memset
2008-06-22 13:34 JAILLET
@ 2008-06-22 16:26 ` Randy Dunlap
2008-06-22 20:21 ` JAILLET Christophe
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2008-06-22 16:26 UTC (permalink / raw)
To: JAILLET; +Cc: petero2, linux
On Sun, 22 Jun 2008 15:34:19 +0200 JAILLET wrote:
> 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;
Looks like tbird ate all of the whitespace.
You can see if Documentation/email-clients.txt has info in it that
would help you, then resend the patch.
---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/1] drivers/block/pktcdvd.c : avoid useless memset
2008-06-22 16:26 ` Randy Dunlap
@ 2008-06-22 20:21 ` JAILLET Christophe
0 siblings, 0 replies; 4+ messages in thread
From: JAILLET Christophe @ 2008-06-22 20:21 UTC (permalink / raw)
To: linux-kernel
Randy Dunlap wrote:
>
> Looks like tbird ate all of the whitespace.
> You can see if Documentation/email-clients.txt has info in it that
> would help you, then resend the patch.
>
Hi,
thanks for the tips. I hope the 2nd try looks better.
Best regards
CJ
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/1] drivers/block/pktcdvd.c : avoid useless memset
@ 2008-06-22 21:37 JAILLET Christophe
0 siblings, 0 replies; 4+ messages in thread
From: JAILLET Christophe @ 2008-06-22 21:37 UTC (permalink / raw)
To: linux, cj, petero2
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.
It is the same patch as the one I sent earlier but the formating should be OK this time.
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;
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-06-22 21:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-22 21:37 [PATCH 1/1] drivers/block/pktcdvd.c : avoid useless memset JAILLET Christophe
-- strict thread matches above, loose matches on Subject: below --
2008-06-22 13:34 JAILLET
2008-06-22 16:26 ` Randy Dunlap
2008-06-22 20:21 ` JAILLET Christophe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox