Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp295283ybh; Sun, 12 Jul 2020 06:43:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzN2xmsL4p+rb6V07rcuVYTGSEhynMKuR6oiNqF4jZnlDMWyhIdbxuNqr8vSuzsWZ1not0S X-Received: by 2002:a17:906:b45:: with SMTP id v5mr67100514ejg.464.1594561390257; Sun, 12 Jul 2020 06:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594561390; cv=none; d=google.com; s=arc-20160816; b=XLsjPu51B49tdImT3yt2Xolkz/roI9WxyzvZpTVITtV/qhEu3nUpQ3puHeA9TSELU+ GIK4YS+G21db/amQDN4mPe0e9v0wpOlp6U+5ezgfmyqUkkjiGSzhYTEcMRPv8qEnTryV S5TJXFp0BuWY4b6qRKQfzkoQVxpwZcJzaxtAq2ihR06YVG7B3y8vArj1fQUL94o9b0yh 2Eyi02v7uVOXC8lYztxcQ/A9Cb4WX0vKiGoVBmrcC5w8QO7/ZozydJHhJ7b8+cUTi795 xq7OAC+TekKsDCkQGXpJjj/tJiUysuKFCIQqHLfkRZdNF9q2P70M1yyQfDXMnpv8e0dF 2aeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=eNjuwv7XEw8dWgTmRUuJjHq4lw0V6z2EE9/IuOSrENo=; b=N6LFsjj+EVo73OtgDJbhWghrLJZj8Vs3Lasb2k3R4T637zEiF+7D92dfjztMPf43c0 2oYkvkZDNjCm8k8owNNNGCkIFcP9uKSoBqFTf95wYqFcSV+KKE1+6PBmyvPRJ2ksCTQF KeQSEzaYWIYm9xxkxyZlzl31kwJz8FoQGgDXL37I68bAMW0X9cJR50rrxvO/qNn2qsuD hYZlTdXQ4/j1knK2876U+pklssFEB+qmz/A5rdGAA0nijSN9GpdvHivMIUlLorENYuL9 dRVQJzXCUeNkSS1m1n6AwrryMb7eFvqd2A5aJByAQFFCtirzf5fdzAsaIjXiiLm+MHBl NP7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=kPA3mDcv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p7si6850430ejc.96.2020.07.12.06.42.46; Sun, 12 Jul 2020 06:43:10 -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; dkim=pass header.i=@kernel.org header.s=default header.b=kPA3mDcv; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728862AbgGLNmn (ORCPT + 99 others); Sun, 12 Jul 2020 09:42:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:43538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728756AbgGLNmm (ORCPT ); Sun, 12 Jul 2020 09:42:42 -0400 Received: from localhost.localdomain (unknown [89.208.247.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 19863206D9; Sun, 12 Jul 2020 13:42:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594561362; bh=YyUE0OgeiZ7J5J4saaGtSuMP8qRods8NoQGoTEHtQLE=; h=From:To:Cc:Subject:Date:From; b=kPA3mDcvzWK5v+v/ghGmHhI0L8gAaoajPv/wGe+BISoCIra9xIyqHZkekkL+Ty2Zm 1uzimxMYhsh0PrcIrJ2opbeNejrlKmQGLlzijCvelQ/2+2dd94EBUTAbRtXS00qxXp w8rX7wg1t7DHp43uicS+xMBAGvAnYcWADHQsMsb8= From: guoren@kernel.org To: palmerdabbelt@google.com Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, guoren@kernel.org, Guo Ren Subject: [PATCH] riscv: Cleanup unnecessary define in asm-offset.c Date: Sun, 12 Jul 2020 13:41:49 +0000 Message-Id: <1594561309-65026-1-git-send-email-guoren@kernel.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren - TASK_THREAD_SP is duplicated define - TASK_STACK is no use at all - Don't worry about thread_info's offset in task_struct, have a look on comment in include/linux/sched.h: struct task_struct { /* * For reasons of header soup (see current_thread_info()), this * must be the first element of task_struct. */ struct thread_info thread_info; Signed-off-by: Guo Ren --- arch/riscv/kernel/asm-offsets.c | 3 --- arch/riscv/kernel/entry.S | 5 ----- 2 files changed, 8 deletions(-) diff --git a/arch/riscv/kernel/asm-offsets.c b/arch/riscv/kernel/asm-offsets.c index 07cb9c1..db20344 100644 --- a/arch/riscv/kernel/asm-offsets.c +++ b/arch/riscv/kernel/asm-offsets.c @@ -27,9 +27,6 @@ void asm_offsets(void) OFFSET(TASK_THREAD_S9, task_struct, thread.s[9]); OFFSET(TASK_THREAD_S10, task_struct, thread.s[10]); OFFSET(TASK_THREAD_S11, task_struct, thread.s[11]); - OFFSET(TASK_THREAD_SP, task_struct, thread.sp); - OFFSET(TASK_STACK, task_struct, stack); - OFFSET(TASK_TI, task_struct, thread_info); OFFSET(TASK_TI_FLAGS, task_struct, thread_info.flags); OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count); OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp); diff --git a/arch/riscv/kernel/entry.S b/arch/riscv/kernel/entry.S index cae7e6d..3e8707e 100644 --- a/arch/riscv/kernel/entry.S +++ b/arch/riscv/kernel/entry.S @@ -389,12 +389,7 @@ ENTRY(__switch_to) lw a4, TASK_TI_CPU(a1) sw a3, TASK_TI_CPU(a1) sw a4, TASK_TI_CPU(a0) -#if TASK_TI != 0 -#error "TASK_TI != 0: tp will contain a 'struct thread_info', not a 'struct task_struct' so get_current() won't work." - addi tp, a1, TASK_TI -#else move tp, a1 -#endif ret ENDPROC(__switch_to) -- 2.7.4