From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757265AbcIVMYe (ORCPT ); Thu, 22 Sep 2016 08:24:34 -0400 Received: from down.free-electrons.com ([37.187.137.238]:56895 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754122AbcIVMY2 (ORCPT ); Thu, 22 Sep 2016 08:24:28 -0400 Date: Thu, 22 Sep 2016 14:24:25 +0200 From: Alexandre Belloni To: Arnd Bergmann Cc: Alessandro Zummo , Gabriele Mazzotta , Andy Shevchenko , rtc-linux@googlegroups.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtc: cmos: avoid unused function warning Message-ID: <20160922122425.ovw5kss2h7zh4vsc@piout.net> References: <20160922094817.2325831-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160922094817.2325831-1-arnd@arndb.de> User-Agent: NeoMutt/20160910 (1.7.0) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22/09/2016 at 11:48:00 +0200, Arnd Bergmann wrote : > A bug fix for the ACPI side of this driver caused a harmless > build warning: > > drivers/rtc/rtc-cmos.c:1115:13: error: 'cmos_check_acpi_rtc_status' defined but not used [-Werror=unused-function] > static void cmos_check_acpi_rtc_status(struct device *dev, > > We can avoid the warning and simplify the driver at the same time > by removing the #ifdef for CONFIG_PM and rely on the SIMPLE_DEV_PM_OPS() > to set everything up correctly. cmos_resume() has to get marked > as __maybe_unused so we don't introduce another warning, and > the two variants of cmos_poweroff() can get merged into one using > an IS_ENABLED() check. > > Fixes: 983bf1256edb ("rtc: cmos: Clear ACPI-driven alarms upon resume") > Signed-off-by: Arnd Bergmann > --- > drivers/rtc/rtc-cmos.c | 21 ++++----------------- > 1 file changed, 4 insertions(+), 17 deletions(-) > Applied, thanks. -- Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com