Files
linux-nvgpu/drivers/gpu
Nitin Kumbhar 51dc43de1e gpu: nvgpu: change return type of __hweight
Instead of using unsigned long for all __hweight variants
use unsigned int as it's sufficient to hold the result
without any data loss.

This also matches with return type used in other OS variants
like Linux and helps avoid CERT-C errors.

Error: CERT INT31-C:
drivers/gpu/nvgpu/common/gr/fs_state.c:76:
cert_violation: Casting "__hweight32(val)" from "unsigned long" to
 "unsigned int" without checking its value may result in lost or
 misinterpreted data.

JIRA NVGPU-3410

Change-Id: I7b9167ee21afd04b4ecc05faa838834e1047bf0d
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2119993
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-05-20 04:37:09 -07:00
..
2017-10-29 11:00:55 -07:00