Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp669556imu; Fri, 11 Jan 2019 07:07:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN7GJsrHcNdhnEst0thA5j36o15U3JaNPvL25fGPO1eJM8y+iwW7IkgDbRXjB1aa4DYvnDl3 X-Received: by 2002:a17:902:9691:: with SMTP id n17mr15414743plp.9.1547219251036; Fri, 11 Jan 2019 07:07:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547219251; cv=none; d=google.com; s=arc-20160816; b=p/ilvAwB+nj2VuHhoYAICGeMUwqaeK940gwzlvi6ZTn6CcAZ0eUMNFMraF/eUFIsiy nRAZNtJNiE/wyVdqaaiDwBLPnvRGem6pcKUXO2j7xvMbiBTR/QYE9b689DdXnswg9KmS v2AGi+NHdSMJbJLEOLTcBOhcFHVesUkuCNXdjxtvq8JNCXJTHz1w0wSRvSMyStFbqfHp XRveMpVWOo6aChCf2YDkDD8pum5mlAv2PKzMQQ0Q5ddEW8cqa9u5qqezgRrdaPbNiIVU s3RjFWIv0pWZTH1QNviRCABbwe8eRtUQ2Rvs/dTOy6zjVuMU+rQU1ad4NQViQGqlnatb 8z9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=3XbEqy88Jb4MHLdqNBAQMVZdhzSqLBYAliAQZ38QAz0=; b=Zsmn66rq5Cy5GZJmVu1T6MznKvl5TWwqp3msXAjPfKGPGjxAKrHf1BBsQ045CkSKpR VCBMcLqN2LB/ojyWz8zqvKOUi9x/R/+K7axHWL99MzcuTZSDrcUDI65ybjGM5VB4zpFA 4TgB9J5i2brLW4CegpiPey3Qu67ZOzy12Dio1CYdKcz8wVeS1iIet+UmCKlieLaO1iE7 9SWgWKw9giezlh6bdQUP9c286kIPM8Zep06RIAoiXwAal6jm5BP3JBMLGxXeAp93VAb8 R09j+skvYbytSE3YvPvHMV2zlzB7mG8IKr3oTjKRUfG5IC+Q4eoMbVTzl0qQBF6EzPh5 eWLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SMaXhdA8; 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 a195si6476141pfd.143.2019.01.11.07.07.15; Fri, 11 Jan 2019 07:07:31 -0800 (PST) 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=SMaXhdA8; 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 S2389181AbfAKPEh (ORCPT + 99 others); Fri, 11 Jan 2019 10:04:37 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:42766 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391771AbfAKPEf (ORCPT ); Fri, 11 Jan 2019 10:04:35 -0500 Received: by mail-pf1-f196.google.com with SMTP id 64so7061688pfr.9 for ; Fri, 11 Jan 2019 07:04:34 -0800 (PST) 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-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:mime-version :content-disposition:user-agent; bh=3XbEqy88Jb4MHLdqNBAQMVZdhzSqLBYAliAQZ38QAz0=; b=V+jYl/7psM4KMVv4JKCk0nYhF408QwpTlHhRZFw9Tj/M/ZwY49gAzAXIvTk23rP6BS PzPTnd8sy4NDTYqO2z5MGrk4qu4ze3UYX38Lk+9SQaeFxiOWBI99UYQ2nAKBEAHRJwwO hxd+w7EKrUvCDa+tZplmDKhMxTY1dPfYnSq0CZJe5S59PMFRwrmJeYGb0S3AOOf5c3JP gJiO/WO9p4gf3ys39kLn6YJE8VfMOTQX0oOA2kulrbT7B8ApmB4GekjLiCMZ0cUKjCYq IUNDF6B/rUXGti9PlAYUDSyZAUI4q4ra3/Sx46syYIKlX14IhHgVbMcuDe6cTWKDa4Us AvDg== X-Gm-Message-State: AJcUukcqqRwHS9anm+TMg3dvIxagn818BVfs9bFt7JRUUYTM3TJd+1bG N+ZHMU7xSUgDTuARw8N56Aw= 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-Type: text/plain; charset=us-ascii Content-Disposition: inline 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_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, -- 1.9.1