Skip to contentSkip to conversation

linux-next: build warning after merge of the v4l-dvb tree

DISCUSSION Stephen Rothwell 4 participants 9 messages Feb 8, 2021 – Feb 15, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Maybe introduced by commit

c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead
include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead
include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Quoted 4 lines

Maybe introduced by commit

  c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Thanks for spotting this. Should be fixed by:

include/media/v4l2-async.h +4 -4
index 6f22daa6f067..3785445282fc 100644
@@ -157,7 +157,7 @@ int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
 				   struct v4l2_async_subdev *asd);
 
 /**
- * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
+ * __v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
  *				subdev to the notifier's master asd_list.
  *
  * @notifier: pointer to &struct v4l2_async_notifier
@@ -181,7 +181,7 @@ __v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
 						   sizeof(__type)))
 
 /**
- * v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode
+ * __v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode
  *						  remote async subdev to the
  *						  notifier's master asd_list.
  *
@@ -210,7 +210,7 @@ __v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif
 							  sizeof(__type)))
 
 /**
- * v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async
+ * __v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async
  *				subdev to the notifier's master asd_list.
  *
  * @notifier: pointer to &struct v4l2_async_notifier
@@ -228,7 +228,7 @@ struct v4l2_async_subdev *
 __v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
 				     int adapter_id, unsigned short address,
 				     unsigned int asd_struct_size);
-#define v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr, __type)	\
+#define v4l2_async_notifier_i2c(__notifier, __adap, __addr, __type)	\
 ((__type *)__v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr,	\
 						sizeof(__type)))
 

I'll send a fix for Mauro.

Best regards,
Ezequiel

maintainer
#2 lore raw

Hi Ezequiel,

Thanks for addressing this.

Quoted 27 lines · Ezequiel Garcia

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead
include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead
include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Quoted 4 lines

Maybe introduced by commit

  c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Thanks for spotting this. Should be fixed by:

include/media/v4l2-async.h +0 -0
index 6f22daa6f067..3785445282fc 100644

include/media/v4l2-async.h int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier, · line 160

Quoted 5 lines
include/media/v4l2-async.h +1 -1
@@ -157,7 +157,7 @@ int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
 				   struct v4l2_async_subdev *asd);
 
 /**
- * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
+ * __v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async

The problem with the approach is that this no longer documents the API that drivers are intended to use, but the intermediate one. I guess fixing this properly could require changes to kerneldoc so I have no objections to the approach.

Quoted 22 lines
include/media/v4l2-async.h +2 -2
  *				subdev to the notifier's master asd_list.
  *
  * @notifier: pointer to &struct v4l2_async_notifier
@@ -181,7 +181,7 @@ __v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
 						   sizeof(__type)))
 
 /**
- * v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode
+ * __v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode
  *						  remote async subdev to the
  *						  notifier's master asd_list.
  *
@@ -210,7 +210,7 @@ __v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif
 							  sizeof(__type)))
 
 /**
- * v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async
+ * __v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async
  *				subdev to the notifier's master asd_list.
  *
  * @notifier: pointer to &struct v4l2_async_notifier

include/media/v4l2-async.h struct v4l2_async_subdev * · line 231

Quoted 5 lines
include/media/v4l2-async.h +1 -1
@@ -228,7 +228,7 @@ struct v4l2_async_subdev *
 __v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
 				     int adapter_id, unsigned short address,
 				     unsigned int asd_struct_size);
-#define v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr, __type)	\
+#define v4l2_async_notifier_i2c(__notifier, __adap, __addr, __type)	\

I guess this change was not intentional?

Quoted 4 lines
include/media/v4l2-async.h +0 -0
 ((__type *)__v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr,	\
 						sizeof(__type)))
 
Signature · 3 lines
Kind regards,

Sakari Ailus
#3 lore raw
Quoted 27 lines · Sakari Ailus

Hi Ezequiel,

Thanks for addressing this.

Quoted 22 lines · Ezequiel Garcia

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead
include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead
include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Quoted 4 lines

Maybe introduced by commit

  c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Thanks for spotting this. Should be fixed by:

Quoted 16 lines
Quoted 10 lines
include/media/v4l2-async.h +0 -0
index 6f22daa6f067..3785445282fc 100644
@@ -157,7 +157,7 @@ int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
                                    struct v4l2_async_subdev *asd);


 /**
- * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
+ * __v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async

The problem with the approach is that this no longer documents the API that drivers are intended to use, but the intermediate one. I guess fixing this properly could require changes to kerneldoc so I have no objections to the approach.

Right, but do we have any other solution here?

Quoted 21 lines
Quoted 21 lines

  *                             subdev to the notifier's master asd_list. *
  * @notifier: pointer to &struct v4l2_async_notifier

include/media/v4l2-async.h +0 -0
@@ -181,7 +181,7 @@ __v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
                                                    sizeof(__type)))


 /**
- * v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode
+ * __v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode *                                               remote async subdev to the *                                               notifier's master asd_list. *

include/media/v4l2-async.h +0 -0
@@ -210,7 +210,7 @@ __v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif
                                                           sizeof(__type)))


 /**
- * v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async
+ * __v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async *                             subdev to the notifier's master asd_list. *
  * @notifier: pointer to &struct v4l2_async_notifier

Quoted 9 lines

include/media/v4l2-async.h struct v4l2_async_subdev * · line 231

Quoted 6 lines
include/media/v4l2-async.h +1 -1
@@ -228,7 +228,7 @@ struct v4l2_async_subdev *
  __v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
                                      int adapter_id, unsigned short address,
                                      unsigned int asd_struct_size);
-#define v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr, __type) \
+#define v4l2_async_notifier_i2c(__notifier, __adap, __addr, __type)    \

I guess this change was not intentional?

Indeed :)

Thanks,
Ezequiel

#4 lore raw

Em Mon, 08 Feb 2021 13:57:56 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 28 lines · Sakari Ailus
Quoted 27 lines

Hi Ezequiel,

Thanks for addressing this.

Quoted 22 lines · Ezequiel Garcia

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead
include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead
include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Quoted 4 lines

Maybe introduced by commit

  c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Thanks for spotting this. Should be fixed by:

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
include/media/v4l2-async.h +0 -0
index 6f22daa6f067..3785445282fc 100644
@@ -157,7 +157,7 @@ int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
Quoted 8 lines
Quoted 5 lines
include/media/v4l2-async.h +0 -0
                                    struct v4l2_async_subdev *asd);


 /**
- * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
+ * __v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async

The problem with the approach is that this no longer documents the API that drivers are intended to use, but the intermediate one.

Yep. the better would be to keep documenting what will be used.

Quoted 3 lines
Quoted 3 lines

I guess fixing
this properly could require changes to kerneldoc so I have no objections to the approach.

It is not a simple kernel-doc change.

The problem is that Kernel-doc expects:

	/**
	 * foo - something
	 */
	void foo(...)

As it parses the file lines sequentially, using the parameters at foo(...) to double-check if everything is ok.

In order for it to parse things like:

	/**
	 * foo - something
	 */

	... (some other functions in the middle)
	
	void foo(...)

Would require kernel-doc to first parse all the file, storing markups on a separate struct, and then, on a second step, produce an output.

Even if modified to do that, there's a question if the result would be what it is expected.

A separate thing would be to do things like:

	/**
	 * foo - something
	 */
	void __foo(...)

The problem here is that usually the arguments for __foo() are different than the ones for foo(). See for example the macros that have a __foo() functions with an owner argument, that are solved on a macro called foo().

Thanks,
Mauro

#5 lore raw
Quoted 45 lines · Mauro Carvalho Chehab

Em Mon, 08 Feb 2021 13:57:56 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 28 lines · Sakari Ailus
Quoted 27 lines

Hi Ezequiel,

Thanks for addressing this.

Quoted 22 lines · Ezequiel Garcia

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead
include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead
include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Quoted 4 lines

Maybe introduced by commit

  c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Thanks for spotting this. Should be fixed by:

Quoted 13 lines
Quoted 5 lines
Quoted 5 lines
include/media/v4l2-async.h +0 -0
index 6f22daa6f067..3785445282fc 100644
@@ -157,7 +157,7 @@ int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
Quoted 8 lines
Quoted 5 lines
include/media/v4l2-async.h +0 -0
                                    struct v4l2_async_subdev *asd);


 /**
- * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
+ * __v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async

The problem with the approach is that this no longer documents the API that drivers are intended to use, but the intermediate one.

Quoted 2 lines

Yep. the better would be to keep documenting what will be used.

Is there a way to silence/ignore the warning for a specific function(s)?

Ezequiel

#6 lore raw

Em Mon, 08 Feb 2021 15:53:00 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 46 lines · Mauro Carvalho Chehab
Quoted 45 lines

Em Mon, 08 Feb 2021 13:57:56 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 41 lines · Sakari Ailus
Quoted 40 lines

Hi Ezequiel,

Thanks for addressing this.

Quoted 28 lines · Ezequiel Garcia

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead
include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead
include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Quoted 4 lines

Maybe introduced by commit

  c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Thanks for spotting this. Should be fixed by:

include/media/v4l2-async.h +0 -0
index 6f22daa6f067..3785445282fc 100644
@@ -157,7 +157,7 @@ int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
                                    struct v4l2_async_subdev *asd);
Quoted 4 lines


 /**
- * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
+ * __v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async

The problem with the approach is that this no longer documents the API that drivers are intended to use, but the intermediate one.

Quoted 4 lines
Quoted 2 lines

Yep. the better would be to keep documenting what will be used.

Is there a way to silence/ignore the warning for a specific function(s)?

No. The warning is there for a very good reason: if you do something like:

	/**
	 * delete - delete some file
	 *
	 * This function deletes something.
	 */
	void insert() {}
	/**
	 * insert - creates a new file
	 *
	 * This function creates a file and inserts something.
	 */
	void delete() {}

the output of it will be:

	$ ./scripts/kernel-doc -sphinx-version 3.0.0 silly.c
	.. c:function:: void insert ()

delete some file

**Parameters**

**Description**

This function deletes something.

.. c:function:: void delete ()

creates a new file

**Parameters**

**Description**

This function creates a file and inserts something.

Which is completely wrong. If someone tries to write a code using the above, the result will be just the opposite than what it was documented.

Btw, I noticed several places where things like that happened, because some code were added between a Kernel-doc markup and some function.

Thanks,
Mauro

#7 lore raw

Em Mon, 15 Feb 2021 11:20:24 +0100
Mauro Carvalho Chehab <[email protected]> escreveu:

Quoted 94 lines

Em Mon, 08 Feb 2021 15:53:00 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 46 lines · Mauro Carvalho Chehab
Quoted 45 lines

Em Mon, 08 Feb 2021 13:57:56 -0300 Ezequiel Garcia <[email protected]> escreveu:

Quoted 41 lines · Sakari Ailus
Quoted 40 lines

Hi Ezequiel,

Thanks for addressing this.

Quoted 28 lines · Ezequiel Garcia

Hi Stephen,

Quoted 12 lines · Stephen Rothwell

Hi all,

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead
include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead
include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Quoted 4 lines

Maybe introduced by commit

  c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

Thanks for spotting this. Should be fixed by:

include/media/v4l2-async.h +0 -0
index 6f22daa6f067..3785445282fc 100644
@@ -157,7 +157,7 @@ int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
                                    struct v4l2_async_subdev *asd);
Quoted 4 lines


 /**
- * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
+ * __v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async

The problem with the approach is that this no longer documents the API that drivers are intended to use, but the intermediate one.

Quoted 4 lines
Quoted 2 lines

Yep. the better would be to keep documenting what will be used.

Is there a way to silence/ignore the warning for a specific function(s)?

No. The warning is there for a very good reason: if you do something like:

	/**
	 * delete - delete some file
	 *
	 * This function deletes something.
	 */
	void insert() {}
	/**
	 * insert - creates a new file
	 *
	 * This function creates a file and inserts something.
	 */
	void delete() {}

the output of it will be:

	$ ./scripts/kernel-doc -sphinx-version 3.0.0 silly.c
	.. c:function:: void insert ()

delete some file

**Parameters**

**Description**

This function deletes something.

.. c:function:: void delete ()

creates a new file

**Parameters**

**Description**

Quoted 7 lines

This function creates a file and inserts something.

Which is completely wrong. If someone tries to write a code using the above, the result will be just the opposite than what it was documented.

Btw, I noticed several places where things like that happened, because some code were added between a Kernel-doc markup and some function.

Btw, in the specific case of this change, something like the above quick hack would fix it.

PS: I didn't think much when I wrote the __type description.

Also, keeping the symbols that should be documented as __foo doesn't seem the right thing to me :-)

---

[PATCH] v4l2-async.h: Fix kerneldoc markups

Document the functions that should be used by the kAPI clients, instead of the internal functions.

include/media/v4l2-async.h +22 -34
index 6f22daa6f067..91dbeaa4e6ee 100644
@@ -156,42 +156,38 @@ void v4l2_async_notifier_init(struct v4l2_async_notifier *notifier);
 int __v4l2_async_notifier_add_subdev(struct v4l2_async_notifier *notifier,
 				   struct v4l2_async_subdev *asd);
 
+struct v4l2_async_subdev *
+__v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
+					struct fwnode_handle *fwnode,
+					unsigned int asd_struct_size);
 /**
  * v4l2_async_notifier_add_fwnode_subdev - Allocate and add a fwnode async
  *				subdev to the notifier's master asd_list.
  *
- * @notifier: pointer to &struct v4l2_async_notifier
- * @fwnode: fwnode handle of the sub-device to be matched
- * @asd_struct_size: size of the driver's async sub-device struct, including
- *		     sizeof(struct v4l2_async_subdev). The &struct
- *		     v4l2_async_subdev shall be the first member of
- *		     the driver's async sub-device struct, i.e. both
- *		     begin at the same memory address.
+ * @__notifier: pointer to &struct v4l2_async_notifier
+ * @__fwnode: fwnode handle of the sub-device to be matched
+ * @__type: type of the struct that contains a struct v4l2_async_subdev.
  *
  * Allocate a fwnode-matched asd of size asd_struct_size, and add it to the
  * notifiers @asd_list. The function also gets a reference of the fwnode which
  * is released later at notifier cleanup time.
  */
-struct v4l2_async_subdev *
-__v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
-					struct fwnode_handle *fwnode,
-					unsigned int asd_struct_size);
 #define v4l2_async_notifier_add_fwnode_subdev(__notifier, __fwnode, __type)	\
 ((__type *)__v4l2_async_notifier_add_fwnode_subdev(__notifier, __fwnode,	\
 						   sizeof(__type)))
 
+struct v4l2_async_subdev *
+__v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif,
+					       struct fwnode_handle *endpoint,
+					       unsigned int asd_struct_size);
 /**
  * v4l2_async_notifier_add_fwnode_remote_subdev - Allocate and add a fwnode
  *						  remote async subdev to the
  *						  notifier's master asd_list.
  *
- * @notif: pointer to &struct v4l2_async_notifier
- * @endpoint: local endpoint pointing to the remote sub-device to be matched
- * @asd_struct_size: size of the driver's async sub-device struct, including
- *		     sizeof(struct v4l2_async_subdev). The &struct
- *		     v4l2_async_subdev shall be the first member of
- *		     the driver's async sub-device struct, i.e. both
- *		     begin at the same memory address.
+ * @__notifier: pointer to &struct v4l2_async_notifier
+ * @__ep: local endpoint pointing to the remote sub-device to be matched
+ * @__type: type of the struct that contains a struct v4l2_async_subdev.
  *
  * Gets the remote endpoint of a given local endpoint, set it up for fwnode
  * matching and adds the async sub-device to the notifier's @asd_list. The
@@ -201,33 +197,25 @@ __v4l2_async_notifier_add_fwnode_subdev(struct v4l2_async_notifier *notifier,
  * This is just like @v4l2_async_notifier_add_fwnode_subdev, but with the
  * exception that the fwnode refers to a local endpoint, not the remote one.
  */
-struct v4l2_async_subdev *
-__v4l2_async_notifier_add_fwnode_remote_subdev(struct v4l2_async_notifier *notif,
-					       struct fwnode_handle *endpoint,
-					       unsigned int asd_struct_size);
 #define v4l2_async_notifier_add_fwnode_remote_subdev(__notifier, __ep, __type)	\
 ((__type *)__v4l2_async_notifier_add_fwnode_remote_subdev(__notifier, __ep,	\
 							  sizeof(__type)))
 
+struct v4l2_async_subdev *
+__v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
+				     int adapter_id, unsigned short address,
+				     unsigned int asd_struct_size);
 /**
  * v4l2_async_notifier_add_i2c_subdev - Allocate and add an i2c async
  *				subdev to the notifier's master asd_list.
  *
- * @notifier: pointer to &struct v4l2_async_notifier
- * @adapter_id: I2C adapter ID to be matched
- * @address: I2C address of sub-device to be matched
- * @asd_struct_size: size of the driver's async sub-device struct, including
- *		     sizeof(struct v4l2_async_subdev). The &struct
- *		     v4l2_async_subdev shall be the first member of
- *		     the driver's async sub-device struct, i.e. both
- *		     begin at the same memory address.
+ * @__notifier: pointer to &struct v4l2_async_notifier
+ * @__adap: I2C adapter ID to be matched
+ * @__addr: I2C address of sub-device to be matched
+ * @__type: type of the struct that contains a struct v4l2_async_subdev.
  *
  * Same as above but for I2C matched sub-devices.
  */
-struct v4l2_async_subdev *
-__v4l2_async_notifier_add_i2c_subdev(struct v4l2_async_notifier *notifier,
-				     int adapter_id, unsigned short address,
-				     unsigned int asd_struct_size);
 #define v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr, __type)	\
 ((__type *)__v4l2_async_notifier_add_i2c_subdev(__notifier, __adap, __addr,	\
 						sizeof(__type)))

Thanks,
Mauro

#8 lore raw
In reply to Stephen Rothwell

Hi all,

Quoted 11 lines · On Mon, 8 Feb 2021 23:37:16 +1100 Stephen Rothwell <[email protected]> wrote:

After merging the v4l-dvb tree, today's linux-next build (htmldocs) produced this warning:

include/media/v4l2-async.h:178: warning: expecting prototype for v4l2_async_notifier_add_fwnode_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_subdev() instead include/media/v4l2-async.h:207: warning: expecting prototype for v4l2_async_notifier_add_fwnode_remote_subdev(). Prototype was for __v4l2_async_notifier_add_fwnode_remote_subdev() instead include/media/v4l2-async.h:230: warning: expecting prototype for v4l2_async_notifier_add_i2c_subdev(). Prototype was for __v4l2_async_notifier_add_i2c_subdev() instead

Maybe introduced by commit

c1cc23625062 ("media: v4l2-async: Discourage use of v4l2_async_notifier_add_subdev")

With the merge window about to open, this is a reminder that these warnings still exist.

Signature · 2 lines
Cheers,
Stephen Rothwell