Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752000AbbBRNmK (ORCPT ); Wed, 18 Feb 2015 08:42:10 -0500 Received: from cantor2.suse.de ([195.135.220.15]:36071 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbbBRNmJ (ORCPT ); Wed, 18 Feb 2015 08:42:09 -0500 Date: Wed, 18 Feb 2015 14:42:06 +0100 (CET) From: Miroslav Benes To: Josh Poimboeuf cc: Seth Jennings , Jiri Kosina , Vojtech Pavlik , Masami Hiramatsu , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 6/9] livepatch: create per-task consistency model In-Reply-To: <20150218131526.GB8611@treble.redhat.com> Message-ID: References: <2c3d1e685dae5cccc2dfdb1b24c241b2f1c89348.1423499826.git.jpoimboe@redhat.com> <20150217151048.GF11861@treble.redhat.com> <20150217160147.GH11861@treble.redhat.com> <20150218131526.GB8611@treble.redhat.com> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2842 Lines: 60 On Wed, 18 Feb 2015, Josh Poimboeuf wrote: > On Wed, Feb 18, 2015 at 01:42:56PM +0100, Miroslav Benes wrote: > > On Tue, 17 Feb 2015, Josh Poimboeuf wrote: > > > > > On Tue, Feb 17, 2015 at 04:48:39PM +0100, Miroslav Benes wrote: > > > > On Tue, 17 Feb 2015, Josh Poimboeuf wrote: > > > > > > > > > On Mon, Feb 16, 2015 at 03:19:10PM +0100, Miroslav Benes wrote: > > > > > > > > > and externs for functions are redundant. > > > > > > > > > > I agree, but it seems to be the norm in Linux. I have no idea why. I'm > > > > > just following the existing convention. > > > > > > > > Yes, I know. It seems that each author does it differently. You can find > > > > both forms even in one header file in the kernel. There is no functional > > > > difference AFAIK (it is not the case for variables of course). So as long > > > > as we are consistent I do not care. And since we have externs already in > > > > livepatch.h... you can scratch this remark if you want to :) > > > > > > Ok. If there are no objections, let's stick with our existing > > > nonsensical convention for now :-) > > > > So I was thinking about it again and we should not use bad patterns in our > > code from the beginning. Externs do not make sense so let's get rid of > > them everywhere (i.e. in the consistency model and also in livepatch.h). > > > > The C specification talks about extern in context of internal and external > > linkages or in context of inline functions but it does not make any sense > > to me. Could you look at the specification and tell me if it makes any > > sense to you, please? > > Relevant parts from C11: > > For an identifier declared with the storage-class specifier extern in a > scope in which a prior declaration of that identifier is visible, if the > prior declaration specifies internal or external linkage, the linkage of > the identifier at the later declaration is the same as the linkage > specified at the prior declaration. If no prior declaration is visible, > or if the prior declaration specifies no linkage, then the identifier > has external linkage. > > If the declaration of an identifier for a function has no storage-class > specifier, its linkage is determined exactly as if it were declared with > the storage-class specifier extern .If the declaration of an identifier > for an object has file scope and no storage-class specifier, its linkage > is external. > > Sounds to me like "extern" is redundant for functions. I'm fine with > removing it. Care to work up a patch for livepatch.h? Agreed. I'll do that. Thanks. Miroslav -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/