From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AD20342BCF; Mon, 5 Jun 2023 13:11:00 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9F71740ED6; Mon, 5 Jun 2023 13:11:00 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2116.outbound.protection.outlook.com [40.107.244.116]) by mails.dpdk.org (Postfix) with ESMTP id 2B9D94003C for ; Mon, 5 Jun 2023 13:10:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tet5b6tSsHNDsLzsMLk2VkyosP5lIWC6QpCpuptbZVl1zc7SeCIPRLrY6DB9aMSk+fuSaDfgvT7+l/j13R5jrMpCxkiO3q86ye/7XastwlGpUqkZviWhCcl5cz//RwzGhyz3jnLdmzmQrIwRGI22VQwRf7GGKiackFUsIjHrIEooupeFXIOaSYjPetDBBKrydL78pVnJWs6PoIqvweN9KyDq8RI8fQZZ2f0iKyg76iG7Wl+UEyWu3K1lxjST1pXPg2WviUC490Cm+rhDBRvZ8w5XHOtELJ8LcY9K7nDUzJqLqkjBsMtcI5lDwwcJcImpVj1NwA/8GRFVqxVloGCYFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sJ4XglObgUDqHaoJ1nFrZFPKeqGX8qtyrwWRPFB4XZQ=; b=Ij9V2ucxaj18Us2rAmIq1LrnrEfM1ppVvmXfOrq64rHMu0XRdfXikIKi3RKoiO0BLocuHX2WpVicy+gpkWrTstaet1GrcFE6PleLX1U+oAI5EF++eWynOPk5datV3Qnvu1PVKj7Tl5xTm7kmDNU1jgRyF1EuYbHE7Si9Zai+LpSh3scSBqEPoUIDSzJqmEUv3d/4JtLCmhf2FHVHDWlR1yXY8NL0KtWAEFtArCBqAUHowhgJrQn8HQ5laU7dGhE4oFwVmFlXA5CoVFYdqj2FeTUAqEDzBo5C6csVLuHZ6EAhLvN5ERcx+S5KIZKN5QhOgxE82X7vJm+19oUF5T2h6w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sJ4XglObgUDqHaoJ1nFrZFPKeqGX8qtyrwWRPFB4XZQ=; b=aOb/2vkbEl+4iFG/uUX1UVY91uhrbT3kQYMR3lbeVQzZDtiKSF8kqqWAmfDIqNo0daJpdGFeSAanw44X2sQZnaGwqE3WoYGuQnzQ0wovGfkq8i3dQ8R8hmIFFE93J+jQzhDErPLdkyzeSfAZQprbH4ikDuvJInZXVtvGwbXAt+Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from BY3PR13MB4804.namprd13.prod.outlook.com (2603:10b6:a03:355::13) by MW4PR13MB5433.namprd13.prod.outlook.com (2603:10b6:303:181::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6455.33; Mon, 5 Jun 2023 11:10:56 +0000 Received: from BY3PR13MB4804.namprd13.prod.outlook.com ([fe80::8306:6bb4:394e:c988]) by BY3PR13MB4804.namprd13.prod.outlook.com ([fe80::8306:6bb4:394e:c988%5]) with mapi id 15.20.6455.030; Mon, 5 Jun 2023 11:10:56 +0000 Date: Mon, 5 Jun 2023 13:10:45 +0200 From: Niklas =?utf-8?Q?S=C3=B6derlund?= To: Stephen Hemminger Cc: dev@dpdk.org, Chaoyong He Subject: Re: [PATCH 22/25] net/nfp: replace snprintf with strlcpy Message-ID: References: <20230601150106.18375-1-stephen@networkplumber.org> <20230601150106.18375-23-stephen@networkplumber.org> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230601150106.18375-23-stephen@networkplumber.org> X-ClientProxiedBy: MM0P280CA0062.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:8::16) To BY3PR13MB4804.namprd13.prod.outlook.com (2603:10b6:a03:355::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BY3PR13MB4804:EE_|MW4PR13MB5433:EE_ X-MS-Office365-Filtering-Correlation-Id: 97072993-8bbc-4c10-9475-08db65b58893 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ESo+zqPtWD1vSqrLmVya6T/RmJuJoKgNGQ3hh/4RxIi527Iyr1OGzKG1r6VEcl6uuQQNqyj4OMys+UPzCZCOZFAnt27ZJ1gRz5lRjllLHlcNjS32y2VG6f8LAj3V+pUu7Qvj5dfSRrUNeBBO6KXBixJ+fe7n8w2WGX69tIjehbPrFLsl8EI+WPYVGIg5KTQk+1HDmpDnclzWsp4i16sKTydbLs62ry4UhgtYNiK4GCBXHu7q+wBYZtdWV5c/Eya1AfODSQUiTHRXjTCPSI4rpLU96QX6YPUchxjXFI2TRh9QCsFoiJotMEpajArV4FNsGSLttSdjSEQEHi57gylH+i4Czzua93zbl835jat0/9UM+w7GjkJtTx5iZvEwPRUW5OKb7iUkXVQMRkdKrLCWVY/yIXf+gIgC5RRABA5DSXEN63PNtbFnYz8m047cmLnm6XMWTFrpHDv8SxrDuUrpiUIv5RSX7AlijXXd1Z7QwfASNWphVGdHabNYrWEd1Vnki+euraIoqcgAAmgcQM2lOdc9E3t6mM5OpM6l8ei04wdDFRBaF3dsSGTZ9M0asRa4IRHQnW5iAUBULrnoU5BidqMqHilht9LngvproSKzmW7HtN1aLCWh59HAK6+F37a1jxn0Hp6FyDzwP732+CIeng== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY3PR13MB4804.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(39840400004)(366004)(396003)(136003)(346002)(376002)(451199021)(52116002)(6666004)(6486002)(2906002)(66946007)(66556008)(66476007)(38100700002)(8936002)(5660300002)(86362001)(8676002)(41300700001)(38350700002)(6916009)(4326008)(316002)(478600001)(53546011)(26005)(6506007)(9686003)(6512007)(107886003)(186003)(83380400001)(156123004); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Njk1T3VTeVhOS08zMW1Ja3dPZEZHcnBhOS9ZTUh2enZ6V2xZVVhQcFUzTTZD?= =?utf-8?B?V3A1UEs0WXhBV0ZYSzg3Zml3dVJSOHV1OGpOZUs4a2NvVWY2Tk45RVRPS0dH?= =?utf-8?B?eXQ2THN4NU0wUmhxS2l3NUtZVC9IVkdZRnl6OUZKNWtUZjkybEwzWjVBL2lF?= =?utf-8?B?bHF1a0tlRVRKN0d5citXZ2NaK2t4ODlPbG9QbFd1N1UyYTFUYjl0QUJGeUQw?= =?utf-8?B?MmIyUk1XVzRXRDFoN2dCVXc1L3ArcWpFalA2T2l0UlcyYWNxZVNYd0Q0SGZ5?= =?utf-8?B?ZzY5U0tPRFVRb3BJQTdTbmkzZFFrcEhJSVZCRXJtTnM5TkZibXdZTlBycENZ?= =?utf-8?B?anZJQWVsNTNlOEljMU1QSGJKclFJOTRQZlpZTk11UHlBR0JHZ21VbGQxL3FM?= =?utf-8?B?TEIrbnlkcDJhdlVhZEUvdlZ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MHphbHJFZVoyaXkreS9OdlZmVEZiV1dvQnZwc0ozVUtyZE8wNTZS?= =?utf-8?B?NGN0S2I3QzJKNkpHQzZFZDZ0bStUQWRxak9IY1lWOUhvREVnN3lFV2xJUTdI?= =?utf-8?B?OGMvc01RaG1YMUl1MUpKVDBTb2dRSFJ4ZjhlMURvRklZZ1pycHJqSDNndHhu?= =?utf-8?B?SEJvMTFZTUN3MmpFM0RqRVB3b0tLMTZvWGFWQmlGR0luRTZJeU9aeWlhazlR?= =?utf-8?B?VCtkc2p3V0hLaHhiSksyZ3M5NGRtL25JVjZsM09TZE5zV3k1SVRSU3pqSDJ2?= =?utf-8?B?SWs3cU1TZzBIOWg0SHBhaHpjemtRaU5ORkFrTFRnMDlWQ0NhQjcwVEh2M2dN?= =?utf-8?B?elp6SFNsQjlhQWFKb1F1M1lVVURIclFMVUQzaFJuZVNRZVkrcDFadWgwSEpX?= =?utf-8?B?U1BLcUcvMlVBbzNISlpHQVhGVXdWZFhzVDBlRmdHRmRxbTZZekFaeGl6bmVm?= =?utf-8?B?ZlRCeWVqRk1aQUNFZGUzdjBTaVpOa0tYWTFuRUhIcytTbm9uU3ZYSVJtWWoz?= =?utf-8?B?bnRMMjluRG9jOUhJSnhUOVY3QnpqSlBPZFdMWVlTTmUwbnRkcVRPK0tETHlP?= =?utf-8?B?aXdaaW9hMFRTb3duVllRcWpsMEVIY3E4M3kySko2K212eFZSWFp1UHlWaVFr?= =?utf-8?B?U01PTjJPd05xejdTYjhPWUdkeHlSODVWcVZldVZ5ZmhIbC9FVDBTTEtYMitq?= =?utf-8?B?czFwQmlsU29NWURzNVREYUExZTIvYXhjY08renhDaU40TnBGMWovSktwcUV6?= =?utf-8?B?RDRJVlQ4MzZDVzFCUXpXU2pWejZFWGJmdU1XYklGZG84c1kwTkl5K0YxRWlj?= =?utf-8?B?REE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 97072993-8bbc-4c10-9475-08db65b58893 X-MS-Exchange-CrossTenant-AuthSource: BY3PR13MB4804.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2023 11:10:55.9132 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: QfPTKghnzPLse1/R9QrizM/F+cn4MCkJM1+3CvscrqixJJq4+V1St5iKcPllKuc/7+ed+SVPy8UXOGwdFiv4AmodQP9F5ZRKBzm7iZsLuSo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR13MB5433 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hi Stephen, Thanks for your work. On 2023-06-01 08:01:03 -0700, Stephen Hemminger wrote: > Suggested by devtools/cocci/strlcpy-with-header.cocci > > Signed-off-by: Stephen Hemminger Reviewed-by: Niklas Söderlund > --- > drivers/net/nfp/flower/nfp_flower_representor.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c > index 362c67f7b56d..09e0447d9268 100644 > --- a/drivers/net/nfp/flower/nfp_flower_representor.c > +++ b/drivers/net/nfp/flower/nfp_flower_representor.c > @@ -600,7 +600,7 @@ nfp_flower_pf_repr_init(struct rte_eth_dev *eth_dev, > repr->repr_type = init_repr_data->repr_type; > repr->app_fw_flower = init_repr_data->app_fw_flower; > > - snprintf(repr->name, sizeof(repr->name), "%s", init_repr_data->name); > + strlcpy(repr->name, init_repr_data->name, sizeof(repr->name)); > > eth_dev->dev_ops = &nfp_flower_pf_repr_dev_ops; > eth_dev->rx_pkt_burst = nfp_flower_pf_recv_pkts; > @@ -671,7 +671,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev, > repr->repr_type = init_repr_data->repr_type; > repr->app_fw_flower = init_repr_data->app_fw_flower; > > - snprintf(repr->name, sizeof(repr->name), "%s", init_repr_data->name); > + strlcpy(repr->name, init_repr_data->name, sizeof(repr->name)); > > eth_dev->dev_ops = &nfp_flower_repr_dev_ops; > eth_dev->rx_pkt_burst = nfp_flower_repr_rx_burst; > -- > 2.39.2 > -- Kind Regards, Niklas Söderlund