From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFldx-0004dE-3d for qemu-devel@nongnu.org; Wed, 02 Dec 2009 04:37:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFlds-0004bH-Sq for qemu-devel@nongnu.org; Wed, 02 Dec 2009 04:37:04 -0500 Received: from [199.232.76.173] (port=55295 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFlds-0004bD-OF for qemu-devel@nongnu.org; Wed, 02 Dec 2009 04:37:00 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24289) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFlds-0007nH-BH for qemu-devel@nongnu.org; Wed, 02 Dec 2009 04:37:00 -0500 From: Markus Armbruster Subject: Re: [Qemu-devel] [PATCH 04/11] Add KVM support for S390x References: <1259241800-2810-1-git-send-email-agraf@suse.de> <1259241800-2810-5-git-send-email-agraf@suse.de> <20091130181841.GA24799@volta.aurel32.net> <4F17E887-F755-4FA1-890E-D37B689F5AFE@suse.de> <20091202081208.GR2310@hall.aurel32.net> <9D58C386-1568-4A7E-8C1C-133F95316AD2@suse.de> Date: Wed, 02 Dec 2009 10:36:32 +0100 In-Reply-To: (malc's message of "Wed, 2 Dec 2009 11:42:26 +0300 (MSK)") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: Carsten Otte , Alexander Graf , Aurelien Jarno , qemu-devel@nongnu.org malc writes: > On Wed, 2 Dec 2009, Alexander Graf wrote: > >> >> On 02.12.2009, at 09:12, Aurelien Jarno wrote: >> >> > On Mon, Nov 30, 2009 at 11:25:03PM +0100, Alexander Graf wrote: >> >> >> >> On 30.11.2009, at 19:18, Aurelien Jarno wrote: >> >> >> >>> On Thu, Nov 26, 2009 at 02:23:13PM +0100, Alexander Graf wrote: [...] >> >>>> + >> >>>> +static void _kvm_s390_interrupt(CPUState *env, int type, uint32_t parm, uint64_t parm64, int vm) >> >>>> +{ >> >>> >> >>> Why such a name starting with an underscore? >> >> >> >> Because that's the internal function that gets used by the exported, properly named ones. Are there any conventions on how to declare private functions? >> > >> > I don't think there is any convention, but I know malc always complains >> > about not introducing names starting with an underscore. > > Yeah he does. > >> >> Hm - I just wanted to clearly show that this is an internal API, nobody >> should really have to call directly. But I'm open for other naming >> suggestions. > > Thing is, in 7.1.3#1 standard says (after explicitly reserving __ _[A-Z] > for any use): > -- All identifiers that begin with an underscore are > always reserved for use as identifiers with file scope > in both the ordinary and tag name spaces. > > And i could never really understand (or recall/comprehend when asked > and being given an answer) what this entails. (Anyone?) Later in 7.1.3: If the program declares or defines an identifier in a context in which it is reserved (other than as allowed by 7.1.4), or defines a reserved identifier as a macro name, the behavior is undefined. This gives implementations of the standard (compiler + libc) license to use reserved identifiers for their own purposes. If they clash with the user's identifiers, and things break, the user gets to keep the pieces. Now, it's quite unlikely that _kvm_s390_interrupt() clashes with anything in practice. It does, however, set a bad example. > So i would go with something imaginative like internal_do_not_use_kvm*, > but that's just me. You can go wild here, leading underscore doesn't look > attractive though. Why not kvm_s390_interrupt_internal(), or even kvm_s390_interrupt_()?