From patchwork Wed Jul 22 06:05:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AKASHI Takahiro X-Patchwork-Id: 246949 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp253299ilg; Tue, 21 Jul 2020 23:06:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwr7ANqO+KzvHOxhYb2Nld8PeCpEgg3+aOgg23Pbi0IU39rTM62hPTBKJd2OslyQXcvbTF3 X-Received: by 2002:a17:906:54a:: with SMTP id k10mr28006366eja.480.1595397996627; Tue, 21 Jul 2020 23:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595397996; cv=none; d=google.com; s=arc-20160816; b=b6PNKsp+rZNRVMsnqiwlwqhhrPKFl3ylsoWwTXLE/6YTOZEdtB/VGpgkQZ6r6q4uFE PQ0nBcmSf/wslo5TJ43jNA4HFruNf7WiD4/P/YaolRNtzkvMHAnkNSNU/XGrhTNCZk7z ZFaEaqUqJaFoKRfbX4aJt1BDqU6TzDuh29Jvs+AHB+hyI7YDoC3AyiP8vXuC/6HbEWBf dBbwuCe07ldAaRtyOXl65h3ktclX42LgukzUNbXfJDxWd/YNVBcIDusSkRDg7H8XjS5p jNV56y/mifg/ARB1hfeCeYqsBQ7iyWmW5oDnPOEKN9R4zF84Zx36X80vx9zzFs7amwhh 0CBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=owcGswnnL8elkasmKoIby4aPsUvIvJXUE8ru8L20K8k=; b=E4njSFMs8USlKAmOzezSsJZFs0c9jrj9fFp8s/vltou2fcN/xy4VS0418XHYcMsfNt VWK1I6/hPGXmwXQnGgA2FipvHbg7BNpa4JgjpCeW4A1LDbWvYsds9DYUB1Qh3bC8Efn2 emipVtQ5omz0zCc4kQeEbrbQX6j2M91EZNEI+VSdfHi29o2/AbTaDbBnrztztaKkBPIM eKXJ1Q44QXNN837fVG0CXdWWN0kmdgowA8QX8sa3jv+l4cIJ8YZQ7y/mS9FPH6bnkHNU tQ4IOGgnPzSZod9Sn94trkmmBekdLcZRvKS6ebyAS+PCklMSSEo1rUbZd2EFsXTaN7Dc a0lA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nH+zLNOk; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [2a01:238:438b:c500:173d:9f52:ddab:ee01]) by mx.google.com with ESMTPS id e26si16002163edv.66.2020.07.21.23.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 23:06:36 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nH+zLNOk; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 2a01:238:438b:c500:173d:9f52:ddab:ee01 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 306AA81B96; Wed, 22 Jul 2020 08:06:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="nH+zLNOk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CAF8D81CE2; Wed, 22 Jul 2020 08:06:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 17B9E819EA for ; Wed, 22 Jul 2020 08:06:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x642.google.com with SMTP id b9so425693plx.6 for ; Tue, 21 Jul 2020 23:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=owcGswnnL8elkasmKoIby4aPsUvIvJXUE8ru8L20K8k=; b=nH+zLNOk0NqHTmkmqCE4UcH/K3+XACmZb+kjpqni70HkUR7OYwl9PG9TVxHdpIrYRW RkDkQdIMYFgxNQDcAD3sjleNKqO7Ok8smUBIuv+d1vSdrzRSozW+tbFtyE/sVwqxohN5 iitU2JBjoXvSW1GSCGZgZmHXAEQnZPVzMAUFPKz9MuSMqwQsrbUpR93mepAWrNtyZdi0 F/TWWIDFyHl7J1UBsoMYZhzg06YvK3lmojTskV4YvO96zjmyqfgawyj4LF+cBRKSbv8g Khf31Ik1U/GZMXPvhO+hdO6KL49+XbURspeFm57jpkxz6kVGO9YqC+LKAJkwwZZQ0nrD 4oUQ== 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:mime-version:content-transfer-encoding; bh=owcGswnnL8elkasmKoIby4aPsUvIvJXUE8ru8L20K8k=; b=J5lwmZS5gvNPsC4MfzCnY4lzFMU9p5hqLMN29rYSIecrQSOsp6An7zkEfl6skC27jT aQdSySfqmAyPxQY0Zx9tKfP4qEeyxLxz3j098c5pZ1Sm4uOM97o59A02SqnayN6qiyH9 KptRJ2it4wKzSQeeecyjUyCGOmCLwMDIto3FcJV/s5jD9hTTcDtH6Nn11JCjuAXY5XkA w1UB2T/9Z0GTbIaWbon5hk223QWVPNGGW6vwOgJ/8wZNVs/4oB3l3gp084qajbtfB6M6 0F0uc/ZvkzbSfwjKWsNK9q9ma3CaPSWruZiPUS2zoqAjmBexqiMGbIuJynoI2EXn++f4 PY3A== X-Gm-Message-State: AOAM531ZYiPp2BmhCdu40kL7DZHTeQvdTtuOFb79apzxPCY1/54Sfck3 jfFfeSgUmbwwkxudiaSCPr1w2g== X-Received: by 2002:a17:90b:488:: with SMTP id bh8mr8802277pjb.49.1595397979540; Tue, 21 Jul 2020 23:06:19 -0700 (PDT) Received: from localhost.localdomain (p6e424d9a.tkyea130.ap.so-net.ne.jp. [110.66.77.154]) by smtp.gmail.com with ESMTPSA id p10sm19578759pgn.6.2020.07.21.23.06.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 23:06:19 -0700 (PDT) From: AKASHI Takahiro To: lukma@denx.de, trini@konsulko.com, xypron.glpk@gmx.de, agraf@csgraf.de Cc: sughosh.ganu@linaro.org, u-boot@lists.denx.de, AKASHI Takahiro Subject: [PATCH v4 02/16] dfu: modify an argument type for an address Date: Wed, 22 Jul 2020 15:05:25 +0900 Message-Id: <20200722060539.15168-3-takahiro.akashi@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200722060539.15168-1-takahiro.akashi@linaro.org> References: <20200722060539.15168-1-takahiro.akashi@linaro.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The range of an addressable pointer can go beyond 'integer'. So change the argument type to a void pointer. Signed-off-by: AKASHI Takahiro --- common/update.c | 3 ++- drivers/dfu/dfu_alt.c | 4 ++-- include/dfu.h | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) -- 2.27.0 Reviewed-by: Heinrich Schuchardt diff --git a/common/update.c b/common/update.c index 7f73c6372da0..f82d77cc0be9 100644 --- a/common/update.c +++ b/common/update.c @@ -181,7 +181,8 @@ got_update_file: } if (fit_image_check_type(fit, noffset, IH_TYPE_FIRMWARE)) { - ret = dfu_write_by_name(fit_image_name, update_addr, + ret = dfu_write_by_name(fit_image_name, + (void *)update_addr, update_size, interface, devstring); if (ret) diff --git a/drivers/dfu/dfu_alt.c b/drivers/dfu/dfu_alt.c index 5b1b13d7170d..f6b87c51ed30 100644 --- a/drivers/dfu/dfu_alt.c +++ b/drivers/dfu/dfu_alt.c @@ -23,14 +23,14 @@ * * Return: 0 - on success, error code - otherwise */ -int dfu_write_by_name(char *dfu_entity_name, unsigned int addr, +int dfu_write_by_name(char *dfu_entity_name, void *addr, unsigned int len, char *interface, char *devstring) { char *s, *sb; int alt_setting_num, ret; struct dfu_entity *dfu; - debug("%s: name: %s addr: 0x%x len: %d device: %s:%s\n", __func__, + debug("%s: name: %s addr: 0x%p len: %d device: %s:%s\n", __func__, dfu_entity_name, addr, len, interface, devstring); ret = dfu_init_env_entities(interface, devstring); diff --git a/include/dfu.h b/include/dfu.h index 94b0a9e68317..327fffc0dba6 100644 --- a/include/dfu.h +++ b/include/dfu.h @@ -507,10 +507,10 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr, * Return: 0 - on success, error code - otherwise */ #if CONFIG_IS_ENABLED(DFU_ALT) -int dfu_write_by_name(char *dfu_entity_name, unsigned int addr, +int dfu_write_by_name(char *dfu_entity_name, void *addr, unsigned int len, char *interface, char *devstring); #else -static inline int dfu_write_by_name(char *dfu_entity_name, unsigned int addr, +static inline int dfu_write_by_name(char *dfu_entity_name, void *addr, unsigned int len, char *interface, char *devstring) {