mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: avoid hard coded constants
Replace the hard coded numeric constants in posix unit. Jira NVGPU-4954 Change-Id: I9f57e2d60b44c942924c47a7e38c237c732b13b0 Signed-off-by: ajesh <akv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2289633 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: Sagar Kamble <skamble@nvidia.com> Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved.
|
||||
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@@ -34,6 +34,7 @@
|
||||
unsigned long nvgpu_posix_ffs(unsigned long word)
|
||||
{
|
||||
int ret = 0;
|
||||
const int maxvalue = 64;
|
||||
|
||||
if ((word & (unsigned long) LONG_MAX) != 0UL) {
|
||||
ret = __builtin_ffsl(
|
||||
@@ -42,7 +43,7 @@ unsigned long nvgpu_posix_ffs(unsigned long word)
|
||||
} else {
|
||||
NVGPU_COV_WHITELIST(false_positive, NVGPU_MISRA(Rule, 14_3), "Bug 2615925")
|
||||
if (word > (unsigned long) LONG_MAX) {
|
||||
ret = (int) 64;
|
||||
ret = maxvalue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user