svn commit: r323692 - in head/sys/compat: linsysfs linux

Ryan Libby rlibby at freebsd.org
Mon Sep 18 17:43:09 UTC 2017


On Sun, Sep 17, 2017 at 4:40 PM, Conrad Meyer <cem at freebsd.org> wrote:
> Author: cem
> Date: Sun Sep 17 23:40:16 2017
> New Revision: 323692
> URL: https://svnweb.freebsd.org/changeset/base/323692
>
> Log:
>   linsysfs(5): Add support for recent libdrm
>
>   Expose more information about PCI devices (and GPUs in particular) via
>   linsysfs to libdrm.
>
>   This allows unmodified modern 64-bit Linux libdrm to work, which allows
>   modern Linux Mesa to work.  The submitter reports that he tested the change
>   with an Ubuntu 16.04 chroot + amdgpu from graphics/drm-next-kmod.
>
>   PR:           222375
>   Submitted by: Greg V <greg AT unrelenting.technology>
>
> Modified:
>   head/sys/compat/linsysfs/linsysfs.c
>   head/sys/compat/linux/linux_util.c
>
> Modified: head/sys/compat/linsysfs/linsysfs.c
> ==============================================================================
> --- head/sys/compat/linsysfs/linsysfs.c Sun Sep 17 22:58:13 2017        (r323691)
> +++ head/sys/compat/linsysfs/linsysfs.c Sun Sep 17 23:40:16 2017        (r323692)
> @@ -133,20 +133,135 @@ linsysfs_link_scsi_host(PFS_FILL_ARGS)
>         return (0);
>  }
>
> +static int
> +linsysfs_fill_data(PFS_FILL_ARGS)
> +{
> +       sbuf_printf(sb, "%s", pn->pn_data);
> +       return (0);
> +}

This broke the gcc build with -Wformat [1]:

/workspace/src/sys/compat/linsysfs/linsysfs.c: In function 'linsysfs_fill_data':
/workspace/src/sys/compat/linsysfs/linsysfs.c:139:20: error: format
'%s' expects argument of type 'char *', but argument 3 has type 'void
*' [-Werror=format=]
  sbuf_printf(sb, "%s", pn->pn_data);

It builds if a char * cast is added.  Is that the right fix?

[1] https://ci.freebsd.org/job/FreeBSD-head-amd64-gcc/2532/


More information about the svn-src-all mailing list