Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp394324lqp; Wed, 22 May 2024 07:44:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV00xOwgS01avQ2GLx4YsF4C9BwsNngaKj9dAVBP/xLza7OY6+fegM15/FnyF2+PCorXCVvV8jSmlV8GSvgdEIENViWtDole4oAfuUnlA== X-Google-Smtp-Source: AGHT+IHi6QAq17P+8NQOde7RxHLLUBPsGnqGWl8IIGyMy9MT0eRYgt07lj1qzund0hUm1K3O/E5M X-Received: by 2002:a17:90a:420e:b0:2bd:9dab:a7b0 with SMTP id 98e67ed59e1d1-2bd9f45530cmr2278557a91.13.1716389067740; Wed, 22 May 2024 07:44:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716389067; cv=pass; d=google.com; s=arc-20160816; b=KZS/WRnStPPdMEiUpn9+DxTmLneY+u3Dz7xtEjDJ1EFU9ez12RF86FN2UHu8bnLECp h6VAkJEpbFykkBa9nJUwT0/+jEx37slqgvfwr63OkJ523pWm8UKkwxpmDk3M5UZ0WhmS sAdT9H2mus94SyiSHoTzp8/d98c7g31QXdgJ+V2Rc7NI/na79SEJ60rxuPA9yivHTn37 KsJ4sOLZXtvATZcxt4oMO5T2KDZP1hW0RVGH4coApuX4aMcyu5BbaEN5eT54WboiGLFa zPv5jsWiv4xPhsRtyoziKBp/+gTeQbbOY1SEzmTXnqOTLQuRSf5n20ria7D3wJTHcKhU IOVA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Z6kote7w5dGI5EGt8VFnMbKvREVUt4B27/SKNnifLU8=; fh=6f5ua6wNwVZESSZkZSleDUtlSoYSg2ixstIrBCkbax0=; b=gSk5ZcxxFDNLa6pEUW2+JBvlXk19ukNkLHh59pQaRoU9HWOqp/0XOhwyomB909viYe QErs5OnGhRmWxBrGa5HVll7KZrHuxqrmwLnmwq0/HaE/TjoP66wgHk06wwAYIBp2B4SS cytkWXZoGuGtAWzF6AX5I9HypRhnsHxES1WmCU35MHWls7N9fu9g4wC5+tlttNrVOsOZ Cpj1eiQK6EgbNuKPSX1iRXsefpNXTQhgl1wUOs8LfMMk31N/E+qRh06A5Ri9YZqWjtF6 f/4QKSs+pkbCOMrUY0iuTzFM8E5+wpQ/F1nxxCVQ+CFai2cdIOssVdNXG8MyVnsl3+OY rh7A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="v/oyrv0K"; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-186379-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186379-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2bd92552755si3494076a91.82.2024.05.22.07.44.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 07:44:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186379-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b="v/oyrv0K"; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-186379-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186379-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 64B2C283F1A for ; Wed, 22 May 2024 14:44:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6D5331BF2A; Wed, 22 May 2024 14:44:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="v/oyrv0K" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0B8AE1A29A for ; Wed, 22 May 2024 14:44:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716389060; cv=none; b=UzV+2swjeO5cUrtGnMerq4oTk+b5qnil3poMzFzpXVpJENFwalm4oNAYGzJsBk+03cOti1ho7E5vXxW3neF+oV6fkcasVZGhInnvJIqRzgrrrjA2a2/f5qCT8o7vC2mcm0Lx5srfdDHnPlGAnvGp8PxqFpzmnSg8LliE82gDw7A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716389060; c=relaxed/simple; bh=Wrhas7+z7n060qrEQIfs83yAi9030U03bjQ2PFmw0J8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=jGMUauPOwO3+YBSA3Ir4hVyXkz+BdkC2ZQTahRnB4BNDIinASARxlMIbu+2VLUaaM9ruYHHhYwnuJ1WR+0mwDMag47OPASc0ZyiPz+MqVfJAL3z5cumJar3JOlqUdkOc5RvxhGacAp4voJN7KEtKWdlfHmpWg/Wj5FK3Uz9zOv0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=v/oyrv0K; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi [81.175.209.231]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id DF99AABE; Wed, 22 May 2024 16:43:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716389038; bh=Wrhas7+z7n060qrEQIfs83yAi9030U03bjQ2PFmw0J8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=v/oyrv0KILjs8z/brlz+dJvcaKKT7YhWyIzKEZPsbAHemOkYKMea/pcWGhPj8Gysg BWvgv3FD1uCKD74pb/o2afPBTPtcrjssf9oZ3rDmIj3AksK/3kgzWI6CWbhhGPTjmV i6hDsXbKfMpHeL2JYrC7gyoYGi63As6BuhFFv4Xo= Date: Wed, 22 May 2024 17:44:01 +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: <20240522144401.GA9789@pendragon.ideasonboard.com> References: <20240521142814.32145-2-palmer@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240521142814.32145-2-palmer@rivosinc.com> 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 ? > *num_formats = 0; > return NULL; > } -- Regards, Laurent Pinchart