Date: Sun, 17 Nov 2002 11:22:10 -0800 From: Luigi Rizzo <luigi@FreeBSD.ORG> To: Sam Leffler <sam@errno.com> Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/sys/net raw_usrreq.c Message-ID: <20021117112210.A18801@xorpc.icir.org> In-Reply-To: <082201c28e65$c5b352e0$52557f42@errno.com>; from sam@errno.com on Sun, Nov 17, 2002 at 10:18:45AM -0800 References: <200211171814.gAHIE4I6006212@repoman.freebsd.org> <082201c28e65$c5b352e0$52557f42@errno.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 17, 2002 at 10:18:45AM -0800, Sam Leffler wrote: > Why are you making ALL these cosmetic changes now? I understood why you did > the multicast routing code, but these seem entirely w/o reason. I would not classify them as cosmetic, but rather as documentation. The motivation is the following: Whenever i look at some code, especially some i am not totally familiar with, i always have a hard time figuring out why different functions are used to do what is apparently the same thing (m_copy() vs. m_copypacket(), in this case) or whether a '0' is a pure number, or a NULL pointer or INADDR_ANY or some other error code, or what is the real scope of a local variable in a 500+ line function, or whether a global variable can give problems when we try to split locks for sections of the kernel. I don't think I am alone in having these difficulties. Besides, it is not unlikely that people takes some of this code as an example to write new one, forgetting some of the original assumptions, and then leading to widespread errors. See as an example the misuse of M_DONTWAIT and M_NOWAIT we have had in the past, the breakage in timeout handling in several network drivers, and the problem in IFF_ALLMULTI that i recently reported. So my general attitude is try and document these things as i step through them, to avoid me and possibly others further confusion in the future. And if in passing there is a small amount of formatting fixup i try to do that as well. Larger whitespace commits i do separately, but for a few lines it seems to me overkill to have a separate commit. cheers luigi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021117112210.A18801>