Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5708169rdb; Wed, 13 Dec 2023 17:52:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFc/J7mPu9ycAYT6qiwaSkH/uQKlXpSOzziEvCQ6SqfMp0oUMC4kGgl0g/di+zXcqy8WJOa X-Received: by 2002:a05:6830:1107:b0:6d9:f66e:f557 with SMTP id w7-20020a056830110700b006d9f66ef557mr8718251otq.8.1702518750672; Wed, 13 Dec 2023 17:52:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702518750; cv=none; d=google.com; s=arc-20160816; b=CO51gphNdJWYG3U+Ub49IxqYDoP536zqBAoorlsKNUxv1ZYK1Ts+oRlO8bWVMoEeZW rL+Q4Bb12rl0EyZM6f1pAs0mURt3XScpSuTAkRAD/HADHQ+Oneoq7UsRtUBHshyf5Zqx q1tzl/wRaKPKikoJGGxhsanX+ObxoWIIBMwWn/YwF/YAYPSvKNGf9oeKRm3tS50qrflV +o6gZGd3UyL9NvOT5ftcxxeTSJjHv1nytLgJeC3u6JxTVaQ6VEmXcgSk9peutQz+b+g+ nELWiPLaoYO0V0voJn9vwZXqoCiufyoTtoYBF10tA+gEt4uJgF/uHG9RzTTJymaa9Bx4 OEKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=9AXXFjkdvphmQ1MZVdZxrm1IU4YccGEU/JmOtXsDs6c=; fh=Li71AkBlg4Y+nf/Xb+pcfHXo3lN7BcKHHVrjtJVizRk=; b=HONy3FRYJctmggBFyfAi1J0Dvw7afzNFkfgNfsrtvAgnKzXs4+xJ80SoH75diu4A3b S1vG6ohpmP6EkalEbkyKTv8CM0O8uEiOt3f/AEnvzLXXRXsMGEnbAHsFNHpawzPVYIyg yUWuDOPtUvZbTycRztjjWxaJXgvjwwHKojN7R3rHxDmWssDLIzJpTFP5v/PIhM17wLSH NbuAHMDOtmd6ZHQP8RQ6civ5Qa3L1ctF+iLElstRVsxueGAU30wFWZGo9BHYjTbWDf+q y3URTPjqvsqUicGypgcT+IW3hs1foTXqxcXfnCpb4T2eM3H5dj2bjxlaA0AcVbyxkdFk XnqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OE/OHna9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id h21-20020a63e155000000b005c69765acddsi10373023pgk.87.2023.12.13.17.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 17:52:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="OE/OHna9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id DF3B5802C6BA; Wed, 13 Dec 2023 17:52:18 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442957AbjLNBwD (ORCPT + 99 others); Wed, 13 Dec 2023 20:52:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442971AbjLNBwC (ORCPT ); Wed, 13 Dec 2023 20:52:02 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1625E0 for ; Wed, 13 Dec 2023 17:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702518727; 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=9AXXFjkdvphmQ1MZVdZxrm1IU4YccGEU/JmOtXsDs6c=; b=OE/OHna9DsPkQGLY2qVXz9FCpEfSDPD23MpBYRyeOZZJNANxHTi7diiyFGb5iEdhOcaeeR qa0UBD5YQmscmeL654cDYxc2iPKNiSYvAXDJr8+hvoHjMuxcnVoqiwFnv7fv/7/GBSjDlL hQNZb1g7kBuo1tjxg0kjgITVQ49/+og= 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-222-FawC5tQhPU2pB8SQSY2xmw-1; Wed, 13 Dec 2023 20:52:05 -0500 X-MC-Unique: FawC5tQhPU2pB8SQSY2xmw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (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 7A21685A588; Thu, 14 Dec 2023 01:52:04 +0000 (UTC) Received: from [10.22.33.1] (unknown [10.22.33.1]) by smtp.corp.redhat.com (Postfix) with ESMTP id 017AD492BF0; Thu, 14 Dec 2023 01:52:02 +0000 (UTC) Message-ID: Date: Wed, 13 Dec 2023 20:52:02 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 02/11] locking: add define if mutex_destroy() is not an empty function Content-Language: en-US To: George Stark , andy.shevchenko@gmail.com, pavel@ucw.cz, lee@kernel.org, vadimp@nvidia.com, mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, hdegoede@redhat.com, mazziesaccount@gmail.com, peterz@infradead.org, mingo@redhat.com, will@kernel.org, boqun.feng@gmail.com, nikitos.tr@gmail.com Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, kernel@salutedevices.com References: <20231213223020.2713164-1-gnstark@salutedevices.com> <20231213223020.2713164-3-gnstark@salutedevices.com> From: Waiman Long In-Reply-To: <20231213223020.2713164-3-gnstark@salutedevices.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 17:52:19 -0800 (PST) On 12/13/23 17:30, George Stark wrote: > mutex_destroy() is only a debug helper and an empty function on non-debug > configurations still we can't legally ignore it because it's the > established API call and it can be extended theoretically in the future. > Sometimes it could be useful to know e.g. in the higher-level API if > mutex_destroy() really does something in the current configuration > and it's should be called or skipped otherwise for the sake of > optimization so add dedicated define to recognize these cases. > > Signed-off-by: George Stark > --- > include/linux/mutex.h | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/include/linux/mutex.h b/include/linux/mutex.h > index a33aa9eb9fc3..2395ce4fcaf6 100644 > --- a/include/linux/mutex.h > +++ b/include/linux/mutex.h > @@ -83,6 +83,9 @@ struct mutex { > > extern void mutex_destroy(struct mutex *lock); > > +/* mutex_destroy() is a real function, not a NOP */ > +#define mutex_destroy mutex_destroy > + > #else > > # define __DEBUG_MUTEX_INITIALIZER(lockname) Acked-by: Waiman Long