Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1104726ybh; Sat, 3 Aug 2019 18:05:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyOsQ+dSPu+Q52F+O9o+OuHs6JUBluyEccnuOwvYQy089rVsA8Ej4EQOH7LrSD/RQ8QhMXR X-Received: by 2002:a63:60a:: with SMTP id 10mr98767991pgg.381.1564880754717; Sat, 03 Aug 2019 18:05:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564880754; cv=none; d=google.com; s=arc-20160816; b=Uxmn3y5EiuFiRIrHE+ymjv5FmtoGPsHeRJ6QYBuPvExzRwex2sjagy6tJsld01UHxw 6dY/ltLGxmf2WIpCCVfUe1holCR44hseST5RAqRM7ixVQPTsmfY7CfzVg61GibilhvIY S/s/VjEy6PprrZcaa/syNH1N8x9bPfe4NQIgB+xq6ii69cFMyar9qHRlYRPvsV8rlCpB UQ+mwkUjLQ0sTarlIOv7Y+3uKZLwxRrKyM+4COGhg6csR3UfZ9lXjjjuB+uf026DzNnY yKHznnsWBPzA9FP6QRAK16wbKapUBuz8MwFEc8wnTzgdpT9w9Ln2UtlTO7/Vi5LK/+fK 1pmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=G0Rs3THwc2fJIRTGW9lnGtwokdpe+/s8nQ6H1nWRA2c=; b=U0ATlGU9AYv/QSYahTWRi608MMh8M0x7RoGHvVNfPkzMGWn8u3nVxxklX79UT1Gqy0 EVARAaqJAS0pq7QtpeS7pe2uNqE6lsaSUXjGVeLIbhh4fJnQqyrCayHxxfrTfUUx+fhj KaHLarAqElNuvAAr0iiX+xQ4eOnIGRhPzRgSUmPcA+sOT5NgSIFUvNbXtZ0hTTAaYNU8 sRlYmWCFSLBbYhshsaNUNWhkI4b+sbTFEKG9ELhnpNdftxBdePj6D59MkpRHpn8cttdM hlzc2qT3KYxd1A+qoWP3PiHX71DFm2YV5Vzb9HwufpTGm2oMl0E1j/LQh2nSAij3pMQB BRjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=icjR+pRr; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si9726538pjb.13.2019.08.03.18.05.07; Sat, 03 Aug 2019 18:05:54 -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=fail header.i=@gmail.com header.s=20161025 header.b=icjR+pRr; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404785AbfHBRXs (ORCPT + 99 others); Fri, 2 Aug 2019 13:23:48 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:41448 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404689AbfHBRXs (ORCPT ); Fri, 2 Aug 2019 13:23:48 -0400 Received: by mail-pf1-f196.google.com with SMTP id m30so36374100pff.8; Fri, 02 Aug 2019 10:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=G0Rs3THwc2fJIRTGW9lnGtwokdpe+/s8nQ6H1nWRA2c=; b=icjR+pRrZARh3oCsHTKiYoHsaoI/8xcNb4lVf8tHXk1wqjIKAPoWXUsJTVrS+F2yf7 Wh+ZgjaU/NWqDLPUZiozCSbA+dSbjAIGbM7hcxduh8zwR5aYrE0KyF2ULpt7WFplAuAp NyyDFz6nP/zxYREK4zabdxCLCDiVWGuk46ujqQ9jeLcLal76+XUwgJ1jDMYdlOfOxO0B OzQ7BGS4nBaU5tqKs/eFvavKGK7cbPDyPA4eaSKzdugcJWkN2osjIYi7YZysDCsAPAnI oOvSGvgnkA9PihLwFaobCOvVEWmvxxgaBsdvnXtK4cLYJyk9eGilbO+0kN2+V7WWEpJl sstw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=G0Rs3THwc2fJIRTGW9lnGtwokdpe+/s8nQ6H1nWRA2c=; b=Hd3ls37sY0Th+5aNWZf/N54olafXY6tpeN/Bkuae7cjCvMJqRUW0fgsFUoe1UYowNO UBkt4SAQmRkRXaxlIlc8HoP+FuVtPxxtSydPx6JJULw53w+d+P7i4Hl+f3tUWdQm3nPA 3uCtGfucflr+8qkpaS8P0JNtLW6GP1t0rRW0d628Uvjg3chS25a3P4eRi5s3CRD/85E0 YAQabn78OOx+IqqRYKq9M/mjCFM5tVQdqI8Y9X95LvzbSKKoD4etD3uaX6FYcAVfcqFf Bxo3iVGKBhKklP+yM+Y7JtI7IzzgeEQ+Js2HG/13FLydEd5UYNEBr4FLJPMzPLWADv8z 9mLg== X-Gm-Message-State: APjAAAW9ppGo0Wc+YztMhx0es1qFH4r2uGtrZsNzq7oxUdz+4jTiJQvE fgmHMhknRkV+fDkezMkbhUU= X-Received: by 2002:a65:6546:: with SMTP id a6mr72342957pgw.220.1564766627142; Fri, 02 Aug 2019 10:23:47 -0700 (PDT) Received: from suzukaze.ipads-lab.se.sjtu.edu.cn ([89.31.126.54]) by smtp.gmail.com with ESMTPSA id f32sm12295921pgb.21.2019.08.02.10.23.44 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 10:23:46 -0700 (PDT) From: Chuhong Yuan Cc: Saeed Mahameed , Leon Romanovsky , netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Chuhong Yuan Subject: [PATCH v2 1/3] mlx5: Use refcount_t for refcount Date: Sat, 3 Aug 2019 01:23:41 +0800 Message-Id: <20190802172341.8359-1-hslester96@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Changes in v2: - Add #include. include/linux/mlx5/driver.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h index 0e6da1840c7d..5b56f343ce87 100644 --- a/include/linux/mlx5/driver.h +++ b/include/linux/mlx5/driver.h @@ -47,6 +47,7 @@ #include #include #include +#include #include #include @@ -398,7 +399,7 @@ enum mlx5_res_type { struct mlx5_core_rsc_common { enum mlx5_res_type res; - atomic_t refcount; + refcount_t refcount; struct completion free; }; -- 2.20.1