Re: [patch] block layer: kmemcheck fixes

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Jens Axboe <jens.axboe@...>, <linux-kernel@...>, <Alan.Brunelle@...>, <arjan@...>, <dgc@...>, <npiggin@...>, Andrew Morton <akpm@...>, Vegard Nossum <vegard.nossum@...>, Pekka Enberg <penberg@...>
Date: Thursday, February 7, 2008 - 3:31 pm

* Linus Torvalds <torvalds@linux-foundation.org> wrote:


i definitely agree and do that for all code i write.

But if someone does item by item initialization for some crazy 
performance reason (networking folks tend to have such constructs), it 
should be done i think how i've done it in the patch: by systematically 
listing _every_ field in the structure, in the same order, and 
indicating it clearly when it is not initialized and why.

and there it already shows that we do not initialize a few other members 
that could cause problems later on:

+       rq->data_len                    = 0;
+       /* rq->sense_len                        */
+       rq->data                        = NULL;
+       rq->sense                       = NULL;

why is sense_len not initialized - while data_len is? In any case, these 
days the memclear instructions are dirt cheap and we should just always 
initialize everything to zero by default, especially if it's almost all 
zero-initialized anyway.

	Ingo
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] IO queuing and complete affinity, Jens Axboe, (Thu Feb 7, 5:18 am)
Re: [PATCH 0/8] IO queuing and complete affinity, Alan D. Brunelle, (Thu Feb 7, 11:16 am)
[patch] block layer: kmemcheck fixes, Ingo Molnar, (Thu Feb 7, 6:49 am)
Re: [patch] block layer: kmemcheck fixes, Linus Torvalds, (Thu Feb 7, 1:42 pm)
Re: [patch] block layer: kmemcheck fixes, Jens Axboe, (Fri Feb 8, 7:38 am)
Re: [patch] block layer: kmemcheck fixes, David Miller, (Thu Feb 7, 9:22 pm)
Re: [patch] block layer: kmemcheck fixes, Arjan van de Ven, (Fri Feb 8, 11:09 am)
Re: [patch] block layer: kmemcheck fixes, Nick Piggin, (Fri Feb 8, 6:44 pm)
Re: [patch] block layer: kmemcheck fixes, Arjan van de Ven, (Fri Feb 8, 6:56 pm)
Re: [patch] block layer: kmemcheck fixes, Nick Piggin, (Fri Feb 8, 7:58 pm)
Re: [patch] block layer: kmemcheck fixes, Linus Torvalds, (Thu Feb 7, 9:28 pm)
Re: [patch] block layer: kmemcheck fixes, Ingo Molnar, (Thu Feb 7, 3:31 pm)
Re: [patch] block layer: kmemcheck fixes, Jens Axboe, (Thu Feb 7, 4:06 pm)
Re: [patch] block layer: kmemcheck fixes, Jens Axboe, (Thu Feb 7, 1:55 pm)