Hi,
On 09/04/2022 00:43, Sakari Ailus wrote:
Moi,
On Sat, Apr 09, 2022 at 04:09:35AM +0800, kernel test robot wrote:
tree: git://linuxtv.org/sailus/media_tree.git master
head: bd1d801f302289ddbf86ff6c38fcc91aef8e7609
commit: 3f1a6a471c6a8b5ba772cb82538ad03fa0255e7c [28/30] media: subdev: add locking wrappers to subdev op wrappers
config: arm-randconfig-r022-20220408 (https://download.01.org/0day-ci/archive/20220409/202204090350.ZbhpomcE-lkp@xxxxxxxxx/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project c29a51b3a257908aebc01cd7c4655665db317d66)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
git remote add sailus-media-tree git://linuxtv.org/sailus/media_tree.git
git fetch --no-tags sailus-media-tree master
git checkout 3f1a6a471c6a8b5ba772cb82538ad03fa0255e7c
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/media/v4l2-core/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>
All error/warnings (new ones prefixed by >>):
drivers/media/v4l2-core/v4l2-subdev.c:342:1: error: implicit declaration of function 'v4l2_subdev_lock_and_get_active_state' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
DEFINE_STATE_WRAPPER(get_fmt, struct v4l2_subdev_format);
^
drivers/media/v4l2-core/v4l2-subdev.c:335:12: note: expanded from macro 'DEFINE_STATE_WRAPPER'
state = v4l2_subdev_lock_and_get_active_state(sd); \
I guess this happens if MC is disabled? Maybe something else, too?
I looked at this and while I can "fix" this easily by dropping the
wrapper for !MC, I feel I'm a bit confused what features are supported
depending on the kconfig. And this is important for the streams API too.
So we always have v4l2-subdev when media framework is enabled. On top of
that, we may have CONFIG_MEDIA_CONTROLLER, which adds media controller,
links, pads. And on top of that we may have CONFIG_VIDEO_V4L2_SUBDEV_API
which adds the uAPI for subdevs.
Is the following correct, and is there something important missing from
below:
No CONFIG_MEDIA_CONTROLLER (and thus no CONFIG_VIDEO_V4L2_SUBDEV_API):
- Have struct v4l2_subdev_pad_ops, although we don't have pads. What
does it mean to call a pad op if there are no pads? Or do we have pads,
but it's just a subdev driver internal decision on how to handle a pad
op for, say, pad 2?
- Have struct v4l2_subdev_state, as it's required by
v4l2_subdev_pad_ops, but afaics state is always NULL. And the state
contains pad configs, and we don't have pads, so if !MC we don't have
state in practice.
- If the above if true, should we hide struct v4l2_subdev_state behind
CONFIG_MEDIA_CONTROLLER, and just do "struct v4l2_subdev_state;", so
that null state pointers would compile? It would reveal any accidental
uses of the state if !MC.
CONFIG_MEDIA_CONTROLLER:
- Adds pads
- Adds active state
CONFIG_VIDEO_V4L2_SUBDEV_API:
- Adds try state
- Adds subdev ioctls
Tomi