linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* re: IB/hfi1: add driver files
@ 2015-09-16  7:13 Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-09-16  7:13 UTC (permalink / raw)
  To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Mike Marciniszyn,

The patch 7724105686e7: "IB/hfi1: add driver files" from Jul 30,
2015, leads to the following static checker warning:

	drivers/staging/rdma/hfi1/user_sdma.c:1349 set_txreq_header_ahg()
	warn: mask and shift to zero

drivers/staging/rdma/hfi1/user_sdma.c
  1347                  /* Clear KDETH.SH on last packet */
  1348                  if (unlikely(tx->flags & USER_SDMA_TXREQ_FLAGS_LAST_PKT)) {
  1349                          val |= cpu_to_le16(KDETH_GET(hdr->kdeth.ver_tid_offset,
  1350                                                                  INTR) >> 16);


KDETH_GET(hdr->kdeth.ver_tid_offset, INTR) is zero or one.  1 >> 16 is
zero.  This line is a no-op.

  1351                          val &= cpu_to_le16(~(1U << 13));
  1352                          AHG_HEADER_SET(req->ahg, diff, 7, 16, 14, val);
  1353                  } else
  1354                          AHG_HEADER_SET(req->ahg, diff, 7, 16, 12, val);

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* re: IB/hfi1: add driver files
@ 2015-09-16  7:14 Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2015-09-16  7:14 UTC (permalink / raw)
  To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Mike Marciniszyn,

The patch 7724105686e7: "IB/hfi1: add driver files" from Jul 30,
2015, leads to the following static checker warning:

	drivers/staging/rdma/hfi1/rc.c:2399 hfi1_rc_hdrerr()
	warn: right shift assign to zero

drivers/staging/rdma/hfi1/rc.c
  2376  void hfi1_rc_hdrerr(
  2377          struct hfi1_ctxtdata *rcd,
  2378          struct hfi1_ib_header *hdr,
  2379          u32 rcv_flags,
  2380          struct hfi1_qp *qp)
  2381  {
  2382          int has_grh = rcv_flags & HFI1_HAS_GRH;
  2383          struct hfi1_other_headers *ohdr;
  2384          struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num);
  2385          int diff;
  2386          u8 opcode;
  2387          u32 psn;
  2388  
  2389          /* Check for GRH */
  2390          ohdr = &hdr->u.oth;
  2391          if (has_grh)
  2392                  ohdr = &hdr->u.l.oth;
  2393  
  2394          opcode = be32_to_cpu(ohdr->bth[0]);
  2395          if (hfi1_ruc_check_hdr(ibp, hdr, has_grh, qp, opcode))
  2396                  return;
  2397  
  2398          psn = be32_to_cpu(ohdr->bth[2]);
  2399          opcode >>= 24;
  2400  

opcode should probably be a u32 instead of a u8.

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* re: IB/hfi1: add driver files
@ 2016-06-27 13:19 Dan Carpenter
  2016-07-13 16:27 ` Marciniszyn, Mike
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2016-06-27 13:19 UTC (permalink / raw)
  To: mike.marciniszyn-ral2JQCrhuEAvxtiuMwx3w; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA

Hello Mike Marciniszyn,

The patch 7724105686e7: "IB/hfi1: add driver files" from Jul 30,
2015, leads to the following static checker warning:

	drivers/infiniband/hw/hfi1/user_sdma.c:1438 set_txreq_header_ahg()
	warn: mask and shift to zero

drivers/infiniband/hw/hfi1/user_sdma.c
  1436                  /* Clear KDETH.SH on last packet */
  1437                  if (unlikely(tx->flags & TXREQ_FLAGS_REQ_LAST_PKT)) {
  1438                          val |= cpu_to_le16(KDETH_GET(hdr->kdeth.ver_tid_offset,
  1439                                                                  INTR) >> 16);

The >> 16 should probably be deleted.  My guess is that it's left over
from an open coded byte swap?

  1440                          val &= cpu_to_le16(~(1U << 13));
  1441                          AHG_HEADER_SET(req->ahg, diff, 7, 16, 14, val);
  1442                  } else {
  1443                          AHG_HEADER_SET(req->ahg, diff, 7, 16, 12, val);
  1444                  }

regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: IB/hfi1: add driver files
  2016-06-27 13:19 Dan Carpenter
@ 2016-07-13 16:27 ` Marciniszyn, Mike
  0 siblings, 0 replies; 4+ messages in thread
From: Marciniszyn, Mike @ 2016-07-13 16:27 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org

> The patch 7724105686e7: "IB/hfi1: add driver files" from Jul 30, 2015, leads to
> the following static checker warning:
> 
> 	drivers/infiniband/hw/hfi1/user_sdma.c:1438
> set_txreq_header_ahg()
> 	warn: mask and shift to zero
> 
> drivers/infiniband/hw/hfi1/user_sdma.c
>   1436                  /* Clear KDETH.SH on last packet */
>   1437                  if (unlikely(tx->flags & TXREQ_FLAGS_REQ_LAST_PKT)) {
>   1438                          val |= cpu_to_le16(KDETH_GET(hdr-
> >kdeth.ver_tid_offset,
>   1439                                                                  INTR) >> 16);
> 
> The >> 16 should probably be deleted.  My guess is that it's left over from an
> open coded byte swap?
> 
>   1440                          val &= cpu_to_le16(~(1U << 13));
>   1441                          AHG_HEADER_SET(req->ahg, diff, 7, 16, 14, val);
>   1442                  } else {
>   1443                          AHG_HEADER_SET(req->ahg, diff, 7, 16, 12, val);
>   1444                  }
> 

Dan, what static checker shows this?
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-13 16:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16  7:14 IB/hfi1: add driver files Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2016-06-27 13:19 Dan Carpenter
2016-07-13 16:27 ` Marciniszyn, Mike
2015-09-16  7:13 Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).