mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: add MISRA-compliant string ops
Add nvgpu_memcpy/nvgpu_memcmp which are MISRA-compliant versions (Rule 21.15) of memcpy/memcmp. Also convert some clk/gr calls over to use the new routines; all of the remaining calls will be converted in subsequent patches. JIRA NVGPU-849 Change-Id: Ib3a602cd08886764ba9a50285462a8b07bfb18ba Signed-off-by: Scott Long <scottl@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1919470 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
f96d229e70
commit
c08b987db3
29
drivers/gpu/nvgpu/common/string.c
Normal file
29
drivers/gpu/nvgpu/common/string.c
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* 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 <nvgpu/string.h>
|
||||
|
||||
void
|
||||
nvgpu_memcpy(u8 *destb, const u8 *srcb, size_t n)
|
||||
{
|
||||
(void) memcpy(destb, srcb, n);
|
||||
}
|
||||
|
||||
int
|
||||
nvgpu_memcmp(const u8 *b1, const u8 *b2, size_t n)
|
||||
{
|
||||
return memcmp(b1, b2, n);
|
||||
}
|
||||
Reference in New Issue
Block a user