mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] staging: media: atomisp: Deduplicate and reformat atomisp_find_in_fmt_conv_by_atomisp_in_fmt()
@ 2026-11-18  9:53 Shivani Patel
  2026-11-18 10:06 ` Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Shivani Patel @ 2026-11-18  9:53 UTC (permalink / raw)
  To: Hans de Goede, Mauro Carvalho Chehab, Greg Kroah-Hartman
  Cc: Sakari Ailus, Andy Shevchenko, linux-media, linux-staging,
	linux-kernel, Shivani Patel

atomisp_subdev.h contains duplicate declarations of
atomisp_find_in_fmt_conv_by_atomisp_in_fmt() under ISP2400 and ISP2401
comments. Both declare the exact same function with broken formatting
(lines ending with open parenthesis, leading spaces, and awkward line
breaks).

Furthermore, the definition in atomisp_subdev.c uses the same broken
formatting with leading spaces and a line ending with an open
parenthesis.

Remove the duplicate declaration in atomisp_subdev.h, place the return
type on its own line, and shorten the parameter name to 'fmt' so that the
prototype and definition adhere to the 80-character line limit and
Linux coding style.

Signed-off-by: Shivani Patel <patelshivani2283@gmail.com>
---
 drivers/staging/media/atomisp/pci/atomisp_subdev.c |  6 +++---
 drivers/staging/media/atomisp/pci/atomisp_subdev.h | 10 ++--------
 2 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.c b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
index bdd2d9b18..6af8a42a6 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_subdev.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.c
@@ -95,13 +95,13 @@ const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv(u32 code)
 	return NULL;
 }
 
-const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv_by_atomisp_in_fmt(
-    enum atomisp_input_format atomisp_in_fmt)
+const struct atomisp_in_fmt_conv *
+atomisp_find_in_fmt_conv_by_atomisp_in_fmt(enum atomisp_input_format fmt)
 {
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(atomisp_in_fmt_conv) - 1; i++)
-		if (atomisp_in_fmt_conv[i].atomisp_in_fmt == atomisp_in_fmt)
+		if (atomisp_in_fmt_conv[i].atomisp_in_fmt == fmt)
 			return atomisp_in_fmt_conv + i;
 
 	return NULL;
diff --git a/drivers/staging/media/atomisp/pci/atomisp_subdev.h b/drivers/staging/media/atomisp/pci/atomisp_subdev.h
index b12bb65be..c4a3bce6f 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_subdev.h
+++ b/drivers/staging/media/atomisp/pci/atomisp_subdev.h
@@ -300,14 +300,8 @@ u32 atomisp_subdev_uncompressed_code(u32 code);
 bool atomisp_subdev_is_compressed(u32 code);
 const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv(u32 code);
 
-/* ISP2400 */
-const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv_by_atomisp_in_fmt(
-    enum atomisp_input_format atomisp_in_fmt);
-
-/* ISP2401 */
-const struct atomisp_in_fmt_conv
-*atomisp_find_in_fmt_conv_by_atomisp_in_fmt(enum atomisp_input_format
-	atomisp_in_fmt);
+const struct atomisp_in_fmt_conv *
+atomisp_find_in_fmt_conv_by_atomisp_in_fmt(enum atomisp_input_format fmt);
 
 const struct atomisp_in_fmt_conv *atomisp_find_in_fmt_conv_compressed(u32 code);
 bool atomisp_subdev_format_conversion(struct atomisp_sub_device *asd);
-- 
2.50.1 (Apple Git-155)


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

* Re: [PATCH] staging: media: atomisp: Deduplicate and reformat atomisp_find_in_fmt_conv_by_atomisp_in_fmt()
  2026-11-18  9:53 [PATCH] staging: media: atomisp: Deduplicate and reformat atomisp_find_in_fmt_conv_by_atomisp_in_fmt() Shivani Patel
@ 2026-11-18 10:06 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2026-11-18 10:06 UTC (permalink / raw)
  To: Shivani Patel
  Cc: Hans de Goede, Mauro Carvalho Chehab, Greg Kroah-Hartman,
	Sakari Ailus, Andy Shevchenko, linux-media, linux-staging,
	linux-kernel

On Wed, Nov 18, 2026 at 11:53 AM Shivani Patel
<patelshivani2283@gmail.com> wrote:
>
> atomisp_subdev.h contains duplicate declarations of
> atomisp_find_in_fmt_conv_by_atomisp_in_fmt() under ISP2400 and ISP2401
> comments. Both declare the exact same function with broken formatting
> (lines ending with open parenthesis, leading spaces, and awkward line
> breaks).
>
> Furthermore, the definition in atomisp_subdev.c uses the same broken
> formatting with leading spaces and a line ending with an open
> parenthesis.
>
> Remove the duplicate declaration in atomisp_subdev.h, place the return
> type on its own line, and shorten the parameter name to 'fmt' so that the
> prototype and definition adhere to the 80-character line limit and
> Linux coding style.

...

> +const struct atomisp_in_fmt_conv *
> +atomisp_find_in_fmt_conv_by_atomisp_in_fmt(enum atomisp_input_format fmt)

Can't we take one more step and drop the duplicate 'atomisp' in the
name? The quick suggestion (you can try find a better one) for the
name is atomisp_find_in_fmt_conv_by_enum() and also rename
atomisp_find_in_fmt_conv() to atomisp_find_in_fmt_conv_by_code().

Also drop stale declaration for atomisp_find_in_fmt_conv_compressed().

Altogether, make a series of the three patches:
- drop duplicate / unused declarations of atomisp_find_in_fmt_conv*() namespace
- rename atomisp_find_in_fmt_conv() to atomisp_find_in_fmt_conv_by_code()
- this patch that renames atomisp_find_in_fmt_conv_by_atomisp_in_fmt()
and fixes formatting

Don't forget to add a cover letter.

-- 
With Best Regards,
Andy Shevchenko

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

end of thread, other threads:[~2026-11-18 10:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18  9:53 [PATCH] staging: media: atomisp: Deduplicate and reformat atomisp_find_in_fmt_conv_by_atomisp_in_fmt() Shivani Patel
2026-11-18 10:06 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®