Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp438049rdg; Tue, 10 Oct 2023 15:14:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGl07FTfdvPdKtYwsnEGKHBuKvsqvoFj31MlbWmz5KFqQ+kPEWW6M/QoOzeBVGP9q45infL X-Received: by 2002:a17:90b:24b:b0:274:4b04:392f with SMTP id fz11-20020a17090b024b00b002744b04392fmr15550910pjb.24.1696976052779; Tue, 10 Oct 2023 15:14:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696976052; cv=none; d=google.com; s=arc-20160816; b=aOIy/sVdlLlIOYtGdxBYPiMQU0EXRiEo94oIszgCxQX0oadKNttOBVjdvNgKU00x90 C1USD8md2TXqorFB/XWykhNyd2Htx2z1L6Q07OGoZDu1vJn4L25b0i/wVM/hklB4RNLA feD/UISPIUUmN2fJIaPKahW8indr79f+3Fed956gigKtMHaas/UGrzsISMwBPeLkknNO 28ecHXegfElkRKZ602AcpOhLz0qPE8Fi4MnqhMmIhldvVnUTTP9PdJYFtcQjBhcbt1iu MctVQ7ZKM4umyxStF4bLX+vdRlPvRWvhD61mFmH/m618007C3bczx/tgbRv55tLOVNI5 hB0Q== 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=hPW6yvv0EUrkLCJYPx2iwf8Z7uT45wdZr5DJERiSkTk=; fh=CRsDVyBDiJsCkJDPTKSlD3QTcHUA403BY5Rbgr8qUcU=; b=Ui/DvDuje0GS1nbVtighXbEWISQVX+JAmBO7oulphO45HC+oMmzqBC5ZqRVkJFCSZQ uFud+EyFgn83JnP13mfrCJUCPdqxoTwznzqqvcFVqB/axTa5awkUmz8XuI4GOu9UWasz O+3mFQiTeRwl1J2HHAIeRXQSQFlWJMfFpdsvBFhdRXqgaWbrz+brV8VA1rKJbLOZIH56 tK1Z+oFSrGoX3/jS0ZirTWhK9UopaXRRZYGj+6cw9quzv/xs+/Sx/OvB2lCsiRCmLK8N DPqNyQUWGtiBX+qjvIyQtqxPoKR0PFXb2sXvLA/7nWu5+n9fF8qdTXagIAeGQ/Z/sDyz mbDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Yxtcwh1g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id ds6-20020a17090b08c600b00276571c0d34si1700241pjb.6.2023.10.10.15.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 15:14:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Yxtcwh1g; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 4194C80BC3F0; Tue, 10 Oct 2023 15:14:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbjJJWOA (ORCPT + 99 others); Tue, 10 Oct 2023 18:14:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbjJJWN7 (ORCPT ); Tue, 10 Oct 2023 18:13:59 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3641E9D; Tue, 10 Oct 2023 15:13:58 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-99bdeae1d0aso1122855666b.1; Tue, 10 Oct 2023 15:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696976036; x=1697580836; 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=hPW6yvv0EUrkLCJYPx2iwf8Z7uT45wdZr5DJERiSkTk=; b=Yxtcwh1gTlb+F7BNCQmz59qA4N7ZUcp6X/DLMU8hIBmhF8RfMbch369E6WGgNkR/FZ 5SOHjhcJaRvJ8oJYBjDfrSupPmJCeIZ/RlcBJ8ciaF7jIEJe69V0TDipq1hc5MuAtVNS sdyi8cMbA0TuFD0H9OpCRwXD+t6b2RFYmNXkGfjGGQoHz6NXqvqQtxNyxgclyf1fJbQS IQK40zT/SrcFDk3SgeYHKBF70Nvh+oqt5V0yRlBifBIOmMUM+j/EwT2L1GcJwIa/PHOA kTsLYhjpQM25E4pq0DUEfGcSrjnCIlYofmTOX6e5gvJc60E6Jefz9qQPILtj/rHEFJPR Z6eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696976036; x=1697580836; 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=hPW6yvv0EUrkLCJYPx2iwf8Z7uT45wdZr5DJERiSkTk=; b=uL4XQ6RduqyNIRUExLH3W9cswADyVp4jI9T7we4SxvY09Qi9FxkmmLqkwdUQDwst03 MKOJnpF5UnA0B8ygaxcKzZtkA+knjMJdp1SSRj+CQuxeskdkoqDQOLtFvKuyBK3bg/PI XBXIF9+bc6W/FFYUPgMei9frSjRxOxEXal9JdU4N7Ijs7M+kg6Osh0wtHQdEO1Lx+0fU ayDfHUmf5zfh49SLqnZbwiyOV+dL2lkwG4vKgRBCVdXxhAQfo4ac4xK1eVT1cA4EftTJ ODwWPkH+k+f5QKKenaI0d2DSauKjXlHQnqQ2K09wTJGA1D1tf4PoUCJWHxSN44Usy3e+ HwQg== X-Gm-Message-State: AOJu0YxxjUHjFWbA1EXKhalT5SkXqL9NjB51fRYt8bOAXD+jRfCE+Qm5 b5ukpOraOYnnPmoaI07CE4s= X-Received: by 2002:a17:906:2215:b0:9ae:4536:728e with SMTP id s21-20020a170906221500b009ae4536728emr19362414ejs.72.1696976036576; Tue, 10 Oct 2023 15:13:56 -0700 (PDT) Received: from skbuf ([188.26.57.160]) by smtp.gmail.com with ESMTPSA id ci24-20020a170906c35800b009a2235ed496sm9100228ejb.141.2023.10.10.15.13.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 15:13:56 -0700 (PDT) Date: Wed, 11 Oct 2023 01:13:54 +0300 From: Vladimir Oltean To: Justin Stitt Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Linus Walleij Subject: Re: [PATCH] net: dsa: vsc73xx: replace deprecated strncpy with ethtool_sprintf Message-ID: <20231010221354.nk3fnypx64rvwr7e@skbuf> References: <20231009-strncpy-drivers-net-dsa-vitesse-vsc73xx-core-c-v1-1-e2427e087fad@google.com> <20231010112051.zgefbx2c3tjneudz@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_SBL_CSS, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Tue, 10 Oct 2023 15:14:10 -0700 (PDT) X-Spam-Level: ** On Tue, Oct 10, 2023 at 10:44:42AM -0700, Justin Stitt wrote: > Wow, thanks for the feedback here. I agree that the current > proposal is problematic. I wonder what you think about > using a ternary to avoid smelly code dupe: > > for (i = 0; i < 3; i++) { > cnt = vsc73xx_find_counter(vsc, indices[i], false); > ethtool_sprintf(&buf, "%s", cnt ? cnt->name : ""); > } Looks like that would address my comment, and it looks okay.