From patchwork Mon Dec 17 20:22:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10734259 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 36416924 for ; Mon, 17 Dec 2018 20:18:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24671296A4 for ; Mon, 17 Dec 2018 20:18:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12497296C2; Mon, 17 Dec 2018 20:18:57 +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 9AE4C296A4 for ; Mon, 17 Dec 2018 20:18:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9EFBD8E004F; Mon, 17 Dec 2018 15:18:55 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 99EAE8E0033; Mon, 17 Dec 2018 15:18:55 -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 8B46B8E004F; Mon, 17 Dec 2018 15:18:55 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id 4BC788E0033 for ; Mon, 17 Dec 2018 15:18:55 -0500 (EST) Received: by mail-pg1-f197.google.com with SMTP id q62so11576038pgq.9 for ; Mon, 17 Dec 2018 12:18:55 -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=Ch62F2QY8urwW75lHMlnLvHqu2uDXYW0Yqs+qczWCl/DWkz5wDyjL1gA6gYASfXpZR 9jjYS2AxisW1cBBfL4dDJhjf1Lu9zKKJwTYvcuffpmvR1DqPCK6c1Lt20r5oDZKOXsmH Qb+U14sy6/1W427wMOtWBC0k2nAo/nuMyIizn/dRT0rAvjabRrRL27kD+s3VYcxSeyvs vQGegvcPYCagu227fmHOReEtBBWfZX25m/f3WCVNfMTNQOGxZ1C7nwTKk3Qxk0yBL1qr 8gCfUd3nZw/8EKm44PvRVJksyEJuLPemxwfb9n0XKZPCkh3RupKJ/KBfhwbOelt40Fsd nNqg== X-Gm-Message-State: AA+aEWarlRPXNejFl0QGmlE4nJ7svfIdL79QVAyDq/Ne99tLhbvkVwQN 0fyp2oJcWR6ut7ZixnK6fSAjhsfSQIOVkaGaJVyjHYVdyFapcXWsx1w2mxDl8kyRavO7SPcLieB 5qpO8qEaThnOgJsP8J0Jsz1r7d4i1VKKIiA7vLi81zSYQP2gCi4iICX6SbYRAMCkjpZyZjpfEr4 TTA/g+MnSY7um8X9as4k4MOYpVv6NBbg5SBtF28XNTQqb3fXhxWnxzMgWb9KPRNEggjhsW5EPUV xnWH0ucXwt67gOFpeIr/HstC0EljI8KsJDBPY1S2u0aqJ4dOn4zdQsum9RKLG9mVo4xP8OrKVKZ bSpcCqPDn5cvbQMyx3FmK9TnhVntYFSdkc2i7s2WR2EG5fTHpPsWSv/GlGHa2TuxH6rq6TzKBsq Q X-Received: by 2002:a62:2c4d:: with SMTP id s74mr13905619pfs.6.1545077935000; Mon, 17 Dec 2018 12:18:55 -0800 (PST) X-Received: by 2002:a62:2c4d:: with SMTP id s74mr13905583pfs.6.1545077934348; Mon, 17 Dec 2018 12:18:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545077934; cv=none; d=google.com; s=arc-20160816; b=C9xzISRjHMYpQItMDvNeVjaFAcqC3IpOiYc2Z4KfLQ5dFnI7vKnMpBy3ToDkI2iHls /ujCHBz++/fULZ2h5CNNHljKZfmOyJiR7nQj4x+MpYTESgjjCVc/9fsEbavx34NsRudH FXIqovTPGjv4Pz4VMmnSiebMgJMJNRdqePhtT4SX2Vuo+qOxI+7yZD5azjXFOsTvzaU4 8KIovHeo7z16Q1DfGj44nMBkrPT7P+pXm9rurtZPQTj7qsJ+J+rzlss3Aj5rVmdKedbI pvz4IIdYTn+zJQ5locRBa0Bsc9kHv97r6ril1O+DfTwMA2n/KjOGgdpM9KxI8SkXPmF4 kpJw== 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=YAS1fdxmQh8l04i6bB4lOaySAh7IwDYgALcapJTiKywqNUBjhYTim1CjLPIvh7D2kp WHoGfomAb+8PerYjv7OrWgQmOWsV0NpGrwbo2nEpOslc129G2Hp7rTOTULgA8BheYxWs 4IqJxZl8A8+3hVw4++w9kbLggHhW0YlSP2gSDqEUHt/M09OpuWRaCuzaacbSOGV+OhOE gE1noGKlv05WbXbW9vf0rC15zYjXohdwNN/IheGOb5nF6EPjMFD2tobos/V4tVgK+X4h i/RUsf5e9Qykv17kq9yKRaxVUBXAAKt79YVEDfg6FJB+eOCFzK9s/F4hvm60JTy/0rEV qTWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UN3LRotB; 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 m78sor22976973pfi.28.2018.12.17.12.18.54 for (Google Transport Security); Mon, 17 Dec 2018 12:18:54 -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=UN3LRotB; 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=UN3LRotBmLU7g4NYrRKgWGuyzje0zXTtKnRBRlwk5Lu8DyWMsl6VlJf+28+6Wu8jUv 3dt9zpCCKdA9JZTazgv5TcRWxgSUlsSdzevpGdqJpv8WVOO3IRZnrSkvKb6ubnohoV8m WBQRSZHxdT7S6ZEvQ/j1SuVSrVP7sby5mirPqSgW8uKaLKcjTIMx1gE8n8BCn7uBbM6E qNvm3sByxZ+GjVVz9M+zYJANQIHyzWVDgrbqWLHcnolk6INBvFGBnZnm5I3oFH71QBCO ra+TEojmKZjUaj3uSfaUG0YtsVnRJmnJwN0YlCBULNR12n8Uynxq3FKnsXpN7gHm1RBp 29tA== X-Google-Smtp-Source: AFSGD/VZpPr1vEyhblYwvkUoYGzeXCeGHGsoaWXD+5TdUu/r2E6BL4B7uDKXBU7K9UAg8FWdanGGog== X-Received: by 2002:a62:8949:: with SMTP id v70mr13708541pfd.85.1545077934004; Mon, 17 Dec 2018 12:18:54 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([103.227.98.208]) by smtp.gmail.com with ESMTPSA id f67sm18955733pfc.141.2018.12.17.12.18.52 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Dec 2018 12:18:53 -0800 (PST) Date: Tue, 18 Dec 2018 01:52:46 +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 v4 3/9] drivers/firewire/core-iso.c: Convert to use vm_insert_range Message-ID: <20181217202246.GA10500@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,