Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp202054pxm; Wed, 2 Mar 2022 13:26:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFymJ/MGF7Mcfp+TeDWtuew+uyZyWFtoCIqYCqAhnwN45LCvZ5/Isam+E7yc631Ul9DnZI X-Received: by 2002:a17:902:b18a:b0:14d:57b2:8c72 with SMTP id s10-20020a170902b18a00b0014d57b28c72mr32619747plr.149.1646256384796; Wed, 02 Mar 2022 13:26:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646256384; cv=none; d=google.com; s=arc-20160816; b=r28knR5G5A3yCnZGiDiyyM5HU9fhgTVl4SCQPsSp92kvpXIsfDYEenZO2/5O/J1xCU kN+mZVgn50QqEasGDHF+rVzO43H7g9hnuhCmQgmsviuZTYq6C8lTjXzOd5ZQi99Pfhv0 B6SgZRNHStTmg2c1c6QcKeSn4xeMJ6GD3uutPeeHg6WseVk30516xogXs+YIZQDnFFA1 Euy2Z2yM8kJVSGvFhCac6TA9+TOXX9cGmRry+Gxrc9kg6KAbgljyRQbh78/9zGyGRhGS 5JMge3FAevsuZfTLzatQdJ1nqan//C6K/nyKu1Lkmfot4fZjTva1gdHy2kdD6ZL0mj+x 3S/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MglquwP1b/HuaDjvT7vJEBPQk37mCfbILyADYa7E3VI=; b=KQqZkphUFTR34Xjcj//w8PGBZtL4LG/HW+6IKsSDDhfYUg2CPbmiP6KSQBMLyM56RR JcLxqFFggH6hCBIWQHWLxqespiKGHlk/M7ZRWbejq22FMpClVlSO9n1nduAZRKFsnq8q R9OAxBfApzxJe9Lz1thvNyalh2SiihGWPFwNE1jOnYG9RmLkjEjVVazmRvWViB/7pyK1 pOCZeiDxIvNBUOmN2zBC/mPKBsyFuekbEKKpNzEc9wnbHKvhYkc0REQYOEuuHkjkgMd1 u7DN7aTW1hw1RDoAb6oKe6Ob8l8Y3T1w6MvXmR70j4UkJOJwMtm4m9IRgiPG9AqOL3fR VVew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qNV3WqbH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h191-20020a6383c8000000b00373d6e7e2desi148659pge.472.2022.03.02.13.26.07; Wed, 02 Mar 2022 13:26:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=qNV3WqbH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239533AbiCBEhP (ORCPT + 99 others); Tue, 1 Mar 2022 23:37:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239512AbiCBEgd (ORCPT ); Tue, 1 Mar 2022 23:36:33 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 856CEB12C1 for ; Tue, 1 Mar 2022 20:35:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=MglquwP1b/HuaDjvT7vJEBPQk37mCfbILyADYa7E3VI=; b=qNV3WqbHUTN9l0d8l6byATAMU/ icRIZcZcX7rmfNHPyRhgN9wVQ/i+BboJM8H/fjjqZ0e4agrbfDKjOWsuURCsxgXnX6U3axwTF65BK dFtk3aCwsc2mOdFhNotNEWIOSwCoFB94YiEwEHhfHsxkrZpz3dn0OVPolKN6N6IiBnT+TGHmfYMdY 0zQZTBOiWR1pIJqTIvcvc//xrSSOfdF1qc5Glel8Q7Cb0Y1CPWdRcKlWGxWBeK1IzgfSoI7MxCesK nN1ZbApMR2RGJV7hFpNd5TTZvaFpoJr4OzlIjRfhfer5HYvWIfqKegdIIhG/+q7htaDrOqBpXjRVh OOfaH15A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPGhS-00AF7J-Ix; Wed, 02 Mar 2022 04:34:54 +0000 From: "Matthew Wilcox (Oracle)" To: Kees Cook , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Linus Torvalds Cc: "Matthew Wilcox (Oracle)" , linux-kernel@vger.kernel.org Subject: [PATCH 11/19] wait: Parameterize the return variable to __wait_event_lock_irq_timeout() Date: Wed, 2 Mar 2022 04:34:43 +0000 Message-Id: <20220302043451.2441320-12-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220302043451.2441320-1-willy@infradead.org> References: <20220302043451.2441320-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Macros should not refer to variables which aren't in their arguments. Pass the name from both its callers. Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/wait.h | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/include/linux/wait.h b/include/linux/wait.h index 524e0d1690a4..757285a04c88 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -1109,7 +1109,7 @@ do { \ __ret; \ }) -#define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state) \ +#define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state, __ret) \ ___wait_event(wq_head, ___wait_cond_timeout(condition, __ret), \ state, 0, timeout, \ spin_unlock_irq(&lock); \ @@ -1140,25 +1140,25 @@ do { \ * was interrupted by a signal, and the remaining jiffies otherwise * if the condition evaluated to true before the timeout elapsed. */ -#define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \ - timeout) \ -({ \ - long __ret = timeout; \ - if (!___wait_cond_timeout(condition, __ret)) \ - __ret = __wait_event_lock_irq_timeout( \ - wq_head, condition, lock, timeout, \ - TASK_INTERRUPTIBLE); \ - __ret; \ +#define wait_event_interruptible_lock_irq_timeout(wq_head, condition, lock, \ + timeout) \ +({ \ + long __ret = timeout; \ + if (!___wait_cond_timeout(condition, __ret)) \ + __ret = __wait_event_lock_irq_timeout( \ + wq_head, condition, lock, timeout, \ + TASK_INTERRUPTIBLE, __ret); \ + __ret; \ }) -#define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \ -({ \ - long __ret = timeout; \ - if (!___wait_cond_timeout(condition, __ret)) \ - __ret = __wait_event_lock_irq_timeout( \ - wq_head, condition, lock, timeout, \ - TASK_UNINTERRUPTIBLE); \ - __ret; \ +#define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \ +({ \ + long __ret = timeout; \ + if (!___wait_cond_timeout(condition, __ret)) \ + __ret = __wait_event_lock_irq_timeout( \ + wq_head, condition, lock, timeout, \ + TASK_UNINTERRUPTIBLE, __ret); \ + __ret; \ }) /* -- 2.34.1