Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3204466pxk; Mon, 21 Sep 2020 07:49:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDfry+L5h90JR+O5Hthah+izsyyciCqinNyR3D7UPX/mOnIeJ7NyMwdHM6yvM93FIJt7bE X-Received: by 2002:a05:6402:1548:: with SMTP id p8mr368edx.65.1600699778495; Mon, 21 Sep 2020 07:49:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600699778; cv=none; d=google.com; s=arc-20160816; b=PlSLQqoQPup1EH5WXEq7jP1nXpEibGlwBE7X3dccSeens+t/V3Md3nYqa5cst0oedi 7pjayOOOO30cBYgFSjoEYIj/uOn5z8T6Di//iU3pQccWikd3SI0waa9tWHg3YIROfUMo z1naddeEEUUSV7IQXpPzTIntzbUDmOxdsNQHS/pU3QL3I2Id/qVSilA2Y6rbyEKqHUmf 8PHv7vRIOEbAgFccxeVS11c4JInrf11mqvEqMzRXr/0lUmCQ8vmlvelMa0v8HCrA5MQJ tsfKBBQGLJ+6GJGQx4IE34kT2gROG5e6UBB4ERLz8d7TI5bp8/csyb4/o46ebavwnyNF dh0w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=7rqYAfCuUEkoDeBQzCb93FBL9jactKW8NwZxwLzEe64=; b=zF0mqb/lPvzZ8gfCjhvwbt+mrHmZfJTMfc0KAqqERvwYxCbwBPocFsXhdzAu7xQpJ6 bCut2b4NoEjnOrT9Ksk5+g6gMguemNTO+Yi8LyeWPQtv/YLvDW+8lmh7aIo/LkRBnWvv 2ZSxRabjJQ5WIDlW7ikxaI6hD3pvzT2GOpODkJUHl6bxKg9Ou2wVqOkZx44p/aEdet+F YHWYxd5NtGTEW/Jjk2BltGecEDvFbqS1ffuGuHGXpNzPaG9Au7sTm4Hwj1DXmrup6S+Z rJ2Vd+kkP5FtTej43pK+WZ3F02AY0FZii0HlwGlTzeMHJ7F5+C0GpkvCy6OO71Uigw/K AQeQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f27si3618626ejf.129.2020.09.21.07.49.14; Mon, 21 Sep 2020 07:49:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728100AbgIUOsO (ORCPT + 99 others); Mon, 21 Sep 2020 10:48:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728068AbgIUOsN (ORCPT ); Mon, 21 Sep 2020 10:48:13 -0400 Received: from smtp1.goneo.de (smtp1.goneo.de [IPv6:2001:1640:5::8:30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14206C0613D6 for ; Mon, 21 Sep 2020 07:48:13 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by smtp1.goneo.de (Postfix) with ESMTP id E667C23F0D2; Mon, 21 Sep 2020 16:48:11 +0200 (CEST) X-Virus-Scanned: by goneo X-Spam-Flag: NO X-Spam-Score: -2.995 X-Spam-Level: X-Spam-Status: No, score=-2.995 tagged_above=-999 tests=[ALL_TRUSTED=-1, AWL=-0.095, BAYES_00=-1.9] autolearn=ham Received: from smtp1.goneo.de ([127.0.0.1]) by localhost (smtp1.goneo.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nd0l_fbNS2a5; Mon, 21 Sep 2020 16:48:11 +0200 (CEST) Received: from lem-wkst-02.lemonage.de. (hq.lemonage.de [87.138.178.34]) by smtp1.goneo.de (Postfix) with ESMTPA id D61E023F0A3; Mon, 21 Sep 2020 16:48:10 +0200 (CEST) From: poeschel@lemonage.de To: Miguel Ojeda Sandonis , linux-kernel@vger.kernel.org (open list) Cc: Lars Poeschel Subject: [PATCH v2 31/32] auxdisplay: charlcd: Do not print chars at end of line Date: Mon, 21 Sep 2020 16:46:43 +0200 Message-Id: <20200921144645.2061313-32-poeschel@lemonage.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921144645.2061313-1-poeschel@lemonage.de> References: <20191016082430.5955-1-poeschel@lemonage.de> <20200921144645.2061313-1-poeschel@lemonage.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Lars Poeschel Skip printing characters at the end of a display line. This fits to the behaviour we already had, that the cursor is nailed to last position of a line. Signed-off-by: Lars Poeschel --- drivers/auxdisplay/charlcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c index cd3a304c08ec..1d5b3af9cca7 100644 --- a/drivers/auxdisplay/charlcd.c +++ b/drivers/auxdisplay/charlcd.c @@ -111,6 +111,9 @@ static void charlcd_home(struct charlcd *lcd) static void charlcd_print(struct charlcd *lcd, char c) { + if (lcd->addr.x >= lcd->width) + return; + if (lcd->char_conv) c = lcd->char_conv[(unsigned char)c]; -- 2.28.0