Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp207486imj; Thu, 14 Feb 2019 18:42:33 -0800 (PST) X-Google-Smtp-Source: AHgI3IY9A2w7argEdvuOZkY20AgfBMSejzf5ujt0Zph/w8VKB+2oxZOK8XJhtybUbdniHjV7+saL X-Received: by 2002:a63:516:: with SMTP id 22mr3012405pgf.353.1550198553349; Thu, 14 Feb 2019 18:42:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198553; cv=none; d=google.com; s=arc-20160816; b=rn1QAXUXPJ6CbeODDlxjbcvMTkmRg7t8CuzfFJAtRRqU0d8b4XO9DbqEZ6sKCX0Tud YpN8lyCc+CvoocKr5prrhq0gH23b+BQqhuk9pkvgShYz8BIuSZC7uGGPR8DxDq/8jwQ8 MjT6kRS6QSpia92JDuIx8Ybdiy04R5AbwDx3V6PrZeRWR1K5CJP0bAN0A7LNkOnt6aw9 TtSDntVg+gIOUD38PNGEImG4CKYHqjdOdUgGUPutXAwhT5G5uXWj5tm3nZxSFIPMRrjw i2VqJEsULQeh2Pu7Mx/UV6BC8A/ijyf7fTFzOL7xQYVwFW4sA/JE+c5lJZSHb2EXL8KO uTuQ== 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=naB3KMuHNTCaDD6/Z64EGJGrk7XQ7GW1pzVQ9Q3Vf6s=; b=XljjzQgMXZlh90St+fXALPnP3k/Uyt2cV+G0+3o1ewCuwu9Ve4sTEK/kaQtV7vFPNu HiAC3JWEaHKdFaMf6GXAm/s5GUfrbOGAtjfoQiVdGlW6TTmjwNlqh0MFeLxzC4VJGx2A i4hPOGKkZ828mSPIMUmxEsPJjuC25z4YxfgFGDGTF99F/ZnN+b2P5eQ3z1i+71ZkM+UM 99Z0YKDf3hUdNKaVGf9aoD3xAxyElzsB76RERx4SWFa1aW156Or4G9A+Ha3lgs2Uur9i 7W8OF7A+MtdUyKxRvQQorp/ra1CSRuzvYA6nzEvgx+qRA1cwBTLrqFuich58qybXKq2M iH0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kLj6pOyk; 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 p13si4079708pgc.538.2019.02.14.18.42.17; Thu, 14 Feb 2019 18:42:33 -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=kLj6pOyk; 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 S1730140AbfBOCj4 (ORCPT + 99 others); Thu, 14 Feb 2019 21:39:56 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39900 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728289AbfBOCjr (ORCPT ); Thu, 14 Feb 2019 21:39:47 -0500 Received: by mail-pl1-f196.google.com with SMTP id 101so4176832pld.6 for ; Thu, 14 Feb 2019 18:39:47 -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=naB3KMuHNTCaDD6/Z64EGJGrk7XQ7GW1pzVQ9Q3Vf6s=; b=kLj6pOykfXcUG+qvmp8kJ2UtHrXBRj6IN3Rg/liMZsHGVPGT1Cp7dMXvFmX5uZCSeY B3KIkeIYAm0k1MB8GKNJ87FZ4Vy695j5l38NPs1xFMYDCLZUvhkvGy1mlKkfvT+k8GQ2 sxhz7j+Ff8zJlO1XPDqtwuLtZpw+ZlgXtuuxCDdo1lQuxcTTQZL7hLUUEsrmJDB7raae ML3zxRkAZIlYzUwLc95t1N0v/NAKk5JyljdPIuHYJC9t4svAJVwEY6qRlPpJWfd+8Y21 tfowupbrIJH1YLp3e5fxV5An+XpPk5PkF0zIASwVxYHrVgB2K7TOXw9wK0KqNnd5f49U yn9g== 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=naB3KMuHNTCaDD6/Z64EGJGrk7XQ7GW1pzVQ9Q3Vf6s=; b=AbvkiVbmNwrRIjJn6kDFIMSmb05zTvd7T8rZ4u58M3P6HYOtVxesi1opLlg7FgetlU kwwV57aI2WdG9WynM+ZAYE7MkRHorMeWf0UxwrjayQVPUu8sG+oMS7vp3GX36rrAFgbf myIxNywbLGT/yCJpDPZE0FWopv1UHouEFFDhds4XDFuzq6tM6PN4058Cx8zQqZz3xXy3 rZa2WfzC+i9u9t9fdn/JsiBNTrbb0EgTgjfh2ss1GbvT4zITAWfnjczCUjcZ63iiWdYA +Gr/TBsAco5btvA62U4vRDSRxlyKWsoRii0gFDs8FcMMAXF/ZNul1/HcYExhFC9BOGGg srhQ== X-Gm-Message-State: AHQUAuYWeVASo24KzB4JxvFZNx6TUfLtorP680uvvcEy2cJGfBfMuXwL iHnTcgG9/sbjPz5ZE1wShR4= X-Received: by 2002:a17:902:1:: with SMTP id 1mr7294631pla.276.1550198387177; Thu, 14 Feb 2019 18:39:47 -0800 (PST) Received: from jordon-HP-15-Notebook-PC ([49.207.53.51]) by smtp.gmail.com with ESMTPSA id k1sm4194873pgq.45.2019.02.14.18.39.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Feb 2019 18:39:46 -0800 (PST) Date: Fri, 15 Feb 2019 08:14:07 +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 v4 3/9] drivers/firewire/core-iso.c: Convert to use vm_map_pages_zero() Message-ID: <20190215024407.GA26389@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_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