From patchwork Tue Apr 12 06:46:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guo Zhengkui X-Patchwork-Id: 560067 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF542C433EF for ; Tue, 12 Apr 2022 09:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240004AbiDLJwM (ORCPT ); Tue, 12 Apr 2022 05:52:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353542AbiDLHZp (ORCPT ); Tue, 12 Apr 2022 03:25:45 -0400 Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sgaapc01on2118.outbound.protection.outlook.com [40.107.215.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 942334EA16; Tue, 12 Apr 2022 00:01:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bv0+1mBfm2OZkztbGrR/VmcCpV1qrHQNU+hynqgUSC9WY6O2hej9aDQ+aRyPF+rO9WJeoIbw02wfwFGfla755AFl+4tanyqup1VgFNDhgJ+fUlUEC5IJIJWWFGu3n1NZJpt4QxxXsJxgUDOwXSPeFZGcd1qVhRVBjaY9H9Ml6ftOO/R3onBu7qHj6q2VEXOyeQGeov/TYbi3TxfGAp9kqs2IXCy4jNdCY8Je5vQIsXmjITOl8hYFRvE1Nmu6GWDIhUdJ1F2NxHo7esnX6NUo9kwA5TrNLeJFyKP59Jn0DnqFZSLAxSl58D+4hZUCRwJwIpRgNSaFcs2aWtka/L0LRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=q+g52sBbc04l5E4ybAdIZXH1enNSTxVRcHBpTOuXgDs=; b=eVttQp6bKW2I6nZAm0UQYgDiWzXl6DnOKA4sV0dpqPZIkvnWWrfyMwNTfY1vifRwBMTIc4GuCQI3ng7VSTzPu/j4iEHVDW93UhuUagn0ZfSFpmkuRmjusg1glxqhNefyXqnahWDCdZkB0sHkUH+yYJxYVqJ9jZZ2wHP3Uitf3QXt2A/HVHC+bKL38z5YxaKKzWeVIj75o8QRfVyi636/DCh/5t4Wzd8+Ko96LdoahUshDoepnB4ENMKc456uJEJjyiWXljSlmI7NS2XBNTunZ+lZCTIkGaKi7D00RTRqDjy5kpwa51b83M9g+6NAc5gbTyf2c7zPQOsgkLslQ2K2aA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo0.onmicrosoft.com; s=selector2-vivo0-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=q+g52sBbc04l5E4ybAdIZXH1enNSTxVRcHBpTOuXgDs=; b=lbkp4V4FjlZoBA3nSFsJb1cRpt9of7lRcHsSmM/KFnUAgtO21JjEmezoV38DC6aFSAzuIJML+QijB0PBtHeIOl0Ss9GP+3j+IA3fjipP/GN2uZ1cqMnCRU17LpU5OJ3lK6dmR/AGm4G04PHQqtS5DhYRL4zSnChW9TjXjgqgU2Y= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) by SI2PR06MB3899.apcprd06.prod.outlook.com (2603:1096:4:fb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5144.29; Tue, 12 Apr 2022 07:00:58 +0000 Received: from HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::5aa:dfff:8ca7:ae33]) by HK2PR06MB3492.apcprd06.prod.outlook.com ([fe80::5aa:dfff:8ca7:ae33%6]) with mapi id 15.20.5144.029; Tue, 12 Apr 2022 07:00:58 +0000 From: Guo Zhengkui To: Ilya Dryomov , Jeff Layton , Xiubo Li , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Guo Zhengkui , ceph-devel@vger.kernel.org (open list:CEPH COMMON CODE (LIBCEPH)), netdev@vger.kernel.org (open list:NETWORKING [GENERAL]), linux-kernel@vger.kernel.org (open list) Cc: zhengkui_guo@outlook.com Subject: [PATCH linux-next] net: ceph: use swap() macro instead of taking tmp variable Date: Tue, 12 Apr 2022 14:46:20 +0800 Message-Id: <20220412064940.14798-1-guozhengkui@vivo.com> X-Mailer: git-send-email 2.20.1 X-ClientProxiedBy: TYBP286CA0023.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::35) To HK2PR06MB3492.apcprd06.prod.outlook.com (2603:1096:202:2f::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 152d154b-0bce-46f5-56f5-08da1c523209 X-MS-TrafficTypeDiagnostic: SI2PR06MB3899:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qq9TXb0d0y7UMr/AhjrMYdl0Tp8VGULiI402/2DCn8KFda8FG3+GlT0zW1o5Jn8q25fjcvLaFjLOIuGDP6o/LWnF2F/qoFUBX4xU1M0xDqyiNqXrnio07mQ72YNUfobkXEIFXW09qZ0kxTSufa6a3q9/dtKMreYFUBUiM4ZLp1pHrp+s2bY4SCOQGLwoJH8s+TyttNM6K49nUIr0Icp5edBDXTsKMaCOE5dD6eRi/Ck+TKvg8E10Jy8f3ftppxhcqnLTHspVqIP7CnlVbctb2Ctxd4FftSNpTFTCmj1mFDNus+i+figqPwa7FgsAxEFZeWv9INXDVbXRXwNL9ZdazD2ZiCNOs2aJjDxfKMm6NRZvwoKjqLzEshRoWxxmBtFfD28IDD+3YnOfiZ+CJ8CHj7NHNnLSoSDuzyl1TYS1JFm+CNMnfuBMFKV5BdyD/yqPOT8t9CbNYbednErY8f4s38yqX8gqvZnQykwInjI+1udgGCbxCI0CkoJHLWEozyIdo0qpEShHsXqiPG4/j3HhPP/HUxdntUxuylGnT78SEtheQdLA/XCDcKqiWEIhUoBUQ4FrbAD6BdcyeIOtufx22TCJDNDGcZi67Yg/L3rGHOWhq3O4oTtS2imqUnF5eyk3JJoh7Id3EU0XCnoxvA1Vw+rzecuPXWINTwnJNyLUEV7x1JEb1UwnrFbaJL6Kun/R1Y97oGv3lT5zExeeTM22/ZuIy3jBuBO11/tNHKBSzu4= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:HK2PR06MB3492.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(1076003)(110136005)(316002)(4326008)(2616005)(186003)(66476007)(66556008)(38100700002)(26005)(36756003)(508600001)(2906002)(5660300002)(6486002)(8936002)(8676002)(66946007)(4744005)(7416002)(921005)(83380400001)(6506007)(52116002)(6512007)(6666004)(38350700002)(86362001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: jL3AUBDTRJshR+uYGlrau9J7A4ufRcN82owIgDLJgYfmFdjTgk/gRzprs/pP7PvhGpvHz6mAD1csS99tcusgW0c7cG9Qk+vfWhTRxnu7/BLOHrxRkUqs6LgIZrUmFjOVDAORZ5IX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olVuIwfnehr2tSk8VZ0rIA3+x/ZqAScGUG3SmxCoNMfGHTdGXbJDNE847XQLBQcS1C8dcPhqMQa/TpnoVaKepnR5LJDyUIj0Xpn/s4hvS9nS5k/pqW+JaMFL/1aqaojE3rHl2UsLS59QVC0mHClaJAQRTqAWj/sjHATWmE/Ma3MUVMn8mnJR52o3Uo3wbwtPn8D/otaTTY6eFHvqU8ER0ZFoqMfki7OyGg9fAmsxvHSYij7IcpKsiE0CYYEmES5K/Wf51VeTi1I1TSNG2UsKCOb1WFq3o0oDXODRxNrFRb0TYQLjDqY/SR51oTP5bllhMyU/4OoKON0gfv8SU+EUMoNcK7zHxAIG4DemMmDfg1BGx6rXXAMBZjd4+fnBf3V57EhgIaF23iFTXDvfMc5RkmZcgF6XJMckjvIyP2MT4xOV9miVchyh5mXPARDjsYyAMWKeErrYWE+u8eoRNzQCe/MCDQUITLs6X4Ex//JD6wQBajbuv0DYnWQp5ldkn9F3W0SbwCrS9CC7HQo7I6ietPlUiIEg/mydQ== X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 152d154b-0bce-46f5-56f5-08da1c523209 X-MS-Exchange-CrossTenant-AuthSource: HK2PR06MB3492.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2022 07:00:58.2152 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cl7zVuVW+4+LJd04H82Vk4AcQatMUDVp9uU3n3zRytq7sHH5pZZMnkcyprxfiC8C0wlNOluijltpTzq1wliayQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SI2PR06MB3899 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org Fix the following coccicheck warning: net/ceph/crush/mapper.c:1077:8-9: WARNING opportunity for swap() by using swap() for the swapping of variable values and drop the tmp variable that is not needed any more. Signed-off-by: Guo Zhengkui --- net/ceph/crush/mapper.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/ceph/crush/mapper.c b/net/ceph/crush/mapper.c index 7057f8db4f99..1daf95e17d67 100644 --- a/net/ceph/crush/mapper.c +++ b/net/ceph/crush/mapper.c @@ -906,7 +906,6 @@ int crush_do_rule(const struct crush_map *map, int recurse_to_leaf; int wsize = 0; int osize; - int *tmp; const struct crush_rule *rule; __u32 step; int i, j; @@ -1073,9 +1072,7 @@ int crush_do_rule(const struct crush_map *map, memcpy(o, c, osize*sizeof(*o)); /* swap o and w arrays */ - tmp = o; - o = w; - w = tmp; + swap(o, w); wsize = osize; break;