Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757352AbcLTOwk (ORCPT ); Tue, 20 Dec 2016 09:52:40 -0500 Received: from mail-db5eur01on0050.outbound.protection.outlook.com ([104.47.2.50]:56497 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753581AbcLTOwX (ORCPT ); Tue, 20 Dec 2016 09:52:23 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=leonro@mellanox.com; Date: Tue, 20 Dec 2016 16:19:36 +0200 From: Leon Romanovsky To: Geliang Tang CC: Saeed Mahameed , Matan Barak , , , Subject: Re: [PATCH] net/mlx5: use rb_entry() Message-ID: <20161220141936.GX1074@mtr-leonro.local> References: <8443fa3fa03d82c2b829375d8020762e5236dc6d.1482203930.git.geliangtang@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3rx43rDlPB5nB2+S" Content-Disposition: inline In-Reply-To: <8443fa3fa03d82c2b829375d8020762e5236dc6d.1482203930.git.geliangtang@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: HE1PR0802CA0021.eurprd08.prod.outlook.com (10.172.123.159) To AM4PR0501MB1923.eurprd05.prod.outlook.com (10.167.91.19) X-MS-Office365-Filtering-Correlation-Id: 70457ca6-0397-4eec-08fc-08d428e33bb0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:AM4PR0501MB1923; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0501MB1923;3:mfwZPaWAq0MHBYqf2BwhwWWSmoEf2JxfuQruzSZV6ptiak0zIOeH3CWqPrSTJcpgW6Z9AFnPniV9I71nqoBi729kpHe1aIlF/Gcw4bHzeSAhmwr9p1nCxJBo1j2VTPc17PgmCYfXzztf1O061yOYVq40nmr8FFKht0TzILjFFRZc+y1KCRr9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VQasQi5OfUF3yT2bA9kNYct3cVMwqphIVnWk97Oj1fEiG7uDWrwIMGPkATsf70aKv7pErV/z4b2Xpm5mOp8mpaR6BtPyn3yNsKLIXtBPzSkwp6y+9vssyUR4tzNN4B2awkuyRY6IfnvHD6lScFINoU735k+QBHuQVZRP0wVzxg/xh34jLPAHcgLtI6AbcVCVynJQCMIRrAmqbhTZQizahMfzyrxOBDrW3f+Sp4zHZB4cIqcO3dEMbYHXMp6j2SEo6kHZru/Ic6+Lw+57snNB5drGZkSgtKMTSKguCSCxZlW0p7GOvHfOzhlKtWjHf X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(6072148);SRVR:AM4PR0501MB1923;BCL:0;PCL:0;RULEID:;SRVR:AM4PR0501MB1923; X-Microsoft-Exchange-Diagnostics: 1;AM4PR0501MB1923;4:MBMT7DZZW4YIOglE5pQvIsoMj+wDck+TQ6hoop38y/7eS4OyCPFcH4k/kKbRr9TwOExE3Vr23IGIg7L92BvLUTpKJLeOl9GUAcdL319s2464iLZb1XTUDqQc6Z3C4isDuKt2war8C/b22HTukmu5T/jvx7KL31lDtYw74/PuaGYGh/pIaWCHbAu3ec/XZ4dav7SD96bFAVCbz52znHG/du8DTpt5syvtmddhW2fIpU4rUO8Prq/KHqoxmqgHSaOrbqz5+6YsRlwtSNedvJV0JVLqM0Lp/oGPG3SxzwDkenTQTN0dsqD9JqlcZmxVGNu/QsFCiobwaDg8ut35jdOVPpukmXvDuoUmkYIA1qp3y6MUZeKggeEgEQkRIWnmBkIuQ7TGXDfKnaKd2Cu59AHz9lZ7EgmCD+m4DimVfYke/ixFLcwZ6q8fmjdjwILI53bmOH4/iYrsYgQrrsfu0AbUKgaRU8wohdf6HrR8bqwDkoT704fzJ1uVAArEYFrTArM5NEXX7L4f8xYiLDmLMz3VSYlxNQBLyC1d5/Ybe+VbQK5OtnrrgCTRbQAM8Yx8ZD1hCK5veGtHuewCVTppU6Wdcg== X-Forefront-PRVS: 0162ACCC24 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(39840400002)(39410400002)(39860400002)(39850400002)(39450400003)(189002)(199003)(24454002)(101416001)(42186005)(76176999)(21480400002)(106356001)(33656002)(86362001)(25786008)(6486002)(98436002)(81156014)(81166006)(54356999)(229853002)(6496003)(1411001)(39060400001)(38730400001)(4001350100001)(3846002)(76506005)(97736004)(7736002)(66066001)(9686002)(92566002)(1076002)(105586002)(8676002)(50986999)(83506001)(305945005)(6116002)(189998001)(68736007)(84326002)(6916009)(110136003)(2950100002)(4326007)(5660300001)(512954002)(2906002)(260700001)(18370500001)(2700100001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0501MB1923;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM4PR0501MB1923;23:cbIIDvzPJuxKRQB9N3Fx39SQBNJCM8ngmPzjbGr?= =?us-ascii?Q?kXi2BsO0EKKNbvED5e/JtjDkzdFvMwbjeFU/nRg/w8K8sCWSO5zjzEkh3dMw?= =?us-ascii?Q?OB2dM7/E6vtghosUhSC2bJmrKkH/th+4WNsJqwMZmcN+fzKc64vMA/UlFDyh?= =?us-ascii?Q?45k8zvfSVel41/r5F642CGMPEEO/N3w4cQPtdOzXgiRhjDhmYYIejqd5yC10?= =?us-ascii?Q?Y7skDLpay1Wj9Is1l8upMgfq7vRn6hIQwGMjN/9INBI+y5lFKCX88kVTrCou?= =?us-ascii?Q?7LE0utF80X95kRir5UmtmMXubjUGefyjCBrXfQXRl8IAlWsH/aFqxZRgaHL4?= =?us-ascii?Q?WmhO+sY03PQuG4JpNR5tlAvPy575GosnobCffHFuTIuYa/IDvSy87qX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prIHk6H0pLdk3sj1etZ7Okczj6xXAjj?= =?us-ascii?Q?q+RKoelGl9tslQSfI3C0j1EdhRZAAA2peG5ksKfZVerUJhK16bnjg0hUGNEd?= =?us-ascii?Q?INik6p6LjPTSvEEb4WauqeSIVyNeBtoHuLVowGnNhrSOUguGiom/UKMn25Kg?= =?us-ascii?Q?FmhoY8sFu+A=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;AM4PR0501MB1923;6:6VoqbeXNDI5YI5SxH7XaEJQ005F4nSpaIj4P196GqaSJJNN1PMpwXQrkK63IZah6e8kvpjnXWU6VZ3hKCszo0JlCgH9C+U/7ba9hqWtSQFNrLDIEEUQJx5qVq71xJ1BB2HvvxssjOW/8Ai3C9/+juMVNlKj/bYxp9Pge4DtdzhHX07T6YEplB1iwb3uyuHb/JgPPkegXIbecE/WF3+aDFoVg5+4SaZ0WUy1A8HJE/haDhVDNYzw+vdw/Fnpp7R1O8MHBlDk8iluzHwij5K5k3oGAsT3cTYKKBClQeBpgtulPy6Zwv+/byvQo4EuxeY6mV8aBU01TFxPNZKpjgcfTtdsCqudMET090QwyhbKtFuwRR6LHkkXrkyec8RZCcLGlvdjVZ+H3crpGYXC762/c03PgJrvGMBE66kJ0f/5UBvmdbw+cPUzPCFlKt9oaTaErGbKCj1PvxRaPm/8bxudteA==;5:db5N4k28DJf8OmH4IWzKmuvHipOgWjCcPTB5y9YWfmRdl1hHqBYO2NzRAqaiQZFG5PLALv9bFf+GJiG47oTMXcBONf5ol/5kGPE8HELwvFhw2HXHmk1Eq6HtlMHkgqeHnrVylLI8NNNRIgiXDEspFA==;24:Cp+rrzVhoTLhO/1TYCUBenM3sVmwpXnT7a9Qbd8kPGmIoFnnOdOhjmhlMV866FFCfiHCsK4nahw6wMUVn2w8g/Ktfqyan6f27f0Xq1xNiTs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM4PR0501MB1923;7:7VXgR8xthvWLg9ZjztFHPEGRxn6/Lqhbx03+FjoDp/SmXekNj99RjMLTQwq94cMwdMWDhjVZc975/WOw248YYw0Uw+AfnyjybEbmr+rtIRIEDC2vOnt0wZZn9yrrQ6Zome6VuJf9aIEwevRwQa/Njv3Fb2QkH7GO3ik6CC/dLiclpACjto9xPRfZGvMFToq3tRHoWByHz8NOyoeRJv268Q8NyoS/4f/HAO+W5UEOZUyPMQrOxp/lBqeb3NIE2fUAtC2e6SYi9VG22rkmqXhtcrUqQgSRUWM+2YFGhvio7xCr9gx4aN0du9I1XE+FUSSyK9KPqB0QbKrehWSvYay89A0vS9aHFsbwXRTySOyrxaW5GYPVIdZA0YkBOG7+RX5mBd17+yYb8lUQfMtb9SRT1qTjplsWqbf75i247ckuEzg4kmohij/Eu6BNL2sOvzx5zGIeJWhz1XDNX7dCfanYGA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2016 14:19:38.7520 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB1923 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2070 Lines: 55 --3rx43rDlPB5nB2+S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 20, 2016 at 10:02:14PM +0800, Geliang Tang wrote: > To make the code clearer, use rb_entry() instead of container_of() to > deal with rbtree. > > Signed-off-by: Geliang Tang > --- > drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Thanks, Acked-by: Leon Romanovsky > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c > index 3b026c1..7431f63 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c > @@ -75,7 +75,7 @@ static void mlx5_fc_stats_insert(struct rb_root *root, struct mlx5_fc *counter) > struct rb_node *parent = NULL; > > while (*new) { > - struct mlx5_fc *this = container_of(*new, struct mlx5_fc, node); > + struct mlx5_fc *this = rb_entry(*new, struct mlx5_fc, node); > int result = counter->id - this->id; > > parent = *new; > -- > 2.9.3 > --3rx43rDlPB5nB2+S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEkhr/r4Op1/04yqaB5GN7iDZyWKcFAlhZPfgACgkQ5GN7iDZy WKeJ+hAAlSCSAtxBiHM84PF/F+Vd3LVyBs8x4nCuIWaHdRwPv7rQwvVbC6HoSFRz aDGGgw74AV9AnYsmiLHtcIYOTFp/MIDY/b9wYhRi+Kowc/dJuwuD9fBpx2s/97v+ c69oJL1QkhUU7eYT6bKzrFAL43YFNM5QV6LcRBBuFgfCuHUw46iWBX/yrXb2tElM 9y2U1y8Cj4RWZ19IoF0YiWw8+S7R39WLUT4lCRJX7kvekP8Hd/xZI83q/8/Dpmr+ bgnudWnD1xx23Y6ncgG7mO3lSJaRJNOmmavCS4UZnDyuXUPvArtNueee7duAMnsE fWBMjlQz9bqaCBela/myiJhrA/csAvcFbUhiqM3/NvhUwwQ7a6fOJ/0BT5aHfSfD U1utFuQ4/cAftVks8BpZasUe+h75NSEQ6c5gA/cPDdSrKz1IqQChpV61ZwDb9qhD MssxcjsSFLKmccUqbaLTG0Rtc4j83QsQRoYhV8jhMak3WthpHWHJr2mslyE8e1+Y XHIYgu/eEK/IS5TiLVp3e0e50SRJkMrySa1AoPNEdU7poB84JgDan2pHxvSTHyTa KhoQH3T+cEvvV87VJvAKz4wVWIOfHsMWMuvuEECc64Kb/dcwAd11SSeeFlCuvVpd NdnT7yZ5ZjcHaWTFJAve0hcne/NaTYlRosZpRhZDKy64w/uV4fc= =ZGfY -----END PGP SIGNATURE----- --3rx43rDlPB5nB2+S--