Skip to contentSkip to conversation

Staging: media: atomisp: style corrections

PATCH In review Thomas Andreatta 2 participants 4 messages Apr 26, 2025 – Apr 27, 2025

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Staging: media: atomisp: style corrections

Corrected consistent spacing around '*' and braces positions

---
 drivers/staging/media/atomisp/pci/sh_css.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/staging/media/atomisp/pci/sh_css.c +4 -6
index 5a8e8e67aa13..77c7245091bb 100644
@@ -333,9 +333,9 @@ static struct sh_css_hmm_buffer_record
 				   enum ia_css_buffer_type type);
 
 static unsigned int get_crop_lines_for_bayer_order(const struct
-	ia_css_stream_config *config);
+	ia_css_stream_config * config);
 static unsigned int get_crop_columns_for_bayer_order(const struct
-	ia_css_stream_config *config);
+	ia_css_stream_config * config);
 static void get_pipe_extra_pixel(struct ia_css_pipe *pipe,
 				 unsigned int *extra_row, unsigned int *extra_column);
 
@@ -2260,8 +2260,7 @@ alloc_continuous_frames(struct ia_css_pipe *pipe, bool init_time)
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "alloc_continuous_frames() IA_CSS_FRAME_FORMAT_RAW_PACKED\n");
 		ref_info.format = IA_CSS_FRAME_FORMAT_RAW_PACKED;
-	} else
-	{
+	} else {
 		ia_css_debug_dtrace(IA_CSS_DEBUG_TRACE_PRIVATE,
 				    "alloc_continuous_frames() IA_CSS_FRAME_FORMAT_RAW\n");
 		ref_info.format = IA_CSS_FRAME_FORMAT_RAW;
@@ -7889,8 +7888,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config,
 
 	/* check if mipi size specified */
 	if (stream_config->mode == IA_CSS_INPUT_MODE_BUFFERED_SENSOR)
-		if (!IS_ISP2401 || !stream_config->online)
-		{
+		if (!IS_ISP2401 || !stream_config->online) {
 			unsigned int port = (unsigned int)stream_config->source.port.port;
 
 			if (port >= N_MIPI_PORT_ID) {
Signature · 1 line
2.34.1
#1 lore raw
Quoted 2 lines · Thomas Andreatta

Corrected consistent spacing around '*' and braces positions

Missed period.
And what is the correct spacing and why?

...

drivers/staging/media/atomisp/pci/sh_css.c static struct sh_css_hmm_buffer_record · line 338

Quoted 6 lines

static unsigned int get_crop_lines_for_bayer_order(const struct

drivers/staging/media/atomisp/pci/sh_css.c +2 -2
-       ia_css_stream_config *config);
+       ia_css_stream_config * config);
 static unsigned int get_crop_columns_for_bayer_order(const struct
-       ia_css_stream_config *config);
+       ia_css_stream_config * config);

No, this makes it the opposite. Please, read Coding Style if it sheds a light on this. In any case the kernel style is to avoid spacing between asterisk and name.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 7 lines · Andy Shevchenko
Quoted 2 lines · Thomas Andreatta

Corrected consistent spacing around '*' and braces positions

Missed period.
And what is the correct spacing and why?

I agree that the spacing looks weird and I questioned it too, but the script checkpatch.pl highlights as error:
sh_css.c:336: ERROR: need consistent spacing around '*' (ctx:WxV) sh_css.c:338: ERROR: need consistent spacing around '*' (ctx:WxV)

Should this be ignored because the script tries its best and it becomes common sense that the suggested spacing is "wrong"?

Quoted 10 lines

...

drivers/staging/media/atomisp/pci/sh_css.c static struct sh_css_hmm_buffer_record · line 338

Quoted 6 lines

static unsigned int get_crop_lines_for_bayer_order(const struct

drivers/staging/media/atomisp/pci/sh_css.c +2 -2
-       ia_css_stream_config *config);
+       ia_css_stream_config * config);
 static unsigned int get_crop_columns_for_bayer_order(const struct
-       ia_css_stream_config *config);
+       ia_css_stream_config * config);
Quoted 3 lines

No, this makes it the opposite. Please, read Coding Style if it sheds a light on this. In any case the kernel style is to avoid spacing between asterisk and name.

Understood. I'll resubmit with the correct spacing.

Thanks,
Thomas

#3 lore raw
Quoted 9 lines · Thomas Andreatta
Quoted 7 lines · Andy Shevchenko
Quoted 1 line · Thomas Andreatta

Corrected consistent spacing around '*' and braces positions

Missed period.
And what is the correct spacing and why?

Quoted 7 lines

I agree that the spacing looks weird and I questioned it too, but the script checkpatch.pl highlights as error:
sh_css.c:336: ERROR: need consistent spacing around '*' (ctx:WxV) sh_css.c:338: ERROR: need consistent spacing around '*' (ctx:WxV)

Should this be ignored because the script tries its best and it becomes common sense that the suggested spacing is "wrong"?

checkpatch sometimes gives false positives. Need to use common sense.

...

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

static unsigned int get_crop_lines_for_bayer_order(const struct

drivers/staging/media/atomisp/pci/sh_css.c +2 -2
-       ia_css_stream_config *config);
+       ia_css_stream_config * config);
 static unsigned int get_crop_columns_for_bayer_order(const struct
-       ia_css_stream_config *config);
+       ia_css_stream_config * config);
Quoted 5 lines
Quoted 3 lines

No, this makes it the opposite. Please, read Coding Style if it sheds a light on this. In any case the kernel style is to avoid spacing between asterisk and name.

Understood. I'll resubmit with the correct spacing.

Looking again at the above I think the best formatting should be like this:

static unsigned int
get_crop_columns_for_bayer_order(const struct ia_css_stream_config *config);

But looking even closer it seems that these are forward declarations for the internal functions. The question here is can we rearrange the functions that we can remove these forward declarations completely?

Signature · 2 lines
With Best Regards,
Andy Shevchenko