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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C8300C4332F for ; Thu, 14 Dec 2023 01:52:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442970AbjLNBwE (ORCPT ); Wed, 13 Dec 2023 20:52:04 -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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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