From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756369AbdCUHiq (ORCPT ); Tue, 21 Mar 2017 03:38:46 -0400 Received: from mail-ot0-f195.google.com ([74.125.82.195]:35584 "EHLO mail-ot0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755004AbdCUHhZ (ORCPT ); Tue, 21 Mar 2017 03:37:25 -0400 MIME-Version: 1.0 In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B543B0650@hasmsx108.ger.corp.intel.com> References: <20170320091755.1043811-1-arnd@arndb.de> <5B8DA87D05A7694D9FA63FD143655C1B543B032E@hasmsx108.ger.corp.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B543B0620@hasmsx108.ger.corp.intel.com> <20170320230430.GA25163@obsidianresearch.com> <5B8DA87D05A7694D9FA63FD143655C1B543B0650@hasmsx108.ger.corp.intel.com> From: Arnd Bergmann Date: Tue, 21 Mar 2017 08:37:13 +0100 X-Google-Sender-Auth: u-3QR82NfRu3czOG5AwfoZFlitg Message-ID: Subject: Re: [PATCH] tpm/tpm_crb: mark PM functions as __maybe_unused To: "Winkler, Tomas" Cc: Jason Gunthorpe , Peter Huewe , Marcel Selhorst , Jarkko Sakkinen , Jerry Snitselaar , "tpmdd-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 21, 2017 at 12:35 AM, Winkler, Tomas wrote: > >> >> On Mon, Mar 20, 2017 at 11:01:36PM +0000, Winkler, Tomas wrote: >> >> > I believe that in this case the #ifdefs can be done correctly quite >> > easily, but now I'm not against your solution as well, just maybe put >> > some of this info to the commit message. >> >> I perfer fewer ifdefs, it makes it more maintainable.. > > Sure, >> >> The compiler will remove unused static functions. > > I'm not sure if this goes away w/o --gc-sections, but it might. > Will check, didn't looked at that for a while. gcc-4.1 had a bug where code it failed to eliminate a dead function if it was referenced through a function pointer in another unused static function, but it would work correctly in this case (obviously unused code) and compiler that people actually use don't have this problem. Note that the kernel depends on dead code elimination to work correctly in a lot of places, it wouldn't build at all if that was broken. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [PATCH] tpm/tpm_crb: mark PM functions as __maybe_unused Date: Tue, 21 Mar 2017 08:37:13 +0100 Message-ID: References: <20170320091755.1043811-1-arnd@arndb.de> <5B8DA87D05A7694D9FA63FD143655C1B543B032E@hasmsx108.ger.corp.intel.com> <5B8DA87D05A7694D9FA63FD143655C1B543B0620@hasmsx108.ger.corp.intel.com> <20170320230430.GA25163@obsidianresearch.com> <5B8DA87D05A7694D9FA63FD143655C1B543B0650@hasmsx108.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <5B8DA87D05A7694D9FA63FD143655C1B543B0650-Jy8z56yoSI8MvF1YICWikbfspsVTdybXVpNB7YpNyf8@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: tpmdd-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: "Winkler, Tomas" Cc: "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org" List-Id: tpmdd-devel@lists.sourceforge.net On Tue, Mar 21, 2017 at 12:35 AM, Winkler, Tomas wrote: > >> >> On Mon, Mar 20, 2017 at 11:01:36PM +0000, Winkler, Tomas wrote: >> >> > I believe that in this case the #ifdefs can be done correctly quite >> > easily, but now I'm not against your solution as well, just maybe put >> > some of this info to the commit message. >> >> I perfer fewer ifdefs, it makes it more maintainable.. > > Sure, >> >> The compiler will remove unused static functions. > > I'm not sure if this goes away w/o --gc-sections, but it might. > Will check, didn't looked at that for a while. gcc-4.1 had a bug where code it failed to eliminate a dead function if it was referenced through a function pointer in another unused static function, but it would work correctly in this case (obviously unused code) and compiler that people actually use don't have this problem. Note that the kernel depends on dead code elimination to work correctly in a lot of places, it wouldn't build at all if that was broken. Arnd ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot