Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Sep 2017 10:43:01 -0700
From:      Ryan Libby <rlibby@freebsd.org>
To:        Conrad Meyer <cem@freebsd.org>
Cc:        src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r323692 - in head/sys/compat: linsysfs linux
Message-ID:  <CAHgpiFzQaOwZSeos9TSKfGA_auzvZ5DUu=XVTOVunqtTrh5skQ@mail.gmail.com>
In-Reply-To: <201709172340.v8HNeGuP016998@repo.freebsd.org>
References:  <201709172340.v8HNeGuP016998@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 17, 2017 at 4:40 PM, Conrad Meyer <cem@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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAHgpiFzQaOwZSeos9TSKfGA_auzvZ5DUu=XVTOVunqtTrh5skQ>