IB/srp: Fix a 32-bit compiler warning
Subsystems (3)
PATCH 1/1 IB/srp: Fix a 32-bit compiler warning
The result of a pointer subtraction has type ptrdiff_t. Hence change a %ld format specifier into %td. This change avoids that the following warning is printed on 32-bit systems:
warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]
Reported-by Wu Fengguang <[email protected]>
Signed-off-by Bart Van Assche <[email protected]>
Cc Sagi Grimberg <sagig-VPRAkNaXOzVWk0Htik3J/[email protected]>
Cc Sebastian Parschauer <[email protected]>
--- drivers/infiniband/ulp/srp/ib_srp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/ulp/srp/ib_srp.c +1 -1
@@ -1747,7 +1747,7 @@ static void srp_process_rsp(struct srp_rdma_ch *ch, struct srp_rsp *rsp) }if (!scmnd) {shost_printk (KERN_ERR , target->scsi_host, -"Null scmnd for RSP w/tag %#016llx received on ch %ld / QP %#x\n" , +"Null scmnd for RSP w/tag %#016llx received on ch %td / QP %#x\n" , rsp->tag, ch - target->ch, ch->qp->qp_num);spin_lock_irqsave (&ch->lock, flags);
Signature · 6 lines
2.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 5 lines · Bart Van Assche
The result of a pointer subtraction has type
ptrdiff_t. Hence change a %ld format specifier into %td. This change avoids that the following warning is printed on 32-bit systems:warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'int' [-Wformat=]
Thanks. Given that this is a new warning in the patches I merged I'll add this one as well.