All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Tomas Winkler <tomasw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"moderated list:TPM DEVICE DRIVER"
	<tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	open list <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 3/3] tpm, tpm_crb: runtime power management
Date: Thu, 16 Jun 2016 14:44:55 -0600	[thread overview]
Message-ID: <20160616204455.GA2744@obsidianresearch.com> (raw)
In-Reply-To: <CA+i0qc4+xh0iehkMVp0Bat+z=ckogMH8ThniaAR_21MTZbqsWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

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

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine

WARNING: multiple messages have this Message-ID (diff)
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Tomas Winkler <tomasw@gmail.com>
Cc: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	linux-security-module@vger.kernel.org,
	"moderated list:TPM DEVICE DRIVER" 
	<tpmdd-devel@lists.sourceforge.net>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [tpmdd-devel] [PATCH 3/3] tpm, tpm_crb: runtime power management
Date: Thu, 16 Jun 2016 14:44:55 -0600	[thread overview]
Message-ID: <20160616204455.GA2744@obsidianresearch.com> (raw)
In-Reply-To: <CA+i0qc4+xh0iehkMVp0Bat+z=ckogMH8ThniaAR_21MTZbqsWQ@mail.gmail.com>

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

  parent reply	other threads:[~2016-06-16 20:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-07 23:01 [PATCH 0/3] Runtime PM for TPM2 CRB chips Jarkko Sakkinen
2016-06-07 23:01 ` Jarkko Sakkinen
2016-06-07 23:02 ` [PATCH 1/3] tpm_crb: fix crb_req_canceled behavior Jarkko Sakkinen
2016-06-07 23:02   ` Jarkko Sakkinen
     [not found] ` <1465340522-1112-1-git-send-email-jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2016-06-07 23:02   ` [PATCH 2/3] tpm, tpm_crb: remove wmb()'s Jarkko Sakkinen
2016-06-07 23:02     ` Jarkko Sakkinen
2016-06-07 23:02 ` [PATCH 3/3] tpm, tpm_crb: runtime power management Jarkko Sakkinen
2016-06-07 23:02   ` Jarkko Sakkinen
2016-06-14 13:14   ` [tpmdd-devel] " Tomas Winkler
2016-06-16 19:57     ` Jarkko Sakkinen
2016-06-16 20:18       ` Jarkko Sakkinen
     [not found]       ` <20160616195735.GA30378-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-16 20:26         ` Tomas Winkler
2016-06-16 20:26           ` [tpmdd-devel] " Tomas Winkler
     [not found]           ` <CA+i0qc4+xh0iehkMVp0Bat+z=ckogMH8ThniaAR_21MTZbqsWQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-16 20:44             ` Jason Gunthorpe [this message]
2016-06-16 20:44               ` Jason Gunthorpe
2016-06-16 21:29             ` Jarkko Sakkinen
2016-06-16 21:29               ` [tpmdd-devel] " Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160616204455.GA2744@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-security-module-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tomasw-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.