Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1424385

Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management

From Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Newsgroups linux.kernel
Subject Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management
Date 2016-06-16 22:50 +0200
Message-ID <rKMoF-4xR-1@gated-at.bofh.it> (permalink)
References <rHyie-wP-19@gated-at.bofh.it> <rHyif-wP-67@gated-at.bofh.it> <rJWq5-5jT-1@gated-at.bofh.it> <rKLCh-437-19@gated-at.bofh.it> <rKM5j-4rD-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management Tomas Winkler <tomasw@gmail.com> - 2016-06-14 15:20 +0200
  Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-06-16 22:00 +0200
    Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-06-16 22:20 +0200
    Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management Tomas Winkler <tomasw@gmail.com> - 2016-06-16 22:30 +0200
      Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2016-06-16 22:50 +0200
      Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2016-06-16 23:40 +0200

csiph-web