Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752215AbcDZGG6 (ORCPT ); Tue, 26 Apr 2016 02:06:58 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:56974 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751027AbcDZGG5 (ORCPT ); Tue, 26 Apr 2016 02:06:57 -0400 Date: Tue, 26 Apr 2016 14:02:48 +0800 From: Jisheng Zhang To: Arnd Bergmann CC: Mark Rutland , Lorenzo Pieralisi , Catalin Marinas , Sudeep Holla , Will Deacon , , Subject: Re: [PATCH] drivers: firmware: psci: make two helper functions inline Message-ID: <20160426140248.023ad696@xhacker> In-Reply-To: <1461629793-3856390-1-git-send-email-arnd@arndb.de> References: <1461629793-3856390-1-git-send-email-arnd@arndb.de> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-26_04:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1604260101 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1996 Lines: 52 Dear Arnd, On Tue, 26 Apr 2016 02:16:17 +0200 Arnd Bergmann wrote: > The previous patch marked these two as 'static' which showed that they > are sometimes unused: > > drivers/firmware/psci.c:103:13: error: 'psci_power_state_is_valid' defined but not used [-Werror=unused-function] > static bool psci_power_state_is_valid(u32 state) > drivers/firmware/psci.c:94:13: error: 'psci_power_state_loses_context' defined but not used [-Werror=unused-function] > static bool psci_power_state_loses_context(u32 state) > > This also marks the functions 'inline', which has the main effect of > silently ignoring them when they are unused. The compiler will typically > inline small static functions anyway, so this seems more appropriate > than using __maybe_unused, which would have the same result otherwise. oops, yes. When preparing the patch, I also thought about making them inline. But forget to do so. Thanks for the fix, Jisheng > > Signed-off-by: Arnd Bergmann > Fixes: 21e8868 ("drivers: firmware: psci: make two helper functions static") > --- > drivers/firmware/psci.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c > index 04f2ac5..89fcbdd 100644 > --- a/drivers/firmware/psci.c > +++ b/drivers/firmware/psci.c > @@ -91,7 +91,7 @@ static inline bool psci_has_ext_power_state(void) > PSCI_1_0_FEATURES_CPU_SUSPEND_PF_MASK; > } > > -static bool psci_power_state_loses_context(u32 state) > +static inline bool psci_power_state_loses_context(u32 state) > { > const u32 mask = psci_has_ext_power_state() ? > PSCI_1_0_EXT_POWER_STATE_TYPE_MASK : > @@ -100,7 +100,7 @@ static bool psci_power_state_loses_context(u32 state) > return state & mask; > } > > -static bool psci_power_state_is_valid(u32 state) > +static inline bool psci_power_state_is_valid(u32 state) > { > const u32 valid_mask = psci_has_ext_power_state() ? > PSCI_1_0_EXT_POWER_STATE_MASK :