From d5392456851094b3e89aaaedf7da194afacc707c Mon Sep 17 00:00:00 2001 From: Vishnu Mandalapu Date: Mon, 16 Oct 2023 15:59:34 +0000 Subject: [PATCH] drivers: virt: hvc sysfs - Previously numbers are appended to the sysfs name to solve the duplicate name issue. Now this issue is fixed as name is changed by server owners. so remove the numbers from sysfs name. Jira HYP-15378 Change-Id: I3384583182520ccd53ea895d799c1e8debc07705 Signed-off-by: Vishnu Mandalapu Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2998182 Reviewed-by: Anil Varma Biruduraju Reviewed-by: Vipin Kumar GVS: Gerrit_Virtual_Submit Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3002432 Reviewed-by: Kiran Puttur --- drivers/virt/tegra/hvc_sysfs.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/drivers/virt/tegra/hvc_sysfs.c b/drivers/virt/tegra/hvc_sysfs.c index c5960d9f..39152c1e 100644 --- a/drivers/virt/tegra/hvc_sysfs.c +++ b/drivers/virt/tegra/hvc_sysfs.c @@ -1,6 +1,18 @@ -/* SPDX-License-Identifier: GPL-2.0-only */ /* - * Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved. + * SPDX-License-Identifier: GPL-2.0-only + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . */ #include @@ -160,11 +172,8 @@ static int __init hvc_sysfs_register(void) hyp_shared_memory_attrs[i].ipa = buffs[i].ipa; hyp_shared_memory_attrs[i].size = (size_t)buffs[i].size; - /* Suffix number to the process name, this solves the duplicate process - * name issue. - */ ret = snprintf(hyp_shared_memory_attrs[i].node_name, MAX_NAME_SIZE, - "%s_%u", buffs[i].name, i); + "%s", buffs[i].name); if (ret > 0U) { hyp_shared_memory_attrs[i].node_name[ret] = '\0';