Skip to contentSkip to conversation

Staging: media: atomisp: Fix style issues

PATCH In review Georgiana Chelu 2 participants 9 messages Sep 20, 2017

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

cover Staging: media: atomisp: Fix style issues

This patchset fix coding style issues found by checkpatch.pl.

Georgiana Chelu (4):
Staging: media: atomisp: Use unsigned int instead of unsigned
Staging: media: atomisp: Add blank line after declarations
Staging: media: atomisp: pci: Move open brace '{' on the next line
Staging: media: atomisp: pci: Place constant on the right side in
comparissons

 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/4 Staging: media: atomisp: Use unsigned int instead of unsigned

Fix the checkpatch.pl issue:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c +3 -3
index 05897b7..b7f22b7 100644
@@ -155,7 +155,7 @@ static void atomisp_css2_hw_store(hrt_address addr,
 				  const void *from, uint32_t n)
 {
 	unsigned long flags;
-	unsigned i;
+	unsigned int i;
 	unsigned int _to = (unsigned int)addr;
 	const char *_from = (const char *)from;
 
@@ -168,7 +168,7 @@ static void atomisp_css2_hw_store(hrt_address addr,
 static void atomisp_css2_hw_load(hrt_address addr, void *to, uint32_t n)
 {
 	unsigned long flags;
-	unsigned i;
+	unsigned int i;
 	char *_to = (char *)to;
 	unsigned int _from = (unsigned int)addr;
 
@@ -4659,7 +4659,7 @@ int atomisp_css_dump_sp_raw_copy_linecount(bool reduced)
 int atomisp_css_dump_blob_infor(void)
 {
 	struct ia_css_blob_descr *bd = sh_css_blob_info;
-	unsigned i, nm = sh_css_num_binaries;
+	unsigned int i, nm = sh_css_num_binaries;
 
 	if (nm == 0)
 		return -EPERM;
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/4 Staging: media: atomisp: Add blank line after declarations

In reply to Georgiana Chelu

This patch adds a blank line after declarations to improve code readability.

Issue find by checkpatch.pl script.
WARNING: Missing a blank line after declarations

---
 .../staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c  | 10 ++++++++++
 1 file changed, 10 insertions(+)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c +10 -0
index b7f22b7..5551934 100644
@@ -232,9 +232,11 @@ static void __dump_pipe_config(struct atomisp_sub_device *asd,
 			       unsigned int pipe_id)
 {
 	struct atomisp_device *isp = asd->isp;
+
 	if (stream_env->pipes[pipe_id]) {
 		struct ia_css_pipe_config *p_config;
 		struct ia_css_pipe_extra_config *pe_config;
+
 		p_config = &stream_env->pipe_configs[pipe_id];
 		pe_config = &stream_env->pipe_extra_configs[pipe_id];
 		dev_dbg(isp->dev, "dumping pipe[%d] config:\n", pipe_id);
@@ -507,6 +509,7 @@ static int __destroy_stream(struct atomisp_sub_device *asd,
 static int __destroy_streams(struct atomisp_sub_device *asd, bool force)
 {
 	int ret, i;
+
 	for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++) {
 		ret = __destroy_stream(asd, &asd->stream_env[i], force);
 		if (ret)
@@ -573,6 +576,7 @@ static int __destroy_stream_pipes(struct atomisp_sub_device *asd,
 	struct atomisp_device *isp = asd->isp;
 	int ret = 0;
 	int i;
+
 	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++) {
 		if (!stream_env->pipes[i] ||
 		    !(force || stream_env->update_pipe[i]))
@@ -1051,6 +1055,7 @@ int atomisp_css_irq_enable(struct atomisp_device *isp,
 void atomisp_css_init_struct(struct atomisp_sub_device *asd)
 {
 	int i, j;
+
 	for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++) {
 		asd->stream_env[i].stream = NULL;
 		for (j = 0; j < IA_CSS_PIPE_MODE_NUM; j++) {
@@ -1189,6 +1194,7 @@ int atomisp_css_start(struct atomisp_sub_device *asd,
 	struct atomisp_device *isp = asd->isp;
 	bool sp_is_started = false;
 	int ret = 0, i = 0;
+
 	if (in_reset) {
 		if (__destroy_streams(asd, true))
 			dev_warn(isp->dev, "destroy stream failed.\n");
@@ -1976,6 +1982,7 @@ void atomisp_css_enable_raw_binning(struct atomisp_sub_device *asd,
 void atomisp_css_enable_dz(struct atomisp_sub_device *asd, bool enable)
 {
 	int i;
+
 	for (i = 0; i < IA_CSS_PIPE_ID_NUM; i++)
 		asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL]
 			.pipe_configs[i].enable_dz = enable;
@@ -2002,6 +2009,7 @@ void atomisp_css_input_set_mode(struct atomisp_sub_device *asd,
 	int i;
 	struct atomisp_device *isp = asd->isp;
 	unsigned int size_mem_words;
+
 	for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++)
 		asd->stream_env[i].stream_config.mode = mode;
 
@@ -2275,6 +2283,7 @@ int atomisp_css_stop(struct atomisp_sub_device *asd,
 	if (!in_reset) {
 		struct atomisp_stream_env *stream_env;
 		int i, j;
+
 		for (i = 0; i < ATOMISP_INPUT_STREAM_NUM; i++) {
 			stream_env = &asd->stream_env[i];
 			for (j = 0; j < IA_CSS_PIPE_ID_NUM; j++) {
@@ -2801,6 +2810,7 @@ static void __configure_video_vf_output(struct atomisp_sub_device *asd,
 	struct atomisp_stream_env *stream_env =
 		&asd->stream_env[ATOMISP_INPUT_STREAM_GENERAL];
 	struct ia_css_frame_info *css_output_info;
+
 	stream_env->pipe_configs[pipe_id].mode =
 					__pipe_id_to_pipe_mode(asd, pipe_id);
 	stream_env->update_pipe[pipe_id] = true;
Signature · 1 line
2.7.4
#3 lore raw

PATCH 3/4 Staging: media: atomisp: pci: Move open brace '{' on the next line

In reply to Georgiana Chelu

Fix the following issue found by checkpatch.pl:
ERROR: open brace '{' following function definitions go on the next line

---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c +2 -1
index 5551934..520d59b 100644
@@ -4474,7 +4474,8 @@ int atomisp_css_load_acc_binary(struct atomisp_sub_device *asd,
 static struct atomisp_sub_device *__get_atomisp_subdev(
 					struct ia_css_pipe *css_pipe,
 					struct atomisp_device *isp,
-					enum atomisp_input_stream_id *stream_id) {
+					enum atomisp_input_stream_id *stream_id)
+{
 	int i, j, k;
 	struct atomisp_sub_device *asd;
 	struct atomisp_stream_env *stream_env;
Signature · 1 line
2.7.4
#4 lore raw

PATCH 4/4 Staging: media: atomisp: pci: Place constant on the right side in comparissons

In reply to Georgiana Chelu

Fix issue found by checkpatch.pl script.
WARNING: Comparisons should place the constant on the right side of the test

---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c +4 -4
index 520d59b..5027fd2 100644
@@ -896,12 +896,12 @@ static inline int __set_css_print_env(struct atomisp_device *isp, int opt)
 {
 	int ret = 0;
 
-	if (0 == opt)
+	if (opt == 0)
 		isp->css_env.isp_css_env.print_env.debug_print = NULL;
-	else if (1 == opt)
+	else if (opt == 1)
 		isp->css_env.isp_css_env.print_env.debug_print =
 			atomisp_css2_dbg_ftrace_print;
-	else if (2 == opt)
+	else if (opt == 2)
 		isp->css_env.isp_css_env.print_env.debug_print =
 			atomisp_css2_dbg_print;
 	else
@@ -4706,7 +4706,7 @@ int atomisp_set_css_dbgfunc(struct atomisp_device *isp, int opt)
 	int ret;
 
 	ret = __set_css_print_env(isp, opt);
-	if (0 == ret)
+	if (ret == 0)
 		dbg_func = opt;
 
 	return ret;
Signature · 1 line
2.7.4
#5 lore raw
In reply to Georgiana Chelu
Quoted 1 line · Georgiana Chelu

This patchset fix coding style issues found by checkpatch.pl.

Did you send these before? They look failiar, but they don't seem to have been applied either.

julia

Quoted 21 lines

Georgiana Chelu (4):
Staging: media: atomisp: Use unsigned int instead of unsigned
Staging: media: atomisp: Add blank line after declarations
Staging: media: atomisp: pci: Move open brace '{' on the next line
Staging: media: atomisp: pci: Place constant on the right side in
comparissons

 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

--
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/cover.1505909511.git.georgiana.chelu93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#6 lore raw
Quoted 10 lines · Julia Lawall
Quoted 1 line · Georgiana Chelu

This patchset fix coding style issues found by checkpatch.pl.

Did you send these before? They look failiar, but they don't seem to have been applied either.

julia

Yes, these changes were sent as a single patch.

Greg advised me to break it down because there
were too many different fixes for a single patch.
So, we agreed to resend it as a patch set.

Thank you,
Georgiana

Quoted 22 lines
Quoted 22 lines

Georgiana Chelu (4):
Staging: media: atomisp: Use unsigned int instead of unsigned
Staging: media: atomisp: Add blank line after declarations
Staging: media: atomisp: pci: Move open brace '{' on the next line
Staging: media: atomisp: pci: Place constant on the right side in
comparissons

 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

--
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/cover.1505909511.git.georgiana.chelu93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#7 lore raw
Quoted 10 lines · Georgiana Chelu
Quoted 9 lines · Julia Lawall
Quoted 1 line · Georgiana Chelu

This patchset fix coding style issues found by checkpatch.pl.

Did you send these before? They look failiar, but they don't seem to have been applied either.

Quoted 7 lines
Quoted 1 line

julia

Yes, these changes were sent as a single patch.

Greg advised me to break it down because there
were too many different fixes for a single patch.
So, we agreed to resend it as a patch set.

OK, it does look more digestible this way. Maybe it should have been a v2. But since Greg has already discarded the previous one, maybe it is OK.

julia

Quoted 28 lines

Thank you,
Georgiana

Quoted 22 lines
Quoted 22 lines

Georgiana Chelu (4):
Staging: media: atomisp: Use unsigned int instead of unsigned
Staging: media: atomisp: Add blank line after declarations
Staging: media: atomisp: pci: Move open brace '{' on the next line
Staging: media: atomisp: pci: Place constant on the right side in
comparissons

 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

--
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/cover.1505909511.git.georgiana.chelu93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#8 lore raw
Quoted 22 lines · Julia Lawall
Quoted 10 lines · Georgiana Chelu
Quoted 9 lines · Julia Lawall
Quoted 1 line · Georgiana Chelu

This patchset fix coding style issues found by checkpatch.pl.

Did you send these before? They look failiar, but they don't seem to have been applied either.

Quoted 7 lines
Quoted 1 line

julia

Yes, these changes were sent as a single patch.

Greg advised me to break it down because there
were too many different fixes for a single patch.
So, we agreed to resend it as a patch set.

Quoted 7 lines

OK, it does look more digestible this way. Maybe it should have been a v2. But since Greg has already discarded the previous one, maybe it is OK.

julia

I did not label it with "v2" because the previous one was just a simple patch, not a patch set. In case this label is required, I will resend it with the correct
label.

Thank you for the review,
Georgiana

Quoted 29 lines
Quoted 29 lines

Thank you,
Georgiana

Quoted 22 lines
Quoted 22 lines

Georgiana Chelu (4):
Staging: media: atomisp: Use unsigned int instead of unsigned
Staging: media: atomisp: Add blank line after declarations
Staging: media: atomisp: pci: Move open brace '{' on the next line
Staging: media: atomisp: pci: Place constant on the right side in
comparissons

 .../atomisp/pci/atomisp2/atomisp_compat_css20.c    | 27 +++++++++++++++-------
 1 file changed, 19 insertions(+), 8 deletions(-)

--
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/cover.1505909511.git.georgiana.chelu93%40gmail.com.
For more options, visit https://groups.google.com/d/optout.