Received: by 2002:a05:7412:40d:b0:e2:908c:2ebd with SMTP id 13csp911445rdf; Tue, 21 Nov 2023 23:26:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHs1sxV+UHIBXVlC4PbXS1GviSFg8PPyex3/1+frYsbzSHcxxlSAwCHJCzGizKDs+y5yY50 X-Received: by 2002:a05:6808:1645:b0:3b2:d6ce:f582 with SMTP id az5-20020a056808164500b003b2d6cef582mr2017775oib.34.1700637998006; Tue, 21 Nov 2023 23:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700637997; cv=none; d=google.com; s=arc-20160816; b=CL/Vvw4iMxuUNPb7X+8PYvnU/mD2y5gxExlp+7Qn1Ir4zdC81pwcBfZqYOLS60+5Gw B4dachDB7IgfMbQhSojzGpX8k11hWURvKfBSQdu18ENX0Zk7I+BkzcUvhzNIXLAbUDrt WDL3gE/gT72JQyhRp1rW0/TCzv/6kiC0N7MS1++1x8uirVutcS03Ehwyf4y+OEeIx0C0 3nkaO7psfaYYSKm1xhAOiyF57TEv8VPD8DdvllHJZIRWq3T1N7FZ25MacHwXEOdZ2q/W 54Gq/akNIJVwkGK/g9ZsmYPcGf04otVqFH8FBEbC9+eBI7ZZkGLPZxRsoNJ4XfkYTopI y0pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=a/kbKeCEYGAl3Cpnin1U0qriK39m5Dp28jqz4j6h/qM=; fh=DBMP6LGNxZvKiaA1PkiO8lR8vqR11snbICsdTyuOfX4=; b=OJKoGVGKlFv1njDQRkbRhLYfCDFqMtPhLkmJbrxmDQDstNNNX8mA9c6gC1GXEBTzXx gbuaWAeq/6uOq42LD3Kss6pLjhY+1pDe5jPgCOWEGYV+mshvC5LFvgdZ8NBVtgak1QDO 74lc6476Vp+bjoGwwHHmqrPaWuiBvsVjOl/aWjFnEBhNdxZ/WZGMVhfF+0pVCojkcnxd ZuMsBGWUS5xh+0WnfWNFY+gthiN8etgh/9IR8rMLk11FgGAjDJCh4okonyog5px5YxK4 8PtRuG5rlb0gNV3xwvTStVOM4NxNcMAdoKxXJU0LvvNuJhIJzRR4NMAyIIQjqQQEmLmh gGpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=gs3d1xjU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id v13-20020a63f20d000000b005b918d9a3c2si12550859pgh.868.2023.11.21.23.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 23:26:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@sipsolutions.net header.s=mail header.b=gs3d1xjU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=sipsolutions.net Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id DF90280D6A26; Tue, 21 Nov 2023 23:26:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234970AbjKVH0L (ORCPT + 99 others); Wed, 22 Nov 2023 02:26:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230145AbjKVH0J (ORCPT ); Wed, 22 Nov 2023 02:26:09 -0500 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:242:246e::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 352E5A1 for ; Tue, 21 Nov 2023 23:26:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=MIME-Version:Content-Transfer-Encoding: Content-Type:References:In-Reply-To:Date:Cc:To:From:Subject:Message-ID:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-To: Resent-Cc:Resent-Message-ID; bh=a/kbKeCEYGAl3Cpnin1U0qriK39m5Dp28jqz4j6h/qM=; t=1700637962; x=1701847562; b=gs3d1xjUGFslj1Iub0ExAgpvmls8WVy84RzzN2bwQr8i3eE 4DxYxeauhK5VWdt/s558W5Ua38mUPppyUEobQz3OVwrkVLXYoRQj3dZwOsgjSdmfiLzbnZjBO/TdY ZABsB48SxtJz3MI7n6uC3MHMTa5hAwW8uujpObOvvhUR+7iBP0M2eNA8G9cIUo4DQAN5//Dx+Fzd6 /J1FiaQbtGfasltfau/dktc0q9mNz4GyWApom7/sl11zMCnxMS8U1k5HFNhOnW9CqFZdduoO9qJil JdlUbKW/2oamWClccNQHtaRtqvRyhjLaW4wMtvZLa1pQFbKuavHGoiGxhB4MZIIA==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.97) (envelope-from ) id 1r5hcS-0000000HUHW-0f9N; Wed, 22 Nov 2023 08:25:56 +0100 Message-ID: <3fa7ec68a0302667f1b73682e4db96f6ba618397.camel@sipsolutions.net> Subject: Re: [PATCH] um: Use swap() instead of open coding it From: Johannes Berg To: Jiapeng Chong , richard@nod.at Cc: anton.ivanov@cambridgegreys.com, linux-um@lists.infradead.org, linux-kernel@vger.kernel.org, Abaci Robot Date: Wed, 22 Nov 2023 08:25:54 +0100 In-Reply-To: <20231122032518.53305-1-jiapeng.chong@linux.alibaba.com> References: <20231122032518.53305-1-jiapeng.chong@linux.alibaba.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-malware-bazaar: not-scanned X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 21 Nov 2023 23:26:20 -0800 (PST) On Wed, 2023-11-22 at 11:25 +0800, Jiapeng Chong wrote: > Swap is a function interface that provides exchange function. To avoid > code duplication, we can use swap function. >=20 > ./arch/um/os-Linux/sigio.c:81:28-29: WARNING opportunity for swap(). >=20 Hm. There's already a use of swap() here in this file, but I actually think we should revert that? This is basically userspace code, not kernel code, so I don't think it should include linux headers, even if those happen to be "standalone enough" right now to work. johannes