From: Nikita Kobylkin <violet.develop@gmail.com>
To: hansg@kernel.org, mchehab@kernel.org
Cc: sakari.ailus@linux.intel.com, linux-media@vger.kernel.org,
Nikita Kobylkin <violet.develop@gmail.com>
Subject: [PATCH] input_formatter.c: cleanup code for readability
Date: Thu, 29 Jan 2026 19:49:33 +0800 [thread overview]
Message-ID: <20260129114933.10134-1-violet.develop@gmail.com> (raw)
Just small cleanup for easier reading:
- Remove unnecessary 'return;' in void functions.
- Adjust indentation and spacing.
No functional changes here.
Signed-off-by: Nikita Kobylkin <violet.develop@gmail.com>
---
.../host/input_formatter.c | 136 +++++++++---------
1 file changed, 64 insertions(+), 72 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c
index 40b3f1e48..de39b74dd 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_formatter.c
@@ -48,7 +48,7 @@ static const bool HIVE_IF_BIN_COPY[N_INPUT_FORMATTER_ID] = {
};
void input_formatter_rst(
- const input_formatter_ID_t ID)
+ const input_formatter_ID_t ID)
{
hrt_address addr;
hrt_data rst;
@@ -65,12 +65,10 @@ void input_formatter_rst(
if (!HIVE_IF_BIN_COPY[ID]) {
input_formatter_reg_store(ID, addr, rst);
}
-
- return;
}
unsigned int input_formatter_get_alignment(
- const input_formatter_ID_t ID)
+ const input_formatter_ID_t ID)
{
assert(ID < N_INPUT_FORMATTER_ID);
@@ -78,22 +76,21 @@ unsigned int input_formatter_get_alignment(
}
void input_formatter_set_fifo_blocking_mode(
- const input_formatter_ID_t ID,
- const bool enable)
+ const input_formatter_ID_t ID,
+ const bool enable)
{
assert(ID < N_INPUT_FORMATTER_ID);
/* cnd_input_formatter_reg_store() */
if (!HIVE_IF_BIN_COPY[ID]) {
input_formatter_reg_store(ID,
- HIVE_IF_BLOCK_FIFO_NO_REQ_ADDRESS, enable);
+ HIVE_IF_BLOCK_FIFO_NO_REQ_ADDRESS, enable);
}
- return;
}
void input_formatter_get_switch_state(
- const input_formatter_ID_t ID,
- input_formatter_switch_state_t *state)
+ const input_formatter_ID_t ID,
+ input_formatter_switch_state_t *state)
{
assert(ID < N_INPUT_FORMATTER_ID);
assert(state);
@@ -102,113 +99,109 @@ void input_formatter_get_switch_state(
(void)ID;
state->if_input_switch_lut_reg[0] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg0);
+ _REG_GP_IFMT_input_switch_lut_reg0);
state->if_input_switch_lut_reg[1] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg1);
+ _REG_GP_IFMT_input_switch_lut_reg1);
state->if_input_switch_lut_reg[2] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg2);
+ _REG_GP_IFMT_input_switch_lut_reg2);
state->if_input_switch_lut_reg[3] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg3);
+ _REG_GP_IFMT_input_switch_lut_reg3);
state->if_input_switch_lut_reg[4] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg4);
+ _REG_GP_IFMT_input_switch_lut_reg4);
state->if_input_switch_lut_reg[5] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg5);
+ _REG_GP_IFMT_input_switch_lut_reg5);
state->if_input_switch_lut_reg[6] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg6);
+ _REG_GP_IFMT_input_switch_lut_reg6);
state->if_input_switch_lut_reg[7] = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_lut_reg7);
+ _REG_GP_IFMT_input_switch_lut_reg7);
state->if_input_switch_fsync_lut = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_fsync_lut);
+ _REG_GP_IFMT_input_switch_fsync_lut);
state->if_input_switch_ch_id_fmt_type = gp_device_reg_load(GP_DEVICE0_ID,
- _REG_GP_IFMT_input_switch_ch_id_fmt_type);
-
- return;
+ _REG_GP_IFMT_input_switch_ch_id_fmt_type);
}
void input_formatter_get_state(
- const input_formatter_ID_t ID,
- input_formatter_state_t *state)
+ const input_formatter_ID_t ID,
+ input_formatter_state_t *state)
{
assert(ID < N_INPUT_FORMATTER_ID);
assert(state);
/*
- state->reset = input_formatter_reg_load(ID,
- HIVE_IF_RESET_ADDRESS);
+ * state->reset = input_formatter_reg_load(ID,
+ * HIVE_IF_RESET_ADDRESS);
*/
state->start_line = input_formatter_reg_load(ID,
- HIVE_IF_START_LINE_ADDRESS);
+ HIVE_IF_START_LINE_ADDRESS);
state->start_column = input_formatter_reg_load(ID,
- HIVE_IF_START_COLUMN_ADDRESS);
+ HIVE_IF_START_COLUMN_ADDRESS);
state->cropped_height = input_formatter_reg_load(ID,
- HIVE_IF_CROPPED_HEIGHT_ADDRESS);
+ HIVE_IF_CROPPED_HEIGHT_ADDRESS);
state->cropped_width = input_formatter_reg_load(ID,
- HIVE_IF_CROPPED_WIDTH_ADDRESS);
+ HIVE_IF_CROPPED_WIDTH_ADDRESS);
state->ver_decimation = input_formatter_reg_load(ID,
- HIVE_IF_VERTICAL_DECIMATION_ADDRESS);
+ HIVE_IF_VERTICAL_DECIMATION_ADDRESS);
state->hor_decimation = input_formatter_reg_load(ID,
- HIVE_IF_HORIZONTAL_DECIMATION_ADDRESS);
+ HIVE_IF_HORIZONTAL_DECIMATION_ADDRESS);
state->hor_deinterleaving = input_formatter_reg_load(ID,
- HIVE_IF_H_DEINTERLEAVING_ADDRESS);
+ HIVE_IF_H_DEINTERLEAVING_ADDRESS);
state->left_padding = input_formatter_reg_load(ID,
- HIVE_IF_LEFTPADDING_WIDTH_ADDRESS);
+ HIVE_IF_LEFTPADDING_WIDTH_ADDRESS);
state->eol_offset = input_formatter_reg_load(ID,
- HIVE_IF_END_OF_LINE_OFFSET_ADDRESS);
+ HIVE_IF_END_OF_LINE_OFFSET_ADDRESS);
state->vmem_start_address = input_formatter_reg_load(ID,
- HIVE_IF_VMEM_START_ADDRESS_ADDRESS);
+ HIVE_IF_VMEM_START_ADDRESS_ADDRESS);
state->vmem_end_address = input_formatter_reg_load(ID,
- HIVE_IF_VMEM_END_ADDRESS_ADDRESS);
+ HIVE_IF_VMEM_END_ADDRESS_ADDRESS);
state->vmem_increment = input_formatter_reg_load(ID,
- HIVE_IF_VMEM_INCREMENT_ADDRESS);
+ HIVE_IF_VMEM_INCREMENT_ADDRESS);
state->is_yuv420 = input_formatter_reg_load(ID,
- HIVE_IF_YUV_420_FORMAT_ADDRESS);
+ HIVE_IF_YUV_420_FORMAT_ADDRESS);
state->vsync_active_low = input_formatter_reg_load(ID,
- HIVE_IF_VSYNCK_ACTIVE_LOW_ADDRESS);
+ HIVE_IF_VSYNCK_ACTIVE_LOW_ADDRESS);
state->hsync_active_low = input_formatter_reg_load(ID,
- HIVE_IF_HSYNCK_ACTIVE_LOW_ADDRESS);
+ HIVE_IF_HSYNCK_ACTIVE_LOW_ADDRESS);
state->allow_fifo_overflow = input_formatter_reg_load(ID,
- HIVE_IF_ALLOW_FIFO_OVERFLOW_ADDRESS);
+ HIVE_IF_ALLOW_FIFO_OVERFLOW_ADDRESS);
state->block_fifo_when_no_req = input_formatter_reg_load(ID,
- HIVE_IF_BLOCK_FIFO_NO_REQ_ADDRESS);
+ HIVE_IF_BLOCK_FIFO_NO_REQ_ADDRESS);
state->ver_deinterleaving = input_formatter_reg_load(ID,
- HIVE_IF_V_DEINTERLEAVING_ADDRESS);
+ HIVE_IF_V_DEINTERLEAVING_ADDRESS);
/* FSM */
state->fsm_sync_status = input_formatter_reg_load(ID,
- HIVE_IF_FSM_SYNC_STATUS);
+ HIVE_IF_FSM_SYNC_STATUS);
state->fsm_sync_counter = input_formatter_reg_load(ID,
- HIVE_IF_FSM_SYNC_COUNTER);
+ HIVE_IF_FSM_SYNC_COUNTER);
state->fsm_crop_status = input_formatter_reg_load(ID,
- HIVE_IF_FSM_CROP_STATUS);
+ HIVE_IF_FSM_CROP_STATUS);
state->fsm_crop_line_counter = input_formatter_reg_load(ID,
- HIVE_IF_FSM_CROP_LINE_COUNTER);
+ HIVE_IF_FSM_CROP_LINE_COUNTER);
state->fsm_crop_pixel_counter = input_formatter_reg_load(ID,
- HIVE_IF_FSM_CROP_PIXEL_COUNTER);
+ HIVE_IF_FSM_CROP_PIXEL_COUNTER);
state->fsm_deinterleaving_index = input_formatter_reg_load(ID,
- HIVE_IF_FSM_DEINTERLEAVING_IDX);
+ HIVE_IF_FSM_DEINTERLEAVING_IDX);
state->fsm_dec_h_counter = input_formatter_reg_load(ID,
- HIVE_IF_FSM_DECIMATION_H_COUNTER);
+ HIVE_IF_FSM_DECIMATION_H_COUNTER);
state->fsm_dec_v_counter = input_formatter_reg_load(ID,
- HIVE_IF_FSM_DECIMATION_V_COUNTER);
+ HIVE_IF_FSM_DECIMATION_V_COUNTER);
state->fsm_dec_block_v_counter = input_formatter_reg_load(ID,
- HIVE_IF_FSM_DECIMATION_BLOCK_V_COUNTER);
+ HIVE_IF_FSM_DECIMATION_BLOCK_V_COUNTER);
state->fsm_padding_status = input_formatter_reg_load(ID,
- HIVE_IF_FSM_PADDING_STATUS);
+ HIVE_IF_FSM_PADDING_STATUS);
state->fsm_padding_elem_counter = input_formatter_reg_load(ID,
- HIVE_IF_FSM_PADDING_ELEMENT_COUNTER);
+ HIVE_IF_FSM_PADDING_ELEMENT_COUNTER);
state->fsm_vector_support_error = input_formatter_reg_load(ID,
- HIVE_IF_FSM_VECTOR_SUPPORT_ERROR);
+ HIVE_IF_FSM_VECTOR_SUPPORT_ERROR);
state->fsm_vector_buffer_full = input_formatter_reg_load(ID,
- HIVE_IF_FSM_VECTOR_SUPPORT_BUFF_FULL);
+ HIVE_IF_FSM_VECTOR_SUPPORT_BUFF_FULL);
state->vector_support = input_formatter_reg_load(ID,
- HIVE_IF_FSM_VECTOR_SUPPORT);
+ HIVE_IF_FSM_VECTOR_SUPPORT);
state->sensor_data_lost = input_formatter_reg_load(ID,
- HIVE_IF_FIFO_SENSOR_STATUS);
-
- return;
+ HIVE_IF_FIFO_SENSOR_STATUS);
}
void input_formatter_bin_get_state(
- const input_formatter_ID_t ID,
- input_formatter_bin_state_t *state)
+ const input_formatter_ID_t ID,
+ input_formatter_bin_state_t *state)
{
assert(ID < N_INPUT_FORMATTER_ID);
assert(state);
@@ -216,20 +209,19 @@ void input_formatter_bin_get_state(
state->reset = input_formatter_reg_load(ID,
HIVE_STR2MEM_SOFT_RESET_REG_ADDRESS);
state->input_endianness = input_formatter_reg_load(ID,
- HIVE_STR2MEM_INPUT_ENDIANNESS_REG_ADDRESS);
+ HIVE_STR2MEM_INPUT_ENDIANNESS_REG_ADDRESS);
state->output_endianness = input_formatter_reg_load(ID,
- HIVE_STR2MEM_OUTPUT_ENDIANNESS_REG_ADDRESS);
+ HIVE_STR2MEM_OUTPUT_ENDIANNESS_REG_ADDRESS);
state->bitswap = input_formatter_reg_load(ID,
- HIVE_STR2MEM_BIT_SWAPPING_REG_ADDRESS);
+ HIVE_STR2MEM_BIT_SWAPPING_REG_ADDRESS);
state->block_synch = input_formatter_reg_load(ID,
- HIVE_STR2MEM_BLOCK_SYNC_LEVEL_REG_ADDRESS);
+ HIVE_STR2MEM_BLOCK_SYNC_LEVEL_REG_ADDRESS);
state->packet_synch = input_formatter_reg_load(ID,
- HIVE_STR2MEM_PACKET_SYNC_LEVEL_REG_ADDRESS);
+ HIVE_STR2MEM_PACKET_SYNC_LEVEL_REG_ADDRESS);
state->readpostwrite_synch = input_formatter_reg_load(ID,
- HIVE_STR2MEM_READ_POST_WRITE_SYNC_ENABLE_REG_ADDRESS);
+ HIVE_STR2MEM_READ_POST_WRITE_SYNC_ENABLE_REG_ADDRESS);
state->is_2ppc = input_formatter_reg_load(ID,
- HIVE_STR2MEM_DUAL_BYTE_INPUTS_ENABLED_REG_ADDRESS);
+ HIVE_STR2MEM_DUAL_BYTE_INPUTS_ENABLED_REG_ADDRESS);
state->en_status_update = input_formatter_reg_load(ID,
- HIVE_STR2MEM_EN_STAT_UPDATE_ADDRESS);
- return;
+ HIVE_STR2MEM_EN_STAT_UPDATE_ADDRESS);
}
--
2.52.0
reply other threads:[~2026-01-29 11:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260129114933.10134-1-violet.develop@gmail.com \
--to=violet.develop@gmail.com \
--cc=hansg@kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox