Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp144193imm; Wed, 12 Sep 2018 20:02:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZtbkcIQcECpMZDFLrqFme0LzKWCHc8gP13Ou0a63SV99WXhP8nANXyuveUUNU7jqWCukqz X-Received: by 2002:a63:2bc9:: with SMTP id r192-v6mr5104830pgr.386.1536807759453; Wed, 12 Sep 2018 20:02:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536807759; cv=none; d=google.com; s=arc-20160816; b=dQ/wpL6IWHSPZWsRTRjwGQrzRxA9R+EdDIBchsFj25q2UZ63q2MprM7efNaQ452sai OPlbuf76GPif+v+vnKpbOxRRIHBxF3VRGtDDe+GfBzzzv8ggblIRiwpc1FvNgzmlzNkn uQE0qVlNtO+xCyILxIBJGWukzDkCgXDaFB+R5IsI5UVS1ziha7OtGrrGbF5/tk1VOYKv 4OdJIPJvh0dMOTuwm/n6qTt38DoA2eRGfcgrq48U+QuzRwgCXMMzskqZCV2ifrSLv/Mo nlY6mfThx2bXN/NBMZ6HfDS2VW/5aNguDvOitCuL1QLWne2Cj+ese31zZozaSwUeIKvQ 5bVQ== 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:mime-version :message-id:date:subject:cc:to:from; bh=PMvPsrIZrCEiseM7EwwUN9dQnOcW4l2rLa9wUiD9+vQ=; b=GYBV369kcZZF6DZL+OBBGk6G2ZOsyVy7ZsmkCuwmZ4lYX8avKY0OMqfQtXb4BvUcC0 hjrwvrr0kE6elbrQhUlYh/tz4GHKRe3Ka02KHE5jVAc5YyCBfnG2SOzXz3etzY6IXedi hY2DBC+q6vovyciuq/A8x1zO90+sbgl4SztZnTwJc6XmfIYKln+5aFhvd+CBvIjqUOxf nJ1tcfokyMxbzJb7k1k0tf6Ub+CEvdsU0g/QhOvLfCXzIuJxvVVFciDS/WErEFbJWXEr F/XA5xVTz1kfjjPp/nCkx+S3ZaW1dzC2lgZyF1VH63EZKHHXAUcbtSHq+JQ+Lb90d6O0 5z6A== 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 c2-v6si2608877pfn.212.2018.09.12.20.02.11; Wed, 12 Sep 2018 20:02:39 -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 S1726838AbeIMIJd (ORCPT + 99 others); Thu, 13 Sep 2018 04:09:33 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12107 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726364AbeIMIJd (ORCPT ); Thu, 13 Sep 2018 04:09:33 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C409AD2B9EC08; Thu, 13 Sep 2018 11:02:01 +0800 (CST) Received: from linux-ibm.site (10.175.102.37) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.399.0; Thu, 13 Sep 2018 11:02:00 +0800 From: zhong jiang To: CC: , , , , Subject: [PATCH] x86: common: fix unused variable warning Date: Thu, 13 Sep 2018 10:49:45 +0800 Message-ID: <1536806985-24197-1-git-send-email-zhongjiang@huawei.com> X-Mailer: git-send-email 1.7.12.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.175.102.37] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following compile warning: rch/x86/kernel/cpu/common.c: In function 'syscall_init': arch/x86/kernel/cpu/common.c:1534:6: warning: unused variable 'cpu' [-Wunused-variable] int cpu = smp_processor_id(); Signed-off-by: zhong jiang --- arch/x86/kernel/cpu/common.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 0e3e803..0b283e5 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1531,8 +1531,6 @@ static __init int setup_clearcpuid(char *arg) /* May not be marked __init: used by software suspend */ void syscall_init(void) { - int cpu = smp_processor_id(); - wrmsr(MSR_STAR, 0, (__USER32_CS << 16) | __KERNEL_CS); wrmsrl(MSR_LSTAR, (unsigned long)entry_SYSCALL_64); @@ -1545,7 +1543,8 @@ void syscall_init(void) * AMD doesn't allow SYSENTER in long mode (either 32- or 64-bit). */ wrmsrl_safe(MSR_IA32_SYSENTER_CS, (u64)__KERNEL_CS); - wrmsrl_safe(MSR_IA32_SYSENTER_ESP, (unsigned long)(cpu_entry_stack(cpu) + 1)); + wrmsrl_safe(MSR_IA32_SYSENTER_ESP, + (unsigned long)(cpu_entry_stack(smp_processor_id()) + 1)); wrmsrl_safe(MSR_IA32_SYSENTER_EIP, (u64)entry_SYSENTER_compat); #else wrmsrl(MSR_CSTAR, (unsigned long)ignore_sysret); -- 1.7.12.4