All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] RFC: New todo for loops
@ 2005-12-18 13:29 Daniel Marjamäki
  2005-12-18 13:44 ` Matthew Wilcox
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Daniel Marjamäki @ 2005-12-18 13:29 UTC (permalink / raw)
  To: kernel-janitors


Hello friends!

I have a suggestion for the TODO.
Making loops faster is important. Therefore in the loops we should use pointers instead of arrays.

Example (fs/reiser/file.c:268):
	int i;
	for (i = 0; i < blocks_to_allocate; i++)
		allocated_blocks[i] = cpu_to_le32(allocated_blocks[i]);

This could be changed to something like:
	struct b_blocknr_t *block, *block_last;
	block_last = &allocated_blocks[allocated_blocks-1];
	for (block = allocated_blocks; block <= block_last; block++)
			*block = cpu_to_le32(*block);

Best Regards,
Daniel Marjamäki

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-18 14:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-18 13:29 [KJ] RFC: New todo for loops Daniel Marjamäki
2005-12-18 13:44 ` Matthew Wilcox
2005-12-18 14:08 ` Ricardo Nabinger Sanchez
2005-12-18 14:34 ` walter harms

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.