Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3209151imu; Fri, 18 Jan 2019 06:40:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN76o6sAIXQqtMNyBUWhlNuc7XV329KQPrZ8tYQuCRnP4q16b+ygjIQYb2HlPkti6nh+b/Qs X-Received: by 2002:a17:902:f64:: with SMTP id 91mr5564804ply.132.1547822425395; Fri, 18 Jan 2019 06:40:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547822425; cv=none; d=google.com; s=arc-20160816; b=jzqFcjBOy4A9viLcYAU89wi3dz17WUFGLFX2OIQmwSsuvnvLZJ9GTpLG0yPo+XRrqF yA2ijcg/DkVE6VlP6zhoxGxH/FwxZgLM2CMJdmvSwIWQfRSKXJp+yTL/oy0Pv/oIpFSE g68rLAwPvjA9B5OcIabrKwP4XTPEjdRRhBU8sRdcCb+f740WlZzOehGccfNKf1ISld/7 lJVMiQVv8qmW2u2CyLJ1agbSGfvQcexByeij3cyOfJ2GC/eOUVM6i5V6wNcO1dKlzvwL 6k1unjri4XsyJOGmUWuWdQlOWampkN/xvo/+o1vcOU3TPIFwe10qql/C0rkw23tHqdp0 UPig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=TMPf9dosTKnb2ICO+dAlaiGvafY5YBfgjHe/zpFLczQ=; b=Bj+DV7ftoaitZ0eTZ4Qd7i5kWP3tW6W8UCnh56v1CDGLXLPGDMgeBsAx8WFJ9sGbjg xnOOFQpkJgSAP8A6AOm6M8Dxlkd2rieTQpOKucEuyLsiWeMVozTD+Tua9++5r+OXpT4X ppnqQMjaK75n/d4NKnNqZYpmhnoFkzIFemw/Bm7J4VgCjzxES8gOZ34993BayheOyHYa o+B5iicSyfiPCkdhU//WQ7e1llIl4V7tZx06ZPbKYXPZcrZCAI3TuSYUKe+EvyIl3b8o jzN+K+VQUHMBIpLJdl3xxic81g1hXOZ37V60Rt8NWjxUhREYokkClc90cquDdIx9ub2F PBIg== 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 c8si4692582pgc.65.2019.01.18.06.40.09; Fri, 18 Jan 2019 06:40:25 -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; 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 S1727672AbfAROiv (ORCPT + 99 others); Fri, 18 Jan 2019 09:38:51 -0500 Received: from baptiste.telenet-ops.be ([195.130.132.51]:59108 "EHLO baptiste.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727572AbfAROiu (ORCPT ); Fri, 18 Jan 2019 09:38:50 -0500 Received: from ramsan ([84.194.111.163]) by baptiste.telenet-ops.be with bizsmtp id Rqen1z00Z3XaVaC01qenMl; Fri, 18 Jan 2019 15:38:48 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gkVIF-0007kw-5o; Fri, 18 Jan 2019 15:38:47 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gkUlz-0007bb-Un; Fri, 18 Jan 2019 15:05:27 +0100 From: Geert Uytterhoeven To: Arnd Bergmann , Greg Kroah-Hartman Cc: Nguyen An Hoan , linux-spi@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 1/2] eeprom: at25: Merge "off" and "offset" in at25_ee_write() Date: Fri, 18 Jan 2019 15:05:24 +0100 Message-Id: <20190118140525.29189-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190118140525.29189-1-geert+renesas@glider.be> References: <20190118140525.29189-1-geert+renesas@glider.be> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 01973a01f9ec34b7 ("eeprom: at25: remove nvmem regmap dependency") changed the type of "off" from "loff_t" to "unsigned int", "off" and "offset" are now the same type, and can be merged into a single variable. Signed-off-by: Geert Uytterhoeven --- v2: - Merge "off" and "offset" into a single variable instead of just killing the cast, as suggested by Arnd. --- drivers/misc/eeprom/at25.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c index 99de6939cd5ac2e3..2d8e5388e574710d 100644 --- a/drivers/misc/eeprom/at25.c +++ b/drivers/misc/eeprom/at25.c @@ -130,7 +130,8 @@ static int at25_ee_read(void *priv, unsigned int offset, return status; } -static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) +static int at25_ee_write(void *priv, unsigned int offset, void *val, + size_t count) { struct at25_data *at25 = priv; const char *buf = val; @@ -138,10 +139,10 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) unsigned buf_size; u8 *bounce; - if (unlikely(off >= at25->chip.byte_len)) + if (unlikely(offset >= at25->chip.byte_len)) return -EFBIG; - if ((off + count) > at25->chip.byte_len) - count = at25->chip.byte_len - off; + if ((offset + count) > at25->chip.byte_len) + count = at25->chip.byte_len - offset; if (unlikely(!count)) return -EINVAL; @@ -160,7 +161,6 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) do { unsigned long timeout, retries; unsigned segment; - unsigned offset = (unsigned) off; u8 *cp = bounce; int sr; u8 instr; @@ -234,7 +234,7 @@ static int at25_ee_write(void *priv, unsigned int off, void *val, size_t count) break; } - off += segment; + offset += segment; buf += segment; count -= segment; -- 2.17.1