Re: [PATCH 2/2] cnic: Use refcount_t for refcount

2019-08-01 Thread Michael Chan
On Wed, Jul 31, 2019 at 7:22 PM Chuhong Yuan wrote: > > Michael Chan 于2019年8月1日周四 上午1:58写道: > > > > On Wed, Jul 31, 2019 at 5:22 AM Chuhong Yuan wrote: > > > > > static void cnic_ctx_wr(struct cnic_dev *dev, u32 cid_addr, u32 off, u32 > > > val) > > > @@ -494,7 +494,7 @@ int

Re: [PATCH 2/2] cnic: Use refcount_t for refcount

2019-07-31 Thread Chuhong Yuan
Michael Chan 于2019年8月1日周四 上午1:58写道: > > On Wed, Jul 31, 2019 at 5:22 AM Chuhong Yuan wrote: > > > static void cnic_ctx_wr(struct cnic_dev *dev, u32 cid_addr, u32 off, u32 > > val) > > @@ -494,7 +494,7 @@ int cnic_register_driver(int ulp_type, struct > > cnic_ulp_ops *ulp_ops) > > } >

Re: [PATCH 2/2] cnic: Use refcount_t for refcount

2019-07-31 Thread Michael Chan
On Wed, Jul 31, 2019 at 5:22 AM Chuhong Yuan wrote: > static void cnic_ctx_wr(struct cnic_dev *dev, u32 cid_addr, u32 off, u32 val) > @@ -494,7 +494,7 @@ int cnic_register_driver(int ulp_type, struct > cnic_ulp_ops *ulp_ops) > } > read_unlock(_dev_lock); > > -

[PATCH 2/2] cnic: Use refcount_t for refcount

2019-07-31 Thread Chuhong Yuan
refcount_t is better for reference counters since its implementation can prevent overflows. So convert atomic_t ref counters to refcount_t. Signed-off-by: Chuhong Yuan --- drivers/net/ethernet/broadcom/cnic.c| 26 - drivers/net/ethernet/broadcom/cnic_if.h | 6 +++---