From patchwork Fri Nov 5 06:12:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Guang X-Patchwork-Id: 1551257 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=fqbu8bN0; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=k3XckD2c; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4HlqvG2tqvz9sf8 for ; Fri, 5 Nov 2021 17:13:30 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RJKni82yBaczkyNlepJMXL+EqjTMrAxWXGaTlWvJCYA=; b=fqbu8bN0q/wh+Z TmMpSLJIGTOydfDBknSGFUF65Z6rvxyA/mjMIxPxr9ofiXxfJp3nTY9R3Sdygsb24nClwjzzhphTr N/ZS3pSwYBI+XCDB/h+rJArekkhw5sQtp+a6pfKWP3ta4TQSmnWzclkfFEKj8eZ7s0l/FXjdHnwQK x8XzKYzBjuXFN/7n0Vj/LzKLwoZyWW2DRxyZHg+RKq2d4y1YL2tJLvKt94cVDZmbL9qdUJV4zQ+c1 rDFUhLoQwlL+CsVroyl3dmcBaTAb5skftKs4ra/lwfy/Q6/c2J6PVqESERzxyltgwXL09zmYqPTvk 5Vl8srvYFAUrl8pM+cAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1misTW-00Ah4j-Bu; Fri, 05 Nov 2021 06:13:18 +0000 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1misTT-00Ah3r-N6 for linux-um@lists.infradead.org; Fri, 05 Nov 2021 06:13:16 +0000 Received: by mail-pj1-x102d.google.com with SMTP id gn3so2430871pjb.0 for ; Thu, 04 Nov 2021 23:13:12 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=gRs3W8sfuDcyX3dCF84m8zhv0Sr6d2guyKmOwxp+H8o=; b=k3XckD2cwappfaIpEMZ+Od4rGEsyL6dq18s03wPZ2+oh99/66xp+GiFmOYab5aC/Ya kepxdYE1vas0UQgDJpeebUX20NpwJ30TDdh2KTWaYIWzLIzdWmcJnUyW6gyytjeY3nSP lpGboZlacJTHnooddheYQ8GXh5Q0DQIUjw6c5Q+rmsP1X8tRi55C6m/Qu+YnKpz6fIuj TjnOorchNj+O0GStOIW6u3Wmdu/NjpFGMq22cfRPqECXDc/5nbGhM/PwdI07T7Isp6IW WGqIDQEr+I32fWgvkpFx9Rn4G2kbrMUXHMefj/4YR4l9mv71un/r8ehaQi8p+BfAXptv 3jIg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=gRs3W8sfuDcyX3dCF84m8zhv0Sr6d2guyKmOwxp+H8o=; b=VXQ/vqWyGAzYHOXeQMMgLEwvL/1+4TGEN2uiJZnf7QEvr22iSoJDwwEI/8WF8aTtKQ JSuhWhcWSG2Znbq/I1k75cpqOPBKgOmm+NtIMq27AeJOzy6vVZQOieM1Stn8hZvb0IAO F14HGT7/3zjBiN7d195N6MZIVZIJENAFr2lqssygzcOKYcJeh92Cf6BKdpZ1Pkk2QHWK mAEraca1XAg8/tm0OXJJ+Giy2bCsSWzOXSHhOOcK0S9ffVwvKqtOKxZ1To1kxS/k5sOW gvH7qONrWjxE1WLO/7AaQsu4Va0Mh0kBw8JCoDUtt2sVWdOtTZgSMXsjIiFRxHc9oWUi H5nA== X-Gm-Message-State: AOAM533PuKg4k9PYHgbMY79gDQEhjFwLuCvnNhbQ2bExBEbZxnIEUGxi y1oz+xXoMPrpBZOdnBxEcBQ= X-Google-Smtp-Source: ABdhPJwEl4sPKPUxMCpFiTBNkkACIlrT8sL1Zxcj3uUOlKLeheDSkKDeJoGmokVFg2Ic8Zfsjkb+zw== X-Received: by 2002:a17:90a:2c02:: with SMTP id m2mr28085538pjd.109.1636092792337; Thu, 04 Nov 2021 23:13:12 -0700 (PDT) Received: from debian11-dev-61.localdomain (192.243.120.180.16clouds.com. [192.243.120.180]) by smtp.gmail.com with ESMTPSA id d13sm6576485pfu.196.2021.11.04.23.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Nov 2021 23:13:11 -0700 (PDT) From: davidcomponentone@gmail.com X-Google-Original-From: yang.guang5@zte.com.cn To: jdike@addtoit.com Cc: davidcomponentone@gmail.com, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes.berg@intel.com, yang.guang5@zte.com.cn, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Zeal Robot Subject: [PATCH v2] um: use swap() to make code cleaner Date: Fri, 5 Nov 2021 14:12:59 +0800 Message-Id: <80d5d60030f9f4c0d299e139597f67c562f1d6b2.1636092427.git.yang.guang5@zte.com.cn> X-Mailer: git-send-email 2.30.2 In-Reply-To: <7f95e669-fba3-32e6-cdb9-41fb415b3b82@cambridgegreys.com> References: <7f95e669-fba3-32e6-cdb9-41fb415b3b82@cambridgegreys.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211104_231315_777306_08BA4F53 X-CRM114-Status: GOOD ( 10.75 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: From: Yang Guang Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yang Guang --- arch/um/os-Linux/sigio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:102d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [davidcomponentone[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org From: Yang Guang Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid opencoding it. Reported-by: Zeal Robot Signed-off-by: Yang Guang --- arch/um/os-Linux/sigio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c index 9e71794839e8..37d60e72cf26 100644 --- a/arch/um/os-Linux/sigio.c +++ b/arch/um/os-Linux/sigio.c @@ -3,6 +3,7 @@ * Copyright (C) 2002 - 2008 Jeff Dike (jdike@{addtoit,linux.intel}.com) */ +#include #include #include #include @@ -50,7 +51,7 @@ static struct pollfds all_sigio_fds; static int write_sigio_thread(void *unused) { - struct pollfds *fds, tmp; + struct pollfds *fds; struct pollfd *p; int i, n, respond_fd; char c; @@ -77,9 +78,7 @@ static int write_sigio_thread(void *unused) "write_sigio_thread : " "read on socket failed, " "err = %d\n", errno); - tmp = current_poll; - current_poll = next_poll; - next_poll = tmp; + swap(current_poll, next_poll); respond_fd = sigio_private[1]; } else {