linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/7] media: ipu3-cio2: Simplify cleanup code
@ 2020-08-14 16:30 Andy Shevchenko
  2020-08-14 16:30 ` [PATCH v1 2/7] media: ipu3-cio2: Introduce CIO2_MAX_ENTRIES constant Andy Shevchenko
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Andy Shevchenko @ 2020-08-14 16:30 UTC (permalink / raw)
  To: Yong Zhi, Sakari Ailus, Bingbu Cao, Tian Shu Qiu, linux-media,
	Mauro Carvalho Chehab
  Cc: Andy Shevchenko

The code looks more nicer if we use:
	while (i--)
instead:
	for (i = i - 1; i >= 0; i--)

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/pci/intel/ipu3/ipu3-cio2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
index 92f5eadf2c99..c7c3692a6e72 100644
--- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c
+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c
@@ -887,7 +887,7 @@ static int cio2_vb2_buf_init(struct vb2_buffer *vb)
 	b->lop[i][j] = cio2->dummy_page_bus_addr >> PAGE_SHIFT;
 	return 0;
 fail:
-	for (i--; i >= 0; i--)
+	while (i--)
 		dma_free_coherent(dev, CIO2_PAGE_SIZE,
 				  b->lop[i], b->lop_bus_addr[i]);
 	return -ENOMEM;
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-08-17 14:37 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-14 16:30 [PATCH v1 1/7] media: ipu3-cio2: Simplify cleanup code Andy Shevchenko
2020-08-14 16:30 ` [PATCH v1 2/7] media: ipu3-cio2: Introduce CIO2_MAX_ENTRIES constant Andy Shevchenko
2020-08-14 20:18   ` Sakari Ailus
2020-08-17 11:46     ` Andy Shevchenko
2020-08-14 16:30 ` [PATCH v1 3/7] media: ipu2-cio2: Replace custom definition with PAGE_SIZE Andy Shevchenko
2020-08-14 16:30 ` [PATCH v1 4/7] media: ipu3-cio2: Use macros from pfn.h Andy Shevchenko
2020-08-14 16:30 ` [PATCH v1 5/7] media: ipu3-cio2: Replace infinite loop by one with clear exit condition Andy Shevchenko
2020-08-17 10:21   ` Bingbu Cao
2020-08-17 11:47     ` Andy Shevchenko
2020-08-14 16:30 ` [PATCH v1 6/7] media: ipu3-cio2: Use readl_poll_timeout() helper Andy Shevchenko
2020-08-17  9:27   ` Bingbu Cao
2020-08-17  9:44     ` Andy Shevchenko
2020-08-17 11:13       ` Sakari Ailus
2020-08-17 11:20         ` Andy Shevchenko
2020-08-17 11:27           ` Sakari Ailus
2020-08-17 11:33             ` Andy Shevchenko
2020-08-17 11:55               ` Sakari Ailus
2020-08-17 12:29                 ` Andy Shevchenko
2020-08-17 12:44                   ` Sakari Ailus
2020-08-14 16:30 ` [PATCH v1 7/7] media: ipu3-cio2: Update Copyright year and fix indentation issues Andy Shevchenko
2020-08-14 20:16 ` [PATCH v1 1/7] media: ipu3-cio2: Simplify cleanup code Sakari Ailus
2020-08-17 14:37   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).