Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S264282AbVBEHtK (ORCPT ); Sat, 5 Feb 2005 02:49:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263645AbVBEHtK (ORCPT ); Sat, 5 Feb 2005 02:49:10 -0500 Received: from courier.cs.helsinki.fi ([128.214.9.1]:42911 "EHLO mail.cs.helsinki.fi") by vger.kernel.org with ESMTP id S266469AbVBEHso (ORCPT ); Sat, 5 Feb 2005 02:48:44 -0500 Subject: Re: [PATCH] PPC/PPC64: Introduce CPU_HAS_FEATURE() macro From: Pekka Enberg To: Olof Johansson Cc: Pekka Enberg , linuxppc64-dev@ozlabs.org, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, paulus@samba.org, anton@samba.org, trini@kernel.crashing.org, benh@kernel.crashing.org, hpa@zytor.com, akpm@osdl.org In-Reply-To: <20050204172041.GA17586@austin.ibm.com> References: <20050204072254.GA17565@austin.ibm.com> <84144f0205020400172d89eddf@mail.gmail.com> <20050204172041.GA17586@austin.ibm.com> Date: Sat, 05 Feb 2005 09:48:19 +0200 Message-Id: <1107589699.17616.4.camel@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit X-Mailer: Evolution 2.0.3 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1047 Lines: 29 On Fri, 2005-02-04 at 11:20 -0600, Olof Johansson wrote: > * cpu-has-feature(cpu-feature-foo) v cpu-has-feature(foo): I picked the > latter for readability. > * Renaming CPU_FTR_ -> CPU_ makes it less obvious that > it's actually a cpu feature it's describing (i.e. CPU_ALTIVEC vs > CPU_FTR_ALTIVEC). > * Renaming would clobber the namespace, CPU_* definitions are used in > other places in the tree. > * Can't make it an inline and still use the preprocessor concatenation. Seriously, if readability is your argument, macro magic is not the answer. Ok, we can't clobber the CPU_ definitions, so pick another prefix. If you want readability, please consider using named enums: enum cpu_feature { CF_ALTIVEC = /* ... */ }; static inline int cpu_has_feature(enum cpu_feature cf) { } Pekka - 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/