Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6A18AC433FE for ; Wed, 15 Sep 2021 01:14:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22B6D60F23 for ; Wed, 15 Sep 2021 01:14:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 22B6D60F23 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.dev Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E3AC56E886; Wed, 15 Sep 2021 01:14:20 +0000 (UTC) Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5B4106E886 for ; Wed, 15 Sep 2021 01:14:19 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1631668456; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=ZNpudidzVmP4jemFhTF+Od7e/hnMt6Xl6jWXwSgmpfs=; b=M9TTANL6lOT2gGPl2aW6mLuWfct17FK29lfcwNsgUym1xpmkQMzLy/s6hTJKSE6Eldfa8t O08E2qM0ZqBj7QYOIO73uw/Nf/TIsh4H8EwtslkhTedbslG1Jd9AH9oV8jxhcA4e8FKI4L RR1XOfuUt7ZH2pXQfeE6d86aAdVlEBE= From: Jackie Liu To: dri-devel@lists.freedesktop.org Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, liu.yun@linux.dev Subject: [PATCH v3] mdacon: fix redefinition of 'scr_memsetw' Date: Wed, 15 Sep 2021 09:13:54 +0800 Message-Id: <20210915011354.2669416-1-liu.yun@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: liu.yun@linux.dev X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Jackie Liu CONFIG_VGA_CONSOLE=n and CONFIG_MDA_CONSOLE=n will cause vt_buffer.h not include . But if we set CONFIG_MDA_CONSOLE=m, mdacon.c include is in front of include . VT_BUF_HAVE_MEMSETW is not defined, so vt_buffer.h will define a scr_memsetw, after that, vga.h also define a scr_memsetw, so the repeated definition of scr_memsetw appears, builds error. We only need to make vt_buffer.h also contain vga.h when CONFIG_MDA_CONSOLE=m. This problem can be fixed. BTW, mdacon.c no need to include vga.h forcibly, let vt_buffer.h do it. Cc: linux-fbdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Fixes: ac036f9570a2 ("vga: optimise console scrolling") Reviewed-by: Greg Kroah-Hartman Signed-off-by: Jackie Liu --- drivers/video/console/mdacon.c | 1 - include/linux/vt_buffer.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c index ef29b321967f..5898d01bc492 100644 --- a/drivers/video/console/mdacon.c +++ b/drivers/video/console/mdacon.c @@ -42,7 +42,6 @@ #include #include -#include static DEFINE_SPINLOCK(mda_lock); diff --git a/include/linux/vt_buffer.h b/include/linux/vt_buffer.h index 848db1b1569f..3a79cc27a33b 100644 --- a/include/linux/vt_buffer.h +++ b/include/linux/vt_buffer.h @@ -16,7 +16,7 @@ #include -#if defined(CONFIG_VGA_CONSOLE) || defined(CONFIG_MDA_CONSOLE) +#if defined(CONFIG_VGA_CONSOLE) || IS_ENABLED(CONFIG_MDA_CONSOLE) #include #endif -- 2.25.1