From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755167AbdESG6f (ORCPT ); Fri, 19 May 2017 02:58:35 -0400 Received: from mail-oi0-f45.google.com ([209.85.218.45]:35642 "EHLO mail-oi0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754918AbdESG6N (ORCPT ); Fri, 19 May 2017 02:58:13 -0400 MIME-Version: 1.0 In-Reply-To: <20170519034007.GJ17481@vireshk-i7> References: <20170518132834.1744968-1-arnd@arndb.de> <20170518141800.GI17481@vireshk-i7> <20170519034007.GJ17481@vireshk-i7> From: Arnd Bergmann Date: Fri, 19 May 2017 08:57:56 +0200 X-Google-Sender-Auth: p2hBdqhXeLl-KPXbZ15hqBFg2ik Message-ID: Subject: Re: [greybus-dev] [PATCH] staging: greybus: mark PM functions as __maybe_unused To: Viresh Kumar Cc: Vaibhav Hiremath , Johan Hovold , Alex Elder , Greg Kroah-Hartman , devel@driverdev.osuosl.org, greybus-dev@lists.linaro.org, Linux Kernel Mailing List 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 Fri, May 19, 2017 at 5:40 AM, Viresh Kumar wrote: > On 18-05-17, 16:51, Arnd Bergmann wrote: >> I find that a lot of users get the #ifdef wrong, either using the wrong >> macro (CONFIG_PM vs CONFIG_PM_SLEEP) or not using the right >> set of functions (e.g. calling a function only from the suspend handler). >> >> The __maybe_unused annotation avoids both problems and also gives >> better build time coverage, so that's what I tend to use. > > Thanks for the explanation Arnd. I hope these unused routines will not > be part of the binary that gets generated. Right? Correct. Ancient compilers (gcc-4.1) had a bug where a function would still be part of the binary if the only reference to it was from a function pointer that got dropped through dead code elimination, but that is not the case here, and those old compilers are not used in real life any more either. Arnd