From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752647AbbKVVTm (ORCPT ); Sun, 22 Nov 2015 16:19:42 -0500 Received: from mout.kundenserver.de ([212.227.126.187]:54822 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752068AbbKVVTk (ORCPT ); Sun, 22 Nov 2015 16:19:40 -0500 From: Arnd Bergmann To: Geert Uytterhoeven Cc: Tomi Valkeinen , Jean-Christophe Plagniol-Villard , Sudip Mukherjee , Teddy Wang , Linux Fbdev development list , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH] fbdev: sm712fb: avoid unused function warnings Date: Sun, 22 Nov 2015 22:16:27 +0100 Message-ID: <3884293.N93RQ5y3N9@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: References: <4240710.SWINpxTKzN@wuerfel> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:UmxT4KRFnBNnE6uxq5seWzfVgZiZNw+HRH/YbftSflu9cWVOw92 mbRXZV5Ycn47JgG+hq+OJOCgr6ShhAxh9U7ICY3biuyKsPBH85sqXVyqpXEBHm0DbBPt/yR fTswmFI1qH5enW9xLKrFDYxLXCLWBGbNG9C+FNwopy7YJjoRAx9VSxu3gfNV/7lVZGrtxq9 4ovKBDNWnc5tW/Zu4DzsQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:l2LH2dMX86w=:g03TofRD1UPyBk1Bo6hmk7 8Hv7ZP3nw2A8mftAyUkCpr8JMdlJM7Z1aaTzuzyR3r8v1OISRjY9UJpSMGpxQPE66UnfK7QNs oerNH7uGf1mAiyG+d5IYmmHVqE948rOTjOU+5ddtszg2ZrZzF7KWWRMNeFW0CCCc6Slxj6bsv Rq/SZeuUBXHrG2wGyiMRZD8zK2ctNTC3EFs5nj53/zT9e+e0PF2/N09dWymoVSUUTOl4V0yXb fPSGcyXTN80hszRKBjfSg1WPefEYZw7Gn2G/1jVFja6y3jQv7H5hpFwmI85RjUQ4/r3e6d6/y YLMzr+/rhjvPXR7x0IL0yiISQCI1odTPn7M5lrwvksxUdu/VIw8WvAAxbsbngeAaYRM3vxAHL wOmgGB7ZPugFwP61YQIMfRNLlrJNMdxx5D2Xo9LQcjWtt8AOqnfFUzii6DAMHaBDu3qE35sjA e4Xkv8QCl/KK2HaXCD1yo9Uws9wL+Jlp08KC4P81p5UXI9+b1x/2mat3d9nRC5A9y9pHdYLu8 HOxdCvtUDIUOV0GJXGCQ2zy18tHS6GiyBgFyqfx19S+L7snb71hRYXU1DFxJ5PDgGfm8pOfiA pAxKjT6iz7AfRwrmjDsrJdKHbcIVpMDIs1PGnGTN3WoLjXevM0toyg4LYiy73YAMcRKS+OQeE 0HJcZu6fJs2QPfpQ2N6OZNeIOReXRZ9+qFd8bbnOSHFUJkAzj5xhMi4xDve52QmfEs4LdD2rB pU4K6tKXE6DgxRcZ Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sunday 22 November 2015 21:51:54 Geert Uytterhoeven wrote: > Hi Arnd, > > On Fri, Nov 20, 2015 at 10:48 PM, Arnd Bergmann wrote: > > The sm712fb framebuffer driver encloses the power-management > > functions in #ifdef CONFIG_PM, but the smtcfb_pci_suspend/resume > > functions are only really used when CONFIG_PM_SLEEP is also > > set, as a frequent gcc warning shows: > > > > fbdev/sm712fb.c:1549:12: warning: 'smtcfb_pci_suspend' defined but not used > > fbdev/sm712fb.c:1572:12: warning: 'smtcfb_pci_resume' defined but not used > > > > The driver also avoids using the SIMPLE_DEV_PM_OPS macro when > > CONFIG_PM is unset, which is redundant. > > Is it? AFAIK there's no dummy of SIMPLE_DEV_PM_OPS() for the !CONFIG_PM case > yet. May be a good idea to have, though. The idea of the macro seems to be that the assignment of the pointers is left out, but the structure is still there. We could fix that, but I'd rather try to fix the macro in a way that creates an unused reference to the functions, so we never need any #ifdef or __maybe_unused annotation. We could also come up with a way to remove the structure from the binary in that case, but I can't think of an obvious solution for that at the moment. Arnd