Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1998536lqg; Mon, 4 Mar 2024 09:42:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXNEFmbAF4UVxdBNbok7FsAPhp8+2Esb6llaI0NNrh1XTixmMGlQl8vRJlqA09Lz4/RKBQm59oqfSBCYsuCd/PIoEVXjU4B94/nxglsiA== X-Google-Smtp-Source: AGHT+IGDkBZHLppXalOp2qD4Bw2kURlatXvDG4CAzWF7QRWpnAn8E3d50+2ENnPu8+P3LFla05uB X-Received: by 2002:a05:6402:26c5:b0:564:3392:e9db with SMTP id x5-20020a05640226c500b005643392e9dbmr8496908edd.33.1709574122408; Mon, 04 Mar 2024 09:42:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709574122; cv=pass; d=google.com; s=arc-20160816; b=cWmKJZ1bk23htZlk1UTdSTZwojKNZe2skfvSGrZopM8U/w6PSjYA0+BHV4GMm/0YAM bE+v1c8xt2VbPRM1To6jipQnWQqWNueXNuT08lDJJdyUkIzKA1gJd9S/m8DjyASSTY// cFeXK4UOno1LbPgTn3Se26lk2f85gzq7kZ7+4P4MRzQD5zhkijViBVa53m07ccwYuUnV WT0vbZQFYraxZ6oI8CwPqzu/uJ6iavQVNX4hrllo8N1En8ZAom2yHy5PsT73Lkim/yL4 yoIFzD2/7/TpGxF4rfYwNSGw1/O0d8gmtezlImhLMKUr9O1LNFy0VKJXWR6p34Av8WmS mOFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=irOzKbJngmE8lAvg1EEurmlk1LMdtkA2xD+8hsC2ASY=; fh=6mfArhhJzn7s3hfrwID1BWCI7sSVdcI/FLXsbTshP/g=; b=meRCdsRiFaHt5yqVAuVCw+J1iwZmAtcc9VhWJlpN030iLxPvhQ56rlmmPs5A0FbKFw vRaGj5InFFuF2QekrYcmfc+OHMORY3IPoMK6OW79YUmdY74ufTOlFJlV/LYb8x9kKCP+ P9UrC5wdN4MR8K11fynFhsP9kXd14wl8QXhFioqwTs7AnFLmT3qX0kl98q48Q2mGIWZx 9zhCk3EnYS0nO2aJs+/Ii4lji4w+risKqzI2krMH/xSNAwTqxkY1BjX6a2Ro1NKoHIFq YRPt66M8+G20eeXMJYeH7wHJiWwMHwq7G0J7QinKCzqOJLmvWwrdfUjMtw79xlaR437C nFYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dVvnZGIn; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-91015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h1-20020a056402280100b00565acd79f60si4171719ede.28.2024.03.04.09.42.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 09:42:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-91015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dVvnZGIn; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-91015-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-91015-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id DEAFF1F21610 for ; Mon, 4 Mar 2024 17:42:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC8496167B; Mon, 4 Mar 2024 17:41:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="dVvnZGIn" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F94C612ED for ; Mon, 4 Mar 2024 17:41:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709574105; cv=none; b=bQZUDK0q3vMkCW1Oqv4zYP7N/ExmPznO+btBsSBCM/mxkrriI7M1ALP2x+0ihOCWDqpN/SrteT28RhU89CBsZj1DP0JGEPy2J9CShCEe09v/5KASfDC8VMFU/39oCqFLKeb1E0mReAKz7WA/3ibzZZvOeafZ384xfbdi92nQ9i4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709574105; c=relaxed/simple; bh=qJMgPawedp3OfAEL1xk7KGXyHJTjGNsXEZPqedbFgnY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kqdwWrFkjJfRhnRyxaFCYAPYlzh01iBIETv+8SiunxAKayh9fb/B2Karj5O5x9vjJSta0AzEZ95UWgv+Xsg0H3QxOph+asGhDNefARyW7Vjogq0ry/JAwoRfbi33H7tz5nlEnvMypYEWZVyoR3uSWWnoEVzFKxs5RZg0/v2hbWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=dVvnZGIn; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709574103; 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=irOzKbJngmE8lAvg1EEurmlk1LMdtkA2xD+8hsC2ASY=; b=dVvnZGInY9C5IQNV2gQh+TsZfwy6BC6ZPQm9xNeK8tm+NTf8LdZYMGFtWE62qjHuEV7+FR 4l0K6YEbuF5BLJ7noV0IqkXnXzY6wDg+VMbmI7tGZMt1zkaJOgM9BTCCSb/1wH53Jce7ak H0YHAZZD/fhpz9qYzRlGGD0Jb060IsI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-326-dxNZ4nP2NaaFgBJchMmRPg-1; Mon, 04 Mar 2024 12:41:37 -0500 X-MC-Unique: dxNZ4nP2NaaFgBJchMmRPg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EBF80185A787; Mon, 4 Mar 2024 17:41:27 +0000 (UTC) Received: from [10.22.34.161] (unknown [10.22.34.161]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7652648C; Mon, 4 Mar 2024 17:41:27 +0000 (UTC) Message-ID: <76d4a653-3525-4359-bcdc-b5e80f63a426@redhat.com> Date: Mon, 4 Mar 2024 12:41:27 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] locking/spinlocks: Make __raw_* lock ops static Content-Language: en-US To: Geert Uytterhoeven , Peter Zijlstra , Ingo Molnar , Will Deacon , Boqun Feng , Arnd Bergmann Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, linux-s390@vger.kernel.org References: <78c366485bff13753de758fd27fb6b465ed2850a.1709549641.git.geert+renesas@glider.be> From: Waiman Long In-Reply-To: <78c366485bff13753de758fd27fb6b465ed2850a.1709549641.git.geert+renesas@glider.be> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.1 On 3/4/24 05:56, Geert Uytterhoeven wrote: > If CONFIG_GENERIC_LOCKBREAK=y and CONFIG_DEBUG_LOCK_ALLOC=n > (e.g. sh/sdk7786_defconfig): > > kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_spin_lock' [-Wmissing-prototypes] > kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_spin_lock_irqsave' [-Wmissing-prototypes] > kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_spin_lock_irq' [-Wmissing-prototypes] > kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_spin_lock_bh' [-Wmissing-prototypes] > kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_read_lock' [-Wmissing-prototypes] > kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_read_lock_irqsave' [-Wmissing-prototypes] > kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_read_lock_irq' [-Wmissing-prototypes] > kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_read_lock_bh' [-Wmissing-prototypes] > kernel/locking/spinlock.c:68:17: warning: no previous prototype for '__raw_write_lock' [-Wmissing-prototypes] > kernel/locking/spinlock.c:80:26: warning: no previous prototype for '__raw_write_lock_irqsave' [-Wmissing-prototypes] > kernel/locking/spinlock.c:98:17: warning: no previous prototype for '__raw_write_lock_irq' [-Wmissing-prototypes] > kernel/locking/spinlock.c:103:17: warning: no previous prototype for '__raw_write_lock_bh' [-Wmissing-prototypes] > > All __raw_* lock ops are internal functions without external callers. > Hence fix this by making them static. > > Note that if CONFIG_GENERIC_LOCKBREAK=y, no lock ops are inlined, as all > of CONFIG_INLINE_*_LOCK* depend on !GENERIC_LOCKBREAK. > > Signed-off-by: Geert Uytterhoeven > Acked-by: Waiman Long Thanks for updating the change log. Cheers, Longman > --- > Compile-tested on all defconfigs that have CONFIG_GENERIC_LOCKBREAK=y: > - sh/sdk7786_defconfig, > - sh/shx3_defconfig, > - s390/debug_defconfig, > and also on s390/debug_defconfig after changing: > CONFIG_DEBUG_LOCK_ALLOC=n > CONFIG_DEBUG_WW_MUTEX_SLOWPATH=n > CONFIG_LOCK_STAT=n > CONFIG_PROVE_LOCKING=n > > v2: > - Add Acked-by, > - Drop RFC, > - Improve patch description. > --- > kernel/locking/spinlock.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c > index 8475a0794f8c5ad2..7009b568e6255d64 100644 > --- a/kernel/locking/spinlock.c > +++ b/kernel/locking/spinlock.c > @@ -65,7 +65,7 @@ EXPORT_PER_CPU_SYMBOL(__mmiowb_state); > * towards that other CPU that it should break the lock ASAP. > */ > #define BUILD_LOCK_OPS(op, locktype) \ > -void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ > +static void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ > { \ > for (;;) { \ > preempt_disable(); \ > @@ -77,7 +77,7 @@ void __lockfunc __raw_##op##_lock(locktype##_t *lock) \ > } \ > } \ > \ > -unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ > +static unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ > { \ > unsigned long flags; \ > \ > @@ -95,12 +95,12 @@ unsigned long __lockfunc __raw_##op##_lock_irqsave(locktype##_t *lock) \ > return flags; \ > } \ > \ > -void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \ > +static void __lockfunc __raw_##op##_lock_irq(locktype##_t *lock) \ > { \ > _raw_##op##_lock_irqsave(lock); \ > } \ > \ > -void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ > +static void __lockfunc __raw_##op##_lock_bh(locktype##_t *lock) \ > { \ > unsigned long flags; \ > \