Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp31899imm; Thu, 30 Aug 2018 07:40:23 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda/e/Y6PliKVWOJH2mG60plLWkkcRHdMSvBd0u5kunDnggcS95rkuIVT7mQ9BPwA48iAOfH X-Received: by 2002:a17:902:3a5:: with SMTP id d34-v6mr10529202pld.98.1535640023061; Thu, 30 Aug 2018 07:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535640023; cv=none; d=google.com; s=arc-20160816; b=CWd414WpMwIgjQVm+SNfDSAKFnV9kwkb5bqVKWkMJZZMYFaxNVR9OPjsxCQUTTH3CZ t1nVA+hQgSMrlkqMTNBw98ZSvmdfsi0oPQgfFofZmW0Gcgbc7ah2eN6kUJZe5ahxc3+6 AzB6byDD+WBZ4WypxY4Igs+8++LLGKkE6AmoTCT04xj1k74N7JjCSj92Pmlo2PY5FMWv RpdVcOJhAPdybWb3jQ2ez855Wgm5FODGYvx5xMgMrkg2pIzyutx6hVZtdzX9+GIlfql3 dZtZ20mRrC/TXJnRP3CgMgZiRTW+Pef8J9aikU97nCzoOecBZpn2ac1pmzQ2vJlBTiQi ZLuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=Hjks0naNoBODbs4+AgLquXmnnAJh63N0IE0oKLsGxkM=; b=skDYUq36pdHhRezO4XkNAwnRFm8gVzK8FhqnmudrgPYF0xYVhQHQKMzB3FZf2qK+oy vJ/4gBb9p+GM5+nQCmxE7Aj4NOtghDpk8ChzCVn3l36ZUjfEL3XVUzX39xphSekILS5Y g8yWjzd98Kvn5qnh5JxKvQcLzHbo9FrYsPPLoxpT1XDsDnH4N2IneTH+OKBnU5WvpT+n +0E4cJu0quH+QNo/al72OGtjX1Cq+ElFTAOwXP3wlg3vcB0Haa4OMQ2s0/VMVliRp4My 23ESJl4APtkaQ8EcjhsAd7/nvhpbaoYCvYng+2qXSzjDsA+t99BBIQzWCxABbJXK7LVJ YLWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RGZwKuim; 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 m76-v6si6936785pfg.323.2018.08.30.07.39.51; Thu, 30 Aug 2018 07:40:23 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RGZwKuim; 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 S1729343AbeH3SkL (ORCPT + 99 others); Thu, 30 Aug 2018 14:40:11 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:37374 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729008AbeH3SkL (ORCPT ); Thu, 30 Aug 2018 14:40:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Hjks0naNoBODbs4+AgLquXmnnAJh63N0IE0oKLsGxkM=; b=RGZwKuimR2h1fgCCOLqJU5BtI xApwLPF1rnODjQSfF2iDE0gyuImV8W3Ahz5WIglgcqm84VBaoo9P6tIbTo/PSxNHPPEY+Jzy8G/K+ j2INZyOq7HAJd2L/PGg+dwTldXJ0ksMRUZAYWhO05FEmPfs5OAVivrq6rzu3F40W7uDcCV1nywvjf oBev8KQIwqSApodEdv9tn1hofWTPn2cwl8IfxZjcO0JyHq1g6ASENH4/z0jGy0lLdVmZSx3mfyaKB o6gZAMevYV/0ZfLOI71xzT4N0gSH6hgA0if3zzmuQFK1xh5tlsVZYgTm9E7nC0hrToqyuk/qsBcK6 JVTtGUcjQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1fvO4p-0005Fl-11; Thu, 30 Aug 2018 14:37:39 +0000 Date: Thu, 30 Aug 2018 07:37:38 -0700 From: Christoph Hellwig To: Palmer Dabbelt Cc: linux-riscv@lists.infradead.org, daniel.lezcano@linaro.org, jason@lakedaemon.net, ard.biesheuvel@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com, dmitriy@oss-tech.org, jeremy.linton@arm.com, linux-kernel@vger.kernel.org, atish.patra@wdc.com, aou@eecs.berkeley.edu, Greg KH , tglx@linutronix.de Subject: Re: [PATCH 1/8] RISC-V: Provide a cleaner raw_smp_processor_id() Message-ID: <20180830143738.GC11544@infradead.org> References: <20180827184243.25344-1-palmer@sifive.com> <20180827184243.25344-2-palmer@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180827184243.25344-2-palmer@sifive.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 27, 2018 at 11:42:36AM -0700, Palmer Dabbelt wrote: > +/* Obtains the hart ID of the currently executing task. This relies on > + * THREAD_INFO_IN_TASK, but we define that unconditionally. */ Kernel comment style would be: /* * Obtains the hart ID of the currently executing task. This relies on * THREAD_INFO_IN_TASK, but we define that unconditionally. */ > +#ifdef CONFIG_THREAD_INFO_IN_TASK THREAD_INFO_IN_TASK is always defined for riscv, so no need for this ifdef. > +#define get_ti() ((struct thread_info *)get_current()) > +#define raw_smp_processor_id() (get_ti()->cpu) Please don't cast structs around. This should be something like #define raw_smp_processor_id() \ (container_of(get_current(), struct task_struct, thread_info)->cpu)