All of lore.kernel.org
 help / color / mirror / Atom feed
* re: qlcnic: 83xx data path routines
@ 2014-10-16 13:45 Dan Carpenter
  2014-10-19  5:26 ` Sony Chacko
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-10-16 13:45 UTC (permalink / raw)
  To: kernel-janitors

Hello Sony Chacko,

The patch 4be41e92f7c6: "qlcnic: 83xx data path routines" from Jan 1,
2013, leads to the following static checker warning:

	drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c:2201 qlcnic_83xx_process_rcv_ring_diag()
	warn: masking and shifting to zero

drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
  2186  void qlcnic_83xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *sds_ring)
  2187  {
  2188          struct qlcnic_adapter *adapter = sds_ring->adapter;
  2189          struct status_desc *desc;
  2190          u64 sts_data[2];
  2191          int ring, opcode;
  2192          u32 consumer = sds_ring->consumer;
  2193  
  2194          desc = &sds_ring->desc_head[consumer];
  2195          sts_data[0] = le64_to_cpu(desc->status_desc_data[0]);
  2196          sts_data[1] = le64_to_cpu(desc->status_desc_data[1]);
  2197          opcode = qlcnic_83xx_opcode(sts_data[1]);
  2198          if (!opcode)
  2199                  return;
  2200  
  2201          ring = QLCNIC_FETCH_RING_ID(qlcnic_83xx_hndl(sts_data[0]));
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ring is always zero.  Probably it should be:
		ring = QLCNIC_FETCH_RING_ID(sts_data[0]);

  2202          qlcnic_83xx_process_rcv_diag(adapter, ring, sts_data);
  2203          desc = &sds_ring->desc_head[consumer];
  2204          desc->status_desc_data[0] = cpu_to_le64(STATUS_OWNER_PHANTOM);
  2205          consumer = get_next_index(consumer, sds_ring->num_desc);
  2206          sds_ring->consumer = consumer;
  2207          writel(consumer, sds_ring->crb_sts_consumer);
  2208  }

regards,
dan carpenter

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

* RE: qlcnic: 83xx data path routines
  2014-10-16 13:45 qlcnic: 83xx data path routines Dan Carpenter
@ 2014-10-19  5:26 ` Sony Chacko
  0 siblings, 0 replies; 2+ messages in thread
From: Sony Chacko @ 2014-10-19  5:26 UTC (permalink / raw)
  To: kernel-janitors

> -----Original Message-----
> From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> Sent: Thursday, October 16, 2014 6:46 AM
> To: Sony Chacko
> Cc: Dept-GE Linux NIC Dev; kernel-janitors@vger.kernel.org
> Subject: re: qlcnic: 83xx data path routines
>
> Hello Sony Chacko,
>
> The patch 4be41e92f7c6: "qlcnic: 83xx data path routines" from
> Jan 1, 2013, leads to the following static checker warning:
>
>       drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c:2201
> qlcnic_83xx_process_rcv_ring_diag()
>       warn: masking and shifting to zero
>
> drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c
>   2186  void qlcnic_83xx_process_rcv_ring_diag(struct
> qlcnic_host_sds_ring *sds_ring)
>   2187  {
>   2188          struct qlcnic_adapter *adapter = sds_ring->adapter;
>   2189          struct status_desc *desc;
>   2190          u64 sts_data[2];
>   2191          int ring, opcode;
>   2192          u32 consumer = sds_ring->consumer;
>   2193
>   2194          desc = &sds_ring->desc_head[consumer];
>   2195          sts_data[0] = le64_to_cpu(desc-
> >status_desc_data[0]);
>   2196          sts_data[1] = le64_to_cpu(desc-
> >status_desc_data[1]);
>   2197          opcode = qlcnic_83xx_opcode(sts_data[1]);
>   2198          if (!opcode)
>   2199                  return;
>   2200
>   2201          ring > QLCNIC_FETCH_RING_ID(qlcnic_83xx_hndl(sts_data[0]));
>
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ring is always zero.  Probably it should be:
>               ring = QLCNIC_FETCH_RING_ID(sts_data[0]);
>
>   2202          qlcnic_83xx_process_rcv_diag(adapter, ring,
> sts_data);
> regards,
> dan carpenter

Dan ,

Thanks, I will submit the appropriate fix in the next set of patches.

Sony

________________________________

This message and any attached documents contain information from the sending company or its parent company(s), subsidiaries, divisions or branch offices that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

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

end of thread, other threads:[~2014-10-19  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-16 13:45 qlcnic: 83xx data path routines Dan Carpenter
2014-10-19  5:26 ` Sony Chacko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.