Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp315279imp; Thu, 21 Feb 2019 01:58:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IaCAqM7bFP1CBV5xtS26cjvbpWhIJTgkYnYjjU4iog2Yrb745Pc6jJssiGBgxC02WXtK1hW X-Received: by 2002:a63:8bc8:: with SMTP id j191mr31723525pge.234.1550743120485; Thu, 21 Feb 2019 01:58:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550743120; cv=none; d=google.com; s=arc-20160816; b=k0Myk9EyVxdJbn6qcUm5rftaKJwzMmMxI9lC63T7NB7WuBddTSj/q233SrGiYo20TL x54kGBuo7ZL9xbLUwIk58jgnj0NrzoqfNYJhevGlV1WANjzYjBFnMB0336SJfEfBgtB9 YGIo5c7TNwWROm3aGMnEcGGBYfr6FVdTx/ulPjxe2c2db2f9fZ52DiZKrTkcTBMox+5n m+/4Rit6UAOKbqS4yrMWQM6SJIlbdX6CgNK5nUeDWmjEslDW8bEL8D4NljKTLoLYOhdi Lw5ZQ/tX4pGR5biAbJ6v7bUHrVA7yJiifRz0AkTPn3V9QSKBL1UW+qwL/ncBaolwxX2p LPOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8y4MXf4r6bbmq8vponW5u4ZKdCSNKeQfcV/pdZ7S1zY=; b=eTqlAyUB7s4F6O/bKgMCh/o0jWy6tdBMDx7XMFm35Izqv+z3kNXwGGTHUWBRbIYhHI XqCyRwWJSe4TaSuUa7E9zXKOeg85NXw5bXwJtkN6Njht+C5AS716t1FvFcwsCle/mWQS wqURSQaxWgxAZqzGi8scJp1xaKj5F6iDi4FXyusvcq+pP8alibg72q5BFtTBBRJS6R+9 xu/ue3XFbayVbvtUbXAbRa3Ek5kRW9mAQ2f17e7VOkmUc/zDfPExjSpberpWskpo4EKD 0E6irS9XTH8Wsptz178YBpQDXmGOhzn9Vo/Oxb8GE/Hyh9Vp78w0iCiTYIw5CJwSND97 AcHg== 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 p12si4907941plo.206.2019.02.21.01.58.25; Thu, 21 Feb 2019 01:58:40 -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 S1727789AbfBUJ5M (ORCPT + 99 others); Thu, 21 Feb 2019 04:57:12 -0500 Received: from mx2.suse.de ([195.135.220.15]:56674 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726151AbfBUJ5M (ORCPT ); Thu, 21 Feb 2019 04:57:12 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 20B33AFED; Thu, 21 Feb 2019 09:57:11 +0000 (UTC) Received: by unicorn.suse.cz (Postfix, from userid 1000) id C0401E00A5; Thu, 21 Feb 2019 10:57:10 +0100 (CET) Date: Thu, 21 Feb 2019 10:57:10 +0100 From: Michal Kubecek To: Florian Fainelli Cc: netdev@vger.kernel.org, David Miller , Andrew Lunn , Jakub Kicinski , Jiri Pirko , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH net-next v3 14/21] ethtool: provide link mode names as a string set Message-ID: <20190221095710.GN23151@unicorn.suse.cz> References: <9a26eed3-f69a-b5fd-66e1-b926c6e92c2f@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9a26eed3-f69a-b5fd-66e1-b926c6e92c2f@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 07:21:58PM -0800, Florian Fainelli wrote: > > +const char *const link_mode_names[] = { > > Maybe you can define a macro (totally untested) to build the table an > avoid some of the repetition, something like: > > #define ETHTOOL_LINK_NAME(speed, duplex) \ > [ETHTOOL_LINK_MODE_##speed_##duplex_BIT] = stringify(speed ## "/" ## > duplex) Thanks for the tip, that should work for most of the modes. Michal