Commit c35abde3 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: atomisp: Avoid some {} just to define new vars

There are a couple of places where {} are used just to
define a new var. Just move the var to the top of the function
and get rid of that ugly blocks.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 0badc300
...@@ -3884,6 +3884,7 @@ preview_start(struct ia_css_pipe *pipe) ...@@ -3884,6 +3884,7 @@ preview_start(struct ia_css_pipe *pipe)
enum ia_css_input_mode preview_pipe_input_mode; enum ia_css_input_mode preview_pipe_input_mode;
const struct ia_css_coordinate *coord = NULL; const struct ia_css_coordinate *coord = NULL;
const struct ia_css_isp_parameters *params = NULL; const struct ia_css_isp_parameters *params = NULL;
unsigned int thread_id;
IA_CSS_ENTER_PRIVATE("pipe = %p", pipe); IA_CSS_ENTER_PRIVATE("pipe = %p", pipe);
if ((!pipe) || (!pipe->stream) || (pipe->mode != IA_CSS_PIPE_ID_PREVIEW)) { if ((!pipe) || (!pipe->stream) || (pipe->mode != IA_CSS_PIPE_ID_PREVIEW)) {
...@@ -3907,9 +3908,6 @@ preview_start(struct ia_css_pipe *pipe) ...@@ -3907,9 +3908,6 @@ preview_start(struct ia_css_pipe *pipe)
} }
send_raw_frames(pipe); send_raw_frames(pipe);
{
unsigned int thread_id;
ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id); ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id);
copy_ovrd = 1 << thread_id; copy_ovrd = 1 << thread_id;
...@@ -3918,7 +3916,6 @@ preview_start(struct ia_css_pipe *pipe) ...@@ -3918,7 +3916,6 @@ preview_start(struct ia_css_pipe *pipe)
&thread_id); &thread_id);
copy_ovrd |= 1 << thread_id; copy_ovrd |= 1 << thread_id;
} }
}
if (IS_ISP2401) { if (IS_ISP2401) {
coord = &pipe->config.internal_frame_origin_bqs_on_sctbl; coord = &pipe->config.internal_frame_origin_bqs_on_sctbl;
...@@ -5653,9 +5650,9 @@ static int video_start(struct ia_css_pipe *pipe) ...@@ -5653,9 +5650,9 @@ static int video_start(struct ia_css_pipe *pipe)
struct ia_css_pipe *copy_pipe, *capture_pipe; struct ia_css_pipe *copy_pipe, *capture_pipe;
enum sh_css_pipe_config_override copy_ovrd; enum sh_css_pipe_config_override copy_ovrd;
enum ia_css_input_mode video_pipe_input_mode; enum ia_css_input_mode video_pipe_input_mode;
const struct ia_css_coordinate *coord = NULL; const struct ia_css_coordinate *coord = NULL;
const struct ia_css_isp_parameters *params = NULL; const struct ia_css_isp_parameters *params = NULL;
unsigned int thread_id;
IA_CSS_ENTER_PRIVATE("pipe = %p", pipe); IA_CSS_ENTER_PRIVATE("pipe = %p", pipe);
if ((!pipe) || (pipe->mode != IA_CSS_PIPE_ID_VIDEO)) { if ((!pipe) || (pipe->mode != IA_CSS_PIPE_ID_VIDEO)) {
...@@ -5677,8 +5674,6 @@ static int video_start(struct ia_css_pipe *pipe) ...@@ -5677,8 +5674,6 @@ static int video_start(struct ia_css_pipe *pipe)
return err; return err;
send_raw_frames(pipe); send_raw_frames(pipe);
{
unsigned int thread_id;
ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id); ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id);
copy_ovrd = 1 << thread_id; copy_ovrd = 1 << thread_id;
...@@ -5688,7 +5683,6 @@ static int video_start(struct ia_css_pipe *pipe) ...@@ -5688,7 +5683,6 @@ static int video_start(struct ia_css_pipe *pipe)
&thread_id); &thread_id);
copy_ovrd |= 1 << thread_id; copy_ovrd |= 1 << thread_id;
} }
}
if (IS_ISP2401) { if (IS_ISP2401) {
coord = &pipe->config.internal_frame_origin_bqs_on_sctbl; coord = &pipe->config.internal_frame_origin_bqs_on_sctbl;
...@@ -7254,6 +7248,7 @@ static int yuvpp_start(struct ia_css_pipe *pipe) ...@@ -7254,6 +7248,7 @@ static int yuvpp_start(struct ia_css_pipe *pipe)
int err = 0; int err = 0;
enum sh_css_pipe_config_override copy_ovrd; enum sh_css_pipe_config_override copy_ovrd;
enum ia_css_input_mode yuvpp_pipe_input_mode; enum ia_css_input_mode yuvpp_pipe_input_mode;
unsigned int thread_id;
IA_CSS_ENTER_PRIVATE("pipe = %p", pipe); IA_CSS_ENTER_PRIVATE("pipe = %p", pipe);
if ((!pipe) || (pipe->mode != IA_CSS_PIPE_ID_YUVPP)) { if ((!pipe) || (pipe->mode != IA_CSS_PIPE_ID_YUVPP)) {
...@@ -7273,12 +7268,8 @@ static int yuvpp_start(struct ia_css_pipe *pipe) ...@@ -7273,12 +7268,8 @@ static int yuvpp_start(struct ia_css_pipe *pipe)
return err; return err;
} }
{
unsigned int thread_id;
ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id); ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id);
copy_ovrd = 1 << thread_id; copy_ovrd = 1 << thread_id;
}
start_pipe(pipe, copy_ovrd, yuvpp_pipe_input_mode); start_pipe(pipe, copy_ovrd, yuvpp_pipe_input_mode);
...@@ -8105,6 +8096,7 @@ create_host_capture_pipeline(struct ia_css_pipe *pipe) ...@@ -8105,6 +8096,7 @@ create_host_capture_pipeline(struct ia_css_pipe *pipe)
static int capture_start(struct ia_css_pipe *pipe) static int capture_start(struct ia_css_pipe *pipe)
{ {
struct ia_css_pipeline *me; struct ia_css_pipeline *me;
unsigned int thread_id;
int err = 0; int err = 0;
enum sh_css_pipe_config_override copy_ovrd; enum sh_css_pipe_config_override copy_ovrd;
...@@ -8145,12 +8137,9 @@ static int capture_start(struct ia_css_pipe *pipe) ...@@ -8145,12 +8137,9 @@ static int capture_start(struct ia_css_pipe *pipe)
#endif #endif
{
unsigned int thread_id;
ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id); ia_css_pipeline_get_sp_thread_id(ia_css_pipe_get_pipe_num(pipe), &thread_id);
copy_ovrd = 1 << thread_id; copy_ovrd = 1 << thread_id;
}
start_pipe(pipe, copy_ovrd, pipe->stream->config.mode); start_pipe(pipe, copy_ovrd, pipe->stream->config.mode);
#if !defined(ISP2401) #if !defined(ISP2401)
......
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