From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965813AbcCJLgf (ORCPT ); Thu, 10 Mar 2016 06:36:35 -0500 Received: from mga04.intel.com ([192.55.52.120]:13097 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932738AbcCJLgZ (ORCPT ); Thu, 10 Mar 2016 06:36:25 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,315,1455004800"; d="scan'208";a="930875995" Message-ID: <56E15DAD.3000104@linux.intel.com> Date: Thu, 10 Mar 2016 13:42:37 +0200 From: Mathias Nyman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Matthias Brugger , Arnd Bergmann , Greg Kroah-Hartman CC: linux-arm-kernel@lists.infradead.org, Felipe Balbi , Alan Stern , linux-usb@vger.kernel.org, Mathias Nyman , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] usb: xhci-mtk: use __maybe_unused to hide pm functions References: <1456932255-71725-1-git-send-email-arnd@arndb.de> <1456932255-71725-3-git-send-email-arnd@arndb.de> <56D9B8EE.3060107@gmail.com> In-Reply-To: <56D9B8EE.3060107@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04.03.2016 18:33, Matthias Brugger wrote: > > > On 02/03/16 16:24, Arnd Bergmann wrote: >> The mediatek XHCI glue driver uses SET_SYSTEM_SLEEP_PM_OPS() to >> conditionally set the correct suspend/resume options, and >> also puts both the dev_pm_ops and the functions inside of >> an #ifdef testing for CONFIG_PM_SLEEP, but those functions >> then call other code that becomes unused: >> >> drivers/usb/host/xhci-mtk.c:135:12: error: 'xhci_mtk_host_disable' defined but not used [-Werror=unused-function] >> drivers/usb/host/xhci-mtk.c:313:13: error: 'usb_wakeup_enable' defined but not used [-Werror=unused-function] >> drivers/usb/host/xhci-mtk.c:321:13: error: 'usb_wakeup_disable' defined but not used [-Werror=unused-function] >> >> This replaces the #ifdef with __maybe_unused annotations so the >> compiler knows it can silently drop them instead of warning. >> >> For the DEV_PM_OPS definition, we can use an IS_ENABLED() check >> to avoid defining the structure when CONFIG_PM is not set without >> the #ifdef. >> >> Signed-off-by: Arnd Bergmann >> --- > > Reviewed-by: Matthias Brugger > Acked-by: Mathias Nyman