Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp602491pxm; Thu, 3 Mar 2022 00:20:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGxC5+tYnlda2Vxa0VvVoEl9FUkUEjOMSfFV3CVFRmCpb1T8cG0XW0e6mNSivCYPH/kHx6 X-Received: by 2002:a17:906:60d6:b0:6cf:e577:c93f with SMTP id f22-20020a17090660d600b006cfe577c93fmr26020130ejk.8.1646295644873; Thu, 03 Mar 2022 00:20:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646295644; cv=none; d=google.com; s=arc-20160816; b=khwG/QbAVBXRjwcs2vQaQtyu7cB48LcdFCVz/hpFBOL5D3RbFn7eGgKAg+C3VLK/sO VEZpuEw7JjnHHsY2E8Sp5oGcbBNQa/pr9e43vA5szSDBhmHSA5V6XVVy4PLhIJSN/z5f mVlv/SYwBMQZTeJGSL4Omn8mH6YxLh84vqIrh/a13lvqww5Y1sGkY6GOuEmHVM2GLz+k gTa71vphdr9a8Q+TWHJAvvDLcqFP9MU5in9pObh4M6uSbj6H8yi5jGa19Rb34V2nlyQa 8JYJOn2ZU1pdeHdm9mDWpwINUeyEAbQxz/hUzfK4koZurWJvbVzq5LtTuyeCBMAev+M4 sU1w== 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; bh=h1rWSiU24VON4gEBEsuZbsZhW6c1YXrUzeEGmIdBL0E=; b=LAV2PMgxqkhS9X2EdosZXmSLGkfRN2HoPgnfDZdW28aXccR4qMl2SzHlepF4PLo/Yx pG8Q7Si0qewjYYjBC0jThwIFpYkG/rNhM9u6dDaGq4rbeM6pc4xX4ZdrXFGMA8Khm1dr gvX/SG6XBtdDh/XS+dlX3Vjm26Cv4Nf+vYyffHRgB9D9jj+vUsn2RpALdbX/FNKU4ByO TqtSOzfReotCvkpj92CUoW3XykZMlBCa/WVTAQ2Md0ticI+8Fujd5La/hJnN0ZfLU44V WVMXDfz6t9/HgxRlptIz+PUEyY9hRGnUz8aWD8/2p/SIp1RoOFxY45j0Ic3e3y1+MHRb 8RNQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a056402351100b00415bdf78bedsi903418edd.421.2022.03.03.00.20.22; Thu, 03 Mar 2022 00:20:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230384AbiCCHyL (ORCPT + 99 others); Thu, 3 Mar 2022 02:54:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229961AbiCCHyI (ORCPT ); Thu, 3 Mar 2022 02:54:08 -0500 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EBB416939A for ; Wed, 2 Mar 2022 23:53:22 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R791e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=xhao@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0V66qkpz_1646293999; Received: from localhost.localdomain(mailfrom:xhao@linux.alibaba.com fp:SMTPD_---0V66qkpz_1646293999) by smtp.aliyun-inc.com(127.0.0.1); Thu, 03 Mar 2022 15:53:20 +0800 From: Xin Hao To: sj@kernel.org Cc: xhao@linux.alibaba.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/damon/sysfs: remove repeat container_of() in damon_sysfs_kdamond_release() Date: Thu, 3 Mar 2022 15:53:14 +0800 Message-Id: <20220303075314.22502-1-xhao@linux.alibaba.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In damon_sysfs_kdamond_release(), we have use container_of() to get "kdamond" pointer, so there no need to get it once again. Signed-off-by: Xin Hao --- mm/damon/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index a4ad6b473b0a..687e7c7e8dea 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -2432,7 +2432,7 @@ static void damon_sysfs_kdamond_release(struct kobject *kobj) if (kdamond->damon_ctx) damon_destroy_ctx(kdamond->damon_ctx); - kfree(container_of(kobj, struct damon_sysfs_kdamond, kobj)); + kfree(kdamond); } static struct kobj_attribute damon_sysfs_kdamond_state_attr = -- 2.27.0