Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4319844rwb; Mon, 16 Jan 2023 22:15:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXuef4ojdpNa7LKnQHypaQnRRPdetj/qwIXs5cr7cyWxOrOPlQ4/aVtaxjTlmYHzYQd8vZsf X-Received: by 2002:a05:6a20:7048:b0:b8:915c:477f with SMTP id i8-20020a056a20704800b000b8915c477fmr1732636pza.19.1673936140003; Mon, 16 Jan 2023 22:15:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673936139; cv=none; d=google.com; s=arc-20160816; b=vbVofyPJog5BFUIFXsFd5PnM0WDFImMdq66x0limq1lZD1FHZt5uhinJxo598YEEh8 im2slmytokfvr2mcB6pLIoySTHSq26szHc7+ZkShIXb01oWr9fzRvDO1MNM/tYQPZ666 KN9h0DWVQPuU57k+29nhoVVPfDi+l19gG/0lYKqldCJOmKHo18nwYQDAWsJ+1oPrRyDk 1lZzUp9fuMQxtZUmTalcdk602FPb85oaZhWO/cZKoRKzbdnt67yTKjS+C9lvjxkpiVmT fHJvktBRnmB87H2OQoOk763o6sUtnOafNvuE3VQ5pRKCzkXhB76C/VILFfU2cwPWh9o2 lZ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=KhgQjVWv3zwQ5uTCrqLq61t3NM+pByfqDGOhTdjJBe8=; b=nxBMU4KCj35pBkczv9WeRmW5kFk3ebUO1cu3zr6rk57MQKmuXi6XbdIo9TOOavC0M8 57BBuTZWXYxuZz9wMaat2kgVk2ZxMg2/3Tzpd9S/iSNGvJ8X5w3ACAkLg/A0dAwd2Eta e+7D096yFP5WF++vM0g9U4Ohd5nmXDQyixez5Rddiz3S0xfiu9HLgoLd6QXfs2gkCN5s /3tYSWzraWpNmouPT0UsCr4zJaxWrHJu9bH2Bmfle1gS19OO3AqP/M8gO9R79WdVxu91 lvH3ETwuTeEW0OqJu7iQ5WKZf0eE6gJHB3MQmOfJ4wckmrsJa4hsTsdxgc6ez+XZcLRb 2vsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r26-20020a635d1a000000b00479568ac352si32234412pgb.526.2023.01.16.22.15.33; Mon, 16 Jan 2023 22:15:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235574AbjAQGDL (ORCPT + 50 others); Tue, 17 Jan 2023 01:03:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235598AbjAQGCg (ORCPT ); Tue, 17 Jan 2023 01:02:36 -0500 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF11683C1; Mon, 16 Jan 2023 22:02:33 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0VZltwnw_1673935344; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VZltwnw_1673935344) by smtp.aliyun-inc.com; Tue, 17 Jan 2023 14:02:31 +0800 From: Jiapeng Chong To: agordeev@linux.ibm.com Cc: gerald.schaefer@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] s390/vmem: Use swap() instead of open coding it Date: Tue, 17 Jan 2023 14:02:23 +0800 Message-Id: <20230117060223.58583-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Swap is a function interface that provides exchange function. To avoid code duplication, we can use swap function. ./arch/s390/mm/vmem.c:680:10-11: WARNING opportunity for swap(). Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3786 Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- arch/s390/mm/vmem.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/s390/mm/vmem.c b/arch/s390/mm/vmem.c index 78d7768f93d7..774a71b94f5c 100644 --- a/arch/s390/mm/vmem.c +++ b/arch/s390/mm/vmem.c @@ -674,11 +674,8 @@ static void __init memblock_region_swap(void *a, void *b, int size) { struct memblock_region *r1 = a; struct memblock_region *r2 = b; - struct memblock_region swap; - swap = *r1; - *r1 = *r2; - *r2 = swap; + swap(*r1, *r2); } /* -- 2.20.1.7.g153144c