Thread (4 messages) 4 messages, 2 authors, 2019-08-01

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

From: Michael Chan <michael.chan@broadcom.com>
Date: 2019-07-31 17:58:52
Also in: lkml

On Wed, Jul 31, 2019 at 5:22 AM Chuhong Yuan [off-list ref] wrote:
quoted hunk ↗ jump to hunk
 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(&cnic_dev_lock);

-       atomic_set(&ulp_ops->ref_count, 0);
+       refcount_set(&ulp_ops->ref_count, 0);
        rcu_assign_pointer(cnic_ulp_tbl[ulp_type], ulp_ops);
        mutex_unlock(&cnic_lock);
Willem's comment applies here too.  The driver needs to be modified to
count from 1 to use refcount_t.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help