Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp205515yba; Mon, 20 May 2019 07:23:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6ByR09ocEY7yHJIafFrJPRAlmMlo058kE1SddEDbY9RvrjOKptEc4cvuzpoih3NPLFdRC X-Received: by 2002:a62:54c7:: with SMTP id i190mr58331175pfb.87.1558362191242; Mon, 20 May 2019 07:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558362191; cv=none; d=google.com; s=arc-20160816; b=fCDDWnFbcLWOR3Mf4lpWqb+TapF8x3u7rX2a7DrEYZ4P3nUGwV8dX4WSAT8oDzLOdr A4c4haPTjpga1M3lL93PmdIYGTIJE6YuM8EAz4nwAeRqa0U9OHTEnu3boqXWX6+p43fZ 0LqWJ7+Te52Fs2G/dQIHNyzb1xc0NvkQO+2ujF1RWaca4vQplV7br26N7XH9DRkWhd7r XBmCT8y4bSP60OkGkLjEJoo3w4OiLE+E0NafsV3khIiuVkF01YmNG+nRSISVvMDctPlc 48IFYyrJDPPA6CiObgvzLU6PWPp3PsT27+CgvNUOAfdXYyCUkzuicuYdgR8ECE9QHQXO 0rLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=+EhGDHH2dmKF8+lYt2N3HwIi0xlN4RsEhVXHhi7cLJo=; b=d7G6DLH2E6TcjujvuplDR6AXNoDacEEHtyR5ba1htZPXQabWeTd0KuizTPM9YGtzmI B3WdiOdgTul98O5qvCm80V7Ll8a5zdcZj4np1tdb6TTL7M9IiAjz3YgRotuE410mZz4k GZsJsxfNibbP3Jdd0dVj/B2f3awiUG/o9H0i52u9CARv5UyMtnoPW78UXJ1zLG0QLEEG W6x8N7TtWnOTE74zjlPNSGFoSNMo8CTLBuLDXbr0pmSYIImpDvlka7/EBfaEPDWcbzoB Wq10MUqnWMQwMWtYe21znzpbtH3whWlos/naltvrKcaJR0X65vq8oz8M9BnvLiF0gcn3 jepw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h8si18589494pgk.221.2019.05.20.07.22.54; Mon, 20 May 2019 07:23:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731621AbfETKxW (ORCPT + 99 others); Mon, 20 May 2019 06:53:22 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7662 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725601AbfETKxV (ORCPT ); Mon, 20 May 2019 06:53:21 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id D68B38C3F3409373927E; Mon, 20 May 2019 18:53:19 +0800 (CST) Received: from [127.0.0.1] (10.74.221.148) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Mon, 20 May 2019 18:53:15 +0800 Subject: Re: [RESEND PATCH] intel_th: msu: Fix unused variable warning on arm64 platform To: Alexander Shishkin , References: <1558333597-63774-1-git-send-email-zhangshaokun@hisilicon.com> <87woilwjli.fsf@ashishki-desk.ger.corp.intel.com> CC: Greg Kroah-Hartman From: Zhangshaokun Message-ID: <46480fe3-8639-c6a3-4acf-e7db2a6157b5@hisilicon.com> Date: Mon, 20 May 2019 18:53:15 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <87woilwjli.fsf@ashishki-desk.ger.corp.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.221.148] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 2019/5/20 17:39, Alexander Shishkin wrote: > Shaokun Zhang writes: > >> drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_alloc’: >> drivers/hwtracing/intel_th/msu.c:783:21: warning: unused variable ‘i’ [-Wunused-variable] >> int ret = -ENOMEM, i; >> ^ >> drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_free’: >> drivers/hwtracing/intel_th/msu.c:863:6: warning: unused variable ‘i’ [-Wunused-variable] >> int i; >> ^ >> Fix this compiler warning on arm64 platform. > > Thank you for taking care of this. > >> Cc: Alexander Shishkin >> Cc: Greg Kroah-Hartman >> Signed-off-by: Shaokun Zhang >> --- >> drivers/hwtracing/intel_th/msu.c | 7 ++++++- >> 1 file changed, 6 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c >> index 81bb54fa3ce8..833a5a8f13ad 100644 >> --- a/drivers/hwtracing/intel_th/msu.c >> +++ b/drivers/hwtracing/intel_th/msu.c >> @@ -780,7 +780,10 @@ static int __msc_buffer_win_alloc(struct msc_window *win, >> static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks) >> { >> struct msc_window *win; >> - int ret = -ENOMEM, i; >> + int ret = -ENOMEM; >> +#ifdef CONFIG_X86 >> + int i; >> +#endif > > Can you factor it out into its own function? And one for the other > memory type? So we can maybe keep it to just one #ifdef like > Got it, I will update it in next version soon. Thanks, Shaokun > #ifdef CONFIG_X86 > void msc_buffer_set_uc() > { ... } > void msc_buffer_set_wb() > { ... } > #else /* !X86 */ > static void msc_buffer_set_uc() {} > static void msc_buffer_set_wb() {} > #endif > > Thanks, > -- > Alex > > . >