From owner-cvs-all Sun Nov 17 11:22:13 2002 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 206BC37B404; Sun, 17 Nov 2002 11:22:12 -0800 (PST) Received: from xorpc.icir.org (xorpc.icir.org [192.150.187.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B25A43E88; Sun, 17 Nov 2002 11:22:11 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: from xorpc.icir.org (localhost [127.0.0.1]) by xorpc.icir.org (8.12.3/8.12.3) with ESMTP id gAHJMAAh018928; Sun, 17 Nov 2002 11:22:10 -0800 (PST) (envelope-from rizzo@xorpc.icir.org) Received: (from rizzo@localhost) by xorpc.icir.org (8.12.3/8.12.3/Submit) id gAHJMACI018927; Sun, 17 Nov 2002 11:22:10 -0800 (PST) (envelope-from rizzo) Date: Sun, 17 Nov 2002 11:22:10 -0800 From: Luigi Rizzo To: Sam Leffler 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> References: <200211171814.gAHIE4I6006212@repoman.freebsd.org> <082201c28e65$c5b352e0$52557f42@errno.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <082201c28e65$c5b352e0$52557f42@errno.com>; from sam@errno.com on Sun, Nov 17, 2002 at 10:18:45AM -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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