From patchwork Thu Jul 21 14:19:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1659124 X-Patchwork-Delegate: monstr@monstr.eu Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=Id1QQv2t; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LpZTp4MkPz9s07 for ; Fri, 22 Jul 2022 00:20:14 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3FDC384052; Thu, 21 Jul 2022 16:20:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=amd.com header.i=@amd.com header.b="Id1QQv2t"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F40F484053; Thu, 21 Jul 2022 16:20:01 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2041.outbound.protection.outlook.com [40.107.236.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DE5FB80FA1 for ; Thu, 21 Jul 2022 16:19:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=michal.simek@amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M3ax00bHsOC6GnFxxeUz5y0zAmv3tW/gGVCwdGnXBpgRLhChzpuDQRI52oA6gp2M4RHN/DeaWEEyZjT2qDoDbVw83M6AD50PF0/H4TP8SkNT+2a05ZPLoaXMNAc8xv/inKAPV0eJU77TBuOobiJv9oztFA6zA5RG0f8QWHkujiH+72XJbBfGw3s1oTDaGT1c5OJCDIsccDbAqeorQM1YSIU9P+cCLyQSNhlHIT2SmxvPWf3tNgN13fWqhYbcsBUMyuS2pV8oBnJuRI2bowR6q09D89h7EYI3+n0a3jp6HZt6TLjevef/341ju4SexbLLBjNO5XZdJMN+7VUIJ/TH/g== 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=sdReth1GRkw7elRe0JgsnEZneFcJfY8F3JMSJ/eNe2c=; b=PIPExSENHQTZ8Ypj7BBC29sJdScNT0cnXeTFDEOuXtw1fBebFaSzD3Sj60BH/ldI1LRNkjVD1TbQ1kZC4dWWfseN2QHhBvJoa8nV5Ppzbiu1QKGwezj0jjdaQ3RhlYemg7GMOw1HPaYgHvkDtG13XCXdEQkabicXJAIcAIOj4nJ9mg7J1WbX0DsA9OXMSluwz6X65jWej7HQ6DI8fvobQ3m3be3BSta2a40GabWlNOekBHZliDTLfzsdcdH1B8eF0P99aGLseX9QqDsdHPmHVpkokx4mu2b5SHGmpPpUuVnLbSaYBlcVGXB6xeb1D9D+ICTQuFIJt9v03leFnV/prA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sdReth1GRkw7elRe0JgsnEZneFcJfY8F3JMSJ/eNe2c=; b=Id1QQv2tZdVeBZnEPHmSRI863f1f1wpm0gjAHVjiG64ClNpTzV7CNy3rFsEoPDsPmlFDnN+A/P14hDxqDY7plR50MCGhPLVQMELkZlyCnexVMrb2wvr5CXXF6aBhgTG5rlBtwd0OU3cW8GvmJu5/N/qM6R9yeDRb+WowC2wAeNo= Received: from BN8PR04CA0003.namprd04.prod.outlook.com (2603:10b6:408:70::16) by MN0PR12MB6197.namprd12.prod.outlook.com (2603:10b6:208:3c6::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Thu, 21 Jul 2022 14:19:56 +0000 Received: from BN8NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:408:70:cafe::fc) by BN8PR04CA0003.outlook.office365.com (2603:10b6:408:70::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.24 via Frontend Transport; Thu, 21 Jul 2022 14:19:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT051.mail.protection.outlook.com (10.13.177.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5458.17 via Frontend Transport; Thu, 21 Jul 2022 14:19:55 +0000 Received: from localhost (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Thu, 21 Jul 2022 09:19:52 -0500 From: Michal Simek To: , Subject: [PATCH 2/2] xilinx: common: Use strlcpy instead of strncpy Date: Thu, 21 Jul 2022 16:19:18 +0200 Message-ID: X-Mailer: git-send-email 2.36.1 In-Reply-To: <1dfa4b4220a508abc05351da2119880811b77612.1658413156.git.michal.simek@amd.com> References: <1dfa4b4220a508abc05351da2119880811b77612.1658413156.git.michal.simek@amd.com> MIME-Version: 1.0 X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d182f1ba-562c-485a-afaa-08da6b2415e3 X-MS-TrafficTypeDiagnostic: MN0PR12MB6197:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oF5vsTEGssXMxK04a0AnB60fi4K6xCGh+o8MAdsMHNUIenjREwxX9G0bV0kzcZZimeuls5AvEags+YeB2gKlMov/33PKnJGdMfObtq9nAGCgujDRr2N1d7EHscpGVh+TxJawlhp5SHPJ/2y/18306pL5qnEtUFoRkIwTyX/phEina3dIKS3ZL5C+vCMXbg8WMRktNkVrbfOcCh3ImjEr1deDLuiiZ+KCviKIty2B5rBO+9NxAOePfGR98DCFfY9C+WEfUp6LbMa16A6qPrwA+aSlLUIdanFQQ8ebDYPz+djFE8omH8B2C8BN6y3Hi6WDJlNveSlYA/3nAK75YZWPgBX4N9I8yOCN7YglJzUuuPCgotgxTxy0+S0DDEo8QdPSNQ1ZsQgJJM9Q1rHEajI7MuiH4B3KxoYuGpfXb1NcfBEm/utp4rExVXo22vMf/RHYsIJ3fV3sHBgzTiSggpPMInv1zAl88IFjZVEqtKdcxiJRQQheVzbI60i1tidcEwqeM3Ba9PsA/r701E8TVuKRrThVZMXMV0Lgu7gnUyLqWHUndyYiPukirXuVT1yeoL9EQSMJkmtGV/YEACLAlTaEcEfDrbl3DhiWgV8j8xCkVuRTPrQHz2TmSlqg+Elz6DqLVFoY1RKMH0k7p0nnpIsVU6EnQ7jkKriE4kovVdhCGg/XMm+pXjwCDKu4wUHiXH6ifNqXg3rgdawNDadYx5ZWd7WwOOVq29Q2bqe7niEFkJYQG/wn9QJy6z2FQvSBBBA4MIe5Uwfb9p9KpchQlWHqVCw+6YeymhafKpQOMWiHcdroQwwkvODb6DbPeDNdKd49Mdb1nnMLEVlz/l8psYJmikKF5L1oF71GFVxVJ43ZlIUEdtx5c65v2l0M1e8hB9lx X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(346002)(136003)(396003)(39860400002)(376002)(36840700001)(40470700004)(46966006)(82740400003)(70586007)(83380400001)(5660300002)(8936002)(44832011)(2906002)(86362001)(82310400005)(40460700003)(40480700001)(70206006)(316002)(8676002)(36756003)(6666004)(16526019)(426003)(186003)(336012)(41300700001)(478600001)(2616005)(81166007)(36860700001)(356005)(47076005)(110136005)(26005)(156123004)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2022 14:19:55.5646 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d182f1ba-562c-485a-afaa-08da6b2415e3 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6197 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean It is recommendation done by checkpatch to all the time have \0 terminated strings. Signed-off-by: Michal Simek --- board/xilinx/common/board.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c index b0c11aaa4256..9b4aded466ab 100644 --- a/board/xilinx/common/board.c +++ b/board/xilinx/common/board.c @@ -238,23 +238,23 @@ static int xilinx_read_eeprom_fru(struct udevice *dev, char *name, } /* It is clear that FRU was captured and structures were filled */ - strncpy(desc->manufacturer, (char *)fru_data.brd.manufacturer_name, + strlcpy(desc->manufacturer, (char *)fru_data.brd.manufacturer_name, sizeof(desc->manufacturer)); - strncpy(desc->uuid, (char *)fru_data.brd.uuid, + strlcpy(desc->uuid, (char *)fru_data.brd.uuid, sizeof(desc->uuid)); - strncpy(desc->name, (char *)fru_data.brd.product_name, + strlcpy(desc->name, (char *)fru_data.brd.product_name, sizeof(desc->name)); for (i = 0; i < sizeof(desc->name); i++) { if (desc->name[i] == ' ') desc->name[i] = '\0'; } - strncpy(desc->revision, (char *)fru_data.brd.rev, + strlcpy(desc->revision, (char *)fru_data.brd.rev, sizeof(desc->revision)); for (i = 0; i < sizeof(desc->revision); i++) { if (desc->revision[i] == ' ') desc->revision[i] = '\0'; } - strncpy(desc->serial, (char *)fru_data.brd.serial_number, + strlcpy(desc->serial, (char *)fru_data.brd.serial_number, sizeof(desc->serial)); while (id < EEPROM_HDR_NO_OF_MAC_ADDR) {