Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp186605ybe; Thu, 5 Sep 2019 20:13:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqzarUAx6EvMT5q5LIcBETy7pJ526yDjypW0a+VW89INqV50O2SFRLSzzgUx6R9SOBhr2hFQ X-Received: by 2002:a63:5823:: with SMTP id m35mr6216340pgb.329.1567739600855; Thu, 05 Sep 2019 20:13:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567739600; cv=none; d=google.com; s=arc-20160816; b=eKwHGJqjwXLqESLNy5De2DjZQ7wsEv1BG0TLzJFCoOF3SCAv+EbYfp0KSZWEGVzdxs omo2Hjksm3up1Fimrzgtb6OY2nnyl1UvCa19mRmrhRs6LzUKjlaMR9Gyl/a3iCzi3ukI zOC/J+TaDm0VwFFJMGV/mjMcc+A3nHmyurHdKyT6Mf+UHPy5/c6TMT4TrLR++7Cggq9U XWK6Xyti1350BsYb+HRfwoLTTWT85CoOT//iyGFud8kErVsvOHg+ZAye04Zq/GLl0MZ5 ofg1z7h7O+i6lqxG99o1Q3dU683tNh1DbEoTZ/KmNswV4xTureDsf/twasfE+YiOc9NO NMFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=cdXMooijOVCDDklAhZuef4glr7GEYQsndAFC5Dzs39I=; b=K/3Cd1LXWvGljewaFhAzjpfxtyHyaGFGeub9ify7j0keUUSn6DRJuuVBKJxp0LajXi rb2rJ8CVlAwoCxXxdDgmimKnEffg+NYZ3sDOQTciNNEB75vCnBPFoIrwVYQ7bniBLnCY oBdBT7zZ1N0IkWfMtx9GYjApHODd4IYP9mQPHYJ2MIrfG39cW30yzaNy1+gpBzAoqPGT CqnmJQ0ng0d4Dzf85d122ISp9VzABAR5peoTv3bxMiGVhrZuStZjkr5RjzoKrN4LkIjs nnwHt5x0nn4TY894xJL0eozl0uNnLDJKwJVRgh+LDuUPQjJsq7sx5keCHqkHYoEWNJ4e DocQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NwYg3DPG; 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 f17si3325752pgh.552.2019.09.05.20.13.02; Thu, 05 Sep 2019 20:13:20 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=NwYg3DPG; 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 S2390252AbfIEShK (ORCPT + 99 others); Thu, 5 Sep 2019 14:37:10 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44745 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725290AbfIEShJ (ORCPT ); Thu, 5 Sep 2019 14:37:09 -0400 Received: by mail-pg1-f194.google.com with SMTP id i18so1873254pgl.11 for ; Thu, 05 Sep 2019 11:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cdXMooijOVCDDklAhZuef4glr7GEYQsndAFC5Dzs39I=; b=NwYg3DPGtouRXEFmIVaeTkxg/FzR6vJ0B1wp1Jb423FCaSfHNTzFGTFBNPWy3159fl H9KmXPmRRPWz93zBA6+IcK/rjm2iBELYPk4ycDH2nRYHnJDLYulNdn2c3WPKjLp9els/ lc60ZGbr5PShXttY3+d7K4II+2+gEoVTMUr5JvnMKaVa3g784WbXSNZWwSyieJDH2Dt4 lsleHHKSV9+VcIRGcpKwxB0qWXBdxngPcXtsk+dlbQOCzNTqjSK9QymsT0aJqTD+6Awe z8aEDm324f48MDpYMuHo633InHRSqfaidV9OwVqJh8wy0bo2oIkppaKBjqkYPWQWOu7+ Hxkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cdXMooijOVCDDklAhZuef4glr7GEYQsndAFC5Dzs39I=; b=de4AGvorFrWD2Q0sNqteUX/8+9LLtMyX8YQuxYkSS1jks1W3bKhBNNoOwjUOHAYlNR lvUQVUkYO9BOpCZc8O9ia1CAVqDtsdW4mSIQLHIRtBzfO40eWpUpeP2qW3POPztMBh/N plaNbY/IDXCouXwES3JAc3tgsP5AMksO0Xy3tC/afVeaUPoInxjLQXpJoDuCXbtpdY0G itoQMZF04RTvRtnwNvJPmP0aG/gBq/5hbic17gc48x4spT8JK/fe7Fc2SPKWeyfHSdmR qWDF82E6wwDUJu6tsHoFYX4rxF6YDJnX957uaG6GmztswCn0bvS0XxjmP/wq/M6lmes7 bXog== X-Gm-Message-State: APjAAAWWqnOrfpGIy9k7YrNl6jvThh97rqgieQWzh26+9VTLokwzKigk 5YjK2QfOUWsTJxl3PPVaRMQ= X-Received: by 2002:a63:eb51:: with SMTP id b17mr4366305pgk.384.1567708628796; Thu, 05 Sep 2019 11:37:08 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC.domain.name ([106.51.17.197]) by smtp.gmail.com with ESMTPSA id k64sm7386471pge.65.2019.09.05.11.37.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Sep 2019 11:37:07 -0700 (PDT) From: Souptick Joarder To: akpm@linux-foundation.org, willy@infradead.org, rcampbell@nvidia.com, jglisse@redhat.com, mhocko@suse.com, aneesh.kumar@linux.ibm.com, peterz@infradead.org, airlied@redhat.com, thellstrom@vmware.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Souptick Joarder Subject: [PATCH] mm/memory.c: Convert to use vmf_error() Date: Fri, 6 Sep 2019 00:13:00 +0530 Message-Id: <1567708980-8804-1-git-send-email-jrdr.linux@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert to use vmf_error() here. Signed-off-by: Souptick Joarder --- mm/memory.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index e2bb51b..1302be32 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1750,13 +1750,10 @@ static vm_fault_t __vm_insert_mixed(struct vm_area_struct *vma, } else { return insert_pfn(vma, addr, pfn, pgprot, mkwrite); } - - if (err == -ENOMEM) - return VM_FAULT_OOM; - if (err < 0 && err != -EBUSY) - return VM_FAULT_SIGBUS; - - return VM_FAULT_NOPAGE; + if (!err || err == -EBUSY) + return VM_FAULT_NOPAGE; + else + return vmf_error(err); } vm_fault_t vmf_insert_mixed(struct vm_area_struct *vma, unsigned long addr, -- 1.9.1