Skip to contentSkip to conversation

staging: media: atomisp: pci: Correct identation in block of conditional statements in file atomisp_v4l2.c

PATCH In review Aline Santana Cordeiro 3 participants 7 messages Apr 14, 2021 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 staging: media: atomisp: pci: Correct identation in block of conditional statements in file atomisp_v4l2.c

Correct identation in block of conditional statements. The function "v4l2_device_unregister_subdev()" depends on the results of the macro function "list_for_each_entry_safe()".

---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +1 -1
index 0295e2e..6d853f4 100644
@@ -1178,7 +1178,7 @@ static void atomisp_unregister_entities(struct atomisp_device *isp)
 		atomisp_mipi_csi2_unregister_entities(&isp->csi2_port[i]);
 
 	list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list)
-	v4l2_device_unregister_subdev(sd);
+		v4l2_device_unregister_subdev(sd);
 
 	v4l2_device_unregister(&isp->v4l2_dev);
 	media_device_unregister(&isp->media_dev);
Signature · 1 line
2.7.4
#2 lore raw
Quoted 14 lines · Aline Santana Cordeiro

Correct identation in block of conditional statements. The function "v4l2_device_unregister_subdev()" depends on the results of the macro function "list_for_each_entry_safe()".

---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0 -0
index 0295e2e..6d853f4 100644

drivers/staging/media/atomisp/pci/atomisp_v4l2.c static void atomisp_unregister_entities(struct atomisp_device *isp) · line 1182

Quoted 6 lines
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +1 -1
@@ -1178,7 +1178,7 @@ static void atomisp_unregister_entities(struct atomisp_device *isp)
 		atomisp_mipi_csi2_unregister_entities(&isp->csi2_port[i]);
 
 	list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list)
-	v4l2_device_unregister_subdev(sd);
+		v4l2_device_unregister_subdev(sd);
 

It's really more common to use curly braces for list_for_each() one liners.

	list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list) {
		v4l2_device_unregister_subdev(sd);
	}

regards,
dan carpenter

#3 lore raw
Quoted 25 lines · Dan Carpenter
Quoted 14 lines · Aline Santana Cordeiro

Correct identation in block of conditional statements. The function "v4l2_device_unregister_subdev()" depends on the results of the macro function "list_for_each_entry_safe()".

---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0 -0
index 0295e2e..6d853f4 100644

drivers/staging/media/atomisp/pci/atomisp_v4l2.c static void atomisp_unregister_entities(struct atomisp_device *isp) · line 1182

Quoted 6 lines
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +1 -1
@@ -1178,7 +1178,7 @@ static void atomisp_unregister_entities(struct atomisp_device *isp)
 		atomisp_mipi_csi2_unregister_entities(&isp->csi2_port[i]);
 
 	list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list)
-	v4l2_device_unregister_subdev(sd);
+		v4l2_device_unregister_subdev(sd);
 

It's really more common to use curly braces for list_for_each() one liners.

Quoted 3 lines
	list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list) {
		v4l2_device_unregister_subdev(sd);
	}

A quick test with grep shows 4000 lines containing list_for_each that contain no {, out of 15000 lines containing list_for_each in all.

julia

Quoted 9 lines

regards,
dan carpenter

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20210414143011.GV6021%40kadam.

#4 lore raw
Quoted 29 lines · Julia Lawall
Quoted 25 lines · Dan Carpenter
Quoted 14 lines · Aline Santana Cordeiro

Correct identation in block of conditional statements. The function "v4l2_device_unregister_subdev()" depends on the results of the macro function "list_for_each_entry_safe()".

---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0 -0
index 0295e2e..6d853f4 100644

drivers/staging/media/atomisp/pci/atomisp_v4l2.c static void atomisp_unregister_entities(struct atomisp_device *isp) · line 1182

Quoted 6 lines
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +1 -1
@@ -1178,7 +1178,7 @@ static void atomisp_unregister_entities(struct atomisp_device *isp)
 		atomisp_mipi_csi2_unregister_entities(&isp->csi2_port[i]);
 
 	list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list)
-	v4l2_device_unregister_subdev(sd);
+		v4l2_device_unregister_subdev(sd);
 

It's really more common to use curly braces for list_for_each() one liners.

Quoted 7 lines
Quoted 3 lines
	list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list) {
		v4l2_device_unregister_subdev(sd);
	}

A quick test with grep shows 4000 lines containing list_for_each that contain no {, out of 15000 lines containing list_for_each in all.

Huh... You're right. Never mind then.

regards,
dan carpenter

author
#5 lore raw

Em qua, 2021-04-14 às 17:45 +0300, Dan Carpenter escreveu:

Quoted 47 lines · Julia Lawall
Quoted 36 lines · Dan Carpenter
Quoted 33 lines
Quoted 18 lines · Aline Santana Cordeiro

Correct identation in block of conditional statements. The function "v4l2_device_unregister_subdev()" depends on the results of the macro function "list_for_each_entry_safe()".

Signed-off-by: Aline Santana Cordeiro < [email protected]>
---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0 -0
index 0295e2e..6d853f4 100644
@@ -1178,7 +1178,7 @@ static void
 atomisp_unregister_entities(struct atomisp_device *isp)

                atomisp_mipi_csi2_unregister_entities(&isp-

Quoted 7 lines
Quoted 1 line

csi2_port[i]);

        list_for_each_entry_safe(sd, next, &isp-

Quoted 1 line

v4l2_dev.subdevs, list)

-       v4l2_device_unregister_subdev(sd); +               v4l2_device_unregister_subdev(sd);

It's really more common to use curly braces for list_for_each() one
liners.

Quoted 9 lines
Quoted 4 lines

        list_for_each_entry_safe(sd, next, &isp-

Quoted 1 line

v4l2_dev.subdevs, list) {

                v4l2_device_unregister_subdev(sd); }

A quick test with grep shows 4000 lines containing list_for_each that
contain no {, out of 15000 lines containing list_for_each in all.

Quoted 5 lines

Huh...  You're right.  Never mind then.

regards,
dan carpenter

Ok then :)

Thank you all,

Aline

author
#6 lore raw
In reply to Dan Carpenter

Em qua, 2021-04-14 às 17:30 +0300, Dan Carpenter escreveu:

Quoted 31 lines
Quoted 18 lines · Aline Santana Cordeiro

Correct identation in block of conditional statements. The function "v4l2_device_unregister_subdev()" depends on the results of the macro function "list_for_each_entry_safe()".

Signed-off-by: Aline Santana Cordeiro < [email protected]>
---
 drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/atomisp/pci/atomisp_v4l2.c +0 -0
index 0295e2e..6d853f4 100644
@@ -1178,7 +1178,7 @@ static void
 atomisp_unregister_entities(struct atomisp_device *isp)

                atomisp_mipi_csi2_unregister_entities(&isp-

Quoted 7 lines
Quoted 1 line

csi2_port[i]);


        list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list)
-       v4l2_device_unregister_subdev(sd);
+               v4l2_device_unregister_subdev(sd);

It's really more common to use curly braces for list_for_each() one liners.

Quoted 8 lines

        list_for_each_entry_safe(sd, next, &isp->v4l2_dev.subdevs, list) {
                v4l2_device_unregister_subdev(sd);
        }

regards,
dan carpenter

Thank you for warning me.
I'm going to send a v2 adding the curly braces.

regards,
Aline

#7 lore raw

PATCH 2/2 staging: media: atomisp: pci: Correct identation in block of conditional statements in file atomisp_acc.c

In reply to a message not in the archive

Correct identation in block of conditional statements. The conditional statement depends on the results of the macro function "list_for_each_entry()".

---
 drivers/staging/media/atomisp/pci/atomisp_acc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/atomisp/pci/atomisp_acc.c +2 -2
index f638d0b..5e5faa4 100644
@@ -77,8 +77,8 @@ acc_get_fw(struct atomisp_sub_device *asd, unsigned int handle)
 	struct atomisp_acc_fw *acc_fw;
 
 	list_for_each_entry(acc_fw, &asd->acc.fw, list)
-	if (acc_fw->handle == handle)
-		return acc_fw;
+		if (acc_fw->handle == handle)
+			return acc_fw;
 
 	return NULL;
 }
Signature · 1 line
2.7.4