mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 09:09:55 -04:00
drm/amd/display: Incorrect 'not' operator usage
Consolidating multiple CodeQL Fixes for alerts with rule id: cpp/incorrect-not-operator-usage Reviewed-by: Joshua Aberback <joshua.aberback@amd.com> Signed-off-by: Clay King <clayking@amd.com> Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -591,7 +591,7 @@ static bool dce_i2c_hw_engine_submit_payload(struct dce_i2c_hw *dce_i2c_hw,
|
||||
DCE_I2C_TRANSACTION_ACTION_I2C_WRITE;
|
||||
|
||||
|
||||
request.address = (uint8_t) ((payload->address << 1) | !payload->write);
|
||||
request.address = (uint8_t) ((payload->address << 1) | (payload->write ? 0 : 1));
|
||||
request.length = payload->length;
|
||||
request.data = payload->data;
|
||||
|
||||
|
||||
@@ -451,7 +451,7 @@ static bool dce_i2c_sw_engine_submit_payload(struct dce_i2c_sw *engine,
|
||||
DCE_I2C_TRANSACTION_ACTION_I2C_WRITE_MOT :
|
||||
DCE_I2C_TRANSACTION_ACTION_I2C_WRITE;
|
||||
|
||||
request.address = (uint8_t) ((payload->address << 1) | !payload->write);
|
||||
request.address = (uint8_t) ((payload->address << 1) | (payload->write ? 0 : 1));
|
||||
request.length = payload->length;
|
||||
request.data = payload->data;
|
||||
|
||||
|
||||
@@ -646,7 +646,7 @@ static void get_meta_and_pte_attr(struct display_mode_lib *mode_lib,
|
||||
|
||||
// the dpte_group_bytes is reduced for the specific case of vertical
|
||||
// access of a tile surface that has dpte request of 8x1 ptes.
|
||||
if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) //reduced, in this case, will have page fault within a group
|
||||
if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) //reduced, in this case, will have page fault within a group
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else
|
||||
//full size
|
||||
|
||||
@@ -646,7 +646,7 @@ static void get_meta_and_pte_attr(struct display_mode_lib *mode_lib,
|
||||
|
||||
// the dpte_group_bytes is reduced for the specific case of vertical
|
||||
// access of a tile surface that has dpte request of 8x1 ptes.
|
||||
if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) //reduced, in this case, will have page fault within a group
|
||||
if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) //reduced, in this case, will have page fault within a group
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else
|
||||
//full size
|
||||
|
||||
@@ -652,7 +652,7 @@ static void get_meta_and_pte_attr(
|
||||
if (hostvm_enable)
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else {
|
||||
if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) //reduced, in this case, will have page fault within a group
|
||||
if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) //reduced, in this case, will have page fault within a group
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else
|
||||
//full size
|
||||
|
||||
@@ -620,7 +620,7 @@ static void get_meta_and_pte_attr(struct display_mode_lib *mode_lib,
|
||||
if (hostvm_enable)
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else {
|
||||
if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) //reduced, in this case, will have page fault within a group
|
||||
if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) //reduced, in this case, will have page fault within a group
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else
|
||||
rq_sizing_param->dpte_group_bytes = 2048;
|
||||
|
||||
@@ -615,7 +615,7 @@ static void get_meta_and_pte_attr(
|
||||
if (hostvm_enable)
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else {
|
||||
if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) //reduced, in this case, will have page fault within a group
|
||||
if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) //reduced, in this case, will have page fault within a group
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else
|
||||
rq_sizing_param->dpte_group_bytes = 2048;
|
||||
|
||||
@@ -703,7 +703,7 @@ static void get_meta_and_pte_attr(
|
||||
if (hostvm_enable)
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else {
|
||||
if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) //reduced, in this case, will have page fault within a group
|
||||
if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) //reduced, in this case, will have page fault within a group
|
||||
rq_sizing_param->dpte_group_bytes = 512;
|
||||
else
|
||||
rq_sizing_param->dpte_group_bytes = 2048;
|
||||
|
||||
Reference in New Issue
Block a user