From patchwork Thu Jan 10 14:59:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10756001 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 2292D1515 for ; Thu, 10 Jan 2019 14:55:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E195B29A35 for ; Thu, 10 Jan 2019 14:55:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D557829A44; Thu, 10 Jan 2019 14:55:05 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66EEA29A35 for ; Thu, 10 Jan 2019 14:55:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5C8928E0003; Thu, 10 Jan 2019 09:55:04 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 577128E0001; Thu, 10 Jan 2019 09:55:04 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4407C8E0003; Thu, 10 Jan 2019 09:55:04 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by kanga.kvack.org (Postfix) with ESMTP id F23748E0001 for ; Thu, 10 Jan 2019 09:55:03 -0500 (EST) Received: by mail-pl1-f198.google.com with SMTP id e68so6351378plb.3 for ; Thu, 10 Jan 2019 06:55:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:date:from:to:cc:subject :message-id:mime-version:content-disposition:user-agent; bh=ZROv1A/sYj6JvGQP/ciFLdFMP9ppu+olFL8waBnQ3zc=; b=fX5K/Hv42hqUbA+Pg7MRiZAZk5KB3BZewnUByYEo20kbkflTOB8TA2oQyjwsAIfEeB uliCR8pDZ6YEeBOK4pGvLY1VRRaLTRBu+ABpYKgWasCQr4usKsYYcTMyHUZDwSnnLdwU maeKlJMbehwVzAIL5tIMwlTRrX7JNYXdOJcuWuEFpAgaNBLjYmflYM03R69WW3MgNQx/ +WOxYECBDeqI1Fh1fBVJqfN+DZdqx1lVqprgyf99bpzub+XoMgqj226oFZks5KtQeeY8 wd/aFRzUu+X+Cj2llIEzEg8CqoysNHvVY5LyApG4wVs4YkexLRXL7j8Cv+Vx8JQQ3bHZ ZTGw== X-Gm-Message-State: AJcUukcyzzNn5VZnpO4S3JhxEmm44BbmL8u5SMn5smnXvj1Z2shJ5WYW JL4IWlpX5W1mgSrc/2k2tTfLVB0tpMPVPEc6Itttgv/foJeyhFTbl4MzsK04I6KTlbUYbdArsCG VjW8l/FHzQ09v6l9Gql7xXmDmPrJGvsjRaoiCgtA0snRPHFwQ1ETpyzTzbad6NUPzLYI02s+Ifm N33ReBSGpm490viQBkiUTlskY37ySoDLrtdpXNCg49OTSPHTABMKXXMLHB4Pezn6KlMKFia7nXX TTXrHaQt6TK0/ys/n4R8RWTbC61nBhZY9L5PSfb2dUt/5YSgsL63NnEFcDiFbWUGnMgLmdnMFKn 7R0xWGiv0izhuXRMbptMhxr/Vx1yaCEkIZIOHdy7MHz4QjimaszNRxCCVAqLBvA+W7g8eaCMpjK F X-Received: by 2002:a17:902:47aa:: with SMTP id r39mr10561674pld.219.1547132103590; Thu, 10 Jan 2019 06:55:03 -0800 (PST) X-Received: by 2002:a17:902:47aa:: with SMTP id r39mr10561636pld.219.1547132102746; Thu, 10 Jan 2019 06:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547132102; cv=none; d=google.com; s=arc-20160816; b=PVTLL57ctj15SUCR2bfSTljtUdBeJcMY2Uvgmpi75HP+adKBArA0cCX1WEC/7aSj1f 20CygWbjDhEUkzcD6njmvDML1yKvK3h057s9iXCvfAOxtPD/cbQZk4BnokiDYgVCHVSF 3T+fBm9irmeTdA/LAGJm4nKKQPKlv5qc4TKWc8upFFJ9RJfggyACDmOaZ/Vkc35r8qUS gJkO4HQHwLzNt41qDZ1vxJ5ZgxwHsOR+DeGK0OoGOckVvIs+z5N0vCAknZzPiPgbX8/F 0Oy9njbphTxKs/TkhPLI59WsgxdvyUp/RxjTkz0+K5MGXv9nIUkbfXYHI/ki/+30OjvV yHcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:content-disposition:mime-version:message-id:subject:cc :to:from:date:dkim-signature; bh=ZROv1A/sYj6JvGQP/ciFLdFMP9ppu+olFL8waBnQ3zc=; b=ah1ByWXnEf3A5fqvK8rMowARRwN/CZozBdSGFqbDUZFv0Ko8SGXiX1Vs5/IP8FQwYc XQmjtdVmxoyqOFI7shEkzL769Vd6+OXJlsQs1jlYtAltl4DNYrAULifI6j0eF4Q7CUAv PLVnW4gDOab7mU6EVQrUDrVxraanCypewqbT3WqFT/EnfjqlevFM2KBTbprWsKswblLG EjeWXNGm0wuxwlxekglAs3XxUW32FvK0s47rJDU2Cu8b0ZWbueplTZuxatKGtcf75GxH 08F67m/kxAsK3HzSpvqRH5ypnwI3yz7+FuZbuwJJfvX3TCQqZO7H3yaT6gN6Hs4ocU0u RATQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HIQCqdVy; spf=pass (google.com: domain of jrdr.linux@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jrdr.linux@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id c8sor52034526plr.70.2019.01.10.06.55.02 for (Google Transport Security); Thu, 10 Jan 2019 06:55:02 -0800 (PST) Received-SPF: pass (google.com: domain of jrdr.linux@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HIQCqdVy; spf=pass (google.com: domain of jrdr.linux@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jrdr.linux@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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-Smtp-Source: ALg8bN49kheJY6V/FPhhJqWB7DnOBR7JGlsMaZBaHvqYU5IKaVFbjrwGGW+4HNMkukHn1+4capKzng== 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-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Jérôme Glisse --- 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,