From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A257C2D0DB for ; Thu, 23 Jan 2020 20:24:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69DC221D7D for ; Thu, 23 Jan 2020 20:24:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UBJgIX8T" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729186AbgAWUY4 (ORCPT ); Thu, 23 Jan 2020 15:24:56 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:31463 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726167AbgAWUY4 (ORCPT ); Thu, 23 Jan 2020 15:24:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579811093; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1SjjdO8NbXcvcs7b4lE6Oq279Dfr2cX6WVtlzprN+W0=; b=UBJgIX8T85WHZGnCkkSOxT5WRg6U+VKe4camjZqwGzddaqhrEtZVsp88p0p6D0kc55GpID ZPO9jUOplOhqYzasYTLmsVmEH2IxXgUjyuYfVE5rM0LJGmFQIbTvcBKSDYYPhEU9THsPe9 rvGDwHilqyKB1vpxVB+q8Go+xLvaCok= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-IWS83qy2NVClpQhaZAYd0A-1; Thu, 23 Jan 2020 15:24:47 -0500 X-MC-Unique: IWS83qy2NVClpQhaZAYd0A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B25F800D53; Thu, 23 Jan 2020 20:24:45 +0000 (UTC) Received: from llong.remote.csb (dhcp-17-59.bos.redhat.com [10.18.17.59]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11E6B5DA8B; Thu, 23 Jan 2020 20:24:43 +0000 (UTC) Subject: Re: [PATCH -next v2] arm64/spinlock: fix a -Wunused-function warning To: Qian Cai , peterz@infradead.org Cc: will@kernel.org, mingo@redhat.com, catalin.marinas@arm.com, clang-built-linux@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org References: <20200123202051.8106-1-cai@lca.pw> From: Waiman Long Organization: Red Hat Message-ID: Date: Thu, 23 Jan 2020 15:24:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20200123202051.8106-1-cai@lca.pw> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1/23/20 3:20 PM, Qian Cai wrote: > The commit f5bfdc8e3947 ("locking/osq: Use optimized spinning loop for > arm64") introduced a warning from Clang because vcpu_is_preempted() is > compiled away, > > kernel/locking/osq_lock.c:25:19: warning: unused function 'node_cpu' > [-Wunused-function] > static inline int node_cpu(struct optimistic_spin_node *node) > ^ > 1 warning generated. > > Fix it by converting vcpu_is_preempted() to a static inline function. > > Fixes: f5bfdc8e3947 ("locking/osq: Use optimized spinning loop for arm64") > Signed-off-by: Qian Cai > --- > > v2: convert vcpu_is_preempted() to a static inline function. > > arch/arm64/include/asm/spinlock.h | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/include/asm/spinlock.h b/arch/arm64/include/asm/spinlock.h > index 102404dc1e13..9083d6992603 100644 > --- a/arch/arm64/include/asm/spinlock.h > +++ b/arch/arm64/include/asm/spinlock.h > @@ -18,6 +18,10 @@ > * See: > * https://lore.kernel.org/lkml/20200110100612.GC2827@hirez.programming.kicks-ass.net > */ > -#define vcpu_is_preempted(cpu) false > +#define vcpu_is_preempted vcpu_is_preempted > +static inline bool vcpu_is_preempted(int cpu) > +{ > + return false; > +} > > #endif /* __ASM_SPINLOCK_H */ Acked-by: Waiman Long