Commit c606970d authored by Aditya Srivastava's avatar Aditya Srivastava Committed by Mauro Carvalho Chehab

media: atomisp: replace boolean comparison of values with bool variables

There are certain expressions in a condition in atomisp, where a boolean
variable is compared with true/false in forms such as (foo == true)
or (false != bar), which does not comply with the coding style rule by
checkpatch.pl (CHK: BOOL_COMPARISON), according to which the boolean
variables should be themselves used in the condition, rather than
comparing with true or false.

E.g. In drivers/staging/media/atomisp/pci/atomisp_compat_css20.c:

if (asd->stream_prepared == false) {

Can be replaced with:
if (!asd->stream_prepared) {

Replace such expressions with boolean variables appropriately.

Link: https://lore.kernel.org/linux-media/20201214132716.28157-1-yashsri421@gmail.comSigned-off-by: default avatarAditya Srivastava <yashsri421@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent ba11bbf3
...@@ -1142,7 +1142,7 @@ int atomisp_css_start(struct atomisp_sub_device *asd, ...@@ -1142,7 +1142,7 @@ int atomisp_css_start(struct atomisp_sub_device *asd,
* Thus the stream created in set_fmt get destroyed and need to be * Thus the stream created in set_fmt get destroyed and need to be
* recreated in the next stream on. * recreated in the next stream on.
*/ */
if (asd->stream_prepared == false) { if (!asd->stream_prepared) {
if (__create_pipes(asd)) { if (__create_pipes(asd)) {
dev_err(isp->dev, "create pipe error.\n"); dev_err(isp->dev, "create pipe error.\n");
return -EINVAL; return -EINVAL;
......
...@@ -179,12 +179,12 @@ ia_css_isys_error_t ia_css_isys_stream_create( ...@@ -179,12 +179,12 @@ ia_css_isys_error_t ia_css_isys_stream_create(
isys_stream->linked_isys_stream_id = isys_stream_descr->linked_isys_stream_id; isys_stream->linked_isys_stream_id = isys_stream_descr->linked_isys_stream_id;
rc = create_input_system_input_port(isys_stream_descr, rc = create_input_system_input_port(isys_stream_descr,
&isys_stream->input_port); &isys_stream->input_port);
if (rc == false) if (!rc)
return false; return false;
rc = create_input_system_channel(isys_stream_descr, false, rc = create_input_system_channel(isys_stream_descr, false,
&isys_stream->channel); &isys_stream->channel);
if (rc == false) { if (!rc) {
destroy_input_system_input_port(&isys_stream->input_port); destroy_input_system_input_port(&isys_stream->input_port);
return false; return false;
} }
...@@ -204,7 +204,7 @@ ia_css_isys_error_t ia_css_isys_stream_create( ...@@ -204,7 +204,7 @@ ia_css_isys_error_t ia_css_isys_stream_create(
if (isys_stream_descr->metadata.enable) { if (isys_stream_descr->metadata.enable) {
rc = create_input_system_channel(isys_stream_descr, true, rc = create_input_system_channel(isys_stream_descr, true,
&isys_stream->md_channel); &isys_stream->md_channel);
if (rc == false) { if (!rc) {
destroy_input_system_input_port(&isys_stream->input_port); destroy_input_system_input_port(&isys_stream->input_port);
destroy_input_system_channel(&isys_stream->channel); destroy_input_system_channel(&isys_stream->channel);
return false; return false;
...@@ -248,7 +248,7 @@ ia_css_isys_error_t ia_css_isys_stream_calculate_cfg( ...@@ -248,7 +248,7 @@ ia_css_isys_error_t ia_css_isys_stream_calculate_cfg(
isys_stream_descr, isys_stream_descr,
&isys_stream_cfg->channel_cfg, &isys_stream_cfg->channel_cfg,
false); false);
if (rc == false) if (!rc)
return false; return false;
/* configure metadata channel */ /* configure metadata channel */
...@@ -260,7 +260,7 @@ ia_css_isys_error_t ia_css_isys_stream_calculate_cfg( ...@@ -260,7 +260,7 @@ ia_css_isys_error_t ia_css_isys_stream_calculate_cfg(
isys_stream_descr, isys_stream_descr,
&isys_stream_cfg->md_channel_cfg, &isys_stream_cfg->md_channel_cfg,
true); true);
if (rc == false) if (!rc)
return false; return false;
} }
...@@ -269,7 +269,7 @@ ia_css_isys_error_t ia_css_isys_stream_calculate_cfg( ...@@ -269,7 +269,7 @@ ia_css_isys_error_t ia_css_isys_stream_calculate_cfg(
&isys_stream->input_port, &isys_stream->input_port,
isys_stream_descr, isys_stream_descr,
&isys_stream_cfg->input_port_cfg); &isys_stream_cfg->input_port_cfg);
if (rc == false) if (!rc)
return false; return false;
isys_stream->valid = 1; isys_stream->valid = 1;
......
...@@ -1063,7 +1063,7 @@ sh_css_config_input_network(struct ia_css_stream *stream) { ...@@ -1063,7 +1063,7 @@ sh_css_config_input_network(struct ia_css_stream *stream) {
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE, ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
"sh_css_config_input_network() enter 0x%p:\n", stream); "sh_css_config_input_network() enter 0x%p:\n", stream);
if (stream->config.continuous == true) if (stream->config.continuous)
{ {
if (stream->last_pipe->config.mode == IA_CSS_PIPE_MODE_CAPTURE) { if (stream->last_pipe->config.mode == IA_CSS_PIPE_MODE_CAPTURE) {
pipe = stream->last_pipe; pipe = stream->last_pipe;
...@@ -5626,7 +5626,7 @@ static int load_video_binaries(struct ia_css_pipe *pipe) ...@@ -5626,7 +5626,7 @@ static int load_video_binaries(struct ia_css_pipe *pipe)
} else { } else {
/* output from main binary is not yuv line. currently this is /* output from main binary is not yuv line. currently this is
* possible only when bci is enabled on vfpp output */ * possible only when bci is enabled on vfpp output */
assert(pipe->config.enable_vfpp_bci == true); assert(pipe->config.enable_vfpp_bci);
ia_css_pipe_get_yuvscaler_binarydesc(pipe, &vf_pp_descr, ia_css_pipe_get_yuvscaler_binarydesc(pipe, &vf_pp_descr,
&mycs->video_binary.vf_frame_info, &mycs->video_binary.vf_frame_info,
pipe_vf_out_info, NULL, NULL); pipe_vf_out_info, NULL, NULL);
...@@ -8072,7 +8072,7 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe) { ...@@ -8072,7 +8072,7 @@ create_host_regular_capture_pipeline(struct ia_css_pipe *pipe) {
struct ia_css_frame *tmp_out_frame = NULL; struct ia_css_frame *tmp_out_frame = NULL;
for (i = 0; i < num_yuv_scaler; i++) { for (i = 0; i < num_yuv_scaler; i++) {
if (is_output_stage[i] == true) if (is_output_stage[i])
tmp_out_frame = out_frame; tmp_out_frame = out_frame;
else else
tmp_out_frame = NULL; tmp_out_frame = NULL;
...@@ -8464,7 +8464,7 @@ sh_css_pipeline_add_acc_stage(struct ia_css_pipeline *pipeline, ...@@ -8464,7 +8464,7 @@ sh_css_pipeline_add_acc_stage(struct ia_css_pipeline *pipeline,
/* In QoS case, load_extension already called, so skipping */ /* In QoS case, load_extension already called, so skipping */
int err = 0; int err = 0;
if (fw->loaded == false) if (!fw->loaded)
err = acc_load_extension(fw); err = acc_load_extension(fw);
ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE, ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE,
...@@ -9701,8 +9701,8 @@ ia_css_stream_destroy(struct ia_css_stream *stream) { ...@@ -9701,8 +9701,8 @@ ia_css_stream_destroy(struct ia_css_stream *stream) {
assert(entry); assert(entry);
if (entry) { if (entry) {
/* get the SP thread id */ /* get the SP thread id */
if (ia_css_pipeline_get_sp_thread_id( if (!ia_css_pipeline_get_sp_thread_id(
ia_css_pipe_get_pipe_num(entry), &sp_thread_id) != true) ia_css_pipe_get_pipe_num(entry), &sp_thread_id))
return -EINVAL; return -EINVAL;
/* get the target input terminal */ /* get the target input terminal */
sp_pipeline_input_terminal = sp_pipeline_input_terminal =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment