From patchwork Thu Dec 6 18:41:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10716613 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 4CBEE15A6 for ; Thu, 6 Dec 2018 18:37:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DB852EBC6 for ; Thu, 6 Dec 2018 18:37:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F8C32F157; Thu, 6 Dec 2018 18:37:56 +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 B3FC02EBC6 for ; Thu, 6 Dec 2018 18:37:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B58186B7B64; Thu, 6 Dec 2018 13:37:54 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id ADCC16B7B65; Thu, 6 Dec 2018 13:37:54 -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 97F5E6B7B66; Thu, 6 Dec 2018 13:37:54 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by kanga.kvack.org (Postfix) with ESMTP id 54B8A6B7B64 for ; Thu, 6 Dec 2018 13:37:54 -0500 (EST) Received: by mail-pf1-f198.google.com with SMTP id 74so1002070pfk.12 for ; Thu, 06 Dec 2018 10:37:54 -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=pFA19XQqRIOonXczeaJc1JMDfCxsc2SPHw+vTN0jttk=; b=QLVQsApxMtZ044XtDu65Y6MRn0S7XbmMpqZvv1fBAKcU62Fx7Y1ugOSMErYGs655bA VUbmLFGfR1Oo6KKvohuPPv+LIT9+gMYvCm8WAXIzbgzNeSf9ftZg+kWy/fz8/fstQkAC hRn9ULZHTGNW5y+UX1JIiVZ63ZUsY9vmvtzSSdppGZE41ZJ9XeDGQqVoXhc0uSTVm+aQ Y0ZUOdN7R4xf4zrBogmkJ7zJiSBpYRqmn/OBUDTbbpqrK+h6UK4etS+JQxJzD7ltgtjk R+pmF3E7tfORlifjBMq6YXN1NzLYG/Qy/Oof9uXBfxv0H8TU8XdJqjFbnXS6rDbzHBJ1 IuIA== X-Gm-Message-State: AA+aEWa3UjhzdU2sx3suOK462B+uCqCPSE3L9varrRa7ci3uEp0lQBDw NBqoJflUAgSglra1FAWceDz0Tku0IUdqHWo55r8TPXzxooK6iOvysMqtgnDNlNsQGC3N9nmAeF7 PJeexoUYzx0lRlRzfDzrMR7nPUFT3XxAGdOOKjldVp6/DULlC6PDdbjcucklVglIqivkM/Pue1m cr4/2XUJn5ztXIWuymKufY8QQk6aHIu3meB7DdNg+1qpuRxR/Mi9fp+DvPdaxzPzFV7nLCRVV5a lYjIC3gYAUvIaRoFQS6gL/OHKYkruWfjcwCfw2M3SB8ZFkxUJHQPxusZjCW6AEvQZEwmiPuNGKc ZIFCTdinutO34pXOnbHjY6CXzicSKEoELVN7TdHM2+v9V99GprFJXO1rkOCCTjd33BFSbKuvhUz x X-Received: by 2002:a62:178f:: with SMTP id 137mr29374915pfx.226.1544121474016; Thu, 06 Dec 2018 10:37:54 -0800 (PST) X-Received: by 2002:a62:178f:: with SMTP id 137mr29374868pfx.226.1544121473356; Thu, 06 Dec 2018 10:37:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544121473; cv=none; d=google.com; s=arc-20160816; b=KtDYzYEQynwyCv4XXDi7sfJY3xAv2fHA6beQco+YMI/OzZRjK6tf4LEN0VAGRrjM4O dMu8ADmqgcdjPraPwbJ7Y00OoGs2V5SueLgjYMZP02Q2n3ZUkjSTM+k2eSzyaRIwMrmv MNSuGmkLGddjsxTN5VPnLYhjmT2j+zF3OKQIwdgXnHTYqZaAJRGLb8vSH66bUCwmS2vK /kNPRYxwOnkroqFtwb/x2/ze22kL8ZvAZ/KEMGfOH+uKhqS6ybwivQ2NBtUcKI0+nCXz 0T68/roo+zn0l8Mt/bUtS+qtzMgEZpPG75TwFuAs1uyROf5LAfXHQ36a4Gb0KPMQzR7l PKPw== 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=pFA19XQqRIOonXczeaJc1JMDfCxsc2SPHw+vTN0jttk=; b=aGYxceQ0NeqBTPWE2oTmYRlVeoLyL0WQrDmD7TECmJf3t83GYWd8pvW4RS8O/GAuF0 Xti6Qt8Oz7VHJMKjP+ABeZotCZAfftOZJfD+H3k7/nbEoqVYFQvdlYoLiV1ukixeI3n4 P+vrjPYhYoLb7nnEbM4PGeautT4HR/mu/WnA2NRPiBlgSZ64kI2+9Vcgt0NS/9C5o9le PIXRW7e8kS/KlBBDxRfkX3l/JkaZukGw3TO8jWOTAkj19rwDtuBWrgBzm8D/4RC4Pe49 57wf3vIs/ugZd9622sZPrtXOtcZ6jbZwDW2IdfMEnaKKt5XEroT3HqBHO5zEleSPE2vk wjRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fbLh52nP; 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 62sor1848550pla.19.2018.12.06.10.37.53 for (Google Transport Security); Thu, 06 Dec 2018 10:37:53 -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=fbLh52nP; 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=pFA19XQqRIOonXczeaJc1JMDfCxsc2SPHw+vTN0jttk=; b=fbLh52nPpkqcT1Z9V3ynz6uiPBZF5qfoJ7/hPEZvBCMX9CeGjmuiaMJt+rxLafnLa7 f/xYhIOsoC0o/ferMj/eZvUp5HVv4NMCx/xUGLT4rts1Z7F6Ekp43794GO6SxyUjq41C 62Wr6dgG7VRi3tjWvD2US+JF0DTPRcxDbkHYRfJ0H+SUa5FM6wr3LYGbjxxPgweg7mGO sZE9GdYGcKvIWQseAlW5idOnudxqMDkBFLSpmuI7zJ1qNdogSjACVAFOtRLMxidohXSa ScDcjF5aHzGL/JZZHC+dhbQx4sQctZ2rE77G+oqhq1rYOkSTTueCdoOBKkz4sBuPsw0/ wcxw== X-Google-Smtp-Source: AFSGD/UDqrBQcxC59f83l1Xagr3hCTLl/ORxA4W+x1FMEYcVxWh5JAcv00gbvM11R+DxMrDXnFwY2A== X-Received: by 2002:a17:902:9a41:: with SMTP id x1mr2169801plv.126.1544121473041; Thu, 06 Dec 2018 10:37:53 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([103.227.99.39]) by smtp.gmail.com with ESMTPSA id o1sm1621229pgn.63.2018.12.06.10.37.51 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Dec 2018 10:37:51 -0800 (PST) Date: Fri, 7 Dec 2018 00:11:39 +0530 From: Souptick Joarder To: akpm@linux-foundation.org, willy@infradead.org, mhocko@suse.com, stefanr@s5r6.in-berlin.de Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux1394-devel@lists.sourceforge.net Subject: [PATCH v3 3/9] drivers/firewire/core-iso.c: Convert to use vm_insert_range Message-ID: <20181206184139.GA27514@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 to map range of kernel memory to user vma. Signed-off-by: Souptick Joarder Reviewed-by: Matthew Wilcox --- 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..7bf28bb 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(vma, vma->vm_start, buffer->pages, + buffer->page_count); } void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,