Message ID | 20180321211056.3339-3-yuval.shaia@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 03/21/2018 06:10 PM, Yuval Shaia wrote: > Macro should not cast the given variable to u64 instead it should use > the supplied format argument (fmt). > > Reported-by: Eric Blake <eblake@redhat.com> > Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> > --- > hw/rdma/rdma_backend.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c > index f1a37ba4a2..0391a7dd95 100644 > --- a/hw/rdma/rdma_backend.c > +++ b/hw/rdma/rdma_backend.c > @@ -656,8 +656,8 @@ void rdma_backend_destroy_qp(RdmaBackendQP *qp) > #define CHK_ATTR(req, dev, member, fmt) ({ \ > pr_dbg("%s="fmt","fmt"\n", #member, dev.member, req->member); \ > if (req->member > dev.member) { \ > - warn_report("%s = 0x%lx is higher than host device capability 0x%lx", \ > - #member, (uint64_t)req->member, (uint64_t)dev.member); \ > + warn_report("%s = "fmt" is higher than host device capability "fmt, \ > + #member, req->member, dev.member); \ > req->member = dev.member; \ > } \ > pr_dbg("%s="fmt"\n", #member, req->member); }) >
diff --git a/hw/rdma/rdma_backend.c b/hw/rdma/rdma_backend.c index f1a37ba4a2..0391a7dd95 100644 --- a/hw/rdma/rdma_backend.c +++ b/hw/rdma/rdma_backend.c @@ -656,8 +656,8 @@ void rdma_backend_destroy_qp(RdmaBackendQP *qp) #define CHK_ATTR(req, dev, member, fmt) ({ \ pr_dbg("%s="fmt","fmt"\n", #member, dev.member, req->member); \ if (req->member > dev.member) { \ - warn_report("%s = 0x%lx is higher than host device capability 0x%lx", \ - #member, (uint64_t)req->member, (uint64_t)dev.member); \ + warn_report("%s = "fmt" is higher than host device capability "fmt, \ + #member, req->member, dev.member); \ req->member = dev.member; \ } \ pr_dbg("%s="fmt"\n", #member, req->member); })
Macro should not cast the given variable to u64 instead it should use the supplied format argument (fmt). Reported-by: Eric Blake <eblake@redhat.com> Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> --- hw/rdma/rdma_backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)