[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160616204455.GA2744@obsidianresearch.com>
Date: Thu, 16 Jun 2016 14:44:55 -0600
From: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To: Tomas Winkler <tomasw@...il.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>,
linux-security-module@...r.kernel.org,
"moderated list:TPM DEVICE DRIVER"
<tpmdd-devel@...ts.sourceforge.net>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management
On Thu, Jun 16, 2016 at 11:26:48PM +0300, Tomas Winkler wrote:
> > It is compiled out if it is unused. Why would you want to trash the code
> > with #ifdef cages if they are not necessary? I can add /* CONFIG_PM */
> > before the function if that makes it cleaner.
>
> I'm not sure about that, I believe it just suppresses warnings.
> You will need something --gc-sessions int the linker, I'm not sure
> this is used by kernel.
No, it is fine. The compiler drops unused static functions, that is
what the attribute is for. It always does this, so supressing the
warning is the desire behavior. The kernel preference is to avoid
ifdefs and always compile all the code to avoid problems with config
option combinations.
--gc-sections isn't useful unless -ffunction-section is used, which the
kernel doesn't do. Fortunately the dead code is removed by the
compiler, not the linker.
Jason
Powered by blists - more mailing lists