Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp920046imj; Sat, 9 Feb 2019 10:48:22 -0800 (PST) X-Google-Smtp-Source: AHgI3IZAWHr1mfwLyK3DgnBoSvgV3xY9FepuuJK8JpVtsByTX4Iec8ZYTiik709sr2oRKkw2RB4V X-Received: by 2002:aa7:87d9:: with SMTP id i25mr7390134pfo.14.1549738102327; Sat, 09 Feb 2019 10:48:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738102; cv=none; d=google.com; s=arc-20160816; b=E8Wpgu9RyHv3EEZGN6Nx8sC9Fbd+LCd2fU1Zin/11udd/cGZlgEb+NA8JSFVZvOy5T rKQa0a1Jc4WrF/LD1Rw11ESj4+W3GOfGz7DYIdDv4MV0JpvzuSci2Cjsu6cuvWkSHoE5 bFS5JZjLOr1dOekqeTq4UCDVXKtcspDahzv5RagwxzIXlYiQT9s0Lnz5jX52u71Z3SJi rbOTIT/fevRyTKrZrW8orcbLVtwDVbq3ZVXV8CYg6sYNVKpTwd44QV3TB/x3uK/bETEW v/lU4SeuajC3ekOyoxzZLMMMUhZLEWPO3alOC04nMkdJRk4gfd7Xd7ajCvnpfSdslJBD qrVw== 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 :dkim-signature; bh=JFOjm7E80I+eSdsakLY8g8YHI/gfvIoNaZCacFteSdk=; b=E/zYa5hn56Hns6YoS3glCxhBQVI0tUe3UYBnv+Od4WqyGFTXYqpjfU+cWWSfNnr8rz wVei4PU8XDL7XePpyVP7VoqsV4ChIvo2q0TZ0dw5uMLWHxuHbiCPvxBdWZWDMMK/tZkl n3inzfRfnQVAfmBvKI0P/V1u30EQN7/hKFBBm8gN+VxuCD3vUfFEGQMPzX63bWeZZHb5 WYxvWhAffHs3gO3AxZNMB+ihuINrbp0Avu3FJagQ+HggGgt+J/cXSeZfnkhTJYqLvc8P +eredoeHAommwfnjvelCML9oA66rBvwo5wBkD29eS8yaDhSUpFJQslCQndo0dsYJSuuk U5KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0krOI0dv; 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 38si5819980pln.313.2019.02.09.10.48.06; Sat, 09 Feb 2019 10:48:22 -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=0krOI0dv; 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 S1727427AbfBISrw (ORCPT + 99 others); Sat, 9 Feb 2019 13:47:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:60454 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727401AbfBISrs (ORCPT ); Sat, 9 Feb 2019 13:47:48 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4DD5A21A4A; Sat, 9 Feb 2019 18:47:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738068; bh=dvR1nJMfzgWZnqjrYs8gGiZCI7ekIPKLaIMovEzrF3M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0krOI0dvuExaGBtoh4frjfeKZ6+W2RYZEUWt+K/iCNMMeZmrP3Sr/I4g0uBbm2t7X Ac1w68N/21J87AVoiiEZ1DR1vLyCukF9jRQi7enpDa6r6toEeoEO483nLRre5611IF wpkaR7fc2AVyJcL8HQhd+Z5vOshgZDQvNl+qJkVg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Guo Ren , Joel Fernandes , Guenter Roeck , Arnd Bergmann , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 4.20 12/42] csky: fixup compile error with pte_alloc Date: Sat, 9 Feb 2019 13:47:04 -0500 Message-Id: <20190209184734.125935-12-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190209184734.125935-1-sashal@kernel.org> References: <20190209184734.125935-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Guo Ren [ Upstream commit 2a60aa14a9a0333b3eef58150bc1ef654f7321ef ] Commit: 4cf58924951e remove the address argument of pte_alloc without modify csky related code. linux-5.0-rc1 compile failed with csky. Remove the unnecessary address testing in pte_alloc(). Signed-off-by: Guo Ren Cc: Joel Fernandes (Google) Cc: Guenter Roeck Cc: Arnd Bergmann Cc: Linus Torvalds Signed-off-by: Sasha Levin --- arch/csky/include/asm/pgalloc.h | 43 ++++++++++++++------------------- 1 file changed, 18 insertions(+), 25 deletions(-) diff --git a/arch/csky/include/asm/pgalloc.h b/arch/csky/include/asm/pgalloc.h index bf4f4a0e140e..d213bb47b717 100644 --- a/arch/csky/include/asm/pgalloc.h +++ b/arch/csky/include/asm/pgalloc.h @@ -24,41 +24,34 @@ static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmd, extern void pgd_init(unsigned long *p); -static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm, - unsigned long address) +static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm) { pte_t *pte; - unsigned long *kaddr, i; + unsigned long i; - pte = (pte_t *) __get_free_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL, - PTE_ORDER); - kaddr = (unsigned long *)pte; - if (address & 0x80000000) - for (i = 0; i < (PAGE_SIZE/4); i++) - *(kaddr + i) = 0x1; - else - clear_page(kaddr); + pte = (pte_t *) __get_free_page(GFP_KERNEL); + if (!pte) + return NULL; + + for (i = 0; i < PAGE_SIZE/sizeof(pte_t); i++) + (pte + i)->pte_low = _PAGE_GLOBAL; return pte; } -static inline struct page *pte_alloc_one(struct mm_struct *mm, - unsigned long address) +static inline struct page *pte_alloc_one(struct mm_struct *mm) { struct page *pte; - unsigned long *kaddr, i; - - pte = alloc_pages(GFP_KERNEL | __GFP_RETRY_MAYFAIL, PTE_ORDER); - if (pte) { - kaddr = kmap_atomic(pte); - if (address & 0x80000000) { - for (i = 0; i < (PAGE_SIZE/4); i++) - *(kaddr + i) = 0x1; - } else - clear_page(kaddr); - kunmap_atomic(kaddr); - pgtable_page_ctor(pte); + + pte = alloc_pages(GFP_KERNEL | __GFP_ZERO, 0); + if (!pte) + return NULL; + + if (!pgtable_page_ctor(pte)) { + __free_page(pte); + return NULL; } + return pte; } -- 2.19.1