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

From: Stephen Rothwell <[email-masked]>
Date: Mon, 5 May 2025 17:14:25 +1000

Hi all,

On Mon, 5 May 2025 16:12:15 +1000 Stephen Rothwell <[email-masked]> wrote:
>
> On Mon, 5 May 2025 16:08:31 +1000 Stephen Rothwell <[email-masked]> 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 <[email-masked]>
> Date: Mon, 5 May 2025 15:56:12 +1000
> Subject: [PATCH] uio_hv_generic: constify bin_attribute definitions
> 
> Signed-off-by: Stephen Rothwell <[email-masked]>
> ---
>  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[] = {
>  	&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?
-- 
Cheers,
Stephen Rothwell