lkml.org 
[lkml]   [2019]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.4 127/266] vfio/pci: use correct format characters
    Date
    [ Upstream commit 426b046b748d1f47e096e05bdcc6fb4172791307 ]

    When compiling with -Wformat, clang emits the following warnings:

    drivers/vfio/pci/vfio_pci.c:1601:5: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~

    drivers/vfio/pci/vfio_pci.c:1601:13: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~

    drivers/vfio/pci/vfio_pci.c:1601:21: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~~~~

    drivers/vfio/pci/vfio_pci.c:1601:32: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~~~~

    drivers/vfio/pci/vfio_pci.c:1605:5: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~

    drivers/vfio/pci/vfio_pci.c:1605:13: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~

    drivers/vfio/pci/vfio_pci.c:1605:21: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~~~~

    drivers/vfio/pci/vfio_pci.c:1605:32: warning: format specifies type
    'unsigned short' but the argument has type 'unsigned int' [-Wformat]
    vendor, device, subvendor, subdevice,
    ^~~~~~~~~
    The types of these arguments are unconditionally defined, so this patch
    updates the format character to the correct ones for unsigned ints.

    Link: https://github.com/ClangBuiltLinux/linux/issues/378
    Signed-off-by: Louis Taylor <louis@kragniz.eu>
    Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
    Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/vfio/pci/vfio_pci.c | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c
    index b31b84f56e8f..47b229fa5e8e 100644
    --- a/drivers/vfio/pci/vfio_pci.c
    +++ b/drivers/vfio/pci/vfio_pci.c
    @@ -1191,11 +1191,11 @@ static void __init vfio_pci_fill_ids(void)
    rc = pci_add_dynid(&vfio_pci_driver, vendor, device,
    subvendor, subdevice, class, class_mask, 0);
    if (rc)
    - pr_warn("failed to add dynamic id [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x (%d)\n",
    + pr_warn("failed to add dynamic id [%04x:%04x[%04x:%04x]] class %#08x/%08x (%d)\n",
    vendor, device, subvendor, subdevice,
    class, class_mask, rc);
    else
    - pr_info("add [%04hx:%04hx[%04hx:%04hx]] class %#08x/%08x\n",
    + pr_info("add [%04x:%04x[%04x:%04x]] class %#08x/%08x\n",
    vendor, device, subvendor, subdevice,
    class, class_mask);
    }
    --
    2.20.1


    \
     
     \ /
      Last update: 2019-05-15 14:11    [W:3.735 / U:0.108 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site