Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4597998imu; Tue, 29 Jan 2019 04:26:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN6b1mAOpCxjRccfgCGMXwiYxwmqmbwsgk3he00UHhD1G49Kzny2IMpJbCEDG6wnU2uJz6pQ X-Received: by 2002:a17:902:2:: with SMTP id 2mr26492421pla.228.1548764811540; Tue, 29 Jan 2019 04:26:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548764811; cv=none; d=google.com; s=arc-20160816; b=mGtMs2u1oHpXArQLp9ucSmk3CiFdDLqqp08tSXMwUu335Cquvf1yml4YHLasVViHJI SDBXBeMUOaVcIvm5sLZWhfcUlvW7tbnYmcdcWYmyy20NwbJNl/+H0/nQ/JtbwvpacjwA h/jXUTS9ohcfv4dBYJg4NpMyn9073kW847mKBXS5E69MQbK/ZwxmGTjcZxe2q35dsVo1 c3hSN1Pc3JGcuV8HLG+mbjj/DP3/E40MTd81zXdpT78apBliE1bhJAe6wKBpb9LHSedG knfdAU29+bfAfDFwsS0BuGDL8Uq26stSiDHoOLa5tj08N4joOOaVfjKl6LY+W/7gi1Mu xpTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=ZKTN+7tcZeWTFLGW5ZON9UubnxZMJBb+kXDOgSXmb+0=; b=AkuUGNXZHtmY0f359izpJZx5EUpja9WISWcvpXpYkj8b6/Umt2VuJqk0HktSKi8Bon vWB3DwO/M8H/2bqHKaf1ikalp1SP+3BipzI0v7f6rS7ChMgCxUj4DgLWZRFf9XIhP8Tw JiwxbG2UEhAuyscLQIVOxiCQjfXhF1pXPP9mYhPUhpdv1Yj2DL8VmM1ozLJ3RWHcEooJ nkLP+tpJ+a89ehY14VtM2fdmvJwLEbj9OB+tzWoUGTg+lnfA0M4tncEBUkY8sCpMu9DH 4IKZehOfRwHoZZfe2CUll7JmIhGsQRq1lobiVdWZVQoKtEBT9GzUWVKBQ4PUiMG6LpYS 2TtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bb481fjg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si6201642pgk.495.2019.01.29.04.26.36; Tue, 29 Jan 2019 04:26:51 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Bb481fjg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728947AbfA2MZO (ORCPT + 99 others); Tue, 29 Jan 2019 07:25:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:36044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727589AbfA2MZN (ORCPT ); Tue, 29 Jan 2019 07:25:13 -0500 Received: from localhost.localdomain (unknown [60.186.218.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C75792087E; Tue, 29 Jan 2019 12:25:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548764712; bh=pnbSH7l2QSlRRn0pxfx4RPnN6AbvF3PlF/HeMHaTsfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bb481fjgrRntRWSXjmep0Ppeid5GsmI71omQYuQ2xWEaTbFsIHJlF624itMXIhsV7 bpgiryPIyMUNPu1puhow/eBL7m1Jc46VQMIM3i8fFrN7hWFSlF4xxEtltjWhxW4+5n lJJBSA34y++GLo89r9i+ntxWjJExfe9uvrxvYQGM= From: guoren@kernel.org To: arnd@arndb.de, robh+dt@kernel.org, marc.zyngier@arm.com Cc: linux-kernel@vger.kernel.org, guoren@kernel.org, linux-arch@vger.kernel.org, Guo Ren Subject: [PATCH 08/10] csky: coding convention: Use task_stack_page Date: Tue, 29 Jan 2019 20:24:27 +0800 Message-Id: <1548764669-16656-8-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1548764669-16656-1-git-send-email-guoren@kernel.org> References: <1548764669-16656-1-git-send-email-guoren@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren Use task_stack_page instead of p->stack to get stack. Follow the coding convention style. Also for init_stack, the same with other archs. Signed-off-by: Guo Ren --- arch/csky/include/asm/processor.h | 4 ++-- arch/csky/kernel/smp.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/csky/include/asm/processor.h b/arch/csky/include/asm/processor.h index 8f45481..21e0bd5 100644 --- a/arch/csky/include/asm/processor.h +++ b/arch/csky/include/asm/processor.h @@ -49,7 +49,7 @@ struct thread_struct { }; #define INIT_THREAD { \ - .ksp = (unsigned long) init_thread_union.stack + THREAD_SIZE, \ + .ksp = sizeof(init_stack) + (unsigned long) &init_stack, \ .sr = DEFAULT_PSR_VALUE, \ } @@ -95,7 +95,7 @@ unsigned long get_wchan(struct task_struct *p); #define KSTK_ESP(tsk) (task_pt_regs(tsk)->usp) #define task_pt_regs(p) \ - ((struct pt_regs *)(THREAD_SIZE + p->stack) - 1) + ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1) #define cpu_relax() barrier() diff --git a/arch/csky/kernel/smp.c b/arch/csky/kernel/smp.c index ddc4dd7..b07a534 100644 --- a/arch/csky/kernel/smp.c +++ b/arch/csky/kernel/smp.c @@ -160,7 +160,8 @@ int __cpu_up(unsigned int cpu, struct task_struct *tidle) { unsigned long mask = 1 << cpu; - secondary_stack = (unsigned int)tidle->stack + THREAD_SIZE - 8; + secondary_stack = + (unsigned int) task_stack_page(tidle) + THREAD_SIZE - 8; secondary_hint = mfcr("cr31"); secondary_ccr = mfcr("cr18"); -- 2.7.4