From patchwork Fri Jul 28 20:33:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 9869411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 49AA56037D for ; Fri, 28 Jul 2017 20:34:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38030287AD for ; Fri, 28 Jul 2017 20:34:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CDBA288CA; Fri, 28 Jul 2017 20:34:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACB22287AD for ; Fri, 28 Jul 2017 20:34:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752234AbdG1UeD (ORCPT ); Fri, 28 Jul 2017 16:34:03 -0400 Received: from vern.gendns.com ([206.190.152.46]:56884 "EHLO vern.gendns.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752056AbdG1UeD (ORCPT ); Fri, 28 Jul 2017 16:34:03 -0400 X-Greylist: delayed 437 seconds by postgrey-1.27 at vger.kernel.org; Fri, 28 Jul 2017 16:34:03 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=Message-Id:Date:Subject:Cc:To:From:Sender: Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Ezm7Bb3MeVpgynSOkVRPfHBQDaj2O/OEn3mLwD47D9M=; b=iZXzXFoBEQ/4I2SUf3Aww7GKod IFOVKf2fadSETH2qfyvUcQKbFXbO/0zkDc2Rr8MI2EUFiFo1WKuCNM+yR+Lh7cc0Y82xDDVR6yEgo BoaEKLbe2SnTQFncqs3dt2TETJmSbYKe4xT+u2ePW9PHeyBKIOA67sdsBQzqmH6DaRYogzu8PZqWW TWlmHYsesfO8ZNDlzOBn5c9N6MCg56LMkDgA7jaCXXa9u7r8ySFYMdtvu5HrT8xaQpZnaDb7UhPTa yYwP7x2D3DiBPNr6xY3oX02ICNxeK98TdQSj6RkNQVUoU5074WLo7U/CTkIgRxChr7CTn3Lwg9ncq pHf+KTrg==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:56066 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.89) (envelope-from ) id 1dbBus-001HWa-GS; Fri, 28 Jul 2017 16:31:22 -0400 From: David Lechner To: linux-fbdev@vger.kernel.org Cc: David Lechner , Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org Subject: [PATCH] fbdev: fix 1bpp logo for unusual width Date: Fri, 28 Jul 2017 15:33:53 -0500 Message-Id: <1501274033-6978-1-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This check is needed in the case where the width of the framebuffer is not a multiple of 8 pixels. For example, LEGO MINDSTORMS EV3 has a 178x128 1bpp display. Signed-off-by: David Lechner --- drivers/video/fbdev/core/fbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c index 7a42238..805a42c 100644 --- a/drivers/video/fbdev/core/fbmem.c +++ b/drivers/video/fbdev/core/fbmem.c @@ -315,7 +315,7 @@ static void fb_set_logo(struct fb_info *info, for (i = 0; i < logo->height; i++) { for (j = 0; j < logo->width; src++) { d = *src ^ xor; - for (k = 7; k >= 0; k--) { + for (k = 7; k >= 0 && j < logo->width; k--) { *dst++ = ((d >> k) & 1) ? fg : 0; j++; }