From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C172C433EF for ; Tue, 14 Dec 2021 05:56:13 +0000 (UTC) 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=INxmOhcAU0gKiGyAdmUp/yO65B6sCO627KHZEMAbvCk=; b=Oa8eDp7BHqw/rs y3UA1DPDzG3DTw4BqlgAGCutBbRB3t4zb0isTq5h3pRnmJ3DnMLgp9g+Rd3+8/FhI3Cd85a2X6PvE DyFSEy8qtWkY8dWFOv6GfbcBHtmKTYjLZ7vVMdNLZvrxDkJDEMzzkSzv1S/TM+qcXixE6r7dL8yT/ eJ9JWnZs0/3A6j6qFk+nCzTOQxDhhGIlnwC4TFAPhnnfyArzuWpqp3uU5/jXLEfuKeorwodF0/GLN 051SMRY3pYKNHHLnkAckVp8Ijm5DHBsCNyLm2qJ31Y6QjgcY58g9kauphd6Qv/MHJAvrgLeDod4FT +UrtMM4a6ro/o4EU/84A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx0ly-00CfoO-M2; Tue, 14 Dec 2021 05:54:46 +0000 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mx0lu-00CfnH-Mj for linux-arm-kernel@lists.infradead.org; Tue, 14 Dec 2021 05:54:44 +0000 Received: by mail-pj1-x102b.google.com with SMTP id iq11so13536649pjb.3 for ; Mon, 13 Dec 2021 21:54:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=R1Fbcs2PkAzxnxr2SD1nIRjZeiJzFKllZFg8W2MhEa4=; b=f31dRgVVLcnOpSdPmRXV5OrNE3tKzDUx9GIBP8WXjcaa1CE7TJNLUstR9/LWNogZz5 UdGrsAK5UaeODNHriSquMzJrUQcSM9vu6CvixYmk7Wsb8y7858f8EcNqTP3InZoYAghY MKJ329LZ66SVlUv2QjJRzk0Eyy1GPUyBg7i5vbXBiC07Vzo1zL3j87/OSPo/ByTDYgXb nZCcGO8QUa2P9wOBBc/2VCio2X9Upb0napZ1Zcj6YwFzVFWzOF9RbEVfJFQOIZrRisSX o+M5tZn3vmQdeZtA1N9Rzd/D4AKIqypgVSUG6zEqiiKjAr5MF0PhzRYghausmF8MXrIC ziLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=R1Fbcs2PkAzxnxr2SD1nIRjZeiJzFKllZFg8W2MhEa4=; b=gtvHc8N791e46O4qWfqxnB7ugQcMlQ1sPnR2z1WdC5lsHOLiV0OeCMznYQcSumLohy fpls+3lE70tvKzBzZOQES8h34gnR753SjOpvIns22yNGGPwAji6NP1AiZ8XFEEZA80yI +/V5DkFRSMm1nBjTotZoBTc5aJvNrCxpL1xpyjMffctDsUZA5evV2kRVuH16M9gDYpwU Pgxt8V4/qRy9sYbvLzJ2tjEGNUKT4c8RP+gVLqw72+XwS1sJENnmjSfpH1t5hD4YtJDn n89I8eVVm92BqFlLku+wOYw0IMj/TtQTUXZTQzrRCf3ZOzvjnjh3kPjoufSvUx9o6s2N uejA== X-Gm-Message-State: AOAM531K93IF3L4kaNhBeaoxTxt72+FC9xvjzINBvvAcu8bPJN1dchb8 jB2dWq1SIyQi1oC76XlznoXfs2Zgs+CMSRzb X-Google-Smtp-Source: ABdhPJzmNeU8tuF6oceL4w9UBP6NmorClr6I1o6JhnvNSREoQpNWLILs9bOV3hnbB07xMd55xQ7GLQ== X-Received: by 2002:a17:902:a714:b0:143:d007:412f with SMTP id w20-20020a170902a71400b00143d007412fmr3185130plq.18.1639461279440; Mon, 13 Dec 2021 21:54:39 -0800 (PST) Received: from localhost ([110.141.142.237]) by smtp.gmail.com with ESMTPSA id l25sm11090819pgt.62.2021.12.13.21.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 21:54:38 -0800 (PST) Date: Tue, 14 Dec 2021 16:54:35 +1100 From: Balbir Singh To: Leo Yan Cc: "David S. Miller" , Jakub Kicinski , Leon Romanovsky , Mathieu Poirier , Suzuki K Poulose , Mike Leach , Alexander Shishkin , Jan Harkes , coda@cs.cmu.edu, Paul Moore , Eric Paris , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, codalist@coda.cs.cmu.edu, linux-audit@redhat.com Subject: Re: [PATCH v2 3/7] coresight: etm4x: Use task_is_in_init_pid_ns() Message-ID: References: <20211208083320.472503-1-leo.yan@linaro.org> <20211208083320.472503-4-leo.yan@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211208083320.472503-4-leo.yan@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_215442_774966_D6DD6008 X-CRM114-Status: GOOD ( 17.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 08, 2021 at 04:33:16PM +0800, Leo Yan wrote: > This patch replaces open code with task_is_in_init_pid_ns() to check if > a task is in root PID namespace. > > Signed-off-by: Leo Yan > --- > drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > index a0640fa5c55b..10ef2a29006e 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > @@ -1890,7 +1890,7 @@ static ssize_t ctxid_pid_show(struct device *dev, > * Don't use contextID tracing if coming from a PID namespace. See > * comment in ctxid_pid_store(). > */ > - if (task_active_pid_ns(current) != &init_pid_ns) > + if (!task_is_in_init_pid_ns(current)) > return -EINVAL; > > spin_lock(&drvdata->spinlock); > @@ -1918,7 +1918,7 @@ static ssize_t ctxid_pid_store(struct device *dev, > * As such refuse to use the feature if @current is not in the initial > * PID namespace. > */ > - if (task_active_pid_ns(current) != &init_pid_ns) > + if (!task_is_in_init_pid_ns(current)) > return -EINVAL; > > /* > @@ -1951,7 +1951,7 @@ static ssize_t ctxid_masks_show(struct device *dev, > * Don't use contextID tracing if coming from a PID namespace. See > * comment in ctxid_pid_store(). > */ > - if (task_active_pid_ns(current) != &init_pid_ns) > + if (!task_is_in_init_pid_ns(current)) > return -EINVAL; > > spin_lock(&drvdata->spinlock); > @@ -1975,7 +1975,7 @@ static ssize_t ctxid_masks_store(struct device *dev, > * Don't use contextID tracing if coming from a PID namespace. See > * comment in ctxid_pid_store(). > */ > - if (task_active_pid_ns(current) != &init_pid_ns) > + if (!task_is_in_init_pid_ns(current)) > return -EINVAL; > > /* Acked-by: Balbir Singh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel