Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp753275rdh; Thu, 26 Oct 2023 15:03:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH8zsJb+UKz/ViJH8KXd5iHrv2I6tvMczUuAep1RVt6j8mMhszqUKe+b+lOs6+yi9fikA1w X-Received: by 2002:a17:907:2684:b0:9bd:bbc1:1c5f with SMTP id bn4-20020a170907268400b009bdbbc11c5fmr765529ejc.35.1698357793302; Thu, 26 Oct 2023 15:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698357793; cv=none; d=google.com; s=arc-20160816; b=htqlmlOsYXpQdvFf/eIW3HeasWZ577AaFIeq4C/v1MHXu+zNuoXgrh+Z/329RnIcsn PFGaPcPDFUroRBkbVK8XW8gO0jalkisp94w/WPUrZ/EYpoRnaqxk1+6ql+F/i+n0ZmLD bh2wrvsT5QPfqCHnm9zCDFoacT53zu/YaCIrhvUYcKkgM1Sqlppy+NG/dnKW1w/W1W1X Kke3OpGk162UfulqM5VLcdAE+Ba6K0JGpCf5p8ikxtg4wYFzWyaLm56qpuB/Ina7mBYt deJn76/DbZ8D6gOcoGPDNVwtYnRf+4uIkQe5HQ9LDrl8gb0X14an5f952FIc4eA/DBGK u3zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BQfvT8y1gch6L7r+cd34RGIc+yfvci8UCEz/1CgAlZs=; fh=A08hpOkwJhqMw6kFVAh540a5au36L9EwT/36Qo1NKe4=; b=qkHflaVA/Nn25qmIy1ba7DjVNDEC3FtYjh5RbJbif7+ZzbEuEJYa4BgkXtiLClBHdY GHo52hLBVtHjxnFGPwmqOxWvTdN/gLYJMrD3xFoHmzrFz4Er5qA8yIKQVga6oqUNYJvd 2TupLOImLpWIDbGohBc93LQJXjU0MAxomtpEmzxyxzcX9rF2VW9zWhbt2g/MQUe9Gl38 xHB0bsGd5cP3V4inRw+bg5mKQ4l9rJ45B+DKcMUGHoAk1yoczsXDxifWSdmrqPGvV4zV K1SsbXdC697J04lObC/8G+7Ct+lpUMohSjnVOyLZj8hm8q+tp4iUznR6WpRI94p7HyeR oXPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WOVbvVk2; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id du5-20020a17090772c500b009ce03057c47si139345ejc.1029.2023.10.26.15.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 15:03:13 -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=@gmail.com header.s=20230601 header.b=WOVbvVk2; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id A9419809C92E; Thu, 26 Oct 2023 15:03:09 -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 S232148AbjJZWC7 (ORCPT + 99 others); Thu, 26 Oct 2023 18:02:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230089AbjJZWC6 (ORCPT ); Thu, 26 Oct 2023 18:02:58 -0400 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C63BFCA; Thu, 26 Oct 2023 15:02:55 -0700 (PDT) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2c515527310so19785821fa.2; Thu, 26 Oct 2023 15:02:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698357774; x=1698962574; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BQfvT8y1gch6L7r+cd34RGIc+yfvci8UCEz/1CgAlZs=; b=WOVbvVk2PczdxkZpmrH3J73c21neRGzHLwWu35GU7oYdns8w3gByVlRez/SjI1lpKF BlAuzRZ4emRga0j1wmtUKMuwLIRSbBvYqcy6DpqlMMYwM/hNaNz3H1XbS21+9YF1SNYF 2jdpvNngxUv0+qy9qnWf3+GHiM+ia5g/XIHYjClVBdCO4Bw60gfJLaf1c1lf1M3PM2oZ EQFxYEpWB9LSP0CQ3tKjZ3lfKst4Aoj3iI3Gng64Iaf13wfxFA2urmWLPQZOa/kMfqTF LsBKDq/sm6aoQcq0F0sVRHBTKX0nFqaA6go5A56eHC78hxi0QAeqgxXJ0uznhyynXKoA uSXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698357774; x=1698962574; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BQfvT8y1gch6L7r+cd34RGIc+yfvci8UCEz/1CgAlZs=; b=DqJZaS4JIQYY6Z2NwcdAhB4Gnma2/wyD72Ri429SVqIkyKdLETt5q9EzvZsoThChRT nTvZIdGXTpCGbu7UQJtwg0FaYcwXuiONR28hNBWXKMEtutnNFeeNUCD+v0Mnnv367CiX ZXMGgGs1KpJAlLO4xwtEX1dFycdy07A1EEHDMLtOecfT5zzZLPw0WXBED1OKC54l/kUr 3NRyE+EW72KJ3XdfmNam4AGCLHdrapEc5/P5MGmfT/ZrmTzfkLE6W5+rBM3TVLp99nMQ sULWBk7k8MObgW3NwQTr7IZg0zhjoxzMzG8caATT4yW2L8a73RkOA2oJ+zQLh3sD//xL VJUg== X-Gm-Message-State: AOJu0Yz8sFkIdhxZgrfUyEeEuMqSNmQWJ1/lM2gQawNha07oCplkVzQA S/kDzMSq9ludF226+lail4E62yPPmIl3ng== X-Received: by 2002:ac2:5f76:0:b0:507:a66f:55e2 with SMTP id c22-20020ac25f76000000b00507a66f55e2mr482508lfc.10.1698357773694; Thu, 26 Oct 2023 15:02:53 -0700 (PDT) Received: from skbuf ([188.26.57.160]) by smtp.gmail.com with ESMTPSA id q26-20020adfb19a000000b0031f82743e25sm324618wra.67.2023.10.26.15.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 15:02:52 -0700 (PDT) Date: Fri, 27 Oct 2023 01:02:48 +0300 From: Vladimir Oltean To: Justin Stitt 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 , Alvin =?utf-8?Q?=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 Subject: Re: [PATCH next v2 1/3] ethtool: Implement ethtool_puts() Message-ID: <20231026220248.blgf7kgt5fkkbg7f@skbuf> References: <20231026-ethtool_puts_impl-v2-0-0d67cbdd0538@google.com> <20231026-ethtool_puts_impl-v2-1-0d67cbdd0538@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231026-ethtool_puts_impl-v2-1-0d67cbdd0538@google.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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:03:09 -0700 (PDT) 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 *fmt, ...); > > +/** > + * 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 = SPEED_##value, \ > - .cap_arr = prefix##_##value, \ > - .arr_size = ARRAY_SIZE(prefix##_##value), \ > -} > +#define ETHTOOL_FORCED_SPEED_MAP(prefix, value) \ > + { \ > + .speed = SPEED_##value, .cap_arr = prefix##_##value, \ > + .arr_size = 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. Please wait for at least 24 hours to pass before posting a new version, to allow for more comments to come in.