From owner-svn-src-head@freebsd.org Tue Mar 20 08:50:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA3C1F5EE8C; Tue, 20 Mar 2018 08:50:29 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9C587C73; Tue, 20 Mar 2018 08:50:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id D30E4D705F5; Tue, 20 Mar 2018 19:19:01 +1100 (AEDT) Date: Tue, 20 Mar 2018 19:19:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Maste cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331226 - in head/sys: amd64/linux amd64/linux32 i386/linux In-Reply-To: <201803192126.w2JLQW0N039356@repo.freebsd.org> Message-ID: <20180320183744.S950@besplex.bde.org> References: <201803192126.w2JLQW0N039356@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cIaQihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=cb1CRZbu697s9Y3qxmIA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Mar 2018 08:50:30 -0000 On Mon, 19 Mar 2018, Ed Maste wrote: > Log: > Rename linuxulator functions with linux_ prefix > > It's preferable to have a consistent prefix. This also reduces > differences between the three linux*_sysvec.c files. It is preferable to have a well-chosen (short...) prefix. The linux emulator mostly uses l_ for internal names. That is a bit too short for external names. > Modified: head/sys/amd64/linux/linux_sysvec.c > ============================================================================== > --- head/sys/amd64/linux/linux_sysvec.c Mon Mar 19 21:13:25 2018 (r331225) > +++ head/sys/amd64/linux/linux_sysvec.c Mon Mar 19 21:26:32 2018 (r331226) > @@ -119,14 +119,14 @@ extern struct sysent linux_sysent[LINUX_SYS_MAXSYSCALL > SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); > > static register_t * linux_copyout_strings(struct image_params *imgp); > -static int elf_linux_fixup(register_t **stack_base, > +static int linux_elf_fixup(register_t **stack_base, > struct image_params *iparams); 'elf_' is an example of a well-chosen prefix. I don't like the style of putting the verb last in names, but it goes well with putting prefixes first. Here the verb placement style is random -- the verb is last in ...handler_set and ...elf_fixup, but not last in ...copyout_strings. > @@ -180,7 +180,7 @@ LINUX_VDSO_SYM_CHAR(linux_platform); > * MPSAFE > */ > static int > -translate_traps(int signal, int trap_code) > +linux_translate_traps(int signal, int trap_code) Names without any prefix are likely to have had the verb first, and now in the middle. > @@ -245,7 +245,7 @@ linux_set_syscall_retval(struct thread *td, int error) > } > > static int > -elf_linux_fixup(register_t **stack_base, struct image_params *imgp) > +linux_fixup_elf(register_t **stack_base, struct image_params *imgp) > { > Elf_Auxargs *args; > Elf_Addr *base; The elf_ prefix was first, but is now last (after the verb, unlike elsewhere for linux_elf_*. > Modified: head/sys/amd64/linux32/linux32_sysvec.c > ... > static void linux32_fixlimit(struct rlimit *rl, int which); The random verb order is especially confsing for 'fix' and 'fixup'. 'fixup' is a noun, but is sometimes abused as a verb and adverb instead of the correct verb and adverb 'fix up'. When it is placed at the end, e.g., for limit_fixup(), it is unclear if it is a noun or a verb. The noun form would mean a function returning a fixup and the verb form would mean a function fixing up something. Using 'fix' instead of fix as a verb at the end is even worse since 'fix' really is both a noun and a verb. The normal order in fixlimit makes it clear that it is used as a verb. Bruce