Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp882530rdb; Fri, 1 Dec 2023 00:38:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IF0iIVE/ECsrVR1SzRHds7Tih06ZlzPkhC0l6Eg699A8w+BVjy7BCciQov15V+ZxJciINWv X-Received: by 2002:a05:6359:4948:b0:170:7b0:2bc4 with SMTP id mu8-20020a056359494800b0017007b02bc4mr2513506rwb.10.1701419899971; Fri, 01 Dec 2023 00:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701419899; cv=none; d=google.com; s=arc-20160816; b=G2kht7aBKHPXv1+iyX6Jzn+gI7c2q8LtjA75EqjZeqNY+9+E8dEQF/GvpxeOo1nYwq QhngP8FOUB0L/T02+IFw1LOq/FNIHXIipW6h8h8m6D8i6hAWmFu91U42416Rh3f+4r7F yYUV4Kxhdtid253f2jUXLX0TK7VE3vHRpuURE2xlqgI1PLrkNwNLhSWJm0NL00nAm7oT x+9hZvKU3l4I60GuYXxG4brGMPWYi0hOR5SpGt8gP3+4Eqq1oTRRdhCz3E+klEzHKDH9 KPxy/2n3Qdb5U3G5tKTGCyC2n+xRpACD4Go8YHplKd6XPkWtTHOrcCj4mTNsubw67HWc fcQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version:date :message-id:subject:references:in-reply-to:cc:to:from:dkim-signature; bh=ttAmhE8optQtHwITfLCf44LtID2Hyaf/SrMlMPmVrKg=; fh=7aY4Tvcauar4UC4BjBPjVykE5KA22AZTxQcNEjCHIg8=; b=YLGln9mQsCfAskLaEuniECWYMs1mUT+x83xtdmhVWaE88Z0YhSdzf9g67flv6Sb+2f zNrJyfWdXAwVvdesCijeWwug9FuEiT92I6hrrQc46feynAlnikSjGfTn5M4hGG62usQs vrPFabjSUdS2Wnp+H6tq9/NaQ4sjUbMdBnOyN5DNzHonchrRhUZ4+qpIz242SmCckzHq u59GXnsiDplpG2f/V65wrfMVXTERpxAZgXQSs19GRP/QRcb5wkbCYv37DOp0SinoxUdC ZKZffGa+EiFGzvl5kfcX51MxXyVzX/OvcBz2st5ewuqx1/+WmVh7DA11AlnUH0bMsY1e 5Blw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4GxHUbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bd40-20020a056a0027a800b006cbb36b9060si2942034pfb.385.2023.12.01.00.38.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 00:38:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=s4GxHUbA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 52C7680A7E71; Fri, 1 Dec 2023 00:37:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377814AbjLAIhh (ORCPT + 99 others); Fri, 1 Dec 2023 03:37:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbjLAIhg (ORCPT ); Fri, 1 Dec 2023 03:37:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9283196 for ; Fri, 1 Dec 2023 00:37:42 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 381EAC433C8; Fri, 1 Dec 2023 08:37:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701419862; bh=q6uyK3KduoHE8Rp2A1HWjw0i+9QdOkbCcHpv3VuzKnY=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=s4GxHUbAKKrXLvZe3ST3qpBvL3RTor6PdTIMHw9UOwvaSIu9tECHqjjclSIEYSNkg 7MVAtaMtUsUGDWyPw7vr0bEwQlaT1z+tF/P8xClmd409WFNKm64kyVM8xRLCqLFNg2 zgPWLcNExCoXIpNdnfLMFcEOQNhIUxjn6RyzPbzWWrEIsRnQrT1JN/ADcKHFsVlMvk JvC1YSxJIfgBriYyHhFRa5atIeJ8QEtt0pzR58PS7hLDucW/jYbEcDPy7Yy+VXDKCl QpiPULE0NW6ARKPvk3RB0tFxVUON8WS1RFuSgpCrbYTVuM7sRUJ5Y13JMKGQ92/+d4 gw9nNwnn4KjQQ== From: Maxime Ripard To: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Donald Robson Cc: matt.coster@imgtec.com, frank.binns@imgtec.com, boris.brezillon@collabora.com, maarten.lankhorst@linux.intel.com, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, kernel test robot In-Reply-To: <20231130160017.259902-1-donald.robson@imgtec.com> References: <20231130160017.259902-1-donald.robson@imgtec.com> Subject: Re: (subset) [PATCH v2 1/5] drm/imagination: Fixed warning due to implicit cast to bool Message-Id: <170141985986.3198881.16310139541433130875.b4-ty@kernel.org> Date: Fri, 01 Dec 2023 09:37:39 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 01 Dec 2023 00:37:47 -0800 (PST) On Thu, 30 Nov 2023 16:00:13 +0000, Donald Robson wrote: > This line appears to confuse the compiler and had been noticed previously in > clang-tidy output. There isn't anything fundamentally wrong that I can see. > I suspect that it just looks like a mistake - hence the first note. By making > the second operand an actual bool result, const correctness can be preserved > while silencing the warning. > > >> drivers/gpu/drm/imagination/pvr_device_info.c:230:47: warning: use of logical '&&' with constant operand [-Wconstant-logical-operand] > 230 | } else if (features_size == mapping_max_size && (mapping_max & 63)) { > | ^ ~~~~~~~~~~~~~~~~~~ > drivers/gpu/drm/imagination/pvr_device_info.c:230:47: note: use '&' for a bitwise operation > 230 | } else if (features_size == mapping_max_size && (mapping_max & 63)) { > | ^~ > | & > drivers/gpu/drm/imagination/pvr_device_info.c:230:47: note: remove constant to silence this warning > 230 | } else if (features_size == mapping_max_size && (mapping_max & 63)) { > | ~^~~~~~~~~~~~~~~~~~~~~ > 1 warning generated. > > [...] Applied to drm/drm-misc (drm-misc-next). Thanks! Maxime