From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754865AbaCZOSA (ORCPT ); Wed, 26 Mar 2014 10:18:00 -0400 Received: from nat28.tlf.novell.com ([130.57.49.28]:49761 "EHLO nat28.tlf.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754556AbaCZOR6 convert rfc822-to-8bit (ORCPT ); Wed, 26 Mar 2014 10:17:58 -0400 Message-Id: <5332EFA102000078000026CD@nat28.tlf.novell.com> X-Mailer: Novell GroupWise Internet Agent 14.0.0 Date: Wed, 26 Mar 2014 14:17:53 +0000 From: "Jan Beulich" To: "Daniel Kiper" Cc: , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v3 2/5] efi: Export arch_tables variable References: <1395781076-12000-1-git-send-email-daniel.kiper@oracle.com> <1395781076-12000-3-git-send-email-daniel.kiper@oracle.com> <5332E25F020000780000255A@nat28.tlf.novell.com> <20140326140800.GP3454@olila.local.net-space.pl> In-Reply-To: <20140326140800.GP3454@olila.local.net-space.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> On 26.03.14 at 15:08, wrote: > On Wed, Mar 26, 2014 at 01:21:19PM +0000, Jan Beulich wrote: >> >>> On 25.03.14 at 21:57, wrote: >> > Export arch_tables variable. Xen init function calls efi_config_init() >> > which takes it as an argument. >> > >> > Additionally, put __initdata in place suggested by include/linux/init.h. >> >> Which isn't necessarily the most appropriate place. > > Why? If comments in include/linux/init.h are not valid they should be > changed. Because they can't go there uniformly: While on function declarations you can put them there, on function definitions they need to come before the function name. And placing attributes between type and name does - iirc - work consistently for everything. >> > --- a/include/linux/efi.h >> > +++ b/include/linux/efi.h >> > @@ -583,6 +583,8 @@ extern struct efi { >> > struct efi_memory_map *memmap; >> > } efi; >> > >> > +extern efi_config_table_type_t arch_tables[] __initdata; >> >> And section placement annotations are bogus on declarations. > > Hmmm... I am not sure which approach is better. I saw that > in many places declarations have annotations. Could you > point me some docs which states (and explains) that this > is wrong idea. Just use common sense: Attributes that are of concern to the caller should go on the declaration. Attributes that only affect code generation for the function/object in question should go on the definition. Jan