Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2741806ybi; Sun, 26 May 2019 07:02:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwWe8vOpWvMZh6KwPsojbYPNVeu71J8qH1P1yrj7GI21Pymoqtupqhll3k7xFnJUwTuXgM X-Received: by 2002:a63:f212:: with SMTP id v18mr13383548pgh.20.1558879377531; Sun, 26 May 2019 07:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558879377; cv=none; d=google.com; s=arc-20160816; b=poYmjEG/Xfe258SDSYHql22YYOJoByK2sltOL5Ua/J03SZP57jhunqN67bgz+HTeTa 9+bjWjzJ6jKfWrPF9Ulx1h/Mqc6xXo8jMQaCTYgVRnzX/IRWUW/URuuJ1/NE97gGkwJu 4VGSxSNKY4IS6QoH2bgzw6vrs38O59GAO8+qIdNCGxyhhpWDQGr2JhJc15Q9NSEadNZx AZoFldoFIfpr3HDKqDm7lR4sKaKgmVAD9E8k+3ppcA7ySf4sV++0CR8Hb5RpAWbTP5Ka 5mdvOm1L3iTmAKDtc9IC749Xeqw6IyafkR2aLN1BAvMD7O5SldxKQ8XDWB3sBVqz7Ry/ DUQw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=seEZN9GlfMqyte/b5gr7S9VneOz3ZE7MUw05Ysu8M+o=; b=fL1SLsydHTmtsjk1Sp0WBzINIFOTSfCy3C/V+2Avj5T0bns0crb/7nYnTnRm+WFbj6 Y5wqMiSR0QkKUNlzQf4gxapVrGWTwDoUDQJNPw23UeikOVyFk7JrLSQITKs1ZOHP0E7u YLzaVhNvqOtDsNHJOrGcgJtG8JJpFigIS0e1bWs+Mr8cuhPLA47a5Hl9CcZr5O1/Z95Z Ova+Xpb0+ruInQZ61uia1qCDgwffVPiGUQN0K3cAVxo4HGjc196p3Ma0ta70G0ryxZnj J7i9/4il2NqROcrrJW6YhZXEsgnyasbl6Et6QfnLupu+RQTfdkOPi30RtqTxCYeIOj2d 7F3Q== 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 d4si13656450pjs.67.2019.05.26.07.02.42; Sun, 26 May 2019 07:02:57 -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 S1727907AbfEZOB1 (ORCPT + 99 others); Sun, 26 May 2019 10:01:27 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:41165 "EHLO relay11.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727717AbfEZOB1 (ORCPT ); Sun, 26 May 2019 10:01:27 -0400 Received: from alex.numericable.fr (127.19.86.79.rev.sfr.net [79.86.19.127]) (Authenticated sender: alex@ghiti.fr) by relay11.mail.gandi.net (Postfix) with ESMTPSA id A102A100005; Sun, 26 May 2019 14:01:20 +0000 (UTC) From: Alexandre Ghiti To: Andrew Morton Cc: Christoph Hellwig , Russell King , Catalin Marinas , Will Deacon , Ralf Baechle , Paul Burton , James Hogan , Palmer Dabbelt , Albert Ou , Alexander Viro , Luis Chamberlain , Kees Cook , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-riscv@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Alexandre Ghiti Subject: [PATCH v4 12/14] mips: Replace arch specific way to determine 32bit task with generic version Date: Sun, 26 May 2019 09:47:44 -0400 Message-Id: <20190526134746.9315-13-alex@ghiti.fr> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190526134746.9315-1-alex@ghiti.fr> References: <20190526134746.9315-1-alex@ghiti.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mips uses TASK_IS_32BIT_ADDR to determine if a task is 32bit, but this define is mips specific and other arches do not have it: instead, use !IS_ENABLED(CONFIG_64BIT) || is_compat_task() condition. Signed-off-by: Alexandre Ghiti --- arch/mips/mm/mmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c index c052565b76fb..900670ea8531 100644 --- a/arch/mips/mm/mmap.c +++ b/arch/mips/mm/mmap.c @@ -17,6 +17,7 @@ #include #include #include +#include unsigned long shm_align_mask = PAGE_SIZE - 1; /* Sane caches */ EXPORT_SYMBOL(shm_align_mask); @@ -191,7 +192,7 @@ static inline unsigned long brk_rnd(void) rnd = rnd << PAGE_SHIFT; /* 32MB for 32bit, 1GB for 64bit */ - if (TASK_IS_32BIT_ADDR) + if (!IS_ENABLED(CONFIG_64BIT) || is_compat_task()) rnd = rnd & SZ_32M; else rnd = rnd & SZ_1G; -- 2.20.1