From patchwork Fri Jan 11 15:08:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10758199 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 C214C91E for ; Fri, 11 Jan 2019 15:04:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC6A6286BD for ; Fri, 11 Jan 2019 15:04:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A07DD29C77; Fri, 11 Jan 2019 15:04:37 +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 88CAF286BD for ; Fri, 11 Jan 2019 15:04:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 901A08E0004; Fri, 11 Jan 2019 10:04:35 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 8D7378E0001; Fri, 11 Jan 2019 10:04:35 -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 7C7678E0004; Fri, 11 Jan 2019 10:04:35 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by kanga.kvack.org (Postfix) with ESMTP id 3B86B8E0001 for ; Fri, 11 Jan 2019 10:04:35 -0500 (EST) Received: by mail-pl1-f197.google.com with SMTP id 89so8391480ple.19 for ; Fri, 11 Jan 2019 07:04:35 -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=3XbEqy88Jb4MHLdqNBAQMVZdhzSqLBYAliAQZ38QAz0=; b=k3SoHAGzJPLVPM6h07L+GgiDJby/6+ba/WTVh2jq3azPbrPPc5HWPAN1Uk4Nyn+pin mIFieETiMJi+6Zqf80BhEfZFRy65LglPfD5psrFpfBjdsvA+Mx/VoWM8otVx6iLHtVqw Hq7xDuWjESNFhZgkp4AY9nNpKa4PGpGEEprAV9Gt6lg1a1aenE/55FFweIkOPnivErP4 vJtsXX+BTFSRGCS6TwOqbC/zxj4BeiYjw/OgJ6pzyDmnx0JsqYC2CegaiOuDftW7M8ei 5Bnxoy9wffHiBqtWlgGZOOFjrUXiatR1t4/AhA7XbhoWD3se1Q61WftvQaviU9GX03Ws j01Q== X-Gm-Message-State: AJcUukfze5om4gXZ4FDFQGYm3hEuzLTZ1lsC5vsLUc8WFxFnRN1oGN0T G49hMO2sgYxfZ48ks1yxiedDyuX31d90N6h7CD+t9R/vA/+LUWZwbAeVLYIheVppT56Skqx8wYn GUp7LZXj/bse94cM5wjrvcYsI6K9OMUQ70KE070rG6TeaT2VQ/wytu5cLFxiVEhQ7HBgX4ilmyt B7t4Yyf+upB41wupmo/jhLJiNKbPp4Y4KEcrQ9O8j/0ss+liV+VRYiRVJOHg+5NLlrK0VmxfUQz hx2lQ6s6LY2fHxaKUPui3IjGyd/MoklWJ4aZeBYNLqqeiuovKNiHJ4Hj5pGCjS5vstndKJMgkYf h1aXXZxWHYr5Enek5yhsWuGGrGBnOpscTmxATPmsJ+4R601MS8WMSuWBK8QY9oC5Z9NWAcJ+qAF v X-Received: by 2002:a63:8149:: with SMTP id t70mr13938858pgd.172.1547219074853; Fri, 11 Jan 2019 07:04:34 -0800 (PST) X-Received: by 2002:a63:8149:: with SMTP id t70mr13938809pgd.172.1547219074222; Fri, 11 Jan 2019 07:04:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547219074; cv=none; d=google.com; s=arc-20160816; b=LYLSB8wmObC3Qi2aosacMNC0QDpT3+mSyOOpC09Lqu6+E1UkRvWGAcamPmR4LmLStp ksAFnjrUb7wlrinexR0R+mwrOaqbLBfipX3tYZPrmEVyWytBuLBdfu+iGPo4UcEZiPYt mm1Fzdl0ogl/FUOGzz0BOdZi5O0K1DZd9xsI1BL6brPgFnEkd7clxREBzlCQlvEu8dnr JAq2bvG8xxDTr/sMeqjf5jc5jQh7QnhMxZBd5Ej17cee6N/h8lOztb3UqDovPhDsSJyZ KkHi8MuNiO2LxVOi8f0yj2ES6QdWvMASyrWDFvgdLP04lcNTtuo6CFWqaJyvEMnr+wty D2BQ== 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=3XbEqy88Jb4MHLdqNBAQMVZdhzSqLBYAliAQZ38QAz0=; b=WFF8L2bsEnQlje8rJEpA1Ref4DJsjz0mZknQ8fuGbb/qvk8k8Q1CdAfI4OMsZhqwtU LQclnMxZGTzqLw2FNJ+/9grIQQN7mk4K9mBb+sfZdU3ivTua85kysRpJsgVpepcqAAXp A3ionQW9yAK5wQNWe2edwauPtuAerkjCrrFw8B9o/xkEZRnXq2VHY7GgkYvhZN+GIFY8 PrEog7/YO3xy8d+8ZNaAf2YFkPoZkrUJ3ln4djL8XzuEPYy9SbPAS13KedQbcFcYF0D8 +PGgWu06HTRyFOgfnNSYIW6vsykTLwx6wwpgDbiAPVE7YcbrJOFI9B4ZEevr8MF3LOJr niMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SMaXhdA8; 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 b21sor3794773pfm.6.2019.01.11.07.04.34 for (Google Transport Security); Fri, 11 Jan 2019 07:04:34 -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=SMaXhdA8; 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=3XbEqy88Jb4MHLdqNBAQMVZdhzSqLBYAliAQZ38QAz0=; b=SMaXhdA8Q7nrM9qGUNh1kXzTtWH3gVpEoGrrBwY0qxY14/6qIrIZLV5RIbHD4KieFg uMMs3JSQnImublU4VhMlU8lpOUNf2T+DQ1ruR+6UTCQVwyJEqccZa5+mnpsFhDKrFHy5 02c65ESvjA43b3Q3wXtts81HrN/V4kc0SPTdigGT9Sgqw4BqeszJJTCwc+gBM1vxQzTN DHTmwg24rP7PK2YUNwW+2JaRT5FNu8YihWMNxmwMPbZTqtN5VeHCCTywejrfNHHFyh5z OaZ/UtkiIR/jd52gMYtkRUHgi4X2dctsgtWFTEfHBzP1UaGCggVU6qAB+PrqACCOkVwX Bv+w== X-Google-Smtp-Source: ALg8bN5euVDCQBAFkwT8uFKwwThbROCLZs0KfIkBUValIFAmJazBRAFlZV0vDYopnVamFPnq3w74KQ== X-Received: by 2002:a62:b24a:: with SMTP id x71mr15274522pfe.148.1547219073889; Fri, 11 Jan 2019 07:04:33 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([49.207.52.190]) by smtp.gmail.com with ESMTPSA id 125sm131459879pfd.124.2019.01.11.07.04.32 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 11 Jan 2019 07:04:33 -0800 (PST) Date: Fri, 11 Jan 2019 20:38:34 +0530 From: Souptick Joarder To: akpm@linux-foundation.org, willy@infradead.org, mhocko@suse.com, stefanr@s5r6.in-berlin.de, linux@armlinux.org.uk, robin.murphy@arm.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux1394-devel@lists.sourceforge.net Subject: [PATCH 3/9] drivers/firewire/core-iso.c: Convert to use vm_insert_range_buggy Message-ID: <20190111150834.GA2744@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_insert_range_buggy to map range of kernel memory to user vma. This driver has ignored vm_pgoff and mapped the entire pages. We could later "fix" these drivers to behave according to the normal vm_pgoff offsetting simply by removing the _buggy suffix on the function name and if that causes regressions, it gives us an easy way to revert. Signed-off-by: Souptick Joarder --- drivers/firewire/core-iso.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 35e784c..99a6582 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -107,19 +107,8 @@ int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer, struct vm_area_struct *vma) { - unsigned long uaddr; - int i, err; - - uaddr = vma->vm_start; - for (i = 0; i < buffer->page_count; i++) { - err = vm_insert_page(vma, uaddr, buffer->pages[i]); - if (err) - return err; - - uaddr += PAGE_SIZE; - } - - return 0; + return vm_insert_range_buggy(vma, buffer->pages, + buffer->page_count); } void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,