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 29B75C433F5 for ; Fri, 14 Jan 2022 22:03:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230073AbiANWDP (ORCPT ); Fri, 14 Jan 2022 17:03:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229980AbiANWDP (ORCPT ); Fri, 14 Jan 2022 17:03:15 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1ACCEC061574 for ; Fri, 14 Jan 2022 14:03:15 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AE61161FD7 for ; Fri, 14 Jan 2022 22:03:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA8C8C36AE9; Fri, 14 Jan 2022 22:03:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1642197794; bh=nn0CO68Tivwlt2P/Mnr6cdxvJP90N3hXPXfcfMMqJqw=; h=Date:From:To:Subject:In-Reply-To:From; b=V8oMPiRYlEtTcfr49iFfTNFP2Ud0+o2xB9cgwZ3ozaJrBMALGSwfqU1oDfupmUsrt SqviG6K+C1c0Kwp26p23e4vNwkuMqvbPrW6R/didNeJaHbmH9Rl/4BDQ1GorEypbeu HbhnPz4QgB7b7aTCSZdtiqF/bVim1um3PfYmcSAU= Date: Fri, 14 Jan 2022 14:03:13 -0800 From: Andrew Morton To: akpm@linux-foundation.org, davidcomponentone@gmail.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, torvalds@linux-foundation.org, yang.guang5@zte.com.cn, zealci@zte.com.cn Subject: [patch 007/146] ia64: module: use swap() to make code cleaner Message-ID: <20220114220313._cn9cqHJT%akpm@linux-foundation.org> In-Reply-To: <20220114140222.6b14f0061194d3200000c52d@linux-foundation.org> User-Agent: s-nail v14.8.16 Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org From: Yang Guang Subject: ia64: module: use swap() to make code cleaner Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Link: https://lkml.kernel.org/r/20211104062642.1506539-1-yang.guang5@zte.com.cn Signed-off-by: Yang Guang Reported-by: Zeal Robot Cc: David Yang Signed-off-by: Andrew Morton --- arch/ia64/kernel/module.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/arch/ia64/kernel/module.c~ia64-module-use-swap-to-make-code-cleaner +++ a/arch/ia64/kernel/module.c @@ -848,7 +848,7 @@ register_unwind_table (struct module *mo { struct unw_table_entry *start = (void *) mod->arch.unwind->sh_addr; struct unw_table_entry *end = start + mod->arch.unwind->sh_size / sizeof (*start); - struct unw_table_entry tmp, *e1, *e2, *core, *init; + struct unw_table_entry *e1, *e2, *core, *init; unsigned long num_init = 0, num_core = 0; /* First, count how many init and core unwind-table entries there are. */ @@ -865,9 +865,7 @@ register_unwind_table (struct module *mo for (e1 = start; e1 < end; ++e1) { for (e2 = e1 + 1; e2 < end; ++e2) { if (e2->start_offset < e1->start_offset) { - tmp = *e1; - *e1 = *e2; - *e2 = tmp; + swap(*e1, *e2); } } } _