From patchwork Tue Jun 18 07:41:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marko Kohtala X-Patchwork-Id: 11003567 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 EFCA8924 for ; Wed, 19 Jun 2019 07:10:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDF2B26B39 for ; Wed, 19 Jun 2019 07:10:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D0C8728825; Wed, 19 Jun 2019 07:10:47 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7444726B39 for ; Wed, 19 Jun 2019 07:10:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0ADF96E2BA; Wed, 19 Jun 2019 07:10:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x361.google.com (mail-wm1-x361.google.com [IPv6:2a00:1450:4864:20::361]) by gabe.freedesktop.org (Postfix) with ESMTPS id E9E8F6E10A for ; Tue, 18 Jun 2019 07:41:52 +0000 (UTC) Received: by mail-wm1-x361.google.com with SMTP id g135so2020555wme.4 for ; Tue, 18 Jun 2019 00:41:52 -0700 (PDT) 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:in-reply-to :references; bh=t0Vqi/RB6vd3sTFj8r0XFtYp6zxmyWgaP1RbCqpMuHg=; b=PWJsTGftm74jhnOlh5mNfndZY6siphKEoPB9w2arS1FUypfOcI3DxGecfXYcRTdFpE +kasITHBSoDcJGw4Fd5nJSMyBNOyrJJa9r/zkiZyqE/mmdoCZr1hX+m0PSyivgjBNJma BZPmo4/hrfV3pcfOEF3KgfqYy1DWGG5x77YZHyBFheBj7KSK55rWzTe8ecBLQZ0cuC1D qJ23GucBWL5p+5y7/O2EkTM7nfekT5NfZP89CmPc/22tnz1xcr3+p0uTVm1uaVzzlLWv KqePnGVV6uXdypujkGoT8kTJVRzOK0e+UgGp3hT4B/MuvSJ9JGpjpCwD99xJf7PfUjUZ kjiA== X-Gm-Message-State: APjAAAWTfeyRsF57v/eG4TgvzJHcnU4eXMpwU09P0gbMJl+gKC4RlKCl FAS307K5IMtHBgT/klY2AGSgRI8vsCM5VgSXNcgPB1H5B0VI0g== X-Google-Smtp-Source: APXvYqydFUxa82KvmETVUZcfjM8PkupOirGSVC5mbNqfnR0pyyVWNFLzIVX6nRu9w3pplClHEc3GhFeBPlpa X-Received: by 2002:a1c:6641:: with SMTP id a62mr2039009wmc.175.1560843711554; Tue, 18 Jun 2019 00:41:51 -0700 (PDT) Received: from localhost.localdomain (46-163-209-30.blcnet.fi. [46.163.209.30]) by smtp-relay.gmail.com with ESMTPS id l18sm212063wrn.66.2019.06.18.00.41.50 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 18 Jun 2019 00:41:51 -0700 (PDT) X-Relaying-Domain: okoko.fi From: Marko Kohtala To: linux-fbdev@vger.kernel.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/6] video: ssd1307fb: Use screen_buffer instead of screen_base Date: Tue, 18 Jun 2019 10:41:06 +0300 Message-Id: <20190618074111.9309-2-marko.kohtala@okoko.fi> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190618074111.9309-1-marko.kohtala@okoko.fi> References: <20190618074111.9309-1-marko.kohtala@okoko.fi> X-Mailman-Approved-At: Wed, 19 Jun 2019 07:10:14 +0000 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=okoko.fi; s=okoko; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t0Vqi/RB6vd3sTFj8r0XFtYp6zxmyWgaP1RbCqpMuHg=; b=IsxmHO8pbbaTDMMhZXGehcVjKzvL6pC8soL58WAW8Ieg7BqyKeSgr9E/W7QLo/HCPq 9rABZnNUxf/Ka6yoa2Apt6EwSl3CBmEVF8yd7MBvbyZYiu/J70IQ6tI4r7tywLwWdtlh 5w99AgJ6Tjhws4M+bacGgFhWaQ0/FgvNoa+zE= X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , =?utf-8?b?TWljaGFsIFZva8OhxI0=?= , Bartlomiej Zolnierkiewicz , David Airlie , Marko Kohtala , Rob Herring MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP sparse reported incorrect type due to different address spaces. The screen_base is __iomem, but the memory is not from a device so we can use screen_buffer instead and avoid some type casts. Signed-off-by: Marko Kohtala --- drivers/video/fbdev/ssd1307fb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c index 3b361bc9feb8..6c2980331ffd 100644 --- a/drivers/video/fbdev/ssd1307fb.c +++ b/drivers/video/fbdev/ssd1307fb.c @@ -150,7 +150,7 @@ static inline int ssd1307fb_write_cmd(struct i2c_client *client, u8 cmd) static void ssd1307fb_update_display(struct ssd1307fb_par *par) { struct ssd1307fb_array *array; - u8 *vmem = par->info->screen_base; + u8 *vmem = par->info->screen_buffer; int i, j, k; array = ssd1307fb_alloc_array(par->width * par->height / 8, @@ -213,7 +213,7 @@ static ssize_t ssd1307fb_write(struct fb_info *info, const char __user *buf, struct ssd1307fb_par *par = info->par; unsigned long total_size; unsigned long p = *ppos; - u8 __iomem *dst; + void *dst; total_size = info->fix.smem_len; @@ -226,7 +226,7 @@ static ssize_t ssd1307fb_write(struct fb_info *info, const char __user *buf, if (!count) return -EINVAL; - dst = (void __force *) (info->screen_base + p); + dst = info->screen_buffer + p; if (copy_from_user(dst, buf, count)) return -EFAULT; @@ -547,7 +547,7 @@ static int ssd1307fb_probe(struct i2c_client *client, struct fb_deferred_io *ssd1307fb_defio; u32 vmem_size; struct ssd1307fb_par *par; - u8 *vmem; + void *vmem; int ret; if (!node) { @@ -657,7 +657,7 @@ static int ssd1307fb_probe(struct i2c_client *client, info->var.blue.length = 1; info->var.blue.offset = 0; - info->screen_base = (u8 __force __iomem *)vmem; + info->screen_buffer = vmem; info->fix.smem_start = __pa(vmem); info->fix.smem_len = vmem_size;