Re: linux-next: build failure after merge of the char-misc tree

From: Thomas Weißschuh
Date: Mon May 05 2025 - 03:39:26 EST


Hi Stephen,

On 2025-05-05 17:14:25+1000, Stephen Rothwell wrote:
> Hi all,
>
> On Mon, 5 May 2025 16:12:15 +1000 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
> >
> > On Mon, 5 May 2025 16:08:31 +1000 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:
> > >
> > > After merging the char-misc tree, today's linux-next build (x86_64
> > > allmodconfig) failed like this:
> > >
> > > drivers/hv/vmbus_drv.c:1893:22: error: initialization of 'const struct bin_attribute * const*' from incompatible pointer type 'struct bin_attribute **' [-Wincompatible-pointer-types]
> > > 1893 | .bin_attrs = vmbus_chan_bin_attrs,
> > > | ^~~~~~~~~~~~~~~~~~~~
> > > drivers/hv/vmbus_drv.c:1893:22: note: (near initialization for 'vmbus_chan_group.<anonymous>.bin_attrs')
> > >
> > > Caused by commit
> > >
> > > f31fe8165d36 ("uio_hv_generic: Fix sysfs creation path for ring buffer")
> > >
> > > interacting with commit
> > >
> > > 9bec944506fa ("sysfs: constify attribute_group::bin_attrs")
> > >
> > > from the driver-core tree.
> > >
> > > I have applied the following merge fixup for today.
> >
> > From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> > Date: Mon, 5 May 2025 15:56:12 +1000
> > Subject: [PATCH] uio_hv_generic: constify bin_attribute definitions
> >
> > Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> > ---
> > drivers/hv/vmbus_drv.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> > index e3d51a316316..857109bb99a0 100644
> > --- a/drivers/hv/vmbus_drv.c
> > +++ b/drivers/hv/vmbus_drv.c
> > @@ -1815,7 +1815,7 @@ static int hv_mmap_ring_buffer_wrapper(struct file *filp, struct kobject *kobj,
> > return channel->mmap_ring_buffer(channel, vma);
> > }
> >
> > -static struct bin_attribute chan_attr_ring_buffer = {
> > +static const struct bin_attribute chan_attr_ring_buffer = {
> > .attr = {
> > .name = "ring",
> > .mode = 0600,
> > @@ -1841,7 +1841,7 @@ static struct attribute *vmbus_chan_attrs[] = {
> > NULL
> > };
> >
> > -static struct bin_attribute *vmbus_chan_bin_attrs[] = {
> > +static const struct bin_attribute *vmbus_chan_bin_attrs[] = {

An additional "const" would be a bit better:

+static const struct bin_attribute *const vmbus_chan_bin_attrs[] = {

Otherwise looks good in general.

> > &chan_attr_ring_buffer,
> > NULL
> > };
> > --
> > 2.47.2

> It occurred to me that the above patch could be applied directly to the
> char-misc tree if vmbus_chan_bin_attrs was assigned to .bin_attrs_new
> instead of .bin_attrs (later in the file), right?

Yes, that would also work. It will require adaption of the future patch
removing .bin_attrs_new again, but that shouldn't be an issue.


Thomas