Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4002743pxu; Mon, 12 Oct 2020 07:07:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzc57Zfn6RsI8fx0nLH41HmgXbj4Acr3Oxi9kamL460D5+hGTDv/HSrt2f/DHlIiTyK9lda X-Received: by 2002:aa7:cad6:: with SMTP id l22mr14557160edt.229.1602511627140; Mon, 12 Oct 2020 07:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602511627; cv=none; d=google.com; s=arc-20160816; b=vzLbElUgPCpOgCeRtIiPB9xud5rfgGh8x562kSxeZjYu4mZgdbKiHVbNi6V1hEEyjn tb+KlueaXzmYMZkwWfNIBjQVKVgq2s6yD6YmUsfY5fnqOiRnu2zGYkcq30dmbcO9GRNs LO8GMGXDcw9w2unbiT57kedBePPqMZ8VYk0fSrbEbdnNupFb2M4uoMvEfdeXuQajmA61 gur4iKQZYqPXRApbl5p15LKH06GaW+osYMIE4xUFxWIWq9DCykPi6e/SiTfk6Bzdar3Y Dmjexou247wqFa2+4tFcf/9AyKm/Tw0FAFtvLyG4RjBxPAHX1pX5WshUzhJoAPk1G1tq 4vUg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=LsIOuGnc66pKct5GEWoIVk6flXfwv1vS5xzZ+X9GJzo=; b=VfSNJOzJ69EiUGs4nOMAr/qUAYvoG1Wpln+6t5QTAFuxyZW2I/5CUUls6rjVTXBu8Y rW/FqBDY+f+57F4pMiyzqGY1kKaGPMMYa0cZnce9CPJ8wRI8LXxmxGprpjtuCbLRsOsB 0ZJ7xpEPxQ1zVOJf8WQwSZnQ9v1Ye8DLA2ROeyHaNLcE7W+wB+DMj15Yw6rcfd3Gli3t XGbyTL3WRwTdFbbwQjq5SneCVqdUbUu29KyvQY+bu6DETVuFe42ExHnhrBWGaG94LMpN N1hvuUR6LT8PLCdNT5CqdCVV086e0UseC6gVpY34BtJchFgaUzMO/v93TiHn5K+G+F7P Aoug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VoN5p7ow; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u9si1417699ejz.746.2020.10.12.07.06.42; Mon, 12 Oct 2020 07:07:07 -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; dkim=pass header.i=@kernel.org header.s=default header.b=VoN5p7ow; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731001AbgJLODf (ORCPT + 99 others); Mon, 12 Oct 2020 10:03:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:39220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730562AbgJLNgd (ORCPT ); Mon, 12 Oct 2020 09:36:33 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F5252087E; Mon, 12 Oct 2020 13:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602509792; bh=ian+zxc+942wa2VjMkKMsqgnSf/6GG5nIsuzRADA73I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VoN5p7owFpIA1W7uLBTrMwHuQmY3pQ0aEEm15+9xr0QlNoLDF4HpRl1ebLwGwUavb 8WwsNiN29zUmyA9wfTNR8cGB4/fgrm8jzqu1PRUB1xcEG1yKVeQJWKQkeY9CvaSqaV ZXRwO9FOEwsPUD6gf/URH4D0NNchc0AoUnBBub6E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peilin Ye , Daniel Vetter Subject: [PATCH 4.14 32/70] fbdev, newport_con: Move FONT_EXTRA_WORDS macros into linux/font.h Date: Mon, 12 Oct 2020 15:26:48 +0200 Message-Id: <20201012132631.724847804@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201012132630.201442517@linuxfoundation.org> References: <20201012132630.201442517@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peilin Ye commit bb0890b4cd7f8203e3aa99c6d0f062d6acdaad27 upstream. drivers/video/console/newport_con.c is borrowing FONT_EXTRA_WORDS macros from drivers/video/fbdev/core/fbcon.h. To keep things simple, move all definitions into . Since newport_con now uses four extra words, initialize the fourth word in newport_set_font() properly. Cc: stable@vger.kernel.org Signed-off-by: Peilin Ye Reviewed-by: Greg Kroah-Hartman Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/7fb8bc9b0abc676ada6b7ac0e0bd443499357267.1600953813.git.yepeilin.cs@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/video/console/newport_con.c | 7 +------ drivers/video/fbdev/core/fbcon.h | 7 ------- drivers/video/fbdev/core/fbcon_rotate.c | 1 + drivers/video/fbdev/core/tileblit.c | 1 + include/linux/font.h | 8 ++++++++ 5 files changed, 11 insertions(+), 13 deletions(-) --- a/drivers/video/console/newport_con.c +++ b/drivers/video/console/newport_con.c @@ -35,12 +35,6 @@ #define FONT_DATA ((unsigned char *)font_vga_8x16.data) -/* borrowed from fbcon.c */ -#define REFCOUNT(fd) (((int *)(fd))[-1]) -#define FNTSIZE(fd) (((int *)(fd))[-2]) -#define FNTCHARCNT(fd) (((int *)(fd))[-3]) -#define FONT_EXTRA_WORDS 3 - static unsigned char *font_data[MAX_NR_CONSOLES]; static struct newport_regs *npregs; @@ -522,6 +516,7 @@ static int newport_set_font(int unit, st FNTSIZE(new_data) = size; FNTCHARCNT(new_data) = op->charcount; REFCOUNT(new_data) = 0; /* usage counter */ + FNTSUM(new_data) = 0; p = new_data; for (i = 0; i < op->charcount; i++) { --- a/drivers/video/fbdev/core/fbcon.h +++ b/drivers/video/fbdev/core/fbcon.h @@ -151,13 +151,6 @@ static inline int attr_col_ec(int shift, #define attr_bgcol_ec(bgshift, vc, info) attr_col_ec(bgshift, vc, info, 0) #define attr_fgcol_ec(fgshift, vc, info) attr_col_ec(fgshift, vc, info, 1) -/* Font */ -#define REFCOUNT(fd) (((int *)(fd))[-1]) -#define FNTSIZE(fd) (((int *)(fd))[-2]) -#define FNTCHARCNT(fd) (((int *)(fd))[-3]) -#define FNTSUM(fd) (((int *)(fd))[-4]) -#define FONT_EXTRA_WORDS 4 - /* * Scroll Method */ --- a/drivers/video/fbdev/core/fbcon_rotate.c +++ b/drivers/video/fbdev/core/fbcon_rotate.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include "fbcon.h" #include "fbcon_rotate.h" --- a/drivers/video/fbdev/core/tileblit.c +++ b/drivers/video/fbdev/core/tileblit.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "fbcon.h" --- a/include/linux/font.h +++ b/include/linux/font.h @@ -57,4 +57,12 @@ extern const struct font_desc *get_defau /* Max. length for the name of a predefined font */ #define MAX_FONT_NAME 32 +/* Extra word getters */ +#define REFCOUNT(fd) (((int *)(fd))[-1]) +#define FNTSIZE(fd) (((int *)(fd))[-2]) +#define FNTCHARCNT(fd) (((int *)(fd))[-3]) +#define FNTSUM(fd) (((int *)(fd))[-4]) + +#define FONT_EXTRA_WORDS 4 + #endif /* _VIDEO_FONT_H */