Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp863267rdf; Fri, 3 Nov 2023 19:07:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHY97xD3DumrlaneCY6COM6FHEr4JJKzHYgH2BIO4BXER10SNFf2jwfo7PKxbjfgVZsKy0O X-Received: by 2002:a05:6a21:788b:b0:177:a131:f31c with SMTP id bf11-20020a056a21788b00b00177a131f31cmr6465617pzc.13.1699063671280; Fri, 03 Nov 2023 19:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699063671; cv=none; d=google.com; s=arc-20160816; b=hlnKE+wU4DZ9DEu8YNDYLNao+Ah1z3pEwICZV+gfnByK65JivIzvlvRSDtWxyfyk9Q Xfeb9KHYsEvi5rz5Pu8iyvgZfQyNtFg0pqA97y/N3wkt5rSlQ7y+aSDcA7FeTDlcRt6v 9GdepaP/pE9Voh547MSWzYofVnDHyGG9WQiMUYqqaS27Ph3zlUOj/rgwgmyRiE0AjOOc Vk5yRWLkoaFeGZ+Xz/YZLW5VMM8UO1rxlBTxFGqku8oMZXG3q0YE2U0p3QujViIggl/p 2WIAtScq2t+9rp0/8pjwPY7+Ul8TzMB1VoCxy80v+uQJozaMghHvrCsZUan1OfIxDLPN TNwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rJHokBPZkilBLpx9O0WcGAnj5+EjtpmdjnMqPdl5xtc=; fh=W0hJifdS2T8gD47VSZUe466dG1Vo96HGLkh220P86BE=; b=THcinVSuYEOq1q7yV+7DCIG6RUYt2OLazw/Bx6SmZ1yO9pFAQvuChBSJ6SyJ4/NFdB 6jpZoDqmpmMxR6O+QjzI68HayRf448wBnEVBrnoinYCBrhNmgfPX7cy3Cs285LXrAcfg fduch98P5BmzV0pnqiGuDElpkDV5hfFjwXKL383/6J1xxZHWoh1sUkKqO0Tf3U9OtwhL 4eV8zcQQeKRGRCpoXDIu/vpvKFlJYCLwhfKOxcemXhpIPU0wKxTcJn3Gb9zThUFOHG43 aJzwhYsydoMDd+xEGA15NEA2gRJ62sM5mGHq6TOeqf+9JB7Ldee6PElkV8m03ddwEmkb sOeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UJUrnToO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q22-20020a056a00089600b0069341622984si2747690pfj.147.2023.11.03.19.07.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 19:07:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UJUrnToO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 019D581C70BA; Fri, 3 Nov 2023 19:07:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbjKDCHn (ORCPT + 99 others); Fri, 3 Nov 2023 22:07:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231209AbjKDCHm (ORCPT ); Fri, 3 Nov 2023 22:07:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FCD9D60; Fri, 3 Nov 2023 19:07:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A970C433C8; Sat, 4 Nov 2023 02:07:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1699063659; bh=L6ks4yKT0/F+fOvkUaGIHPgT6JzQVMFwAqz5caY4KZU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UJUrnToOTQovPehLi9haOD6o6/5UCScaj5JM30hNFQItSwGi1w+nMogw1UJ/dJYpc ua3XgBh20btA8FNNcYLkjqecTFGkHFMrG0bs6JLz1Up7iX9f62geWyNSHBrE6iL1Zl uEgPkL2FyLym3rEwvNYaWzAVaIKSuYTXN3qSzukOQZ41rRUW5ZVmL01GxrE1ywBgQs gzknh1xRxRIcS0jDbi7PqRqcfJCD6q3az+h7frcHd4y9NeqEbYOWzEmOad84/06Fns h3OnLG5IEEok7PiPAzPDzkaIL4RZiyHzkTMlrRnObJESAbpscTKuRvWHu8izzYbW+G 0TbNtB5ppbLJg== Date: Fri, 3 Nov 2023 22:07:38 -0400 From: Sasha Levin To: Sergey Shtylyov Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Helge Deller , daniel@ffwll.ch, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH AUTOSEL 6.5 34/52] fbdev: core: cfbcopyarea: fix sloppy typing Message-ID: References: <20231029225441.789781-1-sashal@kernel.org> <20231029225441.789781-34-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email 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 (agentk.vger.email [0.0.0.0]); Fri, 03 Nov 2023 19:07:49 -0700 (PDT) On Mon, Oct 30, 2023 at 11:39:14AM +0300, Sergey Shtylyov wrote: >Hello! > >On 10/30/23 1:53 AM, Sasha Levin wrote: > >> From: Sergey Shtylyov >> >> [ Upstream commit 7f33df94cf0156f64eee9509bd9b4a178990f613 ] >> >> In cfb_copyarea(), the local variable bits_per_line is needlessly typed as >> *unsigned long* -- which is a 32-bit type on the 32-bit arches and a 64-bit >> type on the 64-bit arches; that variable's value is derived from the __u32 >> typed fb_fix_screeninfo::line_length field (multiplied by 8u) and a 32-bit >> *unsigned int* type should still be enough to store the # of bits per line. >> >> Found by Linux Verification Center (linuxtesting.org) with the Svace static >> analysis tool. >> >> Signed-off-by: Sergey Shtylyov >> Signed-off-by: Helge Deller >> Signed-off-by: Sasha Levin >> --- >> drivers/video/fbdev/core/cfbcopyarea.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/video/fbdev/core/cfbcopyarea.c b/drivers/video/fbdev/core/cfbcopyarea.c >> index 6d4bfeecee350..5b80bf3dae504 100644 >> --- a/drivers/video/fbdev/core/cfbcopyarea.c >> +++ b/drivers/video/fbdev/core/cfbcopyarea.c >> @@ -382,7 +382,7 @@ void cfb_copyarea(struct fb_info *p, const struct fb_copyarea *area) >> { >> u32 dx = area->dx, dy = area->dy, sx = area->sx, sy = area->sy; >> u32 height = area->height, width = area->width; >> - unsigned long const bits_per_line = p->fix.line_length*8u; >> + unsigned int const bits_per_line = p->fix.line_length * 8u; >> unsigned long __iomem *base = NULL; >> int bits = BITS_PER_LONG, bytes = bits >> 3; >> unsigned dst_idx = 0, src_idx = 0, rev_copy = 0; > > I highly doubt this is necessary to pull that into stable. This was >intended to be a cleanup originally. I'll drop this and the other one you've pointed out, thanks! -- Thanks, Sasha