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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 1E1D2C07E95 for ; Tue, 13 Jul 2021 16:14:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3BDA61178 for ; Tue, 13 Jul 2021 16:14:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234632AbhGMQRa (ORCPT ); Tue, 13 Jul 2021 12:17:30 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:54590 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233282AbhGMQQo (ORCPT ); Tue, 13 Jul 2021 12:16:44 -0400 Message-Id: <20210713160749.555316784@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1626192833; 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: references:references; bh=lcAp2Ebv6+16F0mxDdVyBQ2nBOEkR1oO/tMuHXyVnUo=; b=Lpusjd14Ya4gPNRmOGE4TNoXGNGGmtRq+MegXd5VAc+0DZP22ENzGb/HtYTiwVFuTqdkET iELY/pAtlmgAhsEfkKGKYtCaNV6qt2T8uyDTNIj2BuGNDG+AKrTFX7FGX0awcZRzuNdJps ETvHl4wry8Hnmzoj6DJpzj2I9DTvlBnz29UQ+hBUJmoNafh1Qz4AFCjjHz2FYsAQVIhTIu wNgUYbEmnPuleCRs4k31cAEVuvnjS5Z12uKa1pM0Kxj8vP+1ZXxmJhXFbVuetq3f398ocE WGbhxpMUfo80xxhBtW2B3KSeCF/vvzET2P6lZakgjvkNYj9Tasar6VxDOztb+w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1626192833; 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: references:references; bh=lcAp2Ebv6+16F0mxDdVyBQ2nBOEkR1oO/tMuHXyVnUo=; b=pXtZCf8yvaMqUhamsPyR1R1PRNQ9EDJNaZWGSCTIasLS9UmjcjtnMXoN0h9JGxO7hckH1o frX6GjyR/+zo7IAg== Date: Tue, 13 Jul 2021 17:11:31 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Steven Rostedt , Daniel Bristot de Oliveira , Will Deacon , Waiman Long , Boqun Feng , Sebastian Andrzej Siewior , Davidlohr Bueso Subject: [patch 37/50] locking/mutex: Rearrange items in mutex.h References: <20210713151054.700719949@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Gleixner Move the lockdep map initializer to a different place so it can be shared with the upcoming RT variant of struct mutex. No functional change. Signed-off-by: Thomas Gleixner --- include/linux/mutex.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) --- diff --git a/include/linux/mutex.h b/include/linux/mutex.h index 9183e3f7911d..827c32bb44bc 100644 --- a/include/linux/mutex.h +++ b/include/linux/mutex.h @@ -49,6 +49,16 @@ * locks and tasks (and only those tasks) */ +#ifdef CONFIG_DEBUG_LOCK_ALLOC +# define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ + , .dep_map = { \ + .name = #lockname, \ + .wait_type_inner = LD_WAIT_SLEEP, \ + } +#else +# define __DEP_MAP_MUTEX_INITIALIZER(lockname) +#endif + /* * Typedef _mutex_t for ww_mutex and core code to allow ww_mutex being * built on the regular mutex code in RT kernels while mutex itself is @@ -104,16 +114,6 @@ do { \ __mutex_t_init((mutex), name, key); \ } while (0) -#ifdef CONFIG_DEBUG_LOCK_ALLOC -# define __DEP_MAP_MUTEX_INITIALIZER(lockname) \ - , .dep_map = { \ - .name = #lockname, \ - .wait_type_inner = LD_WAIT_SLEEP, \ - } -#else -# define __DEP_MAP_MUTEX_INITIALIZER(lockname) -#endif - #define __MUTEX_INITIALIZER(lockname) \ { .owner = ATOMIC_LONG_INIT(0) \ , .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(lockname.wait_lock) \