Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1041893pxb; Wed, 27 Oct 2021 18:04:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQhaOlfqOnLWqCQoFue9HIZQ3aCKHeH1RmiLX/Pf5yBM3Ns8EavBCzJI+X3PxS8e1FwHC5 X-Received: by 2002:a63:ff11:: with SMTP id k17mr859307pgi.405.1635383063461; Wed, 27 Oct 2021 18:04:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635383063; cv=none; d=google.com; s=arc-20160816; b=s9X3U36SqU1M5aZKLXYKfQtLXvdhNLBvPOKzeXe/7h7RVoPVLntnKui+G1hen3BlLn 9zJUGvegkEPhMKU4JQcMzDOvVFoLOF3Fhk6uBTbRR5MFm75KjxbqTIdRML3CjmjB0pcU we93Lz2FxfeM99ACtZyJTZB4VHWHeOaYCaHSFguKmrfJnc6nG8HI49CKHqiQurEyuVab Iw+28o/eTjLpWHyMi5sgcXlSBnn4UPxt7sEtWvaP3Yl8qUEu06UkBkJrYkNFeUbA/CV9 1i0kbK6zXq2lG9WxhNLYkkP7mVvssCNI5I4FMhLjM4TBnOornZlByQ5TP9fKXf+2jXdS Lhfg== 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:dkim-signature; bh=k+zQD8CQaycNrdXa2NhAlfSk8bkMuLuQctVMZwAMb5o=; b=nhBO84QZxHgXtpVREGBE8CcmhNgtd1PbX3uLw16y+6l3vGwfkzMTumjdoYRolYapH3 dc0Sj66NDdOkUX7bgrt/SwvHMKd7qHuul5alx7I/tiOe3rwzSfZ83PBVRPFI41bNen4d nObiqrZYPh5c7ord0b8RkOcjRki83QKJ3thP5nBulnVxG/n5UiqXwswgZdZFdchFzcRW rcA2HQ1aWZK6c/uGJ4Lym643Pr/KiqIh6qG77OJSnYuiJgIgGXiS6/BdaGw7mW1/HFrt v5tkiZJONdbjYWbt09JK6w8GZsW/mHhj6tDna+RkVnBm8bnN91FxzsM/h6ixt/nWXYl2 0tHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oJ+zSBHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q2si2425838pfj.271.2021.10.27.18.04.10; Wed, 27 Oct 2021 18:04:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oJ+zSBHP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229636AbhJ1BDa (ORCPT + 99 others); Wed, 27 Oct 2021 21:03:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbhJ1BD3 (ORCPT ); Wed, 27 Oct 2021 21:03:29 -0400 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 737B3C061570; Wed, 27 Oct 2021 18:01:03 -0700 (PDT) Received: by mail-pj1-x1033.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so6592172pjl.2; Wed, 27 Oct 2021 18:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k+zQD8CQaycNrdXa2NhAlfSk8bkMuLuQctVMZwAMb5o=; b=oJ+zSBHPinxWCKj93v1TqObCHmImdDl+iVeTO3ls/858ugBtndDUFuSJ0pgqQ8AOzm E+/TfN1Z6carxLC7YuefyE/UcAsl/LeUaWAoCFfYPovNpZLWD2vV0YKf20vvQbOafFsW RW8EKHNU9WvPEQiApp7/CQqpdTDqNZFy8ZCjuwInqa88rCPe6LPNKreeihMyW9010ehS /8HDBn7L1makPYc/dBtOR6Cy9W1yIyceO5riPMIsDl1Uv+PtV+X7nHKO4tIRiEYVp01W nxTd/EBXmZhrjJAjW0tmgF99w/78M92ZaBlPUBO2kT51jkxAR+iLRVbvS/DOib6MonZ3 5b3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=k+zQD8CQaycNrdXa2NhAlfSk8bkMuLuQctVMZwAMb5o=; b=ZlVWyjLIqVbwThpCmPelG8KLgP99xI8dXQWHAnnJJRQVNlGkQeNu9MRWfesixWaKGw Pfvv1lUznjyxMjeOmABIzguqyyOebKv5mhVgSQy6siwD8Nxy5+mxzLIuhoXKhXoWT/sd zW/ttalMR9Uqtn9nUsmPy6uWeAx8czhkAlicjPcLo1kHRVHaS0CS8EsK3Q1lYiLx/PYP 12bsAkkj/VO5BzuH63YyJoC0gADEC6ClA4u58JrrnAIiAAPxTOdKM9eA6yGk+91YdPqc G7IUrG/QQexCS1YTxDr5JS3qr9RUmgWeQCFN6Er1Kaok3xLfj0MNOfSr9nIGb5FNbn+C zpBA== X-Gm-Message-State: AOAM531m6kxeGtvHFsXDgbgbzl+tWmtpQh9E/Niu3cj6qrz9L7YXEdMz qzc4Vq9Tvf3KXcYwPaKbHL8BZBVRGSw= X-Received: by 2002:a17:90b:3892:: with SMTP id mu18mr9469296pjb.102.1635382862984; Wed, 27 Oct 2021 18:01:02 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id y9sm849287pjj.6.2021.10.27.18.01.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 18:01:02 -0700 (PDT) From: Yang Guang X-Google-Original-From: Yang Guang To: Song Liu Cc: Yang Guang , Zeal Robot , linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] raid5-ppl: use swap() to make code cleaner Date: Thu, 28 Oct 2021 01:00:53 +0000 Message-Id: <20211028010053.7609-1-yang.guang5@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using swap() make it more readable. Reported-by: Zeal Robot Signed-off-by: Yang Guang --- drivers/md/raid5-ppl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/md/raid5-ppl.c b/drivers/md/raid5-ppl.c index 3ddc2aa0b530..4ab417915d7f 100644 --- a/drivers/md/raid5-ppl.c +++ b/drivers/md/raid5-ppl.c @@ -1081,7 +1081,7 @@ static int ppl_load_distributed(struct ppl_log *log) struct ppl_conf *ppl_conf = log->ppl_conf; struct md_rdev *rdev = log->rdev; struct mddev *mddev = rdev->mddev; - struct page *page, *page2, *tmp; + struct page *page, *page2; struct ppl_header *pplhdr = NULL, *prev_pplhdr = NULL; u32 crc, crc_stored; u32 signature; @@ -1156,9 +1156,7 @@ static int ppl_load_distributed(struct ppl_log *log) prev_pplhdr_offset = pplhdr_offset; prev_pplhdr = pplhdr; - tmp = page; - page = page2; - page2 = tmp; + swap(page, page2); /* calculate next potential ppl offset */ for (i = 0; i < le32_to_cpu(pplhdr->entries_count); i++) -- 2.30.2