Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp263746pxf; Thu, 8 Apr 2021 02:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlU9dGczbRaScuhdlX+a6ApiEeyJPwkzCNn6Y5WaJiQi2c2jBt/x7Ikl+CjT0jprAGEptD X-Received: by 2002:a65:468d:: with SMTP id h13mr6993659pgr.373.1617874339614; Thu, 08 Apr 2021 02:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617874339; cv=none; d=google.com; s=arc-20160816; b=C7PKFv+S45swE94R+t9/9CtQydbDPa6PcepIpgqSTrWeYaz3jiVn4365C7X/t/3dKS wUx5nx9gxNYdfEPxi3jSES+acAGkDPxiouZwtLixWIG3bqipWKp09WU2f1is+N+MDVQl qS9vPo6xSl+qOGfaRcs7XKdwCY5e4qcAtMBc2qb7bRd8yJFEeXNtO2V2pgm/mlmPY1c0 kvRfH6QPzqi2jLnWNeKTFrtAH+nlOkMpzqaVU8ie8qWzFmBfHea8xZt5R7Ys4IssGDVS brmU+yhe6/ougW/e64y0vrTpovTGqhDRdXweZMuW+31iNSmH59zNr4Jb9nH+qrZxAfBr 7Fdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=30Sjw/e+Pv3SqCo5E7IROTIFYN70ss/JtQb2+TcrI4w=; b=sUS3GmHTjKAzvhd8h7zXeeNiZjcGuciC7Vw/EriAbF1t73/+Uh87dyCMzXek0WHiUc i/4YIkUx9Jkuivqqc/9gV1GBINQtgRl7iZqY8knudCyQSbH9ZTTpt6UrXmG2PTyXTqgP QVJdCf53cAvyRcKjdMCE9RW4zHy+m72b94QfNxyBVUTDCVhky32dCgA1FQT8f69NNqfz cy480BwQIgycsKw9P8z5ye7IyApS85dyY0GUBhF+60IJJ2Vz1UEaUZal+qbJRNDtxeoW F20AogNHz0QW+8dzGEA5MCo50fr7GscJT6RQHbDHpC0NhUv+bXeTicjkPj9O8sF76pAI 7pyw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m186si486055pfb.145.2021.04.08.02.32.07; Thu, 08 Apr 2021 02:32:19 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231172AbhDHJaq (ORCPT + 99 others); Thu, 8 Apr 2021 05:30:46 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15969 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230322AbhDHJap (ORCPT ); Thu, 8 Apr 2021 05:30:45 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FGGCT3Dv4zyNgX; Thu, 8 Apr 2021 17:28:21 +0800 (CST) Received: from [10.174.179.129] (10.174.179.129) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 17:30:25 +0800 Subject: Re: [PATCH 1/2] powerpc: remove set but not used variable 'force_printk_to_btext' To: Christophe Leroy , CC: , , References: <20210408011801.557004-1-yukuai3@huawei.com> <20210408011801.557004-2-yukuai3@huawei.com> From: "yukuai (C)" Message-ID: <9e3e5a40-ff90-9872-30a5-3a65232d5f0e@huawei.com> Date: Thu, 8 Apr 2021 17:30:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.129] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/04/08 13:01, Christophe Leroy wrote: > > > Le 08/04/2021 à 03:18, Yu Kuai a écrit : >> Fixes gcc '-Wunused-but-set-variable' warning: >> >> arch/powerpc/kernel/btext.c:49:12: error: 'force_printk_to_btext' >> defined but not used. > > You don't get this error as it is now. > You will get this error only if you make it 'static', which is what you > did in your first patch based on the 'sparse' report. > > When removing a non static variable, you should explain that you can > remove it after you have verifier that it is nowhere used, neither in > that file nor in any other one. Hi, I do use 'git grep force_printk_to_btext' to confirm that 'force_printk_to_btext' is not used anywhere. Maybe it's better to metion it in commit message? Thanks Yu Kuai > >> >> It is never used, and so can be removed. >> >> Signed-off-by: Yu Kuai >> --- >>   arch/powerpc/kernel/btext.c | 1 - >>   1 file changed, 1 deletion(-) >> >> diff --git a/arch/powerpc/kernel/btext.c b/arch/powerpc/kernel/btext.c >> index 803c2a45b22a..359d0f4ca532 100644 >> --- a/arch/powerpc/kernel/btext.c >> +++ b/arch/powerpc/kernel/btext.c >> @@ -46,7 +46,6 @@ unsigned long disp_BAT[2] __initdata = {0, 0}; >>   static unsigned char vga_font[cmapsz]; >>   int boot_text_mapped __force_data = 0; >> -int force_printk_to_btext = 0; >>   extern void rmci_on(void); >>   extern void rmci_off(void); >> > . >