From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Robert P. J. Day" Date: Mon, 12 Feb 2007 08:59:22 +0000 Subject: Re: [KJ] memory zeroing macros Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kernel-janitors@vger.kernel.org On Mon, 12 Feb 2007, Srdjan Todorovic wrote: > On Sun, 11 Feb 2007, Greg KH wrote: > > > On Sun, Feb 11, 2007 at 03:34:34PM -0500, burns.ethan@gmail.com wrote: > > > On Sun, Feb 11, 2007 at 04:32:11AM -0500, Robert P. J. Day wrote: > > > > or maybe this really is just not worth the effort. who knows? > > > > > > I don't think its worth the effort. Changing the name on this > > > wouldn't add any readability. memset(dest, 0, len) is very > > > clear, in my opinion. Also, there's nothing really error prone > > > about it... I see no advantage. > > > > Not true at all, 0 and len get switched a lot accidentally. See > > the archives for times people have swept the kernel tree to fix > > this issue up. > > I agree with you here, Greg, about accidentally switching the args > to memset(). However just because someone (I've done this in the > past, damn hard to debug since you don't expect to make this silly > mistake) can do: > > if (x = 0) { } > > doesn't mean that we should discourage if statements. > > The macros from the wiki page add yet another set of > macros/functions that someone has to learn. i agree that those extra macros are overkill, except possibly in the case of a simple memzero(), given that other developers seem to re-invent it on an occasional basis. but i'll leave this decision to someone else. rday -- ==================================== Robert P. J. Day Linux Consulting, Training and Annoying Kernel Pedantry Waterloo, Ontario, CANADA http://fsdev.net/wiki/index.php?title=Main_Page ==================================== _______________________________________________ Kernel-janitors mailing list Kernel-janitors@lists.osdl.org https://lists.osdl.org/mailman/listinfo/kernel-janitors