From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.214.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796065877; b=nK1RgP4CnJB4e0mNFEhYUfghSm5IC/S4GTaWFtMCmsiNQ3PZVTK0kxUek5IjO33hjmWJ NYQwKpHYnSgSPbSFevbkUzCuLL9qHMB3WcSiZMMLolKfLtJqtwbi7xNR4kNZ1mBfMGl48 2cRWBTqkrMfetIAah6/BGdq8aU1zykfJk5fllK9X5OO9lKVQHgnALAXeIc6KTXSHpcgoL y11ymeKevTbcAsyEbAZfZFfDsDzR4ugjVlxaV0HbKI9KKnHGSAtFo1lo5UOsed7fj/85C fC4wF5uQYnW1hb+HBuFBbrqrFhUEgeSd371pH1UXxvb8y7Ip5Y+Zp1x1Q9UaiQ/t+fw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796065877; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=HVseSnenC+gJus6Z/c5SJv8PES7k/TY6jgfxTQpZ/KY=; b=hxd5Jmemu47pikjgSubcxqtSr2YqhjaojO2CEQvpkZ//lovc1vs4uGuYuy/If9jdPvG/ KSIAQnNT3qzluglSj0iKT9wtME7GGGiWuYRHanFsd0IKahNIJ+8Ww87LPJ6tH6EvdxUyF efas3cj0xYjEkqnmmllYdxpw6b0PbD7Urm+zJQJxB3/V98Ru5RzAvz9Eo2XU2gvfnOaXu HODAo9RF7BxnhlsAd9qxHGRGo2wbmsY2nycGizW0PerAnrB0T7Get+8wj4VbWKG1gxukC eYIylOh5x/tJzqFvLOTqVs/yO45Mv3MkDv7/kGxWctFT4xHiQhZ0FpjRztfV0bzxF0A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=networkplumber.org; spf=pass smtp.mailfrom=networkplumber.org; dkim=pass header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ItuvzOkp; arc=none smtp.remote-ip=209.85.214.176 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 789F4606A32C for ; Mon, 30 Nov 2026 19:11:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 789F4606A32C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=networkplumber.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=networkplumber-org.20260707.gappssmtp.com header.i=@networkplumber-org.20260707.gappssmtp.com header.a=rsa-sha256 header.s=20260707 header.b=ItuvzOkp Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-2f045b921caso62053365ad.3 for ; Mon, 30 Nov 2026 11:11:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20260707.gappssmtp.com; s=20260707; t=1796065877; x=1796670677; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HVseSnenC+gJus6Z/c5SJv8PES7k/TY6jgfxTQpZ/KY=; b=ItuvzOkpHlQjWpisjhfio6TGbslyHKvNOEVWQ5Qvjdj/gGKTzVriIS9KwSm9TEY7Iq SWf4U7DG4X53W3XD9ZfkTfJtycGqRtIWE3w6+HopHsI/mzrj9F9ePB0H3IgcXMpnLCz2 jhu2yc7nBkUhql6NrbP/FfZqKK2dX9M3QhKU1kdUNgL0owENxGwY3MgzkySg3IQ9bmhD ErylmCmZvxfVAoOBKSwDOiJCguorSZ2gieDEOFX/8s+8ua5OJsLq8jTSwjp/2yA9ZIWh hJMwLaXwstwZx40EFqY2GUmm2u+PS5sQyfa++a2gFRK9yfvvQmcpaaCF7aSsOwnauMj+ MFlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796065877; x=1796670677; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=HVseSnenC+gJus6Z/c5SJv8PES7k/TY6jgfxTQpZ/KY=; b=u/KQm0uOB+oxBXhXXnZ/Xomo8O0SX2OaBkIbqhNEW9U6R+HvfIrFmQHLjhj8UxGviS ZUliXHu/lLzcMEBcxB7oYvu9d+DUWXp9J1mzudB814EWMgCb4vujrc9fhD2b+yMYH7tm fFZiw+ZmkVgCDOqba7vWnw9A4bGMeiklVB51oET7BiG7aRFBPwECp8JpQgt0Q9Njmfvy NlA0eq5k3dmmEdXFbRCGMQfMkEtXy/lAEb3JfEA6yzqdXfvIDzJ+X+3HIaXquVV8bSUQ YaKEKgLytAbxd1kjCwMsB2DJHGRYqxFz2qv09IT1rKIELkpkGsiaG8BMMcWqQPM7SJ+5 VpPQ== X-Gm-Message-State: APuU4Z+FUaULBdNxkqO9sZ5nzVKrZPmN52VFvLfzlHDBueP7e2hcPFyR F54ywNQM+siDIGNi7mxCDqVpJaWyvKwifcOdRwq0eyu/tjZ8saKalQbRtCSH/t1xKNXU+HeUDdP nQF7JoGE= X-Gm-Gg: AZFdTZeJQ7zbbD9/83dM39A12JKPCu2rXT56HEKml1E5YwsCHrDjVuXzzaMuCblmm7l y0pVGDDbq1P+89F7ujtBhQheC1d7LHqISGf7YsUILv4wD+AwWMxfnxBg9cN9jfT5mtzpNQASSlx mUrPudLAKZFMDYEd2CifVbeaJposHJIFdpaDKsD8/w6eM75q/9CEEuLLcZp7mm6ewsDdRJKdh39 O0quRMjPyLq8QhUhOXnY+5P/k+csA+aBSOfTOQOGSGIbo9c2rBSIicG8DD41QdGb5cSpAYbQqA0 arz7akbUiVOL0/c1wYh0yz8/gmPasg770SnwEC6NkXblQHci8MBgrJZq/gEa8oQY9THNlbDB6Lg UGUuI4MtBXl8jlK5gy+wyu7AJclMYgnxDdYrEmwZ+WiyML8a8t3VGqwBxwFW9GEE3kjfdHvOFHC 3TS9tRZMKIjibI7CmaAqoAxWKjZjZshBeBWFdN7rvMgTUh6/6aNiwUuweKEFXuCCHNh8PrcFKJV Lx+/UR7Wdwapts2F9qKRIJUR+/ECaRCPfjR2iT5X7qvSA/5Vz58R9zFW0G4nrIhM9Tz3UP4zH28 l8AgYnT7uF77vDrKnwjSJM/ZfawFIqCr9O1DVeP65wRbvOWKtUihlk5kG20rimIuBzzCY5Looz8 JcFljKPWGI6Pccw== X-Received: by 2002:a17:90b:3f0f:b0:3a0:b312:1fbe with SMTP id 98e67ed59e1d1-3b41c9006d4mr48572019a91.23.1796065876743; Mon, 30 Nov 2026 11:11:16 -0800 (PST) Received: from phoenix.lan (204-195-112-43.wavecable.com. [204.195.112.43]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3b40f4312dfsm55591195a91.3.2026.11.30.11.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 11:11:16 -0800 (PST) From: Stephen Hemminger To: netdev@vger.kernel.org Cc: dsahern@kernel.org, Stephen Hemminger Subject: [PATCH iproute2-next 03/10] lib: rename parameters that shadow globals Date: Mon, 30 Nov 2026 10:47:04 -0800 Message-ID: <20261130184752.545119-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261130184752.545119-1-stephen@networkplumber.org> References: <20261130184752.545119-1-stephen@networkplumber.org> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit new_json_obj(), new_json_obj_plain(), __new_json_obj() and check_enable_color() take an int parameter named json, which shadows the global of the same name. print_color_rate() does the same with use_iec. Rename the parameters; no functional change. Signed-off-by: Stephen Hemminger --- include/color.h | 2 +- include/json_print.h | 10 +++++----- lib/color.c | 4 ++-- lib/json_print.c | 18 +++++++++--------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/color.h b/include/color.h index b543c267..4d9fff1f 100644 --- a/include/color.h +++ b/include/color.h @@ -21,7 +21,7 @@ enum color_opt { }; int default_color_opt(void); -bool check_enable_color(int color, int json); +bool check_enable_color(int color, int is_json); bool matches_color(const char *arg, int *val); int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...); enum color_attr ifa_family_color(__u8 ifa_family); diff --git a/include/json_print.h b/include/json_print.h index 79d8d4ff..56e82743 100644 --- a/include/json_print.h +++ b/include/json_print.h @@ -32,9 +32,9 @@ enum output_type { PRINT_ANY = 4, }; -void new_json_obj(int json); +void new_json_obj(int is_json); void delete_json_obj(void); -void new_json_obj_plain(int json); +void new_json_obj_plain(int is_json); void delete_json_obj_plain(void); bool is_json_context(void); @@ -94,14 +94,14 @@ _PRINT_NAME_VALUE_FUNC(uint, unsigned int, u); _PRINT_NAME_VALUE_FUNC(string, const char*, s); #undef _PRINT_NAME_VALUE_FUNC -int print_color_rate(bool use_iec, enum output_type t, enum color_attr color, +int print_color_rate(bool iec, enum output_type t, enum color_attr color, const char *key, const char *fmt, unsigned long long rate); -static inline int print_rate(bool use_iec, enum output_type t, +static inline int print_rate(bool iec, enum output_type t, const char *key, const char *fmt, unsigned long long rate) { - return print_color_rate(use_iec, t, COLOR_NONE, key, fmt, rate); + return print_color_rate(iec, t, COLOR_NONE, key, fmt, rate); } unsigned int print_range(const char *name, __u32 start, __u32 end); diff --git a/lib/color.c b/lib/color.c index aa112352..ddfda58a 100644 --- a/lib/color.c +++ b/lib/color.c @@ -97,9 +97,9 @@ int default_color_opt(void) return CONF_COLOR; } -bool check_enable_color(int color, int json) +bool check_enable_color(int color, int is_json) { - if (json || color == COLOR_OPT_NEVER) + if (is_json || color == COLOR_OPT_NEVER) return false; if (color == COLOR_OPT_ALWAYS || isatty(fileno(stdout))) { diff --git a/lib/json_print.c b/lib/json_print.c index e028e766..864e250b 100644 --- a/lib/json_print.c +++ b/lib/json_print.c @@ -13,9 +13,9 @@ static json_writer_t *_jw; -static void __new_json_obj(int json, bool have_array) +static void __new_json_obj(int is_json, bool have_array) { - if (json) { + if (is_json) { _jw = jsonw_new(stdout); if (!_jw) { perror("json object"); @@ -37,9 +37,9 @@ static void __delete_json_obj(bool have_array) } } -void new_json_obj(int json) +void new_json_obj(int is_json) { - __new_json_obj(json, true); + __new_json_obj(is_json, true); } void delete_json_obj(void) @@ -47,9 +47,9 @@ void delete_json_obj(void) __delete_json_obj(true); } -void new_json_obj_plain(int json) +void new_json_obj_plain(int is_json) { - __new_json_obj(json, false); + __new_json_obj(is_json, false); } void delete_json_obj_plain(void) @@ -352,11 +352,11 @@ void print_nl(void) printf("%s", _SL_); } -int print_color_rate(bool use_iec, enum output_type type, enum color_attr color, +int print_color_rate(bool iec, enum output_type type, enum color_attr color, const char *key, const char *fmt, unsigned long long rate) { - unsigned long kilo = use_iec ? 1024 : 1000; - const char *str = use_iec ? "i" : ""; + unsigned long kilo = iec ? 1024 : 1000; + const char *str = iec ? "i" : ""; static char *units[5] = {"", "K", "M", "G", "T"}; char *buf; int rc; -- 2.53.0