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 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 38D58C25B79 for ; Wed, 22 May 2024 15:45:52 +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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=z+3ekzgu8giASFFU5Egke5Nhu03AJwBlD6IRujbf5hc=; b=jjkNJqU+0GZ0+o E6yEszdGfYq21fCk9uqSnQRVw75hVDw0lfXqn5aPcYFzmmNUXWEFvy6sLu+VDLSiTxf0Lrd3ZtCLZ wxysx+D8lzQm5FARUjrFsMw770AQBO17taAslGJIs7GYBe0FDs1V8NDO1A5KoT2NLjr4VDUBDbFxx kWYGDkqidgtduvcX7Da77DIUr6Vf/GtvOKcbhOfGpQRo4+JrS1aTHQiv+kCjz5JBspmkdigobxQHv M6EbpcPnfEbCSkCLOwpCWv7sY9dbOup1eAP/7v1gqQ5xvFNjoKYbU53U42rtZAUv+1YVT6s/tkZeJ hgNjp9lMCASaNgocg16w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9o9v-00000003Q2Y-0mO0; Wed, 22 May 2024 15:45:43 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s9o9s-00000003Q1d-29rq for linux-arm-kernel@lists.infradead.org; Wed, 22 May 2024 15:45:42 +0000 Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B2F18C67; Wed, 22 May 2024 17:45:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716392724; bh=fKcCOsO4NNeLFnYkRnTn7t5xMARBcbBgiNAr8ZKdLj8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MijpRaPT8SEi4hN1+goFLDZp29Rl64oVy52jvnwYBbNG1gSWCelpwX0I1L0v/KWOX uRYejZOU9lAcj/oTXVden6YncFRkhkw/iLwfgjVehN+C1I1X2f7eTJhvfIXFlkmVW9 mpk4YubWRGNL1QoVux3OPtH4ILlCGnvlFh22WmE8= Date: Wed, 22 May 2024 18:45:28 +0300 From: Laurent Pinchart To: Palmer Dabbelt Cc: tomi.valkeinen@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, kernel test robot , Anatoliy Klymenko Subject: Re: [PATCH] drm: xlnx: zynqmp_disp: Fix WARN_ON build warning Message-ID: <20240522154528.GA15832@pendragon.ideasonboard.com> References: <20240521142814.32145-2-palmer@rivosinc.com> <20240522144401.GA9789@pendragon.ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240522144401.GA9789@pendragon.ideasonboard.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240522_084540_721954_1804C159 X-CRM114-Status: GOOD ( 31.60 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, May 22, 2024 at 05:44:02PM +0300, Laurent Pinchart wrote: > Hi Palmer, > > (CC'ing Anatoliy) > > Thank you for the patch. > > On Tue, May 21, 2024 at 07:28:15AM -0700, Palmer Dabbelt wrote: > > 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. > > I think this should have > > Fixes: b0f0469ab662 ("drm: xlnx: zynqmp_dpsub: Anounce supported input formats") > > > 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)) { > > That doesn't seem right. layer->mode isn't a boolean, it's an enum. The > right fix seems to be > > if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_NONLIVE)) { > > Anatoliy, could you check this ? Palmer, do you plan to submit a new > version of the patch, or should I send the right fix separately ? I see a fix is already present in the drm-misc-fixes branch. Please ignore my previous e-mail. > > *num_formats = 0; > > return NULL; > > } -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel