mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: acr: misra 12.1 fixes
MISRA Advisory Rule states that the precedence of operators within expressions should be made explicit. This change removes the Advisory Rule 12.1 violations from acr code. Jira NVGPU-3178 Change-Id: Ibfcb23dbf9931efd1890c9b548c36462c55ae47d Signed-off-by: Scott Long <scottl@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2277477 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
c96164ede4
commit
20114c7c8c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -50,8 +50,8 @@ bool nvgpu_acr_is_lsf_lazy_bootstrap(struct gk20a *g, struct nvgpu_acr *acr,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (falcon_id == FALCON_ID_FECS || falcon_id == FALCON_ID_PMU ||
|
if ((falcon_id == FALCON_ID_FECS) || (falcon_id == FALCON_ID_PMU) ||
|
||||||
falcon_id == FALCON_ID_GPCCS) {
|
(falcon_id == FALCON_ID_GPCCS)) {
|
||||||
return acr->lsf[falcon_id].is_lazy_bootstrap;
|
return acr->lsf[falcon_id].is_lazy_bootstrap;
|
||||||
} else {
|
} else {
|
||||||
nvgpu_err(g, "Invalid falcon id\n");
|
nvgpu_err(g, "Invalid falcon id\n");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -449,7 +449,7 @@ static int lsfm_discover_ucode_images(struct gk20a *g,
|
|||||||
*/
|
*/
|
||||||
for (i = 0U; i < FALCON_ID_END; i++) {
|
for (i = 0U; i < FALCON_ID_END; i++) {
|
||||||
if (nvgpu_test_bit(i, (void *)&acr->lsf_enable_mask) &&
|
if (nvgpu_test_bit(i, (void *)&acr->lsf_enable_mask) &&
|
||||||
acr->lsf[i].get_lsf_ucode_details != NULL) {
|
(acr->lsf[i].get_lsf_ucode_details != NULL)) {
|
||||||
|
|
||||||
(void) memset(&ucode_img, 0, sizeof(ucode_img));
|
(void) memset(&ucode_img, 0, sizeof(ucode_img));
|
||||||
err = acr->lsf[i].get_lsf_ucode_details(g,
|
err = acr->lsf[i].get_lsf_ucode_details(g,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
|
* Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
* copy of this software and associated documentation files (the "Software"),
|
||||||
@@ -132,7 +132,7 @@ static int acr_ucode_patch_sig(struct gk20a *g,
|
|||||||
|
|
||||||
/* Patching logic:*/
|
/* Patching logic:*/
|
||||||
sig_size = sig_size / 4U;
|
sig_size = sig_size / 4U;
|
||||||
for (i = 0U; i < sizeof(*p_patch_loc)>>2U; i++) {
|
for (i = 0U; i < (sizeof(*p_patch_loc)>>2U); i++) {
|
||||||
for (j = 0U; j < sig_size; j++) {
|
for (j = 0U; j < sig_size; j++) {
|
||||||
p_img[nvgpu_safe_add_u32((p_patch_loc[i]>>2U), j)] =
|
p_img[nvgpu_safe_add_u32((p_patch_loc[i]>>2U), j)] =
|
||||||
p_sig[nvgpu_safe_add_u32((p_patch_ind[i]<<2U), j)];
|
p_sig[nvgpu_safe_add_u32((p_patch_ind[i]<<2U), j)];
|
||||||
|
|||||||
Reference in New Issue
Block a user