]> git.itanic.dy.fi Git - linux-stable/commit
media: ti-vpe: cal: avoid FIELD_GET assertion
authorArnd Bergmann <arnd@arndb.de>
Thu, 3 Dec 2020 23:07:30 +0000 (00:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:30:18 +0000 (10:30 +0200)
commitc759c9e4bf38312557cf192cc7eaf9c9dea9e1ec
tree09de52e5592c82a1d94efc8550d5ea4209e7f560
parentd21e955de918821643c03fa93be581393cbcca4f
media: ti-vpe: cal: avoid FIELD_GET assertion

commit d7a7d721064c548042b019cd0d4d62e0bb878d71 upstream.

FIELD_GET() must only be used with a mask that is a compile-time
constant:

drivers/media/platform/ti-vpe/cal.h: In function 'cal_read_field':
include/linux/compiler_types.h:320:38: error: call to '__compiletime_assert_247' declared with attribute error: FIELD_GET: mask is not constant
include/linux/bitfield.h:46:3: note: in expansion of macro 'BUILD_BUG_ON_MSG'
   46 |   BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask),  \
      |   ^~~~~~~~~~~~~~~~
drivers/media/platform/ti-vpe/cal.h:220:9: note: in expansion of macro 'FIELD_GET'
  220 |  return FIELD_GET(mask, cal_read(cal, offset));
      |         ^~~~~~~~~

The problem here is that the function is not always inlined. Mark it
__always_inline to avoid the problem.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/platform/ti-vpe/cal.h