[PATCH 4/9] amdgpu/dal: Use the canonical form in branch predicates
Edward O'Callaghan
eocallaghan at alterapraxis.com
Sat Apr 30 14:06:24 UTC 2016
Found-By: Coccinelle
Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c | 8 ++++----
drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c | 2 +-
drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c | 2 +-
drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c | 2 +-
drivers/gpu/drm/amd/dal/dc/audio/dce112/hw_ctx_audio_dce112.c | 2 +-
drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c | 2 +-
drivers/gpu/drm/amd/dal/dc/basics/grph_object_id.c | 4 ++--
drivers/gpu/drm/amd/dal/dc/basics/register_logger.c | 4 ++--
drivers/gpu/drm/amd/dal/dc/bios/command_table.c | 6 +++---
drivers/gpu/drm/amd/dal/dc/core/dc_link.c | 4 ++--
drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c | 6 +++---
drivers/gpu/drm/amd/dal/dc/core/dc_stream.c | 2 +-
drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c | 2 +-
drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c | 2 +-
drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c | 6 +++---
drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c | 4 ++--
drivers/gpu/drm/amd/dal/include/logger_interface.h | 2 +-
17 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c
index f6d7920..46e5c38 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_irq.c
@@ -156,7 +156,7 @@ static struct list_head *remove_irq_handler(
DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
- if (handler_removed == false) {
+ if (!handler_removed) {
/* Not necessarily an error - caller may not
* know the context. */
return NULL;
@@ -225,7 +225,7 @@ static void remove_timer_handler(
DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
- if (handler_in != NULL && handler_removed == false) {
+ if (handler_in != NULL && !handler_removed) {
DRM_ERROR("DM_IRQ: handler: %p is not in the list!\n",
handler_in);
}
@@ -310,7 +310,7 @@ void *amdgpu_dm_irq_register_interrupt(
unsigned long irq_table_flags;
enum dc_irq_source irq_source;
- if (false == validate_irq_registration_params(int_params, ih))
+ if (!validate_irq_registration_params(int_params, ih))
return DAL_INVALID_IRQ_HANDLER_IDX;
handler_data = kzalloc(sizeof(*handler_data), GFP_KERNEL);
@@ -368,7 +368,7 @@ void amdgpu_dm_irq_unregister_interrupt(
struct dc_interrupt_params int_params;
int i;
- if (false == validate_irq_unregistration_params(irq_source, ih))
+ if (!validate_irq_unregistration_params(irq_source, ih))
return;
memset(&int_params, 0, sizeof(int_params));
diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
index 205d4a4..32b69d8 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
@@ -2665,7 +2665,7 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
}
- if (need_to_validate == false || set_count == 0 ||
+ if (!need_to_validate || set_count == 0 ||
dc_validate_resources(dc, set, set_count))
ret = 0;
diff --git a/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c b/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
index aeabfc6..e4720c9 100644
--- a/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
+++ b/drivers/gpu/drm/amd/dal/dc/asic_capability/asic_capability.c
@@ -136,7 +136,7 @@ static bool construct(
break;
}
- if (false == asic_supported) {
+ if (!asic_supported) {
dal_logger_write(ctx->logger,
LOG_MAJOR_ERROR,
LOG_MINOR_MASK_ALL,
diff --git a/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c b/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c
index d2769c7..4317d89 100644
--- a/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c
@@ -1514,7 +1514,7 @@ static void setup_channel_splitting_mapping(
value = audio_mapping->u32all;
- if (enable == false)
+ if (!enable)
/*0xFFFFFFFF;*/
value = MULTI_CHANNEL_SPLIT_NO_ASSO_INFO;
diff --git a/drivers/gpu/drm/amd/dal/dc/audio/dce112/hw_ctx_audio_dce112.c b/drivers/gpu/drm/amd/dal/dc/audio/dce112/hw_ctx_audio_dce112.c
index 95cb86f..03b31a9 100644
--- a/drivers/gpu/drm/amd/dal/dc/audio/dce112/hw_ctx_audio_dce112.c
+++ b/drivers/gpu/drm/amd/dal/dc/audio/dce112/hw_ctx_audio_dce112.c
@@ -1521,7 +1521,7 @@ static void setup_channel_splitting_mapping(
value = audio_mapping->u32all;
- if (enable == false)
+ if (!enable)
/*0xFFFFFFFF;*/
value = MULTI_CHANNEL_SPLIT_NO_ASSO_INFO;
diff --git a/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c b/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c
index 3b2fb52..f771a09 100644
--- a/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c
+++ b/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c
@@ -1448,7 +1448,7 @@ static void setup_channel_splitting_mapping(
value = audio_mapping->u32all;
- if (enable == false)
+ if (!enable)
/*0xFFFFFFFF;*/
value = MULTI_CHANNEL_SPLIT_NO_ASSO_INFO;
diff --git a/drivers/gpu/drm/amd/dal/dc/basics/grph_object_id.c b/drivers/gpu/drm/amd/dal/dc/basics/grph_object_id.c
index 9c80847..5f88528 100644
--- a/drivers/gpu/drm/amd/dal/dc/basics/grph_object_id.c
+++ b/drivers/gpu/drm/amd/dal/dc/basics/grph_object_id.c
@@ -53,13 +53,13 @@ bool dal_graphics_object_id_is_equal(
struct graphics_object_id id1,
struct graphics_object_id id2)
{
- if (false == dal_graphics_object_id_is_valid(id1)) {
+ if (!dal_graphics_object_id_is_valid(id1)) {
dm_output_to_console(
"%s: Warning: comparing invalid object 'id1'!\n", __func__);
return false;
}
- if (false == dal_graphics_object_id_is_valid(id2)) {
+ if (!dal_graphics_object_id_is_valid(id2)) {
dm_output_to_console(
"%s: Warning: comparing invalid object 'id2'!\n", __func__);
return false;
diff --git a/drivers/gpu/drm/amd/dal/dc/basics/register_logger.c b/drivers/gpu/drm/amd/dal/dc/basics/register_logger.c
index b8d57d9..362c1fc 100644
--- a/drivers/gpu/drm/amd/dal/dc/basics/register_logger.c
+++ b/drivers/gpu/drm/amd/dal/dc/basics/register_logger.c
@@ -183,10 +183,10 @@ void dal_reg_logger_rw_count_increment(void)
bool dal_reg_logger_should_dump_register(void)
{
- if (true == dal_reg_dump_stack_is_empty())
+ if (dal_reg_dump_stack_is_empty())
return false;
- if (false == is_reg_dump_process())
+ if (!is_reg_dump_process())
return false;
return true;
diff --git a/drivers/gpu/drm/amd/dal/dc/bios/command_table.c b/drivers/gpu/drm/amd/dal/dc/bios/command_table.c
index 22524b3..403f2fa 100644
--- a/drivers/gpu/drm/amd/dal/dc/bios/command_table.c
+++ b/drivers/gpu/drm/amd/dal/dc/bios/command_table.c
@@ -1341,7 +1341,7 @@ static enum bp_result enable_spread_spectrum_on_ppll_v1(
memset(¶ms, 0, sizeof(params));
- if ((enable == true) && (bp_params->percentage > 0))
+ if ((enable) && (bp_params->percentage > 0))
params.ucEnable = ATOM_ENABLE;
else
params.ucEnable = ATOM_DISABLE;
@@ -1392,7 +1392,7 @@ static enum bp_result enable_spread_spectrum_on_ppll_v2(
else
BREAK_TO_DEBUGGER(); /* Unexpected PLL value!! */
- if ((enable == true) && (bp_params->percentage > 0)) {
+ if ((enable) && (bp_params->percentage > 0)) {
params.ucEnable = ATOM_ENABLE;
params.usSpreadSpectrumPercentage =
@@ -1462,7 +1462,7 @@ static enum bp_result enable_spread_spectrum_on_ppll_v3(
return result;
}
- if (enable == true) {
+ if (enable) {
params.ucEnable = ATOM_ENABLE;
params.usSpreadSpectrumAmountFrac =
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
index 6d715c2..fd3adc7 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link.c
@@ -564,7 +564,7 @@ bool dc_link_detect(const struct dc_link *dc_link, bool boot)
if (link->public.connector_signal == SIGNAL_TYPE_VIRTUAL)
return false;
- if (false == detect_sink(link, &new_connection_type)) {
+ if (!detect_sink(link, &new_connection_type)) {
BREAK_TO_DEBUGGER();
return false;
}
@@ -1090,7 +1090,7 @@ struct core_link *link_create(const struct link_init_data *init_params)
if (NULL == link)
goto alloc_fail;
- if (false == construct(link, init_params))
+ if (!construct(link, init_params))
goto construct_fail;
return link;
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c
index c38e60e..3f9c1d2 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_link_ddc.c
@@ -522,7 +522,7 @@ static uint8_t aux_read_edid_block(
ddc->ddc_pin,
&cmd);
- if (false == result)
+ if (!result)
dal_logger_write(
ddc->ctx->logger,
LOG_MAJOR_ERROR,
@@ -822,7 +822,7 @@ void dal_ddc_service_i2c_query_dp_dual_mode_adaptor(
"DP-DVI passive dongle %dMhz: ",
DP_ADAPTOR_DVI_MAX_TMDS_CLK / 1000);
} else {
- if (is_valid_hdmi_signature == true) {
+ if (is_valid_hdmi_signature) {
*dongle = DISPLAY_DONGLE_DP_HDMI_DONGLE;
CONN_DATA_DETECT(ddc->link, type2_dongle_buf,
@@ -845,7 +845,7 @@ void dal_ddc_service_i2c_query_dp_dual_mode_adaptor(
}
} else {
- if (is_valid_hdmi_signature == true) {
+ if (is_valid_hdmi_signature) {
*dongle = DISPLAY_DONGLE_DP_HDMI_DONGLE;
CONN_DATA_DETECT(ddc->link, type2_dongle_buf,
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc_stream.c b/drivers/gpu/drm/amd/dal/dc/core/dc_stream.c
index b696401..d507120 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc_stream.c
@@ -161,7 +161,7 @@ struct dc_stream *dc_create_stream_for_sink(const struct dc_sink *dc_sink)
if (NULL == stream)
goto alloc_fail;
- if (false == construct(&stream->protected, dc_sink))
+ if (!construct(&stream->protected, dc_sink))
goto construct_fail;
dc_stream_retain(&stream->protected.public);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
index 265617d..866c8e5 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
@@ -1564,7 +1564,7 @@ static bool wait_for_reset_trigger_to_occur(
tg->funcs->wait_for_state(tg, CRTC_STATE_VBLANK);
}
- if (false == rc)
+ if (!rc)
DC_ERROR("GSL: Timeout on reset trigger!\n");
return rc;
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
index 4487638..e89c3fd 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_link_encoder.c
@@ -660,7 +660,7 @@ static void link_encoder_edp_wait_for_hpd_ready(
dal_adapter_service_release_irq(as, hpd);
- if (false == edp_hpd_high) {
+ if (!edp_hpd_high) {
dal_logger_write(ctx->logger,
LOG_MAJOR_ERROR,
LOG_MINOR_HW_TRACE_RESUME_S3,
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
index 07f7d12..bdec2c0 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
@@ -597,7 +597,7 @@ void dce110_transform_set_alpha(struct transform *xfm, bool enable)
value = dm_read_reg(ctx, addr);
- if (enable == 1)
+ if (enable)
set_reg_field_value(
value,
1,
@@ -798,7 +798,7 @@ bool dce110_transform_set_pixel_storage_depth(
break;
}
- if (ret == true) {
+ if (ret) {
set_denormalization(xfm110, color_depth);
ret = program_bit_depth_reduction(xfm110, color_depth,
bit_depth_params);
@@ -936,7 +936,7 @@ bool dce110_transform_v_set_pixel_storage_depth(
break;
}
- if (ret == true) {
+ if (ret) {
set_denormalization(xfm110, color_depth);
ret = program_bit_depth_reduction(xfm110, color_depth,
bit_depth_params);
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
index 1dc0dbc..9fae717 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_bit_depth.c
@@ -588,7 +588,7 @@ void dce80_transform_enable_alpha(
value = dm_read_reg(ctx, addr);
- if (enable == 1)
+ if (enable)
set_reg_field_value(
value,
1,
@@ -791,7 +791,7 @@ bool dce80_transform_set_pixel_storage_depth(
break;
}
- if (ret == true) {
+ if (ret) {
set_denormalization(xfm80, color_depth);
ret = program_bit_depth_reduction(xfm80, color_depth);
diff --git a/drivers/gpu/drm/amd/dal/include/logger_interface.h b/drivers/gpu/drm/amd/dal/include/logger_interface.h
index e4e6b3a..521c218 100644
--- a/drivers/gpu/drm/amd/dal/include/logger_interface.h
+++ b/drivers/gpu/drm/amd/dal/include/logger_interface.h
@@ -128,7 +128,7 @@ const struct log_minor_info *dal_logger_enum_log_minor_info(
{ \
static bool print_not_impl = true; \
\
- if (print_not_impl == true) { \
+ if (print_not_impl) { \
print_not_impl = false; \
dal_logger_write(ctx->logger, LOG_MAJOR_WARNING, \
log_minor, "DAL_NOT_IMPL: " fmt, ##__VA_ARGS__); \
--
2.5.5
More information about the dri-devel
mailing list