From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E717437D13A for ; Sat, 18 Jul 2026 11:57:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784375864; cv=none; b=tyDR+ROXdMFMuMoDrtDfVczUUCOjm72Jnt0URmLzNBCh4dfJFj7KJKv71FGaNeKFr9cT1IxTiYYYqZiusqNgTXIKOy/Yrg21ouw7DB820E7hkhqKJVt0vYooUWg3+i2A3kgM1Dpii4AT9YTSaAqqFeVdNapDaGfrffwzOh6sxc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784375864; c=relaxed/simple; bh=bRZ7r5ito+ISYPPpW3iV3q8jRne4kVIXg/UH5tYXNOo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sXRp6laGw248k3YDhA3GQAvTZ66jClnAu7b8jqfQrT23j3ZhSee0Bn92rivhtJcwCLSZluICSnSi583bBXbw2+/SQ+NlI0VZKpfqSLcFf+9QIzVNK+G+7z6biXNrjw4rXR3nG5h94/Q0hOgZ8/9FYEY+vhuwOYS+WW8ZW6XnZ90= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nV2CgT8F; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nV2CgT8F" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-6a397a0e5d8so4461640eaf.3 for ; Sat, 18 Jul 2026 04:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784375860; x=1784980660; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3/gVjW7F0KtjB8QhqPU1YYK9NmfO70mkrphRQOGidpk=; b=nV2CgT8F4LupCZyW1367FJg9CvVgtvvviVahWhTIHCUP0I79SbUghiyVhs7dsAmYjH qoMgNrP0LlI59LPAfGm9qJicr0ieR9ZT97U2hAV5/E4PNapwVw69ZtElA7PEZVH4xJpv LiU89dbR1WTE7r7Q73P4/+OtMg12RLL5Q8qMiDyiwujQBxXxfc1awIGCiCB0fgpvOGxI S2zLenWpen+2w1KMcu3TxCoSJV1wLz0wBTbcHHUk5rvkrb9dZKf0JMZcH4DJJ1SqfhCs VkTSCLnQfgoJ8kWbXmXYfRRcGwtINi617PGAYWPb72b7g//z4oLVGK8kV3J1+ulHEFzq Zj/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784375860; x=1784980660; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3/gVjW7F0KtjB8QhqPU1YYK9NmfO70mkrphRQOGidpk=; b=OddcPURys7GmUwQvfwFFn0oqbHAjS+pAgqppe4goCPfe4JOlBxemcHbcgbHqSR8n9n 7JcUMbx+XN7+xRmUFrpahG4egk3kZ/yQwNMWTsDXeb9P04LSOzbE6JNj1b/TVPGKQpY7 Kbz3thOCqkxJljOHLwhlxGE+6E8R29sqoudaYaxtlJmgMqHXqxChpZdTyqCGP06KAlXc FPOx6qnzIXG8ZNdO6o3M37miX5MZPpE48snay7EHBbTEBmnocVxVjdYzVBDNVqM+yfMR f18r5J58FngAiN8XDl+z/Bp1NiMrjFdFiqqDCg/S8tccdGAQlp5UMcVRkveRVBYH4v0E sNmQ== X-Forwarded-Encrypted: i=1; AHgh+RqVX8lUHeeftWTpNFJmk5ADtsvdHopbrXsxg5Tq22ZvEZEprRYAs3K/5dMAYXdeXTfGtoJYr9s1kBwrEAk=@vger.kernel.org X-Gm-Message-State: AOJu0YwktlVXQj9qBNnwDxzEU0sFHYROzXU6UIwBa1PvsTN99YbZl3dq xcWRbQv9JY7Q/J/nUqSwRFbV67aK6pbjsUX1WalFJ52Yc8ugC1mirBEA X-Gm-Gg: AfdE7ckud3XNEBl08TeC0ARLDJv8Sgi0FP/BKE+OLAbf8Po7PLTNVcdwEptIpLyT1L/ g0AOMaBbEdldshCqyLy2U66Hzl6bDrsxmqjpcr/nUz21EfMSdWDaMREfdQ6T1raUlr74ao8IZQZ jEdJurQ0ZH2QQF6X2Bykd67ZvY9gE8PWIzhcCWHzVURBth7ZA9ESjN/tS3xK2MRZNyya42dnfgc 7uGy1TEQsMWTJ1krZfa1OZCyY+q3QbKA4q5NIB5W4NWn5aPrtjVJubzOgx835E5lDokfsL26QTx 4DVEYjc6j5zHY6dmTXzJI9Hgi8a72C6J6hjK0xKhSvDlreoXIZJxQG1oDpLunKgFJJICMRQXDE6 Cz3QCpD3JhcIQoWLVFyxpBSZYF0pAYL1TuOR0CACy5NECZBT+d5e3DoWlssTHLnLmqqx0DA== X-Received: by 2002:a05:6820:151e:b0:6a4:cf9:9a69 with SMTP id 006d021491bc7-6a5366c922emr2917108eaf.20.1784375860437; Sat, 18 Jul 2026 04:57:40 -0700 (PDT) Received: from localhost ([74.80.182.90]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6a516c03f36sm3343831eaf.7.2026.07.18.04.57.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Jul 2026 04:57:38 -0700 (PDT) Date: Sat, 18 Jul 2026 14:57:32 +0300 From: Dan Carpenter To: Muhammad Bilal Cc: Sudip Mukherjee , Teddy Wang , Greg Kroah-Hartman , linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] staging: sm750fb: fix mono image source stride mismatch in lynxfb_ops_imageblit() Message-ID: References: <20260718103103.18082-1-meatuni001@gmail.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=us-ascii Content-Disposition: inline In-Reply-To: <20260718103103.18082-1-meatuni001@gmail.com> On Sat, Jul 18, 2026 at 03:31:03PM +0500, Muhammad Bilal wrote: > sm750_hw_imageblit() advances its monochrome source pointer by > src_delta per scanline, and computes the correct rounded-up stride > internally as: > > bytes_per_scan = (width + start_bit + 7) / 8; > > Its only caller, lynxfb_ops_imageblit(), instead passed src_delta as > image->width >> 3. For widths not a multiple of 8 this under-counted > the stride, so the source pointer fell further behind the real > per-scanline layout on every line, corrupting the rendered image. > > Rather than just fixing the caller's calculation, remove src_delta > as a parameter entirely and have sm750_hw_imageblit() advance by the > bytes_per_scan it already computes for itself. There has only ever > been one caller, and that caller was passing an out-of-sync > derivative of the same width/start_bit values sm750_hw_imageblit() > already has, so keeping stride as a separate parameter served no > purpose beyond letting the two calculations drift apart, which is > exactly what happened here. > > Fixes: 81dee67e215b2 ("staging: sm750fb: add sm750 to staging") > Signed-off-by: Muhammad Bilal > --- There is supposed to be a little note here: --- v2: Added a Fixes tag. https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/ Obviously there is an inconsistency between rounding up and down but without testing it's less clear which one is correct... regards, dan carpenter