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 <vmandalapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2998182
Reviewed-by: Anil Varma Biruduraju <abiruduraju@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3002432
Reviewed-by: Kiran Puttur <kputtur@nvidia.com>
This commit is contained in:
Vishnu Mandalapu
2023-10-16 15:59:34 +00:00
committed by mobile promotions
parent 3a40a01b9e
commit d539245685

View File

@@ -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 <http://www.gnu.org/licenses/>.
*/
#include <linux/module.h>
@@ -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';