From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77AA5C2E9 for ; Wed, 19 Jul 2023 08:48:05 +0000 (UTC) Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B17E136 for ; Wed, 19 Jul 2023 01:48:02 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-231-2FrdlNlEO-aRlwCr8sDXcg-1; Wed, 19 Jul 2023 09:47:59 +0100 X-MC-Unique: 2FrdlNlEO-aRlwCr8sDXcg-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 19 Jul 2023 09:47:57 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Wed, 19 Jul 2023 09:47:57 +0100 From: David Laight To: 'Andrew Lunn' , Jakub Kicinski CC: Kees Cook , "justinstitt@google.com" , Florian Fainelli , "Vladimir Oltean" , "David S. Miller" , "Eric Dumazet" , Paolo Abeni , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Kees Cook , Nick Desaulniers Subject: RE: [PATCH] net: dsa: remove deprecated strncpy Thread-Topic: [PATCH] net: dsa: remove deprecated strncpy Thread-Index: AQHZua5uBGaLyFdvXEuDn4GOsjwmUK/Ax0MA Date: Wed, 19 Jul 2023 08:47:57 +0000 Message-ID: <02afcfd1dc4d4c258c2c5ffbda2688c8@AcuMS.aculab.com> References: <20230718-net-dsa-strncpy-v1-1-e84664747713@google.com> <316E4325-6845-4EFC-AAF8-160622C42144@kernel.org> <20230718121116.72267fff@kernel.org> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,PDS_BAD_THREAD_QP_64, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net From: Andrew Lunn > Sent: 18 July 2023 20:31 ... > Maybe we should actually add another helper: >=20 > ethtool_name_cpy(u8 **data, unsigned int index, const char *name); >=20 > Then over the next decade, slowly convert all drivers to it. And then > eventually replace the u8 with a struct including the length. Define the structure with the length from the start. Add a wrapper that allows the length to be absent. (Either ignoring the length or using 0/infinity to mean no length.) Then you don't need to visit everywhere twice - just some places. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)