Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5566914rdb; Wed, 13 Dec 2023 12:24:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAtQUC4x8ZGQ/zFLstyi+JodZQeQwoRpdvneBmEAJH6vcUjg3DgLI3qGeZMuRT218ql7jb X-Received: by 2002:a05:6a20:639e:b0:190:65d3:779b with SMTP id m30-20020a056a20639e00b0019065d3779bmr7335029pzg.92.1702499050904; Wed, 13 Dec 2023 12:24:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702499050; cv=none; d=google.com; s=arc-20160816; b=Bv8J69ek4WvYEk74Hfwahgsofah0r+077ccB51i/j2OE2mlqMwLwTyGb9huttQPAwj /2Co72zD+rx2cfSNkmPrbi/u/OTts98xQUS9nEZXEsd7ZTTOHRItWYnNnIFmzBXo7Amj tAKpgIvoHGk1/03DStPvb33/qHsdyqVZkgv8pig78+S2K29r/bc2B2WZhKgahXDLbGPg NblBqQMY2cfgcwmikDmhqjdwYjDOhse3VZzA9FRu/T1N09FqxSfaE7s+AQm6cJXdqvo0 kWYiQ2KSvn//jmM0Jdr2ASJZkHOk7wYfqjWVqTplWksOeqc9W59wwxCmdOHXwFrOFYHb q3Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=REov+oFNlg6yYMIR/95rdfAyE9Q9tktH/CA0m6KaQUI=; fh=9p34L7KF7bfMLHxp/5OUkfV8x0r4g3aazwcd2QJ5G+E=; b=WPCmwPJfH5K6KUDv8QFEeU0QKMl3ELeUKXUWj93+uxngA1C/NP0q++daQV0Z02QRYk X/D2az+l2YRiYjmF68XQFNekkR79cENPHcUp/wUouxO0j4V2+YA47riHv8WNDqOohXHX Zn6QB5qZqKG6v8R2NMqZvbC1ivv4Ak7HWuUB1sAI693kpCWjKd7wwnq4OxZrAhS8HByy y/gROJHGPXn/IWXqazPs9XghEdaqnLlXpDapE3JExoY1bOvvabyVx57YApQw94LIz+RV fmDqjsW6yto/GG3l7g5iTuyz6GruEW5dbqZrDGSfB3uyofoPFFKEPPFR6EKjWsUTCuDm dOLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=fY4+FmOH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id y24-20020a634b18000000b005c215b317e9si9829909pga.478.2023.12.13.12.24.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 12:24:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=fY4+FmOH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 948A0802C7CA; Wed, 13 Dec 2023 12:24:09 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233770AbjLMUX7 (ORCPT + 99 others); Wed, 13 Dec 2023 15:23:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbjLMUX6 (ORCPT ); Wed, 13 Dec 2023 15:23:58 -0500 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 333369C; Wed, 13 Dec 2023 12:24:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=REov+oFNlg6yYMIR/95rdfAyE9Q9tktH/CA0m6KaQUI=; b=fY4+FmOH5yJykXdclne/eOJ4sx o1yZxkvltFI5nvWbGcly5/o5zItlScMmj/IcU95tEWUFjEBs3rZVCOhU96oM/Eam5xi0zaduDzvw0 zOLAqklAejhQ6Sl7dgEWVA9q6UVERPw90kw+UtTMZUmBnhpO2/S8GZ0qE7FkDRUZtDYRuXcqkCIyW bdrhW7eK8YRAnbBVYVS5Zqzsnv5YvgEfy/FevlSZtSZOXHR0TbweFpYxhOfdTT7jb9RPqjp5FJccp TKt1Rgeby6E8CeGl/Si8sCcIFnIfQrWG1uZiMF/8LYxVpEudA8ZSxwFI0h2N8g+2z5ixkLBpyt7Bt j6idMUsw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:56454) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rDVlr-0000Yk-2D; Wed, 13 Dec 2023 20:23:55 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rDVlt-0001p4-Gq; Wed, 13 Dec 2023 20:23:57 +0000 Date: Wed, 13 Dec 2023 20:23:57 +0000 From: "Russell King (Oracle)" To: Christian Marangi 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 Message-ID: References: <20231213181554.4741-1-ansuelsmth@gmail.com> <20231213181554.4741-2-ansuelsmth@gmail.com> <657a10e1.050a0220.22d18.b3cb@mx.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <657a10e1.050a0220.22d18.b3cb@mx.google.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 12:24:09 -0800 (PST) On Wed, Dec 13, 2023 at 09:15:27PM +0100, Christian Marangi wrote: > 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) I think my comment on patch 2 gives some ideas! :D -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!