staging: media: atomisp: pci: Change line break to avoid an open parenthesis at the end of the line
Subsystems (4)
PATCH v2 1/1 staging: media: atomisp: pci: Change line break to avoid an open parenthesis at the end of the line
Change line break to avoid an open parenthesis at the end of the line. It consequently removed spaces at the start of the subsequent line. Both issues detected by checkpatch.pl.
---
Changes since v1:
- Keep the * with the function return type
instead of left it with the function name
drivers/staging/media/atomisp/pci/atomisp_cmd.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_cmd.h +5 -5
@@ -75,8 +75,8 @@ void atomisp_wdt(struct timer_list *t);void atomisp_setup_flash (struct atomisp_sub_device *asd);irqreturn_t atomisp_isr (int irq,void *dev);irqreturn_t atomisp_isr_thread (int irq,void *isp_ptr); -const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);bool atomisp_is_mbuscode_raw (uint32_t code);int atomisp_get_frame_pgnr (struct atomisp_device *isp,const struct ia_css_frame *frame,u32 *p_pgnr);
@@ -381,9 +381,9 @@ enum mipi_port_id __get_mipi_port(struct atomisp_device *isp,bool atomisp_is_vf_pipe (struct atomisp_video_pipe *pipe); -void atomisp_apply_css_parameters ( -struct atomisp_sub_device *asd, -struct atomisp_css_params *css_param); +void atomisp_apply_css_parameters (struct atomisp_sub_device *asd, +struct atomisp_css_params *css_param); +void atomisp_free_css_parameters (struct atomisp_css_params *css_param);void atomisp_handle_parameter_and_buffer (struct atomisp_video_pipe *pipe);
Signature · 1 line
2.7.4
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 79
Quoted 4 lines · Aline Santana Cordeiro
drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);
No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function and/or struct name that isn't so ridiculously long, but that would require some in-depth thinking.
drivers/staging/media/atomisp/pci/atomisp_cmd.h enum mipi_port_id __get_mipi_port(struct atomisp_device *isp, · line 386
Quoted 6 lines
drivers/staging/media/atomisp/pci/atomisp_cmd.h +3
-3-void atomisp_apply_css_parameters ( -struct atomisp_sub_device *asd, -struct atomisp_css_params *css_param); +void atomisp_apply_css_parameters (struct atomisp_sub_device *asd, +struct atomisp_css_params *css_param); +
Good.
Em qui, 2021-04-15 às 18:14 +0100, Matthew Wilcox escreveu:
Quoted 14 lines
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 79
Quoted 5 lines · Aline Santana Cordeiro
-const struct
atomisp_format_bridge
*get_atomisp_format_bridge_from_mbus(
- u32mbus_code);drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-0+const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
and/or struct name that isn't so ridiculously long, but that would require some in-depth thinking.
I left the type of function and its name with the parameters in different lines, following up some examples of other files, such as atomisp_acc.c.
But I didn't pay attention and left the pointer with the function name instead of left it with the type of the function in v1, so Hans suggested it to a v2, as I did.
What should I do in this case?
Thank you in advance,
Aline
Quoted 10 lines
Quoted 7 lines
drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-3-void atomisp_apply_css_parameters ( - struct atomisp_sub_device *asd, - struct atomisp_css_params *css_param); +void atomisp_apply_css_parameters (struct atomisp_sub_device *asd, + struct atomisp_css_params
*css_param);
+Good.
Sakari Ailus
reviewerQuoted 8 lines · Matthew Wilcox
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 79
Quoted 4 lines · Aline Santana Cordeiro
drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
Having the return type on the previous line is perfectly fine. There should be a space before the asterisk though.
Signature · 1 line
Sakari Ailus
Quoted 10 lines · Sakari Ailus
Quoted 8 lines · Matthew Wilcox
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 79
Quoted 4 lines · Aline Santana Cordeiro
drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
Quoted 2 lines
Having the return type on the previous line is perfectly fine. There should be a space before the asterisk though.
No, it's not. Linus has ranted about that before.
Quoted 11 lines · Matthew Wilcox
Quoted 10 lines · Sakari Ailus
Quoted 8 lines · Matthew Wilcox
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 79
Quoted 4 lines · Aline Santana Cordeiro
drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
Quoted 4 lines
Quoted 2 lines
Having the return type on the previous line is perfectly fine. There should be a space before the asterisk though.
No, it's not. Linus has ranted about that before.
Sakari Ailus
reviewerQuoted 12 lines · Matthew Wilcox
Quoted 11 lines · Matthew Wilcox
Quoted 10 lines · Sakari Ailus
Quoted 8 lines · Matthew Wilcox
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 79
Quoted 4 lines · Aline Santana Cordeiro
drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
Having the return type on the previous line is perfectly fine. There should be a space before the asterisk though.
No, it's not. Linus has ranted about that before.
Two decades ago, really?
This is simply one of the practical means how you split long function declarations and avoid overly long lines. Not my favourite though, but still better than those long lines.
My personal preference would be to wrap at the opening parenthesis and indent by just a tab, but I know many people who disagree with that...
Signature · 1 line
Sakari Ailus
Quoted 18 lines · Sakari Ailus
Quoted 17 lines · Matthew Wilcox
Quoted 15 lines · Matthew Wilcox
Quoted 10 lines · Sakari Ailus
Quoted 8 lines · Matthew Wilcox
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 79
Quoted 4 lines · Aline Santana Cordeiro
drivers/staging/media/atomisp/pci/atomisp_cmd.h +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge * +get_atomisp_format_bridge_from_mbus (u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
Quoted 2 lines
Having the return type on the previous line is perfectly fine. There should be a space before the asterisk though.
No, it's not. Linus has ranted about that before.
Quoted 7 lines
Quoted 1 line
Two decades ago, really?
This is simply one of the practical means how you split long function declarations and avoid overly long lines. Not my favourite though, but still better than those long lines.
I've always thought we allow either style, but it has to be done consistently within the file. I was pretty sure that was policy but it's another thing that goes back decades so I don't have a reference. It shouldn't be about breaking up long lines.
Quoted 3 lines
My personal preference would be to wrap at the opening parenthesis and indent by just a tab, but I know many people who disagree with that...
If you're running into the 80 character limit, then it's fine to use two tabs. I think we have been rejecting patches that push align the parameters but push past the 80 character limit. Using one tab is confusing because it makes the decalarations line up with the code.
regards,
dan carpenter
Sakari Ailus
reviewerHi Dan,
Quoted 33 lines · Dan Carpenter
Quoted 18 lines · Sakari Ailus
Quoted 17 lines · Matthew Wilcox
Quoted 15 lines · Matthew Wilcox
Quoted 10 lines · Sakari Ailus
Quoted 8 lines · Matthew Wilcox
Review
Quoted 4 lines · Aline Santana Cordeiro
(quoted diff) +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus( - u32 mbus_code); +const struct atomisp_format_bridge* +get_atomisp_format_bridge_from_mbus(u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
Quoted 2 lines
Having the return type on the previous line is perfectly fine. There should be a space before the asterisk though.
No, it's not. Linus has ranted about that before.
Quoted 7 lines
Quoted 1 line
Two decades ago, really?
This is simply one of the practical means how you split long function declarations and avoid overly long lines. Not my favourite though, but still better than those long lines.
I've always thought we allow either style, but it has to be done consistently within the file. I was pretty sure that was policy but it's another thing that goes back decades so I don't have a reference. It shouldn't be about breaking up long lines.
Quoted 1 line
Quoted 7 lines
Quoted 2 lines
My personal preference would be to wrap at the opening parenthesis and indent by just a tab, but I know many people who disagree with that...
If you're running into the 80 character limit, then it's fine to use two tabs. I think we have been rejecting patches that push align the parameters but push past the 80 character limit. Using one tab is confusing because it makes the decalarations line up with the code.
Interesting. Do you have an example of this? I've thought checkpatch.pl gave a warning if the line ended with an opening parenthesis no matter what.
Signature · 3 lines
Kind regards, Sakari Ailus
Quoted 8 lines
Quoted 4 lines
If you're running into the 80 character limit, then it's fine to use two tabs. I think we have been rejecting patches that push align the parameters but push past the 80 character limit. Using one tab is confusing because it makes the decalarations line up with the code.
Interesting. Do you have an example of this? I've thought checkpatch.pl gave a warning if the line ended with an opening parenthesis no matter what.
Checkpatch is a perl script that searches for patterns that often indicate code that is hard to understand. It is not a precise definition of what is allowed in the Linux kernel. Humans have to amke compromises.
julia
Sakari Ailus
reviewerQuoted 5 lines · Julia Lawall
Quoted 5 lines
Quoted 4 lines
If you're running into the 80 character limit, then it's fine to use two tabs. I think we have been rejecting patches that push align the parameters but push past the 80 character limit. Using one tab is confusing because it makes the decalarations line up with the code.
Quoted 7 lines
Quoted 3 lines
Interesting. Do you have an example of this? I've thought checkpatch.pl gave a warning if the line ended with an opening parenthesis no matter what.
Checkpatch is a perl script that searches for patterns that often indicate code that is hard to understand. It is not a precise definition of what is allowed in the Linux kernel. Humans have to amke compromises.
Yeah... but I'd think if this is a preferred style then the warning could be omitted. It might not be that difficult.
Signature · 1 line
Sakari Ailus
Quoted 10 lines · Sakari Ailus
Quoted 9 lines · Julia Lawall
Quoted 8 lines
Quoted 4 lines
If you're running into the 80 character limit, then it's fine to use two tabs. I think we have been rejecting patches that push align the parameters but push past the 80 character limit. Using one tab is confusing because it makes the decalarations line up with the code.
Interesting. Do you have an example of this? I've thought checkpatch.pl gave a warning if the line ended with an opening parenthesis no matter what.
Quoted 6 lines
Quoted 3 lines
Checkpatch is a perl script that searches for patterns that often indicate code that is hard to understand. It is not a precise definition of what is allowed in the Linux kernel. Humans have to amke compromises.
Yeah... but I'd think if this is a preferred style then the warning could be omitted. It might not be that difficult.
No idea. It involves looking at two successive lines, which may make it more complicated. Probably the biggest problem would be knowing whether the line being looked at represents a function header. Maybe that could be detected by the fact that there is normally no space at the beginning of the line?
julia
Quoted 39 lines · Sakari Ailus
Hi Dan,
Quoted 36 lines · Dan Carpenter
Quoted 18 lines · Sakari Ailus
Quoted 17 lines · Matthew Wilcox
Quoted 15 lines · Matthew Wilcox
Quoted 10 lines · Sakari Ailus
Quoted 8 lines · Matthew Wilcox
Review
Quoted 4 lines · Aline Santana Cordeiro
(quoted diff) +2
-2-const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus( - u32 mbus_code); +const struct atomisp_format_bridge* +get_atomisp_format_bridge_from_mbus(u32 mbus_code);No, this does not match coding style. Probably best to break the 80-column guideline in this instance. Best would be to have a function
Quoted 2 lines
Having the return type on the previous line is perfectly fine. There should be a space before the asterisk though.
No, it's not. Linus has ranted about that before.
Quoted 7 lines
Quoted 1 line
Two decades ago, really?
This is simply one of the practical means how you split long function declarations and avoid overly long lines. Not my favourite though, but still better than those long lines.
I've always thought we allow either style, but it has to be done consistently within the file. I was pretty sure that was policy but it's another thing that goes back decades so I don't have a reference. It shouldn't be about breaking up long lines.
Quoted 3 lines
My personal preference would be to wrap at the opening parenthesis and indent by just a tab, but I know many people who disagree with that...
Quoted 8 lines
Quoted 4 lines
If you're running into the 80 character limit, then it's fine to use two tabs. I think we have been rejecting patches that push align the parameters but push past the 80 character limit. Using one tab is confusing because it makes the decalarations line up with the code.
Interesting. Do you have an example of this? I've thought checkpatch.pl gave a warning if the line ended with an opening parenthesis no matter what.
The prefered style is still aligning with the parentheses but if you have to choose between a warning about going over the limit or a warning about aligning then probably it's fine to not align.
I can't find an example, but I'm pretty sure we've been rejecting patches that align the parameters but now go over the 80/100 char limit.
regards,
dan carpenter
Quoted 19 lines · Aline Santana Cordeiro
Change line break to avoid an open parenthesis at the end of the line. It consequently removed spaces at the start of the subsequent line. Both issues detected by checkpatch.pl.
Signed-off-by Aline Santana Cordeiro <[email protected]>---
Changes since v1:
- Keep the * with the function return type
instead of left it with the function namedrivers/staging/media/atomisp/pci/atomisp_cmd.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/staging/media/atomisp/pci/atomisp_cmd.h +0
-0
drivers/staging/media/atomisp/pci/atomisp_cmd.h void atomisp_wdt(struct timer_list *t); · line 78
Quoted 6 lines
drivers/staging/media/atomisp/pci/atomisp_cmd.h +1
-2@@ -75,8 +75,8 @@ void atomisp_wdt(struct timer_list *t);void atomisp_setup_flash (struct atomisp_sub_device *asd);irqreturn_t atomisp_isr (int irq,void *dev);irqreturn_t atomisp_isr_thread (int irq,void *isp_ptr); -const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus ( -u32 mbus_code); +const struct atomisp_format_bridge*
Keep the space before the *!
Regards,
Hans
Quoted 18 lines
drivers/staging/media/atomisp/pci/atomisp_cmd.h +4
-3+get_atomisp_format_bridge_from_mbus(u32 mbus_code);bool atomisp_is_mbuscode_raw (uint32_t code);int atomisp_get_frame_pgnr (struct atomisp_device *isp,const struct ia_css_frame *frame,u32 *p_pgnr);@@ -381,9 +381,9 @@ enum mipi_port_id __get_mipi_port(struct atomisp_device *isp,bool atomisp_is_vf_pipe (struct atomisp_video_pipe *pipe); -void atomisp_apply_css_parameters ( -struct atomisp_sub_device *asd, -struct atomisp_css_params *css_param); +void atomisp_apply_css_parameters (struct atomisp_sub_device *asd, +struct atomisp_css_params *css_param); +void atomisp_free_css_parameters (struct atomisp_css_params *css_param);void atomisp_handle_parameter_and_buffer (struct atomisp_video_pipe *pipe);