Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753621AbZKBCFn (ORCPT ); Sun, 1 Nov 2009 21:05:43 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753573AbZKBCFm (ORCPT ); Sun, 1 Nov 2009 21:05:42 -0500 Received: from cn.fujitsu.com ([222.73.24.84]:49492 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1753412AbZKBCFm (ORCPT ); Sun, 1 Nov 2009 21:05:42 -0500 Message-ID: <4AEE3E39.4070403@cn.fujitsu.com> Date: Mon, 02 Nov 2009 10:04:41 +0800 From: Li Zefan User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: Arjan van de Ven CC: Ingo Molnar , Steven Rostedt , Frederic Weisbecker , Linus Torvalds , Andrew Morton , LKML Subject: Re: [PATCH 1/2] compiler: Introduce __always_unused References: <4AEE2CEC.8040206@cn.fujitsu.com> <20091101171542.56a44a49@infradead.org> In-Reply-To: <20091101171542.56a44a49@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 928 Lines: 26 Arjan van de Ven wrote: > On Mon, 02 Nov 2009 08:50:52 +0800 > Li Zefan wrote: > > Hi, > >> I wrote some code which is used as compile-time checker, and the >> code should be elided after compile. >> +#define __always_unused >> __attribute__((unused)) > > I have a suggestion. > In addition to marking it attribute unused, would it be useful to also > put a section attribute as part of this, to a section that we can then > drop from the binary by way of the linker script ? > __unused is used to suppress define-but-unused warning. If the annotated symbol is really unused, it will be optimized out, so I think we don't need to add a section for this. -- 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/