Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp160041pxb; Mon, 18 Oct 2021 23:29:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzEGJi2rw++LzJZzfTnRsvl8rG/nbsWnjvMioP46hxyHFUxV9LaOIEmhKIV9iaKfRJ9C2r X-Received: by 2002:a05:6402:42cd:: with SMTP id i13mr51228053edc.396.1634624993772; Mon, 18 Oct 2021 23:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634624993; cv=none; d=google.com; s=arc-20160816; b=FKQq3PpoxjI2aVs2rYPg6CvxUQsZfIil6F2KeZtDT7HCs9IWdnpCy0MwK1Icx5urx9 sNsz+u3d0fWcLucbxLrABix2qBTyZi6ZXFLyiFFX1+Z+MJbQVnNKu4jH422LCWP8P9mJ Wf09s5xzTkYNj41CsB+MEfgjSUKcKvzTuCdAUWymqnXVcGE86G/o1/3aKd6tAyIUYxh9 rhy9Kar2K18GTnS1CrtzWOG+b29V+//AadC0JMrWIQUDC25YuHWVOPJaJmT3ZzWmqP8r s6cmBA6vdMQz+703rDFBA+UYz7nQSyHi1cQQqaDazzTlT1iytUO5ASwmrjFO/eI/OjRr sL/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+Hz18V9cmevixb6yPJp+xhm9+FmsVtQxvQp4KWS9Xn0=; b=LaRDKkIQ+9O/ImPI/AigpASQVhvlrFZR4UBcvD/GPlVYqhFuQ8U7OWSYGfU8nhPVIV 65bUjuhMZuH2N/jcXsA2vko2hAh15etIeoFTyk4dugGH2AtRPcy2SEAr39nCVOdHaCye aywrF6Xykh/bcO6VlY8zlUL9vS14e7fTh4fxDqKUVkcxxw/1hfJ82FtUphbPiR4XuaXA 0rnhwqgHfp+tFDQSByV4TeNF2bX13a2BX4M+S9DiRU5/HXR/74WPL+ar6yVttZfJ4RRJ OPFGqGpEkPqoWztDJ/yWJoWEM5hgBHhs2rTxPGBnjUnOnRuf2Yn+eStmFQFfK9iMYLEK ddlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MaQGIQas; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k11si22501880edh.512.2021.10.18.23.29.30; Mon, 18 Oct 2021 23:29:53 -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=@linux-foundation.org header.s=google header.b=MaQGIQas; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229695AbhJSG3f (ORCPT + 99 others); Tue, 19 Oct 2021 02:29:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38162 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234190AbhJSG3e (ORCPT ); Tue, 19 Oct 2021 02:29:34 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62FF0C061745 for ; Mon, 18 Oct 2021 23:27:22 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id j21so5219766lfe.0 for ; Mon, 18 Oct 2021 23:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+Hz18V9cmevixb6yPJp+xhm9+FmsVtQxvQp4KWS9Xn0=; b=MaQGIQasM+dLV7KwlcsE5Cl9HFetE/vzwFHktseUxeQcmw5PdeCbgreOiQxEbNmFt4 dnLQIc2SvagaUe91R1lrfZl+mhDwAH/5cNO7uFEDcK1cxss/qgvbSTzqirsdRKsLf/ix x+1OQif8898d3tVTgUGcnvsSybigNO3qRv1Cs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+Hz18V9cmevixb6yPJp+xhm9+FmsVtQxvQp4KWS9Xn0=; b=tpHommDd5xgAghsGcE/Tx/lBtTfZwyemAQmPMgNyiJG7RIj7O1vF5bC2f3CFAppX/w fO2keJWhMsjPL/J9AcnPMrAMzw/yMzpbxGpIwXPUObFd+EbUGvn4BS5yNSnzXkeOZO3c 3K6/mS7YiwuLYMV9awOupYX4shH55Hc7V3cRTdYahpPR+v93g7Euo0VGTxDJxSo3Yqo3 yC7B0fuEqB6Qknp7JgHx7T97c3H729L5oIGrxUucjcpZYRgPsi/Nd6PSmVKkKjtIRPIz acUJkBPp74Am4NgHyQpIH7rqTK2ELwIOLUpV/Ebcfi06LllPIUf76KzGS+ycfoEdx+Gx 1nZQ== X-Gm-Message-State: AOAM531IxmRDxAiq2AATxDpL7YOC7mHA/3NDCJvqgFVxUkBcYWVuAjak gp3IKW8PLiW8Kzna3K+SBYzpRB1s8OLeHg== X-Received: by 2002:a19:c3c8:: with SMTP id t191mr4179610lff.525.1634624840086; Mon, 18 Oct 2021 23:27:20 -0700 (PDT) Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com. [209.85.208.175]) by smtp.gmail.com with ESMTPSA id p21sm1575383lfg.18.2021.10.18.23.27.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Oct 2021 23:27:19 -0700 (PDT) Received: by mail-lj1-f175.google.com with SMTP id n7so4134764ljp.5 for ; Mon, 18 Oct 2021 23:27:18 -0700 (PDT) X-Received: by 2002:a2e:1510:: with SMTP id s16mr4766664ljd.56.1634624838613; Mon, 18 Oct 2021 23:27:18 -0700 (PDT) MIME-Version: 1.0 References: <20211018182537.2316800-1-nathan@kernel.org> In-Reply-To: From: Linus Torvalds Date: Mon, 18 Oct 2021 20:27:02 -1000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] platform/x86: thinkpad_acpi: Fix bitwise vs. logical warning To: Nathan Chancellor Cc: Nick Desaulniers , Henrique de Moraes Holschuh , Hans de Goede , Mark Gross , ibm-acpi-devel@lists.sourceforge.net, platform-driver-x86@vger.kernel.org, Linux Kernel Mailing List , llvm@lists.linux.dev, Tor Vic Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 7:00 PM Nathan Chancellor wrote: > > For what it's worth, the suggested fix is the '||' underneath the > warning text: > > In file included from arch/x86/kvm/mmu/tdp_iter.c:5: > arch/x86/kvm/mmu/spte.h:318:9: error: use of bitwise '|' with boolean operands [-Werror,-Wbitwise-instead-of-logical] > return __is_bad_mt_xwr(rsvd_check, spte) | > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > || > arch/x86/kvm/mmu/spte.h:318:9: note: cast one or both operands to int to silence this warning > 1 error generated. Hmm. That's not at all obvious. The *much* bigger part is that note: cast one or both operands to int to silence this warning which is what I'm complaining about. That note should die. It should say "maybe you meant to use a logical or" or something like that. > Perhaps that hint should also be added to the warning text, like: > > In file included from arch/x86/kvm/mmu/tdp_iter.c:5: > arch/x86/kvm/mmu/spte.h:318:9: error: use of bitwise '|' with boolean operands; did you mean logical '||'? [-Werror,-Wbitwise-instead-of-logical] > return __is_bad_mt_xwr(rsvd_check, spte) | > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > || > arch/x86/kvm/mmu/spte.h:318:9: note: cast one or both operands to int to silence this warning I don't understand why you seem to continue to ignore the "note" message, which makes a completely crazy suggestion. Linus