Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6253993ybi; Wed, 31 Jul 2019 11:00:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxj5kJxL6ioc/Zrg/JhshZZW0wNkf18llJa0bfSWGvLd2hJOaqtSbtq0izdXrIA/z3kj3KZ X-Received: by 2002:a62:7552:: with SMTP id q79mr48944330pfc.71.1564596028252; Wed, 31 Jul 2019 11:00:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564596028; cv=none; d=google.com; s=arc-20160816; b=DqkkUY6fEnd2RIT8d2CgYAD3BwGVxArWOygMdoXC+SclLL8vwXuxXve5H4K/KqDiQf Qmn6vFfDVUArHASoy/0m14/JhtzuelDz15JmPDujU6hFjyRhHSFB5U+jFAuRXX6wEt9A XO/xYIlzB9OlcePnWuxFA4R6ynVG9ysIa2u5I5yZ5xXade+lLvwL3wQTWD/xve4XdYsF zryJBLI+Y5KQzxvsQUqYIcJsCgdWlmh9+ULmEa4FpjtjCcDanIEM63/YKwjsYdJC2mlX 7O3/87js70zGI0WstLvRdeGPT353Cq6wFvo6z/KBipScj8JfeXJNYtzHxABPi5w+bYxX D3TQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kle/jIqFf1IBE1ChD4Ekr3jmYwXu/5ocoCRxbcDWju8=; b=DjKemo14u1TmlCrfLdSDGt2/+Pdlkk1VxxN9EAXM7GEp+CJ0VLGxDwqTnLxi4DpD5/ iceoeqyDKok0m/byEunN6vZWxEI/HtIMQvNk8FCBCfM0vSFehp9R8Gw1Qi1FTp+rTNRy nmXAFKjWAkyLetmcgM7JtYC58dX4OvJoAdFjeBcZdA/z6rkXRsrgz7v4YAxh0DsYl4Ii lkUec8Um6lhZZohJUJ4HvkLbaH02YRW3Bixsu5NmBW6sdVvjCKPBgBbjBfZMRuz5+a+S zhEOLnYh0Jq60Xe8ojfPFvd1Eox/qhiMQ40jhx0+5uFXno1un1PS8PyKtijzsFmwMDTN 05FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=eE8FsgX7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s15si33462636pgm.413.2019.07.31.11.00.12; Wed, 31 Jul 2019 11:00:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=eE8FsgX7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727000AbfGaR6v (ORCPT + 99 others); Wed, 31 Jul 2019 13:58:51 -0400 Received: from mail-yw1-f66.google.com ([209.85.161.66]:42660 "EHLO mail-yw1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbfGaR6u (ORCPT ); Wed, 31 Jul 2019 13:58:50 -0400 Received: by mail-yw1-f66.google.com with SMTP id z63so25277693ywz.9 for ; Wed, 31 Jul 2019 10:58:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kle/jIqFf1IBE1ChD4Ekr3jmYwXu/5ocoCRxbcDWju8=; b=eE8FsgX7scWFsv3ZMwBZQ7axOCEi+d10t8w6hFWXlivn3IMzmsGuTmyWHXdxPCwRKv o+y8WWvSNtpaGElI7rzmnGJO4ic98MrxUyhjnEiDbhAjk+2YVXO1iRYlrnxtxQFqiCQ2 DQPgEFSaZS6nf3TaVpT9xi7XiX5dhLwrV+3ag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kle/jIqFf1IBE1ChD4Ekr3jmYwXu/5ocoCRxbcDWju8=; b=kLs99aIDw/DTVeX0x4m3WTtnJamlE4z6L5v6y4xNpC+YcKKFEXjWv0nai/5OHNgbY/ aoN9c7eXZNKBAl2y2pUz58GufqqvhucqrFcubNcqF3XiOGp34hyMqchYoZZYTxyr3D/7 YE8DOEH96BSvbKNmAA234MoPaRzAw6yeQXlUW4ozmrRwmt1x1OrFyhuL9fVAuuVPYSYd wn3w6w29Mlo2cArdHDgXbfkCftyltzhXocgnJIaHrUq0veotH/ZNL9h16iACADbXhJcr P38Kf9L7UvFUX6q/RBHHesncpWtBRB0U+mXJpqgIkDlGZ/nUWacY4fXUqvvNrHnu+il1 iG9Q== X-Gm-Message-State: APjAAAXW4Td6FL107Xn2zPYgc9v5BMsV0LVV7Y2NlT0ir2yZmusBKd9b Ek56hgZtHW8AMzl84dFDaiLLDa5yzDsa3GwQgRHJdQ== X-Received: by 2002:a81:9a01:: with SMTP id r1mr70879517ywg.490.1564595929908; Wed, 31 Jul 2019 10:58:49 -0700 (PDT) MIME-Version: 1.0 References: <20190731122224.1003-1-hslester96@gmail.com> In-Reply-To: <20190731122224.1003-1-hslester96@gmail.com> From: Michael Chan Date: Wed, 31 Jul 2019 10:58:38 -0700 Message-ID: Subject: Re: [PATCH 2/2] cnic: Use refcount_t for refcount To: Chuhong Yuan Cc: "David S . Miller" , Netdev , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(&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.