From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8D31AC433EF for ; Mon, 2 May 2022 14:21:04 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4FC8283F48; Mon, 2 May 2022 16:19:36 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=solid-run.com 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=solid-run-com.20210112.gappssmtp.com header.i=@solid-run-com.20210112.gappssmtp.com header.b="Tshe6O4e"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id EA37E83F41; Mon, 2 May 2022 16:19:14 +0200 (CEST) Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 8592283E2B for ; Mon, 2 May 2022 16:18:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=solid-run.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=josua@solid-run.com Received: by mail-wr1-x42f.google.com with SMTP id x18so19811688wrc.0 for ; Mon, 02 May 2022 07:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=solid-run-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wGMHe/PCd4/rGZ6MJVjLTBbGFAYDP8InsfnSbSBeXvU=; b=Tshe6O4eaS6kVffK4b4/ykSOVIJZrIR48HGdZ1m4un/YFkeXx6FHK7mkux9+y9u4YJ MUKBcHpSbjYHURjlqy1nBbBxZEStmWT4Su7gVufSb6XJmvgXqKIEpVfkASyECJ5/gcp/ b/0/cotqJzCDmk3GGQLw4fwD5N9uqW/1iYxg8GLd5quFhBEDrEeXK81gePHTj/zftyMK Lcwm8VZyW16vu35XL12+aD72epN22BjvvxHOpuaB5qg+L5nwMrvUD74oSdJeHECol4fO q0IHqgMH5bl7BIo8fOdKFLCTMB8bveyQ/h1tkn3vC6LUeGztfpf+0SSrsJOUWtz5HRhU Oz3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wGMHe/PCd4/rGZ6MJVjLTBbGFAYDP8InsfnSbSBeXvU=; b=Y0QYz3pm09esCrnkhkFRexuwJyoso9jpZ6uzIJZFfC0Yyewtf7OSWx+ReSs+QGVNCp nAiCHlMVMrT9WUYGPJyf4MEMS1rkh3+laulUNJVUUeiSKOr3/OtlM8FHBNqiY4a4xvb/ n5bYH7yVRBkCZ3tPL63RiI1GOeqIAbW3RZfRaYBoUCj27TnAb/+Os02+PHBA+ijOXI9S +AYBliZrIkwo/WP4bpK4c+B6f/R+gzXjTaCBI/X8vopcFlqkiOIMZruM66CyWXbafBnw AZZ7QD0LiCXPyF68Wx81dN6MeMvpFYODCGhO1KsFNJBbjLP2nQP7srY8nVlo7coCxaEU IYyw== X-Gm-Message-State: AOAM531FkfklfELxDNLSpmrjlAay5AwBhWXmHnzS2GBbi1cGtVxPB6qG ineHsckgqT/kwMyrCF1ePXHyfBqT3pFMpA== X-Google-Smtp-Source: ABdhPJyJ+7rwcuQyVYvStCQKmCc2+bzqhTx0yd8wAgDlfH12c/ZVrr6tto1rIYIz2JoRpEakwe7m4A== X-Received: by 2002:a05:6000:186f:b0:20c:5f3d:44a4 with SMTP id d15-20020a056000186f00b0020c5f3d44a4mr5099406wri.152.1651501137850; Mon, 02 May 2022 07:18:57 -0700 (PDT) Received: from josua-work.lan (bzq-82-81-222-124.cablep.bezeqint.net. [82.81.222.124]) by smtp.gmail.com with ESMTPSA id t1-20020adfba41000000b0020c6fa5a797sm940035wrg.91.2022.05.02.07.18.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 07:18:57 -0700 (PDT) From: Josua Mayer To: u-boot@lists.denx.de Cc: Josua Mayer , Simon Glass , Stefan Roese , Sven Auhagen Subject: [PATCH 08/12] cmd: tlv_eeprom: clean up two defines for one thing Date: Mon, 2 May 2022 17:18:34 +0300 Message-Id: <20220502141838.15912-9-josua@solid-run.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220502141838.15912-1-josua@solid-run.com> References: <20220502141838.15912-1-josua@solid-run.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.103.5 at phobos.denx.de X-Virus-Status: Clean MAX_TLV_DEVICES defined in C, and TLV_MAX_DEVICES defined in the header serve the same purpose. Replace all occurences of the former by the latter. Signed-off-by: Josua Mayer --- cmd/tlv_eeprom.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmd/tlv_eeprom.c b/cmd/tlv_eeprom.c index f51a9666bf..c110927cb5 100644 --- a/cmd/tlv_eeprom.c +++ b/cmd/tlv_eeprom.c @@ -25,8 +25,6 @@ DECLARE_GLOBAL_DATA_PTR; -#define MAX_TLV_DEVICES 2 - /* File scope function prototypes */ static int read_eeprom(int devnum, u8 *eeprom); static void show_eeprom(int devnum, u8 *eeprom); @@ -39,7 +37,7 @@ static void show_tlv_devices(int current_dev); /* The EERPOM contents after being read into memory */ static u8 eeprom[TLV_INFO_MAX_LEN]; -static struct udevice *tlv_devices[MAX_TLV_DEVICES]; +static struct udevice *tlv_devices[TLV_MAX_DEVICES]; #define to_header(p) ((struct tlvinfo_header *)p) #define to_entry(p) ((struct tlvinfo_tlv *)p) @@ -873,7 +871,7 @@ static void show_tlv_devices(int current_dev) { unsigned int dev; - for (dev = 0; dev < MAX_TLV_DEVICES; dev++) + for (dev = 0; dev < TLV_MAX_DEVICES; dev++) if (exists_tlv_eeprom(dev)) printf("TLV: %u%s\n", dev, (dev == current_dev) ? " (*)" : ""); @@ -890,7 +888,7 @@ static int find_tlv_devices(struct udevice **tlv_devices_p) ret = uclass_next_device_check(&dev)) { if (ret == 0) tlv_devices_p[count_dev++] = dev; - if (count_dev >= MAX_TLV_DEVICES) + if (count_dev >= TLV_MAX_DEVICES) break; } @@ -899,7 +897,7 @@ static int find_tlv_devices(struct udevice **tlv_devices_p) static struct udevice *find_tlv_device_by_index(int dev_num) { - struct udevice *local_tlv_devices[MAX_TLV_DEVICES] = {}; + struct udevice *local_tlv_devices[TLV_MAX_DEVICES] = {}; struct udevice **tlv_devices_p; int ret; @@ -926,7 +924,7 @@ int read_tlv_eeprom(void *eeprom, int offset, int len, int dev_num) { struct udevice *dev; - if (dev_num >= MAX_TLV_DEVICES) + if (dev_num >= TLV_MAX_DEVICES) return -EINVAL; dev = find_tlv_device_by_index(dev_num); -- 2.34.1