Received: by 2002:a17:90a:2044:0:0:0:0 with SMTP id n62csp527295pjc; Mon, 20 May 2019 11:16:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhbqqQmiCSSbHZG+yNQgud3EyLkONSmh7wXyXpbVYsME6eTmfHzbWY25Y1C/e/vOWCPPyR X-Received: by 2002:a63:61cf:: with SMTP id v198mr76157915pgb.29.1558376198158; Mon, 20 May 2019 11:16:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558376198; cv=none; d=google.com; s=arc-20160816; b=icB/s06Qd+N7fjxs4ZKp/l/kNNj9Q8fH71JGPt3bOD6L4GFdOMpa5tAjvFxW+nAGND KYBs8ZmjVdqzyoClDS09cQJGZwXEzqRUms69/NBkYrqy8Ol2YYZcrkRtGBY6qfMtvCtE rrTiv/pP963H9SUkKrYcAvJYWQx57gy5y3eYim8VhK5m4UKR7ma/9zc2UfCjnPrzjexv o34Gq2IpA4sVg3Je7VWBL3606mpujA6PLESO4GNmfGejqQIH8Lo9C/xYtu1kC7/bpIjz iqa4cwKskdncxPm7ZKQfTu3bF/VvEb9IVmotjOS1FwXJ2RXo/iFI1BSRNTfpMDEKPuKQ fnSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=AtdQtJeikUe33L23nGWRCANS3+RKC7kzegDcoMmpvfM=; b=sBX9GDvpJHXOoEVY+usQKtM/j8Ye2Hzi+0gPG2TEdQ+4dosqOkOxcbWLXM7WV4SNAW ez8AHklmEHT7fg6xNXIzDOOrzzc5CD6BGjhy2FawgCl3iPWWzdZ2C+aQlAqFXGe81Ro9 32FFdn3BRCUbZ+XDvP8AHzzCxNlG2sXRpdyW33XuD0PjoGdIbQc/037rNCLvpbR5hPwr kWyiMAw7kK9mVDqu0F0pthVuAnKrXPL6ft7T6YhWDJETsT/4YjN8Yf41/WVFvUU/q18a hpT17lN/xULuIVnAJdUnvigBvdKvZpx4JuUu0E4pErArzvZfzX7S81w39lP6CWdadp/u 2RCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AsQfvvwv; 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 w7si17958256pgr.399.2019.05.20.11.16.23; Mon, 20 May 2019 11:16:38 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=AsQfvvwv; 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 S2392092AbfETP0B (ORCPT + 99 others); Mon, 20 May 2019 11:26:01 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:46782 "EHLO mail-pg1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730766AbfETP0B (ORCPT ); Mon, 20 May 2019 11:26:01 -0400 Received: by mail-pg1-f196.google.com with SMTP id t187so6935577pgb.13 for ; Mon, 20 May 2019 08:26:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=AtdQtJeikUe33L23nGWRCANS3+RKC7kzegDcoMmpvfM=; b=AsQfvvwvPdSvQlBqu7MYfLmND64DNmrzYGHUXz18jU9F2uy3D4q3WPQBNmmc5ODkwd d0+878rxkRJ57QT1Tb6r3/rCCopQ8peRCcb5a7bqTHQsJTbVoVX0McIAqtnjlFgMoRN9 6qPLLrMo8JZgFkn9P29Y9m++IF0wboffXyOkwH8GN5c0T86HMKs4EF63c+2g2MbLwKWm uTdvRLdVj9T1xaRc2z3ZHaKU1//bvMQR/4Rege5MM+lapZIfg1+tXYbDxuziT1lI5f13 LhybyH5gJj8XQ2XfrxqirZRz0dW0XXhc/XuCjjOxbdCE7r0v4UmON+crPBTga4TSh7yd 33+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AtdQtJeikUe33L23nGWRCANS3+RKC7kzegDcoMmpvfM=; b=p/rNJ+AnpGisKFso9Jfj8XQwOBB0qwaofKz1T5Tj8VTHzInkXV3OMIS52Pk7C1Z8S7 EEvX6QquqUrT74GLX99hNnYfxLU87fyfJqVCaus3+CoqNfq8zGScweXXDhqOV049bN+z j7ViAlraiOLh4mIng0CyzhSTlxNSyDZVABEGFOMkUuf7NwnNR1l9nhGWCW3131Gvs5Gu LJHNR2nnozqAaG4TnPiMx7KPpilqAON4ZaHzkd26Y7cCvNgDUhmZ27fJA9VxvuR5PdUm 1CZ6OMDeYukb2EnHFZ+f/EWTtVY1vShBX8wEGMqUD3+fV+QzphJjLVyMa/eGnQGAO05B PZjw== X-Gm-Message-State: APjAAAVK5BxevlAEvmvqyMY5ouipRRnZ2y4tcvNFSgf5GR2eCMivsPrb DWiJDLIasBe81msswrvVovIP+PS2 X-Received: by 2002:a62:e117:: with SMTP id q23mr81050039pfh.60.1558365960780; Mon, 20 May 2019 08:26:00 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC.domain.name ([106.51.19.216]) by smtp.gmail.com with ESMTPSA id i7sm14718871pfo.19.2019.05.20.08.25.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 08:25:59 -0700 (PDT) From: Souptick Joarder To: miguel.ojeda.sandonis@gmail.com, robin@protonic.nl Cc: linux-kernel@vger.kernel.org, willy@infradead.org, Souptick Joarder Subject: [PATCH 2/2] auxdisplay/ht16k33.c: Convert to use vm_map_pages_zero() Date: Mon, 20 May 2019 21:00:58 +0530 Message-Id: <1558366258-3808-1-git-send-email-jrdr.linux@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 = { -- 1.9.1