mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
gpu: nvgpu: modify the ffs and fls interface
Modify the ffs/fls interface function names to nvgpu_ffs and nvgpu_fls. The return bit values are numbered from 1 to 64. A return value of 0 indicates an input of 0 value. Jira NVGPU-3601 Change-Id: I1c151eeac1f94fe3b5b85bd5daf0488f75c5efa0 Signed-off-by: ajesh <akv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2146119 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Philip Elcan <pelcan@nvidia.com> Reviewed-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -57,7 +57,7 @@ static int test_ffs(struct unit_module *m, struct gk20a *g, void *args)
|
||||
{
|
||||
#define CHECK_FFS_WORD(w, answer) \
|
||||
do { \
|
||||
unsigned long ret = ffs(w); \
|
||||
unsigned long ret = nvgpu_ffs(w); \
|
||||
\
|
||||
if (ret != (answer)) \
|
||||
unit_return_fail(m, \
|
||||
@@ -86,9 +86,9 @@ static int test_ffs(struct unit_module *m, struct gk20a *g, void *args)
|
||||
* possible return values of the function.
|
||||
*/
|
||||
for (i = 0; i < BITS_PER_LONG; i++) {
|
||||
if (ffs(BIT(i)) != (i + 1))
|
||||
if (nvgpu_ffs(BIT(i)) != (i + 1))
|
||||
unit_return_fail(m, "ffs(1 << %lu) != %lu [%lu]!\n",
|
||||
i, i, ffs(BIT(i)));
|
||||
i, i, nvgpu_ffs(BIT(i)));
|
||||
}
|
||||
|
||||
return UNIT_SUCCESS;
|
||||
@@ -98,7 +98,7 @@ static int test_fls(struct unit_module *m, struct gk20a *g, void *args)
|
||||
{
|
||||
#define CHECK_FLS_WORD(w, answer) \
|
||||
do { \
|
||||
unsigned long ret = fls(w); \
|
||||
unsigned long ret = nvgpu_fls(w); \
|
||||
\
|
||||
if (ret != (answer)) \
|
||||
unit_return_fail(m, \
|
||||
@@ -123,9 +123,9 @@ static int test_fls(struct unit_module *m, struct gk20a *g, void *args)
|
||||
#undef CHECK_FLS_WORD
|
||||
|
||||
for (i = 0; i < BITS_PER_LONG; i++) {
|
||||
if (fls(BIT(i)) != (i+1))
|
||||
if (nvgpu_fls(BIT(i)) != (i+1))
|
||||
unit_return_fail(m, "fls(1 << %lu) != %lu! [%lu]\n",
|
||||
i, i, fls(BIT(i)));
|
||||
i, i, nvgpu_fls(BIT(i)));
|
||||
}
|
||||
|
||||
return UNIT_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user