From patchwork Tue May 28 17:05:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 10965541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F081C112C for ; Tue, 28 May 2019 17:05:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DAC41285FD for ; Tue, 28 May 2019 17:05:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CF25628673; Tue, 28 May 2019 17:05:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70BB2285FD for ; Tue, 28 May 2019 17:05:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbfE1RFH (ORCPT ); Tue, 28 May 2019 13:05:07 -0400 Received: from mail-eopbgr740138.outbound.protection.outlook.com ([40.107.74.138]:6077 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726600AbfE1RFG (ORCPT ); Tue, 28 May 2019 13:05:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavesemi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P8y8zpvR8eIaKBVFI/gn8od5yvKJPTrHdwCTyw9QYw4=; b=MZd312xuDnEQoXWldvCRHyWQQBulMNj3gr+yNIQFUcwG5f6u18bpBhsOq+derL9f6KhX1irc/zSQDJZ8MDsACI+cfoNBF4NYX/frXcb55het/yiH1aKMI1B9TvaRfg3h7ArJMQZWrCj/WCORYwUgwqJ+McNJS84AR3FxcQ4cNH8= Received: from MWHPR2201MB1277.namprd22.prod.outlook.com (10.174.162.17) by MWHPR2201MB1725.namprd22.prod.outlook.com (10.164.206.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.15; Tue, 28 May 2019 17:05:04 +0000 Received: from MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::90ff:8d19:8459:834b]) by MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::90ff:8d19:8459:834b%7]) with mapi id 15.20.1922.021; Tue, 28 May 2019 17:05:04 +0000 From: Paul Burton To: "linux-mips@vger.kernel.org" CC: Paul Burton Subject: [PATCH 2/2] MIPS: Make virt_addr_valid() return bool Thread-Topic: [PATCH 2/2] MIPS: Make virt_addr_valid() return bool Thread-Index: AQHVFXd+OhmrHtHwAUuhxD1EVo2LSw== Date: Tue, 28 May 2019 17:05:04 +0000 Message-ID: <20190528170444.1557-2-paul.burton@mips.com> References: <20190528170444.1557-1-paul.burton@mips.com> In-Reply-To: <20190528170444.1557-1-paul.burton@mips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR07CA0060.namprd07.prod.outlook.com (2603:10b6:a03:60::37) To MWHPR2201MB1277.namprd22.prod.outlook.com (2603:10b6:301:24::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.21.0 x-originating-ip: [12.94.197.246] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: cd6ccf3a-b6e2-4e45-b7d9-08d6e38ea098 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:MWHPR2201MB1725; x-ms-traffictypediagnostic: MWHPR2201MB1725: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:883; x-forefront-prvs: 00514A2FE6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(39840400004)(366004)(376002)(136003)(346002)(189003)(199004)(5640700003)(25786009)(2906002)(316002)(478600001)(71190400001)(71200400001)(476003)(2616005)(53936002)(446003)(186003)(486006)(11346002)(6916009)(14454004)(68736007)(305945005)(42882007)(2501003)(6436002)(6486002)(44832011)(26005)(4326008)(8676002)(3846002)(6116002)(107886003)(81156014)(81166006)(2351001)(5660300002)(52116002)(76176011)(1076003)(102836004)(7736002)(6512007)(6506007)(386003)(64756008)(99286004)(73956011)(66946007)(50226002)(66066001)(66476007)(66556008)(36756003)(66446008)(256004)(8936002);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1725;H:MWHPR2201MB1277.namprd22.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: FUw8NIpY/ozVtYQ96VN/6k2IV4n5QpJA7LcyM9MyeRrZVk0//ihCnUmSgszNYYPMasoQuBHtSt2L1WUP5iZD7ILGN+Bd94EBbKCip1VYztO7WETIUoiXtBQYvDz4cLY22GGJbXi3ioQfGwyLYzFNhjZ1Fh2giiPJbsWzkJVY5G/ba+YJGneL1Gf7XS6Py7eoQ66Z1YnG8awDpxw0uYyTQOSxT3yBpc7sdvIUyZJL4tZbVVQZAKyO6g1z6ies338dDjNV+0UV3YpGrPvGaR0GkwAX4oaVWzF1nMePRDG1Qkkz+HFYkxR3o6dT4ofR5A8HIV+nXbw32t7VG1Of5TRZ5dJzMmUaUpxp6XYjK//0QpkPRRJZvmu4gobhIdmxPf15R7DRcTWDeHRS09+LvT9nWfk6RQ3eDyFpp93iQxuWGHA= MIME-Version: 1.0 X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-Network-Message-Id: cd6ccf3a-b6e2-4e45-b7d9-08d6e38ea098 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 May 2019 17:05:04.5483 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pburton@wavecomp.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR2201MB1725 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP virt_addr_valid() really returns a boolean value, but currently uses an integer to represent it. Switch to the bool type to make it clearer that we really are returning a true or false value. Signed-off-by: Paul Burton Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- arch/mips/include/asm/page.h | 2 +- arch/mips/mm/mmap.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/page.h b/arch/mips/include/asm/page.h index 6b31c93b5eaa..a25643d258cb 100644 --- a/arch/mips/include/asm/page.h +++ b/arch/mips/include/asm/page.h @@ -249,7 +249,7 @@ static inline int pfn_valid(unsigned long pfn) #define virt_to_pfn(kaddr) PFN_DOWN(virt_to_phys((void *)(kaddr))) #define virt_to_page(kaddr) pfn_to_page(virt_to_pfn(kaddr)) -extern int __virt_addr_valid(const volatile void *kaddr); +extern bool __virt_addr_valid(const volatile void *kaddr); #define virt_addr_valid(kaddr) \ __virt_addr_valid((const volatile void *) (kaddr)) diff --git a/arch/mips/mm/mmap.c b/arch/mips/mm/mmap.c index 7755a1fad05a..50ee7213b432 100644 --- a/arch/mips/mm/mmap.c +++ b/arch/mips/mm/mmap.c @@ -201,12 +201,12 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) return ret; } -int __virt_addr_valid(const volatile void *kaddr) +bool __virt_addr_valid(const volatile void *kaddr) { unsigned long vaddr = (unsigned long)vaddr; if ((vaddr < PAGE_OFFSET) || (vaddr >= MAP_BASE)) - return 0; + return false; return pfn_valid(PFN_DOWN(virt_to_phys(kaddr))); }