Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp657014pxv; Fri, 9 Jul 2021 06:19:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUC26q5Vfg82Y3Vdvq6WiyWPPgt4Yj4sWbeY/V/SaST2vO5+AFZ7fS0qCRnfgC2ZrPGSv8 X-Received: by 2002:a92:dd89:: with SMTP id g9mr27115115iln.209.1625836785046; Fri, 09 Jul 2021 06:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625836785; cv=none; d=google.com; s=arc-20160816; b=vOpOigLDfLYYi/Ni/48lpQZSvhvIWyCDDHLv7BOTP7rbpF4cDkezVOwhV+fyQyCk5O 9ALnVBptfj1f0T8+KsXZeQh6LJsD6BZnvcxvu7J8RRfSgUsInJWohLyW088EzscnVpil YAAGD5YEYpasCw7SyhAsN7qgWitn6lxr4N9YwXWk2sjlg2eLvGlpywicT4H3+LdJbw0c 4PQIltIVCsC9KYxwILyMaNZXOLk4SHqrOOe4xVNJMPDgMq2Czwsh4Xhu5X8VbzZIWlZU pHd37tk0l60r/MAwnumMMjspLgunfC0p3OzOoTAKFPUkgeQPlnJx2IiZpGpsKs6HHpDU LnKw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=+3agSAR2QhatHP2biruzhONSe0uKErkqX2UVEXsxykQ=; b=qCTO03S3awVLVzwgwv6WcBmpo920Anra2rs4jCbWW5BRhp3dsPZITojTttjzjDtkfX 8Z81uUVESoZ4N10LNdUYPg7cAFSKkUBCh4qIdyBxE0y/YHXyYYPj49aiO/K7Yr1ZADlK r1YvvwOiKlk5Y0OtPiujdTJjuGoaBLm6Nm3MRpIk7b/0DA9/+7zOjYcI0/AaWKqPG6Lw lfAEqihxX8dcPbzq0IP/NraU0a9dwQRZ0hXiR5jm6/grUQYUScTPZ8JDdGGs5qtNOSPp YhMXthyoiiskZvEE9PGvyeji/eEMY3IJy1Ipi0NC1y1Iv+zo1rAyCwUSgqHDWWiTBAWs iYvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=itMP1ddE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si6175265jah.108.2021.07.09.06.19.32; Fri, 09 Jul 2021 06:19:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=itMP1ddE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231893AbhGINVZ (ORCPT + 99 others); Fri, 9 Jul 2021 09:21:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:51532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231605AbhGINVY (ORCPT ); Fri, 9 Jul 2021 09:21:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C45AE613B6; Fri, 9 Jul 2021 13:18:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625836721; bh=meWJgC+veHMqH+lP3kH65iI4Alc7pQicK4wPeAjIBJ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=itMP1ddEuYN5PmFrlgyDHPVBYe21DBiEu9G6J5D+omHnETSX4zIwjBsOeKwt50cn/ 38oXvv8UnaXKYZC/pXjNqLHbOV8DyFFvi9XdLY7HGdhBxNvAm0IQTvzEJxHCXmgHmI yuLWVezKicjzEHQE4hi3DjwLoaS+JskZkgX0qo/k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Hocko , Andrew Morton , Stephen Rothwell , Linus Torvalds , Sasha Levin Subject: [PATCH 4.9 1/9] include/linux/mmdebug.h: make VM_WARN* non-rvals Date: Fri, 9 Jul 2021 15:18:28 +0200 Message-Id: <20210709131544.767197681@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210709131542.410636747@linuxfoundation.org> References: <20210709131542.410636747@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Hocko [ Upstream commit 91241681c62a5a690c88eb2aca027f094125eaac ] At present the construct if (VM_WARN(...)) will compile OK with CONFIG_DEBUG_VM=y and will fail with CONFIG_DEBUG_VM=n. The reason is that VM_{WARN,BUG}* have always been special wrt. {WARN/BUG}* and never generate any code when DEBUG_VM is disabled. So we cannot really use it in conditionals. We considered changing things so that this construct works in both cases but that might cause unwanted code generation with CONFIG_DEBUG_VM=n. It is safer and simpler to make the build fail in both cases. [akpm@linux-foundation.org: changelog] Signed-off-by: Michal Hocko Reviewed-by: Andrew Morton Cc: Stephen Rothwell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- include/linux/mmdebug.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/linux/mmdebug.h b/include/linux/mmdebug.h index 451a811f48f2..deaba1cc3cfc 100644 --- a/include/linux/mmdebug.h +++ b/include/linux/mmdebug.h @@ -36,10 +36,10 @@ void dump_mm(const struct mm_struct *mm); BUG(); \ } \ } while (0) -#define VM_WARN_ON(cond) WARN_ON(cond) -#define VM_WARN_ON_ONCE(cond) WARN_ON_ONCE(cond) -#define VM_WARN_ONCE(cond, format...) WARN_ONCE(cond, format) -#define VM_WARN(cond, format...) WARN(cond, format) +#define VM_WARN_ON(cond) (void)WARN_ON(cond) +#define VM_WARN_ON_ONCE(cond) (void)WARN_ON_ONCE(cond) +#define VM_WARN_ONCE(cond, format...) (void)WARN_ONCE(cond, format) +#define VM_WARN(cond, format...) (void)WARN(cond, format) #else #define VM_BUG_ON(cond) BUILD_BUG_ON_INVALID(cond) #define VM_BUG_ON_PAGE(cond, page) VM_BUG_ON(cond) -- 2.30.2