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 X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92862C43457 for ; Mon, 12 Oct 2020 17:27:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 368FF2067D for ; Mon, 12 Oct 2020 17:27:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390744AbgJLR1W (ORCPT ); Mon, 12 Oct 2020 13:27:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389613AbgJLR1W (ORCPT ); Mon, 12 Oct 2020 13:27:22 -0400 Received: from a3.inai.de (a3.inai.de [IPv6:2a01:4f8:10b:45d8::f5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70266C0613D0 for ; Mon, 12 Oct 2020 10:27:22 -0700 (PDT) Received: by a3.inai.de (Postfix, from userid 25121) id 09B195872C948; Mon, 12 Oct 2020 19:27:21 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by a3.inai.de (Postfix) with ESMTP id 05D7360DB5336; Mon, 12 Oct 2020 19:27:21 +0200 (CEST) Date: Mon, 12 Oct 2020 19:27:21 +0200 (CEST) From: Jan Engelhardt To: Stephen Hemminger cc: netdev@vger.kernel.org Subject: Re: [iproute PATCH v2] lib/color: introduce freely configurable color strings In-Reply-To: <20201012100440.0de0be16@hermes.local> Message-ID: References: <20201012164639.20976-1-jengelh@inai.de> <20201012100440.0de0be16@hermes.local> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Monday 2020-10-12 19:04, Stephen Hemminger wrote: > >> +static struct color_code { >> + const char match[8], *code; >> + int len; >> +} color_codes[C_MAX] = { >> + {"iface="}, {"lladdr="}, {"v4addr="}, {"v6addr="}, {"operup="}, >> + {"operdn="}, {"clear=", "0", 1}, >> }; > >Also if each match has = that maybe redundant. The = is needed so that strncmp in set_color_palette will do an equality match on the key name rather than a prefix match.