From patchwork Tue May 21 14:28:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Palmer Dabbelt X-Patchwork-Id: 13669486 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C9DCC25B74 for ; Tue, 21 May 2024 14:29:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:From:Cc:MIME-Version:Message-ID:Date :Subject:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wrK1OV3GjRvAdAdUZ9K5BbmoF4uNJRTfUKa77BXslQw=; b=O8puDMRU0b/VTF ollT+fH8Onyp7ZbA3M+lVeQcdC3qa29oerGSXmsg1/zr22UwuEZBTUFHmzYBAs5337TTAfrRGAOz/ MeCU9QLXiQVkJrRvNh85MjG0t+dDHCGU1UbBygUq7sihDKJ71xQ3uzInaFq6sbAoncgJypVUDVgDB nps2n14F30YWFhKLmDFSGCdEqbuCzkoNCaJoUPM4DeSgIf3AzsqMB5NwnIGEBCo+IcbGrKrFLClP9 5hpZhlKLA8iMj15l6ko4SmejnVbGwJ0pgU/iUBommnYFO+BqBbun85yCIYRkw7EqRM9arWzH/q005 brNl/qE84m5a2T4EW/uQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9QUF-00000000BMD-3XKj; Tue, 21 May 2024 14:29:08 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9QUD-00000000BL7-095k for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2024 14:29:06 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-5b273b9f1deso2433638eaf.3 for ; Tue, 21 May 2024 07:29:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1716301742; x=1716906542; darn=lists.infradead.org; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:from:to:cc:subject:date:message-id:reply-to; bh=TwldfdL+T6NcWAidI3T3bL1Xd+CxsE6EH6dzBTpXKgU=; b=PHSSkzznPvTgMA2gSFOdH/zsoGY3KWYD3ZZRtT8SKe0v13CrijVxlAd/LHCFAHnxT5 gf+3gjSOokaPXXMZiJjB1mFfLn/wM2dMmdtbHbNRSP3oLodmNCColagBDUgFSDyx9oNm LYHl6yRYr9ypHpvtbbLWLdrLFF4cUiYSeSZoBJnRp4dho5MA9AAvgtU5DZ6eTPBjyaab H9LCUex1pf097FuK6Qw/Preaq2UmzoL7E4DPNTQed1UnqPM4SSURFDZx6J6g3QUJvOUI P1VRkrBjcQHewRhSoZOo0d9AgFYUK/BJOeS6MkYG8sOH8OjImiCbd9U3SuGpgemYj3iq dnvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716301742; x=1716906542; h=to:from:cc:content-transfer-encoding:mime-version:message-id:date :subject:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=TwldfdL+T6NcWAidI3T3bL1Xd+CxsE6EH6dzBTpXKgU=; b=DzvPXFLW1fvAthO6SiQkFPSfImptD5HnHFQJ0z8NPWLw6dTGpcOcIuozX8UIESkVFB /xKQuAzL3j5nPLszo6EuF45IJ/B5qWpC93fMEYqwmfUWBn6FZ0WY7BgZZSrPrgU/MHT7 6W2OFdiI5+2LmHp4KA1G0sNaz5UX8IkN11A3Ol1wdn0dzMACclCMtUZnOzjh1IdyS4ry +/wWUrFvyBnq8XNinBNy5E92/Y5NZ6Y1aawTo16nbMz6bH3eybMWlGIJ2xJ3XMOKFexg SYSGb7JpWzlNFuXXAc8kx4syZhR2aTj9GDRCjEa9Mpra9Tk9nzPzlrj9AieyJU+w9end iMtg== X-Forwarded-Encrypted: i=1; AJvYcCXAci7Lq+12lgGFZNw/yd/BHE0HNIbA6LIZmcIQ/BPujnSRzOmeuU3j0GT3HKOQz8fpfN/kL4fqBv9cq+d4XbnBI6ZdR+4ohpjsU57IL6E2ghnokXc= X-Gm-Message-State: AOJu0YzuGcvhPsgN8YchgKrc26ltpNMVM6o5weFWRvUzCNfixQlOBXOO Lzy8/Joqo98+B03Tq91YXQPb/ELfNAne7YKlfICZddS1vUnr8I562mji1nkMKf8= X-Google-Smtp-Source: AGHT+IF+toXA1Nu3KEKk8hdXyTF86rbz9YOAD8q6l99vrilAUb3JIDxN2FfEB1nAafTrGIeh+79vhw== X-Received: by 2002:a05:6358:8a8:b0:186:12e6:42b4 with SMTP id e5c5f4694b2df-193bcfc56a2mr3916016555d.23.1716301741198; Tue, 21 May 2024 07:29:01 -0700 (PDT) Received: from localhost ([50.145.13.30]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f6af98d9edsm3937397b3a.156.2024.05.21.07.29.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 07:29:00 -0700 (PDT) Subject: [PATCH] drm: xlnx: zynqmp_disp: Fix WARN_ON build warning Date: Tue, 21 May 2024 07:28:15 -0700 Message-ID: <20240521142814.32145-2-palmer@rivosinc.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 Cc: laurent.pinchart@ideasonboard.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, michal.simek@amd.com, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Palmer Dabbelt , kernel test robot From: Palmer Dabbelt To: tomi.valkeinen@ideasonboard.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240521_072905_197950_1F66E8A1 X-CRM114-Status: GOOD ( 16.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Palmer Dabbelt Without this I get warnings along the lines of drivers/gpu/drm/xlnx/zynqmp_disp.c:949:14: error: logical not is only applied to the left hand side of this comparison [-Werror,-Wlogical-not-parentheses] 949 | if (WARN_ON(!layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE)) { | ^ ~~ arch/s390/include/asm/bug.h:54:25: note: expanded from macro 'WARN_ON' 54 | int __ret_warn_on = !!(x); \ | ^ drivers/gpu/drm/xlnx/zynqmp_disp.c:949:14: note: add parentheses after the '!' to evaluate the comparison first drivers/gpu/drm/xlnx/zynqmp_disp.c:949:14: note: add parentheses around left hand side expression to silence this warning which get promoted to errors in my test builds. Adding the suggested parens elides those warnings. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202405080553.tfH9EmS8-lkp@intel.com/ Signed-off-by: Palmer Dabbelt --- I couldn't find a patch for this in Linus' tree or on the lists, sorry if someone's already fixed it. No rush on my end, I'll just stash this in a local branch for the tester. --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 13157da0089e..d37b4a9c99ea 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -981,7 +981,7 @@ u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, unsigned int i; u32 *formats; - if (WARN_ON(!layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE)) { + if (WARN_ON((!layer->mode) == ZYNQMP_DPSUB_LAYER_NONLIVE)) { *num_formats = 0; return NULL; }