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.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 8C0C7C2D0DB for ; Thu, 23 Jan 2020 20:25:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6267B21835 for ; Thu, 23 Jan 2020 20:25:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b2WHO/Ga"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="UBJgIX8T" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6267B21835 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=L0Cae5I8NYHLj6hffumK0iaZLOdldJt4w7Jdu3TzSNc=; b=b2WHO/Ga1eEPQp XWFJVM9w1rgdbNj8PExC0oTTO+PsDdq12J7XT+nlOIuisqfLXG+PPl0v6Vswn/AZsPKyBb7/gWHRp RBqIqgtaBl4MCxZAopwiW1c/qnF0LeERx5j7SU7FPEUCb8cj3xI22jhZIVqVNS3kGZfBRbwGD73kI QOEdbyEieP/Jp8M/efpmCUp10myCmGHSU2JeyODdb8TZsUYL/y+IRwQcS14uiEkMmaFfDv+x7pfpk dX0kq3aOSFa7LYuhQ+mhBNL61KBUun7tuf/0QXgGku7AarKMUntd0M2OoHQ3sCyLj1K2V6JDEQnb5 kJzWfZZl4XIgwry2pGcw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuj2A-0003nA-Qu; Thu, 23 Jan 2020 20:24:58 +0000 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iuj27-0003me-As for linux-arm-kernel@lists.infradead.org; Thu, 23 Jan 2020 20:24:57 +0000 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 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-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200123_122455_451252_E0631B41 X-CRM114-Status: GOOD ( 14.76 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: catalin.marinas@arm.com, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, mingo@redhat.com, will@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel