Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2012977imu; Thu, 10 Jan 2019 06:56:37 -0800 (PST) X-Google-Smtp-Source: ALg8bN7os8seYyEoVbKViSvVwQs2+4k2LYB33SFdpklaIi9a53R+8j6hNIW1nL+WZJ9I4a/CsCl6 X-Received: by 2002:a17:902:e002:: with SMTP id ca2mr10836062plb.103.1547132197276; Thu, 10 Jan 2019 06:56:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547132197; cv=none; d=google.com; s=arc-20160816; b=oGg7CnzUjE/EQGLzt/LY7lRI9zvCyVWNvxgaEqb0KmklpIS/3foSo2RzhbX73Y5mij 9QDNEHyDwPjhcp8Ne7aCeMk69Yp02KUOb9OOtfgwOPcNCQh3sBscV5Xwl5T4MXg2/rJa 1qZFH1gDiH18ystRO480aiFurcZxFdBYPFT4+fB6hKvitcymBVYI/l4k30Qr5diatb5y AKtpO0iHLjOPu5Oy4EpeA3ra0u37z3i/THkmLf/234xU6UPyoNAMI+FYpVI34AvT32Kw gV3zbNhppFuDjrJBCXZoAq1d1DmA/Lf7lticwC7AusWpRQryW9lPVPwAs4NeLSFHigUX hnZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=ZROv1A/sYj6JvGQP/ciFLdFMP9ppu+olFL8waBnQ3zc=; b=PyrgC8OLNORhumktt9uXd3Oc7Qk4hTBr+9/CP3+W54ZphCYxWtLHpsLfuD/jPr6GWN jQrS8pl4VI+yrzq3UYi+flvZ/Htd/rBY4BtEsoQnatlDW63YKcrGutUoqjM7GZBqxTBX mvU0GsOxHYZf6nCvtFe14djJ77Cj76H/KCKntyGpyB1mvcE5D0kKUHPBqhLboqhGdtJ3 qUbhEOv3/wKM4yqxd1rRKM1etZdH9BrLeyccEADiATJ1aByR0kZ8PNk9jkaOJXQgVI7u 2/NR8iZrW29GTxGRT08y04Ki8r3g2BezBhuNHCQ3erXtvNoLmsuDK7EJ0CU3Vb25SfFc PctQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HIQCqdVy; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39si5861866pld.434.2019.01.10.06.56.21; Thu, 10 Jan 2019 06:56:37 -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=@gmail.com header.s=20161025 header.b=HIQCqdVy; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728841AbfAJOzE (ORCPT + 99 others); Thu, 10 Jan 2019 09:55:04 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39414 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728130AbfAJOzD (ORCPT ); Thu, 10 Jan 2019 09:55:03 -0500 Received: by mail-pl1-f196.google.com with SMTP id 101so5289801pld.6 for ; Thu, 10 Jan 2019 06:55:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=ZROv1A/sYj6JvGQP/ciFLdFMP9ppu+olFL8waBnQ3zc=; b=HIQCqdVyCtyjgufumY5Uz2k819abJru0S0Di2EGblX3AM6oXJ+mpz9+XXpieDhfcEq 5Yvr5jQQRGnjtMXpGqfmP/Ukowbom6oTvHXCAr6D48mVIdjbRleNbHZXnvIqncMBK5an P3GtJ5zgrU+eVpe0HSSoIbvchkfs6s58uIHoZbPaX9HxySrpypaNMDlbvWTNPkGiYyrv 3X+9gqlEA7v/ULsR1RlBr2kX6loSeuOfV1pR6QSqA8opwVKzYOeDSUZjrz959RVmgwRc smGv/U7Ok2OP2BlNOVNPWYp8Xo47l4dfdTd314tMz5hDF9ZW/ye8CPSFb1y7YZmbfUCi H++w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=ZROv1A/sYj6JvGQP/ciFLdFMP9ppu+olFL8waBnQ3zc=; b=Ag34Zsxsu/z0KmKAVJLVofBJyLGBvRk8+EEle/vq9pMEIueHStZKZW3BPhrgF6Egvv v2J4HrfIRWlRrEjO+YrNGVPCtZC0UG+XEym7TyjKtYdfsRxh7CA/dtzHy6gsDvMGLvui r005qyNZgoxrEv2hJckn1orClgToXWt8qUXcMO9KKcwvb+YnhVuSw3OEfvbBhKs0IoAt rp85jrCY4JcCuTPep+AvUQ0z+84LDl7VMCnSxrIBwuOfX7GA0MOdZjLYbM3Y9vb/kyys 6r8nE1+hlzGnwV+r0ROoD6Spv0JfVL9heT61L9EgLXSZTihNRRQyYOOxNsVoggGVsCgq wEFQ== X-Gm-Message-State: AJcUukegw4roK28fDF4/1HydZ0RYEIDx2rNcYtXGfH8VAstQVeaGC0wE YlvdJ9kUD53fvBEBJ/3dND3bncDl X-Received: by 2002:a17:902:3124:: with SMTP id w33mr10724890plb.241.1547132102317; Thu, 10 Jan 2019 06:55:02 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([49.207.54.206]) by smtp.gmail.com with ESMTPSA id l85sm135461494pfg.161.2019.01.10.06.55.00 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jan 2019 06:55:01 -0800 (PST) Date: Thu, 10 Jan 2019 20:29:00 +0530 From: Souptick Joarder To: akpm@linux-foundation.org Cc: jglisse@redhat.com, willy@infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/hmm: Convert to use vm_fault_t Message-ID: <20190110145900.GA1317@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org convert to use vm_fault_t type as return type for fault handler. kbuild reported warning during testing of *mm-create-the-new-vm_fault_t-type.patch* available in below link - https://patchwork.kernel.org/patch/10752741/ [auto build test WARNING on linus/master] [also build test WARNING on v5.0-rc1 next-20190109] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] kernel/memremap.c:46:34: warning: incorrect type in return expression (different base types) kernel/memremap.c:46:34: expected restricted vm_fault_t kernel/memremap.c:46:34: got int This patch has fixed the warnings and also hmm_devmem_fault() is converted to return vm_fault_t to avoid further warnings. Signed-off-by: Souptick Joarder --- include/linux/hmm.h | 4 ++-- mm/hmm.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/hmm.h b/include/linux/hmm.h index 66f9ebb..ad50b7b 100644 --- a/include/linux/hmm.h +++ b/include/linux/hmm.h @@ -468,7 +468,7 @@ struct hmm_devmem_ops { * Note that mmap semaphore is held in read mode at least when this * callback occurs, hence the vma is valid upon callback entry. */ - int (*fault)(struct hmm_devmem *devmem, + vm_fault_t (*fault)(struct hmm_devmem *devmem, struct vm_area_struct *vma, unsigned long addr, const struct page *page, @@ -511,7 +511,7 @@ struct hmm_devmem_ops { * chunk, as an optimization. It must, however, prioritize the faulting address * over all the others. */ -typedef int (*dev_page_fault_t)(struct vm_area_struct *vma, +typedef vm_fault_t (*dev_page_fault_t)(struct vm_area_struct *vma, unsigned long addr, const struct page *page, unsigned int flags, diff --git a/mm/hmm.c b/mm/hmm.c index a04e4b8..fe1cd87 100644 --- a/mm/hmm.c +++ b/mm/hmm.c @@ -990,7 +990,7 @@ static void hmm_devmem_ref_kill(struct percpu_ref *ref) percpu_ref_kill(ref); } -static int hmm_devmem_fault(struct vm_area_struct *vma, +static vm_fault_t hmm_devmem_fault(struct vm_area_struct *vma, unsigned long addr, const struct page *page, unsigned int flags, -- 1.9.1