Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp434893lqp; Wed, 22 May 2024 08:46:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUg3fM6RjR/wfpYBpq5hPLqSF70/RlZ3XiNje/P9ZQp7YfQZhLmppBTckGWBKqEdbMZZ9yt22JQA1ndmZ6lDDj1zWtIOJ2dlPgpgBP8IA== X-Google-Smtp-Source: AGHT+IFdy40K/Krf4PgGKz09ibgG/5w/hmbBGcpWZ5f1yct92+Yyux9bU9ZUTZbrPfnY/nWWCvtz X-Received: by 2002:a17:907:369:b0:a59:c3a5:4df6 with SMTP id a640c23a62f3a-a6228084d06mr139022066b.29.1716392800248; Wed, 22 May 2024 08:46:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716392800; cv=pass; d=google.com; s=arc-20160816; b=LthWfpy8YqrT89etfeUqwuDzUfXmJT/Awrhta2e2ErknfbglDyfZZKryJJGFI0G4fx MCFwMQDYZ2NmT+RbccCX1c9CpK3KJFcn3Spjcqu7sDPVd/4OP/mXgUmY94YKpA0Vn+sk i+KtlG0eQJFxnQ4S0rxQx0+9WtH4H6ZuNBrmVUlsEPpjwGBLbpIbwOQKkO6SzWn3tvae MGlGAAYrBHtqe+FD8gQlR8BMLoWplnb7pyiMf8cnm7x3FMY1FUOFe7hONJ7ParB6EqK1 0G0Q7Q+PLj/Uh6dBJYhXPpPDyVTytT/aZ2RDeZD6MovMoOJRIn1BJqTymxwKIzFjvYl1 8KMQ== 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=OQ5gohtSKUFBCWHG1tvEcTNuDV060LXLPgEpharzzKY=; fh=6f5ua6wNwVZESSZkZSleDUtlSoYSg2ixstIrBCkbax0=; b=JQpWto9nWAnjQjsVP3UQPSqWAC1XqsNEJ3z35DgZqluP4Qd2t5EBBQMUPdm5o50+9u AFTEa9CdxvzFB6Jggt1vRywSNOJM1owJt9auWfLVYajkrVVmHEnzBZrV1TEB/a9FMpO8 CackGd1WI+LywW+3D8PNQvlkArJxmfgEIW9fAMmn6NvVFKm0HREArVdOPL+ISFjgjpVk WUcJWplfv+Ld86ZRqQCILh6ddf6nqCv1BJsbuGMkypCt/jB+ulX26eMW+rYyhAxc0hV/ Tb2roEytuL09oEMH7MwJxRkhryaZ36C86n71z+ySOb2eiOeS3dhcwKr+2iSF/8/Yy8ql SGjw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=uLwquy6H; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-186452-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186452-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17be8bd5si1559262266b.854.2024.05.22.08.46.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 08:46:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186452-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=uLwquy6H; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-186452-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186452-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 015491F215BA for ; Wed, 22 May 2024 15:46:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6AEEF28EA; Wed, 22 May 2024 15:46:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="uLwquy6H" 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 2FA1081204 for ; Wed, 22 May 2024 15:46:23 +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=1716392784; cv=none; b=j7JBZjpTaUXvay6qDce6nkatyHQaUHp0OWy8loST6AhXPi0WXbs/gQ0cXYDnlhfVcUCIX6ouodfV7mYOKS0v9Ccpbedw2xV/ToQmyGqOwNAJE1iY9bwlWH2in7DgM+LSfqQpzpnaI6KKW1bTxnZSHiRKWAHo2ecN62njTWIA4eU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716392784; c=relaxed/simple; bh=m5IRUcHKz6e88TJmUQOvC2AcC0A8I/DAAbwMO2bG0QE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oRCat4WDchiPXFdxLTVYn/OCYOpFbHdH0hAuF22Zh5Hr6u5TUvh7dm6jimoMCTrapQoKm8n69hJfUeJN1gujU6DOjpcysN5+grXeJ/wWBqJajlns1xixiXGDP7SyYYZVeI6qJ+/rvrSPd9V5eZBVumVrZDqm46Fz0fUWk79kISU= 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=uLwquy6H; 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 D0ADFC67; Wed, 22 May 2024 17:46:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1716392769; bh=m5IRUcHKz6e88TJmUQOvC2AcC0A8I/DAAbwMO2bG0QE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uLwquy6HMmuiD24COtyH6xSjv/kXtcgWiBMQBEv+U7HSfTSW1VYqGfrEaKEq8qbzQ BpJnOb+XzfoXL3IXqwq2OFJKqdM3gt9BAtiBsTw3SDBqpqcMmWnrs0YdXqzjmLznj9 RN7mA8sJdeNGC2oVNTSnwxnXhJtWJT3I3CfcM6J4= Date: Wed, 22 May 2024 18:46:12 +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: <20240522154612.GB15832@pendragon.ideasonboard.com> References: <20240521142814.32145-2-palmer@rivosinc.com> <20240522144401.GA9789@pendragon.ideasonboard.com> <20240522154528.GA15832@pendragon.ideasonboard.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: <20240522154528.GA15832@pendragon.ideasonboard.com> On Wed, May 22, 2024 at 06:45:29PM +0300, Laurent Pinchart wrote: > 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. I meant drm-misc-next-fixes. > > > *num_formats = 0; > > > return NULL; > > > } -- Regards, Laurent Pinchart