From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PCDS5xsT" Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2D389C; Wed, 13 Dec 2023 12:15:31 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-40c317723a8so64072355e9.3; Wed, 13 Dec 2023 12:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702498530; x=1703103330; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=Vb5B6Yi9sghxkDMCL6Vt09IrQB+8r0DuYMikKdRw/lc=; b=PCDS5xsTMRP1UYxJG/5a1yKY6dKnAyHRqCMvt8XW3lvhMXGpeqqmqOE93QguPxDIcl 3rE6UgdBtJjp7/esPc7CTkjoDlYRg01+0gfeCg0OlugBY4g5yoEV7hLzxXiWByTNyBt8 I0Wz3GW0WV/Z404rv0J+omFyL+j2tCNz87wSSLfoSRH8FBuiXS1nFZzjWiBhK4FCzwpI S4vR7SXFEgePdy4p2HckmBD1hCmGIU1DEGI0KHqTUTm6Cmrf3ID9ZYi/j0S7CjxMRnZx xDC2oqmd95eHZu6Kw1xIzdP0hDdb64RyplZEqQEkZMxYD6bAO6riI/+euOkaZd/tYX6V uHGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702498530; x=1703103330; h=in-reply-to:content-disposition:mime-version:references:subject:cc :to:from:date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Vb5B6Yi9sghxkDMCL6Vt09IrQB+8r0DuYMikKdRw/lc=; b=guCsNrE9X32jd9XJK/ZjOK5ZAmbNl6noE+i95SMT0Wc8aO71g2KMJegt3deDsuR+5c YCEueWp2gLb9X7r4iQfHEcx6vbx/P8jCGc2gSxdvghvIky3jBEEEJMSz80DMjD7E8NZN c8gyjMJRjwF86GcXmpHq1/yBQXpx/8oIigXiCu0oBJYULTS+vrKEKsCucZUcc5S8+lqH 17LZBWuKWw9kO9vBBcBw+ErFX6jj7xWGtGrNrJ1+gNoxYcLrg+wuzVI3eH913E8/cnJc cAbYmDwzrjMJA3NOZxT6Eu6qW291WgmUJfNC0JGT9rNeVnVz/qJTZ+N1aWuuuDKEEiJ7 0c9A== X-Gm-Message-State: AOJu0Yy1n7ilZ+mg+pOXZcpQff+CMXqhy/xSGg+ADAoNrnM92q9WQWO8 9j/bQ39mbP+TxOS72lr+hdg= X-Google-Smtp-Source: AGHT+IGt77bq+tJdZfS3kvtLEs7hLVZ3XtfobDRpKoGENDqN+bvJEfNqHY62OfsG1FJFgLUqwJdA1w== X-Received: by 2002:a05:600c:2a41:b0:40b:5e21:d344 with SMTP id x1-20020a05600c2a4100b0040b5e21d344mr4754263wme.77.1702498530206; Wed, 13 Dec 2023 12:15:30 -0800 (PST) Received: from Ansuel-xps. (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.gmail.com with ESMTPSA id az27-20020a05600c601b00b0040c34e763ecsm20923276wmb.44.2023.12.13.12.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 12:15:29 -0800 (PST) Message-ID: <657a10e1.050a0220.22d18.b3cb@mx.google.com> X-Google-Original-Message-ID: Date: Wed, 13 Dec 2023 21:15:27 +0100 From: Christian Marangi To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Vincent Mailhol , Kees Cook , Piergiorgio Beruto , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [net-next PATCH 1/2] net: ethtool: add define for link speed mode number References: <20231213181554.4741-1-ansuelsmth@gmail.com> <20231213181554.4741-2-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Dec 13, 2023 at 08:10:42PM +0000, Russell King (Oracle) wrote: > NAK. > > You *clearly* didn't look before you leaped. > > On Wed, Dec 13, 2023 at 07:15:53PM +0100, Christian Marangi wrote: > > +enum ethtool_link_speeds { > > + SPEED_10 = 0, > > + SPEED_100, > > + SPEED_1000, > ... > > and from the context immediately below, included in your patch: > > #define SPEED_10 10 > ^^^^^^^^ > > #define SPEED_100 100 > ^^^^^^^^^ > > #define SPEED_1000 1000 > ^^^^^^^^^^ > > Your enumerated values will be overridden by the preprocessor > definitions. > > Moreover, SPEED_xxx is an already taken namespace and part of the UAPI, > and thus can _not_ be changed. Convention is that SPEED_x will be > defined as the numeric speed. > Well yes that is the idea of having the enum to count them and then redefining them to the correct value. (wasn't trying to introduce new define for the speed and trying to assign incremental values) Any idea how to handle this without the enum - redefine thing? Was trying to find a more automated way than defining the raw number of the current modes. (but maybe this is not that bad? since on adding more modes, other values has to be changed so it would be just another value to document in the comment) -- Ansuel