[PATCH] media: c8sectpfe: remove redundant assignment to pointer tsin

Subsystems: media input infrastructure (v4l/dvb), the rest

STALE1702d LANDED

Landed in mainline as 00a7bba084ba on 2021-12-07.

3 messages, 3 authors, 2021-12-07 · open the first message on its own page

[PATCH] media: c8sectpfe: remove redundant assignment to pointer tsin

From: Colin Ian King <hidden>
Date: 2021-12-05 00:37:51

Pointer tsin is being assigned a value that is never read. The assignment
is redundant and can be removed.

Signed-off-by: Colin Ian King <redacted>
---
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
index 02dc78bd7fab..e1f520903248 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
@@ -930,12 +930,8 @@ static int configure_channels(struct c8sectpfei *fei)
 
 	/* iterate round each tsin and configure memdma descriptor and IB hw */
 	for_each_child_of_node(np, child) {
-
-		tsin = fei->channel_data[index];
-
 		ret = configure_memdma_and_inputblock(fei,
 						fei->channel_data[index]);
-
 		if (ret) {
 			dev_err(fei->dev,
 				"configure_memdma_and_inputblock failed\n");
-- 
2.33.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH] media: c8sectpfe: remove redundant assignment to pointer tsin

From: Patrice CHOTARD <patrice.chotard@foss.st.com>
Date: 2021-12-07 09:35:30

Hi Colin

On 12/5/21 1:37 AM, Colin Ian King wrote:
quoted hunk
Pointer tsin is being assigned a value that is never read. The assignment
is redundant and can be removed.

Signed-off-by: Colin Ian King <redacted>
---
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
index 02dc78bd7fab..e1f520903248 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
@@ -930,12 +930,8 @@ static int configure_channels(struct c8sectpfei *fei)
 
 	/* iterate round each tsin and configure memdma descriptor and IB hw */
 	for_each_child_of_node(np, child) {
-
-		tsin = fei->channel_data[index];
-
 		ret = configure_memdma_and_inputblock(fei,
 						fei->channel_data[index]);
-
 		if (ret) {
 			dev_err(fei->dev,
 				"configure_memdma_and_inputblock failed\n");
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

Re: [PATCH] media: c8sectpfe: remove redundant assignment to pointer tsin

From: Dan Carpenter <hidden>
Date: 2021-12-07 12:45:23

On Sun, Dec 05, 2021 at 12:37:45AM +0000, Colin Ian King wrote:
quoted hunk
Pointer tsin is being assigned a value that is never read. The assignment
is redundant and can be removed.

Signed-off-by: Colin Ian King <redacted>
---
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 4 ----
 1 file changed, 4 deletions(-)
diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
index 02dc78bd7fab..e1f520903248 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
@@ -930,12 +930,8 @@ static int configure_channels(struct c8sectpfei *fei)
 
 	/* iterate round each tsin and configure memdma descriptor and IB hw */
 	for_each_child_of_node(np, child) {
-
-		tsin = fei->channel_data[index];
-
 		ret = configure_memdma_and_inputblock(fei,
 						fei->channel_data[index]);
-
 		if (ret) {
 			dev_err(fei->dev,
 				"configure_memdma_and_inputblock failed\n");
This function is weird.  So far as I can see instead of looping
for_each_child_of_node() it could just do:

	for (i = 0; i < fei->tsin_count; i++) {

It's equivalent and simpler.

The error handling has a double free as well because
configure_memdma_and_inputblock() calls free_input_block() and the
goto err_unmap does too.  It should be:

	while (--i >= 0)
		free_input_block(fei, fei->channel_data[i]);

I'll send a patch for this tomorrow.

regards,
dan carpenter

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help