gpu: nvgpu: add nvgpu_bitmap_set and nvgpu_bitmap_clear

Introduce nvgpu_bitmap_set() and nvgpu_bitmap_clear() APIs to wrap the
bitmap_set() and bitmap_clear() APIs, respectively. The new nvgpu_*
versions accept unsigned length parameters since length is logically an
unsigned value where bitmap_set and bitmap_clear accept signed values.
We inherit bitmap_set and bitmap_clear from the OS, so we can't
directly change those.

Also, change uses of the old APIs to the new ones.

These changes resolve MISRA Rule 10.3 violations for implicit assignment
of objects of different essential or narrower type.

JIRA NVGPU-2953

Change-Id: I2c8f790049232a791f248b350c485bb07452315b
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2077624
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-03-20 13:47:47 -04:00
committed by mobile promotions
parent a67729dcfc
commit 257115e06c
6 changed files with 27 additions and 13 deletions

View File

@@ -67,9 +67,9 @@ static void setup_fifo(struct gk20a *g, unsigned long *tsg_map,
g->runlist_interleave = interleave;
/* set bits in active_tsgs correspond to indices in f->tsg[...] */
bitmap_set(runlist->active_tsgs, 0, num_tsgs);
nvgpu_bitmap_set(runlist->active_tsgs, 0, num_tsgs);
/* same; these are only used if a high enough tsg appears */
bitmap_set(runlist->active_channels, 0, num_channels);
nvgpu_bitmap_set(runlist->active_channels, 0, num_channels);
}