media:atomisp:pci: Remove comparinson on bool tests
Subsystems (4)
PATCH 1/1 media:atomisp:pci: Remove comparinson on bool tests
Remove the comparison when a bool test to make
the code easy to read.
--- .../pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c +6 -6
@@ -331,7 +331,7 @@ static bool create_input_system_channel(break ; } -if (rc == false) +if (!rc)return false;if (!acquire_sid (me->stream2mmio_id, &(me->stream2mmio_sid_id))) {
@@ -474,7 +474,7 @@ static bool calculate_input_system_channel_cfg( rc =calculate_stream2mmio_cfg (isys_cfg, metadata, &(channel_cfg->stream2mmio_cfg)); -if (rc == false) +if (!rc)return false; rc = calculate_ibuf_ctrl_cfg(
@@ -482,7 +482,7 @@ static bool calculate_input_system_channel_cfg( input_port, isys_cfg, &(channel_cfg->ibuf_ctrl_cfg)); -if (rc == false) +if (!rc)return false;if (metadata) channel_cfg->ibuf_ctrl_cfg.stores_per_frame = isys_cfg->metadata.lines_per_frame;
@@ -491,7 +491,7 @@ static bool calculate_input_system_channel_cfg( channel, isys_cfg, &(channel_cfg->dma_cfg)); -if (rc == false) +if (!rc)return false; rc = calculate_isys2401_dma_port_cfg(
@@ -499,7 +499,7 @@ static bool calculate_input_system_channel_cfg( false, metadata, &(channel_cfg->dma_src_port_cfg)); -if (rc == false) +if (!rc)return false; rc = calculate_isys2401_dma_port_cfg(
@@ -507,7 +507,7 @@ static bool calculate_input_system_channel_cfg( isys_cfg->raw_packed, metadata, &(channel_cfg->dma_dest_port_cfg)); -if (rc == false) +if (!rc)return false;return true;
Signature · 1 line
2.7.4
Quoted 2 lines · Georgiana Rodica Chelu
Remove the comparison when a bool test to make
the code easy to read.
I wonder if this is really worth doing. I looked at some of the functions, and they don't seem like predicates. It seems that false means failure. It could be better to return 0 for success or error codes for failure.
I would suggest to do this slowly, ie one function at a time, to the extent possible, rather than trying to do the whole thing at once, which is likely to be error prone.
julia
Quoted 74 lines
Signed-off-by Georgiana Rodica Chelu <[email protected]>--- .../pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/isys/src/virtual_isys.c +6
-7@@ -331,7 +331,7 @@ static bool create_input_system_channel(break ; } -if (rc == false) +if (!rc)return false;if (!acquire_sid (me->stream2mmio_id, &(me->stream2mmio_sid_id))) {@@ -474,7 +474,7 @@ static bool calculate_input_system_channel_cfg( rc =calculate_stream2mmio_cfg (isys_cfg, metadata, &(channel_cfg->stream2mmio_cfg)); -if (rc == false) +if (!rc)return false; rc = calculate_ibuf_ctrl_cfg(@@ -482,7 +482,7 @@ static bool calculate_input_system_channel_cfg( input_port, isys_cfg, &(channel_cfg->ibuf_ctrl_cfg)); -if (rc == false) +if (!rc)return false;if (metadata) channel_cfg->ibuf_ctrl_cfg.stores_per_frame = isys_cfg->metadata.lines_per_frame;@@ -491,7 +491,7 @@ static bool calculate_input_system_channel_cfg( channel, isys_cfg, &(channel_cfg->dma_cfg)); -if (rc == false) +if (!rc)return false; rc = calculate_isys2401_dma_port_cfg(@@ -499,7 +499,7 @@ static bool calculate_input_system_channel_cfg( false, metadata, &(channel_cfg->dma_src_port_cfg)); -if (rc == false) +if (!rc)return false; rc = calculate_isys2401_dma_port_cfg(@@ -507,7 +507,7 @@ static bool calculate_input_system_channel_cfg( isys_cfg->raw_packed, metadata, &(channel_cfg->dma_dest_port_cfg)); -if (rc == false) +if (!rc)return false;return true; --2.7.4
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20170306191403.GA4848%40fireworks.
For more options, visit https://groups.google.com/d/optout.