Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp959700img; Mon, 18 Mar 2019 19:23:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcoca2hNwHpuNwg5759Ss+x0Oy0qwacHXCnSkvq1mN1It6b3THXFzftMQVsgBaj0JG7lAY X-Received: by 2002:a62:2c91:: with SMTP id s139mr11952pfs.196.1552962195631; Mon, 18 Mar 2019 19:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552962195; cv=none; d=google.com; s=arc-20160816; b=hWbgD6zonR9lmYb+TQ/bvPoqpKHeHK+cckmEGaA8xTyuyYEMBPfkvetScNC1Kejw2O TRizojMmKdQo8GcD2dUeE9PHB6jHdTEYV0FaX5Ulg+21faa69Pq02drJSS+nRd6BKV6L O1dOIP3GoES9aJCm0vrTPXyJT6o2ZrPoBZJyQoorJFqirBK2VJxUOagCcs//zURTKzH6 RCUHw8SkW2/PnmMSAL4AoDzjBU1ueEqgiJyxqS2Yq+q5W7bQbDfJM9uQ2NsEvWLcOaBV pFhCjRbKVk9kiI6lgFkf6CbWojPFtFJ0rkZ8w0sdXMYKngSqN7YfJlS99zD2uJ/5mwvn uOvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=naB3KMuHNTCaDD6/Z64EGJGrk7XQ7GW1pzVQ9Q3Vf6s=; b=toZ8Rb9Quq6vqd5KuxmL30aQNP6YrKOIv2fiw0bR+a9aK9yDsSPV3TQ8q+QNzrf/HL fJiqN/yTntkgNwH8bzPD/RpnHXDcytfCZdOAz0QG65YcyTa+4Y3F4t0nxagvzvuU4VdE aCJyw61bCMkqzC4P/sdPkWzWt64IofiDPzQ1v0y+u1BzGACo7BiDr4Ky4lFIyuSmEMd3 5kCugKk5pao2F5ZOOXZir3rWz77PA/6taL2B+VbshJwvUFXFgvW1dsURIEjeLTUECrZS gk9BKk1IaVzG1X+D43xHCBaLHma1biHkXBMKqj98nJBJBwxE2ekde9urvOI0Voxr6sPn oNNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WSM8bcfn; 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 h2si10068010pgp.60.2019.03.18.19.23.00; Mon, 18 Mar 2019 19:23:15 -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=WSM8bcfn; 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 S1727745AbfCSCU4 (ORCPT + 99 others); Mon, 18 Mar 2019 22:20:56 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:40996 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727695AbfCSCUy (ORCPT ); Mon, 18 Mar 2019 22:20:54 -0400 Received: by mail-pg1-f194.google.com with SMTP id k11so12726242pgb.8 for ; Mon, 18 Mar 2019 19:20:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=naB3KMuHNTCaDD6/Z64EGJGrk7XQ7GW1pzVQ9Q3Vf6s=; b=WSM8bcfnzprJdWx5H+Bbv4NvzZb7wmLUkYvEXRdyRIA5Wek38wiyF5fe3XVDp6HxhT SvVyViH+yOhwKt5+i0vurYanvZ8p+7/XaZT+N/09Z4mb0j1ffPYCdO/VV/Rmg1j8OXR6 l6vfFMjD9dK320LX88jeEMALCpeYCU+OZQFHRrJB7BYXIx+Wf/mTqJevt5oMTgUEhjNO HhGi9v8uHsnhCYu4jocHvOqIx1oxeMs3wYpDBpUnKWFzF2ByzT1hFXJfEWfMxZ9sjOVQ qa2yU0L1O2tZ7bhBxG+k+KBlp+I2vnJMt0+oDT36Q/jj6m8hTO9q1IET22Be90zWrdWm P+lg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=naB3KMuHNTCaDD6/Z64EGJGrk7XQ7GW1pzVQ9Q3Vf6s=; b=iBlF8y58TYsweP/KFyKFfh8PI+dA38mchijtFlL4GO11m2Mx6NKaqkudFOS4ey/4kb aSGjBgE9x/2TFfvliG5TBcfoH6sNH2jD0eVSpJD9WFCbRf5p9mosxjwbN7P70sFnz2C3 fHatLpE80xqDpEgVZasY897tCRyBuR62pn+K4E13M450BHVDGHELD9W57RadMe539GhX HjrjEwky8uI1nPTyTKfac897mlWBwOW551JJlR7n59NT7Kd3569nYSToVlcrQF0ls0KJ GqioiT5X9m1J+kHFv05a+6XxANuwuwCJRXa6FOYyUUahijiDtOIn7Vzfe4ozFqsQrNVr hHJw== X-Gm-Message-State: APjAAAURdSlpz+teBCzJW6C/NSt1cDHTAtL8xCZ5RqNW4b/mWvoFJ2Bn zn974LPo2Ca8+MBCxV+xzqA= X-Received: by 2002:a63:4550:: with SMTP id u16mr20189420pgk.73.1552962053552; Mon, 18 Mar 2019 19:20:53 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([106.51.22.39]) by smtp.gmail.com with ESMTPSA id m3sm13043728pgp.85.2019.03.18.19.20.52 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 18 Mar 2019 19:20:52 -0700 (PDT) Date: Tue, 19 Mar 2019 07:55:27 +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: [RESEND PATCH v4 3/9] drivers/firewire/core-iso.c: Convert to use vm_map_pages_zero() Message-ID: <88645f5ea8202784a8baaf389e592aeb8c505e8e.1552921225.git.jrdr.linux@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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_map_pages_zero() 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 _zero 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..5414eb1 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_map_pages_zero(vma, buffer->pages, + buffer->page_count); } void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, -- 1.9.1