On Mon, Apr 26, 2021 at 04:20:11PM +0200, Christoph Hellwig wrote: > > diff --git a/drivers/vfio/mdev/mdev_sysfs.c b/drivers/vfio/mdev/mdev_sysfs.c > > index 5a3873d1a275ae..0ccfeb3dda2455 100644 > > +++ b/drivers/vfio/mdev/mdev_sysfs.c > > @@ -244,11 +244,20 @@ static ssize_t remove_store(struct device *dev, struct device_attribute *attr, > > > > static DEVICE_ATTR_WO(remove); > > > > -static const struct attribute *mdev_device_attrs[] = { > > +static struct attribute *mdev_device_attrs[] = { > > Why does this lose the const? Due to the way the driver core sets up it structs: drivers/vfio/mdev/mdev_sysfs.c:273:11: error: initialization of ‘struct attribute **’ from incompatible pointer type ‘const struct attribute **’ [-Werror=incompatible-pointer-types] 273 | .attrs = mdev_device_attrs, struct attribute_group { [..] struct attribute **attrs; Thanks, Jason