Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp758018rdh; Thu, 26 Oct 2023 15:12:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9ww8BQCtct8GhMaYDzTURrmIRXC94xRT5JS8hTXBrI3y0oeISy0l596BlPb1awTbfcR8V X-Received: by 2002:a05:6830:3145:b0:6b9:cba6:b246 with SMTP id c5-20020a056830314500b006b9cba6b246mr1243019ots.9.1698358326228; Thu, 26 Oct 2023 15:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698358326; cv=none; d=google.com; s=arc-20160816; b=d031m7bZadi5nsuK4IP8yY6oazWvgq3W+4frs+H9mo3XuqGMPdsQCuBn46k4lgMshp f0QbXDe98iYFO0oOk/uljcI23FLR5ElQcWtCuRXBriJQjTSffwmQkf9nnbiNGgBFsOM2 WqrQOcLjPtV66RtNpswX1/uHxExpignpKxp8i3bsQ7yfpzV4Dbnolp4GJm0wxGqIqn/U m1Gq12hG1ELjwC4BYVz9Wwj3LMsUBZz+FK1meZlezzeKxvZVls1WgLRz5jH7WSXiK624 udWTHdWzlEKUKQ1PbIY3KsEL4WmaGZxHB3tyl7GMRazIgi5rpW6bCLcCu2gA7KJ5XxNY IXrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=u7QyUigwL+AihRwuENBgL/lkTObabmHkjoTqFNGjpDU=; fh=E+O6lB+WksfCgT0P8JRY9LGebRJ8IEjJgrBLhq6dx78=; b=vKPwqAICEqCzdC/HaBwpQ5g7rL1qBSD8mZ3JspIjlKxFb2zVjFFVTpeyFyddF83tPj 3YuV6XJ+tkHxiKVpMYxPs20ErCCY8xO9A4nZRaxUqlO3L3QJp6sIANjvQnx2IUW34OQD Z2QHbAM7eIDkFg0Cd7qpjCIo8yo4o/9+DY8TFL6tRM08GMIIk4igVv8eomLF4b9zIrkw Rts4XdfuYmJcHEi9tCzzEGQinTzCuJHvh6hXyZ8EDotfzQR0qiR5gOGa80dG/eJ5LsjC JAj/JDqaL8h6apvQBKMZJhMiPyXH3oVoYltgZB9taBBW1X287dZJ5VKknZwo2KAxYmgS VaaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=JoVLho0R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id e9-20020a81e949000000b005a7fbac35c5si412407ywm.451.2023.10.26.15.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 15:12:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=JoVLho0R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id D6AE6825F1E0; Thu, 26 Oct 2023 15:11:57 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344896AbjJZWLr (ORCPT + 99 others); Thu, 26 Oct 2023 18:11:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbjJZWLp (ORCPT ); Thu, 26 Oct 2023 18:11:45 -0400 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8CAB116 for ; Thu, 26 Oct 2023 15:11:42 -0700 (PDT) Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-507973f3b65so2234438e87.3 for ; Thu, 26 Oct 2023 15:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698358301; x=1698963101; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=u7QyUigwL+AihRwuENBgL/lkTObabmHkjoTqFNGjpDU=; b=JoVLho0Ry/Nc3mefIZkDvwTWG8RS8v7YxyhoZ0dOiN+JlESexiFIKGBD8wInQ2syjT 1EoHhhzQ3ZrM+uECf1iJIiJnHYOU7Sa/R2OrT22M6/HFk37TAiv4oMzt5KPwi1sYc5ze 96kKe1U2XO/ej3+T7baBKZmwt14e8AtCqimELAOgY2mstJZUr2t33tiuA8sLShWDN5Zn GD80rlzyfDK7ii5/lQ3nKU4dSbsej3OQ8ih8G+gtNsrZw6Nx3FN4Jcr7heY6sebYwzfd KeXKcB2Rz8cDEQZdvcl8rH2wZnBW+ue0RNJpTuKp5VpC9q2sL19ikPqagAjuLXYUco+S TbEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698358301; x=1698963101; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u7QyUigwL+AihRwuENBgL/lkTObabmHkjoTqFNGjpDU=; b=e0tOk6TWyfjU+0i2/bdnxv1NB/NEOLSsHT177KxB/U8dG0XWc7e2Sfc9ei9Qt8MJin DgCPpj/XVmCEEHaj042QyE99Mt6dFNdq9SP03MYGYI9Fske8XAUzKAVAKCEBEeHXrPCU L24ZOXD1ps8D6AoqVVFcayqp/x1hsU3/Jdb3dANwEeGBsHDVQCOdKBzEw0uZmG4rxn9F 60p8gCVcz9UK3De3COOQ1mKqLPSTx9AhokhSDB+FLqyFq6mhuYFnIU02mpkMdaW0BWwJ xYwhxQMfOQtbDQMAKKUG2rxE3h4d6lo4Oy1trhyH+vNi9Y1Fa0zsr+wiL8oPcKkPVPIj Q7KA== X-Gm-Message-State: AOJu0YyRPSadQEcOFzHrHfdqBylsIMipYuqfUouuQvr21hgd5CsodM/Y EnAjm7yV9k9kokyxl9rZfkAicycjM5AbjBkDc1155g== X-Received: by 2002:a19:ac0a:0:b0:4ff:a04c:8a5b with SMTP id g10-20020a19ac0a000000b004ffa04c8a5bmr431476lfc.47.1698358300700; Thu, 26 Oct 2023 15:11:40 -0700 (PDT) MIME-Version: 1.0 References: <20231026-ethtool_puts_impl-v2-0-0d67cbdd0538@google.com> <20231026-ethtool_puts_impl-v2-1-0d67cbdd0538@google.com> <20231026220248.blgf7kgt5fkkbg7f@skbuf> In-Reply-To: From: Justin Stitt Date: Thu, 26 Oct 2023 15:11:28 -0700 Message-ID: Subject: Re: [PATCH next v2 1/3] ethtool: Implement ethtool_puts() To: Vladimir Oltean Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Shay Agroskin , Arthur Kiyanovski , David Arinzon , Noam Dagan , Saeed Bishara , Rasesh Mody , Sudarsana Kalluru , GR-Linux-NIC-Dev@marvell.com, Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Jesse Brandeburg , Tony Nguyen , Louis Peens , Shannon Nelson , Brett Creeley , drivers@pensando.io, "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Ronak Doshi , VMware PV-Drivers Reviewers , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Hauke Mehrtens , Andrew Lunn , Florian Fainelli , =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , Linus Walleij , =?UTF-8?Q?Alvin_=C5=A0ipraga?= , Wei Fang , Shenwei Wang , Clark Wang , NXP Linux Team , Lars Povlsen , Steen Hegelund , Daniel Machon , UNGLinuxDriver@microchip.com, Jiawen Wu , Mengyuan Lou , Heiner Kallweit , Russell King , Alexei Starovoitov , Daniel Borkmann , Jesper Dangaard Brouer , John Fastabend , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , Kees Cook , intel-wired-lan@lists.osuosl.org, oss-drivers@corigine.com, linux-hyperv@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email 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 (groat.vger.email [0.0.0.0]); Thu, 26 Oct 2023 15:11:58 -0700 (PDT) On Thu, Oct 26, 2023 at 3:09=E2=80=AFPM Justin Stitt wrote: > > On Thu, Oct 26, 2023 at 3:02=E2=80=AFPM Vladimir Oltean wrote: > > > > Hi Justin, > > > > On Thu, Oct 26, 2023 at 09:56:07PM +0000, Justin Stitt wrote: > > > Use strscpy() to implement ethtool_puts(). > > > > > > Functionally the same as ethtool_sprintf() when it's used with two > > > arguments or with just "%s" format specifier. > > > > > > Signed-off-by: Justin Stitt > > > --- > > > include/linux/ethtool.h | 34 +++++++++++++++++++++++----------- > > > net/ethtool/ioctl.c | 7 +++++++ > > > 2 files changed, 30 insertions(+), 11 deletions(-) > > > > > > diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h > > > index 226a36ed5aa1..7129dd2e227c 100644 > > > --- a/include/linux/ethtool.h > > > +++ b/include/linux/ethtool.h > > > @@ -1053,22 +1053,34 @@ static inline int ethtool_mm_frag_size_min_to= _add(u32 val_min, u32 *val_add, > > > */ > > > extern __printf(2, 3) void ethtool_sprintf(u8 **data, const char *fm= t, ...); > > > > > > +/** > > > + * ethtool_puts - Write string to ethtool string data > > > + * @data: Pointer to start of string to update > > > + * @str: String to write > > > + * > > > + * Write string to data. Update data to point at start of next > > > + * string. > > > + * > > > + * Prefer this function to ethtool_sprintf() when given only > > > + * two arguments or if @fmt is just "%s". > > > + */ > > > +extern void ethtool_puts(u8 **data, const char *str); > > > + > > > /* Link mode to forced speed capabilities maps */ > > > struct ethtool_forced_speed_map { > > > - u32 speed; > > > + u32 speed; > > > __ETHTOOL_DECLARE_LINK_MODE_MASK(caps); > > > > > > - const u32 *cap_arr; > > > - u32 arr_size; > > > + const u32 *cap_arr; > > > + u32 arr_size; > > > }; > > > > > > -#define ETHTOOL_FORCED_SPEED_MAP(prefix, value) = \ > > > -{ = \ > > > - .speed =3D SPEED_##value, = \ > > > - .cap_arr =3D prefix##_##value, = \ > > > - .arr_size =3D ARRAY_SIZE(prefix##_##value), = \ > > > -} > > > +#define ETHTOOL_FORCED_SPEED_MAP(prefix, value) = \ > > > + { \ > > > + .speed =3D SPEED_##value, .cap_arr =3D prefix##_##value= , \ > > > + .arr_size =3D ARRAY_SIZE(prefix##_##value), = \ > > > + } > > > > > > -void > > > -ethtool_forced_speed_maps_init(struct ethtool_forced_speed_map *maps= , u32 size); > > > +void ethtool_forced_speed_maps_init(struct ethtool_forced_speed_map = *maps, > > > + u32 size); > > > #endif /* _LINUX_ETHTOOL_H */ > > > > Maybe this is due to an incorrect rebase conflict resolution, but you > > shouldn't have touched any of the ethtool force speed maps. > > Ah, I did have a conflict and resolved by simply moving the hunks > out of each other's way. Trivial resolution. > > Should I undo this? I want my patch against next since it's targeting > some stuff in-flight over there. BUT, I also want ethtool_puts() to be > directly below ethtool_sprintf() in the source code. What to do? Oh, I just realized my auto formatter had a field day with that function. I will rectify this in a new version after waiting 24hrs for comments to trickle in as well. > > > > > Please wait for at least 24 hours to pass before posting a new version, > > to allow for more comments to come in. > > Ok :) > > Thanks > Justin Thanks Justin