Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp613634ybm; Tue, 21 May 2019 00:03:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxfUOMFt90mLu8gTda/pRR0APbXRPHQQv+/tff5jusOuLOB4Vr5J3702kTXaMIrCqswxnxB X-Received: by 2002:a62:6444:: with SMTP id y65mr85980152pfb.148.1558422205548; Tue, 21 May 2019 00:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558422205; cv=none; d=google.com; s=arc-20160816; b=0oYNvRQNIN2PsyB8D0gda8KFZTMHbjV/AYMxIR6Lb5PA8/+wG2IL03K0ZgXeA7Od5h NlvTM0ZoZa2WymAJupGrEgsAd8BRwt1xAtuzv/6iA/4db3LZASbcLBhCznYOfK/owTVb a5kryFCyqTXvuJnxtK5mb07p7b3Wa52LuUKIXZHNpqOpXvKm6VTxhGpSaMLImHvlMJSn IvtoCLSF6SWRAxe5eN2rbpiiowHfOKH4LvEiL276t6GP+Wlj7AcoI8BalUrwg4C98HHk oQ8ApqrY8f0+1rN0z4ZqgnpIA09mariuLgOmnpJ+XailJUcWrN6Bx7sFw+zqy7eWHuGe wrLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=SBw2Dd85ivzFzxdieC5BOEktRJc33nGZ5QV9NndJpuc=; b=ixbUnpkp+NS1GG4MDEXuG6VnsOT8UYvhQwPERS3IgC2Z48QqvlsK4xvnlKranpO+3U o0X3Od8yFnl6CsXQPxAO+0dcAi4jW2VzAI1xutDbuJbJxN15IO7jaAXqSzE4bLd+nLqG 52GWc7HODi+7DHhLglu3PmYRJH1WR+YaIvnqlQOrHwRRgXa1u8jhF6DXtvQyE40gACxP eUlf+F6DS33q97PRLZhaQ/Qv9uhCJ3aBEMhEivCTDdpFVmGpxhCrf1Zw60ZR5s8Na5g9 9YPZGHLkxWaILGDdABfxQQPssCuInwjHKbinw1p4mCSe43R+KM76fb0grRJSfGYxXfd3 kCHg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w20si20802733pgk.203.2019.05.21.00.03.09; Tue, 21 May 2019 00:03:25 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726259AbfEUHAz (ORCPT + 99 others); Tue, 21 May 2019 03:00:55 -0400 Received: from protonic.xs4all.nl ([83.163.252.89]:47279 "EHLO protonic.nl" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725809AbfEUHAz (ORCPT ); Tue, 21 May 2019 03:00:55 -0400 X-Greylist: delayed 374 seconds by postgrey-1.27 at vger.kernel.org; Tue, 21 May 2019 03:00:54 EDT Received: from erd987 (erd987.prtnl [192.168.237.3]) by sparta (Postfix) with ESMTP id 1FD2344A00B2; Tue, 21 May 2019 08:56:16 +0200 (CEST) Date: Tue, 21 May 2019 08:55:47 +0200 From: Robin van der Gracht To: Souptick Joarder Cc: miguel.ojeda.sandonis@gmail.com, linux-kernel@vger.kernel.org, willy@infradead.org Subject: Re: [PATCH 2/2] auxdisplay/ht16k33.c: Convert to use vm_map_pages_zero() Message-ID: <20190521085547.58e1650c@erd987> In-Reply-To: <1558366258-3808-1-git-send-email-jrdr.linux@gmail.com> References: <1558366258-3808-1-git-send-email-jrdr.linux@gmail.com> Organization: Protonic Holland X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 May 2019 21:00:58 +0530 Souptick Joarder wrote: > While using mmap, the incorrect value of length and vm_pgoff are > ignored and this driver go ahead with mapping fbdev.buffer > to user vma. > > Convert vm_insert_pages() to use vm_map_pages_zero(). 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/auxdisplay/ht16k33.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c > index 21393ec..9c0bb77 100644 > --- a/drivers/auxdisplay/ht16k33.c > +++ b/drivers/auxdisplay/ht16k33.c > @@ -223,9 +223,9 @@ static int ht16k33_bl_check_fb(struct backlight_device *bl, struct fb_info *fi) > static int ht16k33_mmap(struct fb_info *info, struct vm_area_struct *vma) > { > struct ht16k33_priv *priv = info->par; > + struct page *pages = virt_to_page(priv->fbdev.buffer); > > - return vm_insert_page(vma, vma->vm_start, > - virt_to_page(priv->fbdev.buffer)); > + return vm_map_pages_zero(vma, &pages, 1); > } > > static struct fb_ops ht16k33_fb_ops = { Acked-by: Robin van der Gracht