* [PATCH 0/2] A few IPU3 CIO2 fixes
@ 2017-12-29 12:59 Sakari Ailus
2017-12-29 12:59 ` [PATCH 1/2] v4l: Fix references in Intel IPU3 Bayer documentation Sakari Ailus
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Sakari Ailus @ 2017-12-29 12:59 UTC (permalink / raw)
To: linux-media; +Cc: mchehab, yong.zhi
Hi Yong and Mauro,
The two patches are addressing a few matters Mauro pointed out whilst
handling the CIO2 driver pull request.
Yong: could you review especially the latter patch?
Sakari Ailus (2):
v4l: Fix references in Intel IPU3 Bayer documentation
intel-ipu3: Rename arr_size macro, use min
Documentation/media/uapi/v4l/pixfmt-srggb10-ipu3.rst | 8 ++++----
drivers/media/pci/intel/ipu3/ipu3-cio2.c | 11 ++++-------
2 files changed, 8 insertions(+), 11 deletions(-)
--
2.11.0
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] v4l: Fix references in Intel IPU3 Bayer documentation 2017-12-29 12:59 [PATCH 0/2] A few IPU3 CIO2 fixes Sakari Ailus @ 2017-12-29 12:59 ` Sakari Ailus 2017-12-29 12:59 ` [PATCH 2/2] intel-ipu3: Rename arr_size macro, use min Sakari Ailus 2017-12-29 13:42 ` [PATCH 0/2] A few IPU3 CIO2 fixes Mauro Carvalho Chehab 2 siblings, 0 replies; 4+ messages in thread From: Sakari Ailus @ 2017-12-29 12:59 UTC (permalink / raw) To: linux-media; +Cc: mchehab, yong.zhi The references in Intel IPU3 Bayer format documentation were wrong. Fix them. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- Documentation/media/uapi/v4l/pixfmt-srggb10-ipu3.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/media/uapi/v4l/pixfmt-srggb10-ipu3.rst b/Documentation/media/uapi/v4l/pixfmt-srggb10-ipu3.rst index 72fbd8f96381..99cde5077519 100644 --- a/Documentation/media/uapi/v4l/pixfmt-srggb10-ipu3.rst +++ b/Documentation/media/uapi/v4l/pixfmt-srggb10-ipu3.rst @@ -1,9 +1,9 @@ .. -*- coding: utf-8; mode: rst -*- -.. _V4L2_PIX_FMT_IPU3_SBGGR10: -.. _V4L2_PIX_FMT_IPU3_SGBRG10: -.. _V4L2_PIX_FMT_IPU3_SGRBG10: -.. _V4L2_PIX_FMT_IPU3_SRGGB10: +.. _v4l2-pix-fmt-ipu3-sbggr10: +.. _v4l2-pix-fmt-ipu3-sgbrg10: +.. _v4l2-pix-fmt-ipu3-sgrbg10: +.. _v4l2-pix-fmt-ipu3-srggb10: ********************************************************************************************************************************************** V4L2_PIX_FMT_IPU3_SBGGR10 ('ip3b'), V4L2_PIX_FMT_IPU3_SGBRG10 ('ip3g'), V4L2_PIX_FMT_IPU3_SGRBG10 ('ip3G'), V4L2_PIX_FMT_IPU3_SRGGB10 ('ip3r') -- 2.11.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] intel-ipu3: Rename arr_size macro, use min 2017-12-29 12:59 [PATCH 0/2] A few IPU3 CIO2 fixes Sakari Ailus 2017-12-29 12:59 ` [PATCH 1/2] v4l: Fix references in Intel IPU3 Bayer documentation Sakari Ailus @ 2017-12-29 12:59 ` Sakari Ailus 2017-12-29 13:42 ` [PATCH 0/2] A few IPU3 CIO2 fixes Mauro Carvalho Chehab 2 siblings, 0 replies; 4+ messages in thread From: Sakari Ailus @ 2017-12-29 12:59 UTC (permalink / raw) To: linux-media; +Cc: mchehab, yong.zhi The arr_size() macro which is used to calculate the size of the chunk in the array to be arranged resembles ARRAY_SIZE naming-wise. Avoid confusion by renaming it to CHUNK_SIZE instead. Also use min() macro to calculate the minimum of two numbers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2.c b/drivers/media/pci/intel/ipu3/ipu3-cio2.c index 941caa987dab..52827d572493 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2.c @@ -1894,20 +1894,17 @@ static void arrange(void *ptr, size_t elem_size, size_t elems, size_t start) { start, elems - 1 }, }; -#define arr_size(a) ((a)->end - (a)->begin + 1) +#define CHUNK_SIZE(a) ((a)->end - (a)->begin + 1) /* Loop as long as we have out-of-place entries */ - while (arr_size(&arr[0]) && arr_size(&arr[1])) { + while (CHUNK_SIZE(&arr[0]) && CHUNK_SIZE(&arr[1])) { size_t size0, i; /* * Find the number of entries that can be arranged on this * iteration. */ - if (arr_size(&arr[0]) > arr_size(&arr[1])) - size0 = arr_size(&arr[1]); - else - size0 = arr_size(&arr[0]); + size0 = min(CHUNK_SIZE(&arr[0]), CHUNK_SIZE(&arr[1])); /* Swap the entries in two parts of the array. */ for (i = 0; i < size0; i++) { @@ -1919,7 +1916,7 @@ static void arrange(void *ptr, size_t elem_size, size_t elems, size_t start) swap(d[j], s[j]); } - if (arr_size(&arr[0]) > arr_size(&arr[1])) { + if (CHUNK_SIZE(&arr[0]) > CHUNK_SIZE(&arr[1])) { /* The end of the first array remains unarranged. */ arr[0].begin += size0; } else { -- 2.11.0 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] A few IPU3 CIO2 fixes 2017-12-29 12:59 [PATCH 0/2] A few IPU3 CIO2 fixes Sakari Ailus 2017-12-29 12:59 ` [PATCH 1/2] v4l: Fix references in Intel IPU3 Bayer documentation Sakari Ailus 2017-12-29 12:59 ` [PATCH 2/2] intel-ipu3: Rename arr_size macro, use min Sakari Ailus @ 2017-12-29 13:42 ` Mauro Carvalho Chehab 2 siblings, 0 replies; 4+ messages in thread From: Mauro Carvalho Chehab @ 2017-12-29 13:42 UTC (permalink / raw) To: Sakari Ailus; +Cc: linux-media, yong.zhi Em Fri, 29 Dec 2017 14:59:12 +0200 Sakari Ailus <sakari.ailus@linux.intel.com> escreveu: > Hi Yong and Mauro, > > The two patches are addressing a few matters Mauro pointed out whilst > handling the CIO2 driver pull request. > > Yong: could you review especially the latter patch? I'm applying the first one, as it cleans 4 warnings. I'll wait for an ack for the second one. Regards, Mauro\ ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-12-29 13:43 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-12-29 12:59 [PATCH 0/2] A few IPU3 CIO2 fixes Sakari Ailus 2017-12-29 12:59 ` [PATCH 1/2] v4l: Fix references in Intel IPU3 Bayer documentation Sakari Ailus 2017-12-29 12:59 ` [PATCH 2/2] intel-ipu3: Rename arr_size macro, use min Sakari Ailus 2017-12-29 13:42 ` [PATCH 0/2] A few IPU3 CIO2 fixes Mauro Carvalho Chehab
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).