Message ID | 20230417092959.3571307-1-sakari.ailus@linux.intel.com |
---|---|
State | Accepted |
Commit | 25857a007d521acee63012876ba00d94112c2ba3 |
Headers | show |
Series | [1/1] media: ipu3-cio2: Fix container_of() macro wrapper arguments | expand |
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com> ------------------------------------------------------------------------ BRs, Bingbu Cao >-----Original Message----- >From: Sakari Ailus <sakari.ailus@linux.intel.com> >Sent: Monday, April 17, 2023 17:30 >To: linux-media@vger.kernel.org >Cc: Cao, Bingbu <bingbu.cao@intel.com> >Subject: [PATCH 1/1] media: ipu3-cio2: Fix container_of() macro wrapper >arguments > >The argument of the to_sensor_asd() is called the same as the field name >for the container_of() macro, so it only works if the argument name is >"asd". Fix it. > >Also switch to container_of_const(). > >Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> >--- > drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c >b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c >index fa53d0835c89c..39ad1309a61b5 100644 >--- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c >+++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c >@@ -1374,7 +1374,8 @@ struct sensor_async_subdev { > struct csi2_bus_info csi2; > }; > >-#define to_sensor_asd(asd) container_of(asd, struct sensor_async_subdev, >asd) >+#define to_sensor_asd(__asd) \ >+ container_of_const(__asd, struct sensor_async_subdev, asd) > > /* The .bound() notifier callback when a match is found */ static int >cio2_notifier_bound(struct v4l2_async_notifier *notifier, >-- >2.30.2
diff --git a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c index fa53d0835c89c..39ad1309a61b5 100644 --- a/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c +++ b/drivers/media/pci/intel/ipu3/ipu3-cio2-main.c @@ -1374,7 +1374,8 @@ struct sensor_async_subdev { struct csi2_bus_info csi2; }; -#define to_sensor_asd(asd) container_of(asd, struct sensor_async_subdev, asd) +#define to_sensor_asd(__asd) \ + container_of_const(__asd, struct sensor_async_subdev, asd) /* The .bound() notifier callback when a match is found */ static int cio2_notifier_bound(struct v4l2_async_notifier *notifier,
The argument of the to_sensor_asd() is called the same as the field name for the container_of() macro, so it only works if the argument name is "asd". Fix it. Also switch to container_of_const(). Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> --- drivers/media/pci/intel/ipu3/ipu3-cio2-main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)