Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1208077rwn; Thu, 8 Sep 2022 15:30:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR70IMhu+SnMWnbC7H3DXMTZEO7H7e0AfSkIkedmRoaBNDY4/bOTWVa/9qpsnvMpJ8WLCDhQ X-Received: by 2002:a2e:b610:0:b0:263:9395:1afc with SMTP id r16-20020a2eb610000000b0026393951afcmr3267640ljn.31.1662676236963; Thu, 08 Sep 2022 15:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662676236; cv=none; d=google.com; s=arc-20160816; b=LizHaigqqOhGbZXbidY6NVZk0iqJY23SLWDclJj+7g54Pe4QJ3h32OiUaUD+CyVZEw rJWbxhUTtjUWxyy+zSttWYqyZKTMIOFs42JU6de/23grvoN0+LlQaNJ9qXKPabRpfvIy LO/9cT/mFLC2B4vvQCma2MeuUU0xNK7t20zWwXeocW3ZM+C4rLeYdlAn4CgCGGtxYiXm ZXMw1ekqTJ+S9xQ/+0uv2AMWJhOyRPF4xa52uPfWBpLC5D27LAMC9g9lNwR5zynyelNr f7xxEan1pk1t3eXd6B4HK+mVtU0FcJ+1f04Z8FwN/EXLiQ/m89cgyX6u8o6Xh/lbu3Lw uswA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=mQ087S2Fa03QiaIbJ7I0+Cq3rnfIuI/LW9yk+xl3sp0=; b=refWHno597SUUxv/BdI7Ng1issUb7zqiZmnFpPlaIgoIj83lx9YMCE7gztwKOCnX3D JbA7ti/o2/oN1oZ4WYdK7wjVsoeZWGQVaTaxyofTNBOKnPZ1661DJIvGGKiNaeHk7aeE ObhMVz9iNpwYczm91/SYUgxrPS8a25USj0I3QesdyjoCJr6Lw5x5fD4dK+5dihhWqR7O t4DRj10M5R79S4u1NcHvQ07tkgA4nu6qi3qqsdsilXrNVQwa+QHZ62NOzIsXOJkrLXiW bRf4sULZySBUKqgM+jh6abTH7CTqmxcTC845jkLZHM8+NT6CinzDinNtESCnpoIycw86 ejDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=w3vl4Md4; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020ac25e64000000b004947c8cf626si32424lfr.181.2022.09.08.15.30.07; Thu, 08 Sep 2022 15:30:36 -0700 (PDT) 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; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=w3vl4Md4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229902AbiIHWKt (ORCPT + 99 others); Thu, 8 Sep 2022 18:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49714 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbiIHWKp (ORCPT ); Thu, 8 Sep 2022 18:10:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32B0D7428 for ; Thu, 8 Sep 2022 15:10:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3469761E43 for ; Thu, 8 Sep 2022 22:10:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E72DC433C1; Thu, 8 Sep 2022 22:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1662675043; bh=XCIEEKRk/9WvUsGT3ciNFy1vp9nzMZ5TXc8Ty7hjscY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=w3vl4Md4FHGe0tnYeeCYkS5h5JMouvTrbMEHCgTuEJxAyd0WvjHEUVdC26QvLciGm Q5wf0618dav32gRdyqyKw2UQ5JLNldT0FNoNuSqQ4j66Fdxjh6Eiy+6PyzyuCbZhWK 9a/Dju5mptLZw4vwp/HA3Z1+woZeG4meSvOxTEhU= Date: Thu, 8 Sep 2022 15:10:42 -0700 From: Andrew Morton To: SeongJae Park Cc: Xin Hao , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon/sysfs: change few functions execute order Message-Id: <20220908151042.239189ddb1635c0f598c6fd2@linux-foundation.org> In-Reply-To: <20220908184947.103206-1-sj@kernel.org> References: <20220908081932.77370-1-xhao@linux.alibaba.com> <20220908184947.103206-1-sj@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, 8 Sep 2022 18:49:47 +0000 SeongJae Park wrote: > Hi Xin, > > On Thu, 8 Sep 2022 16:19:32 +0800 Xin Hao wrote: > > > These nr_{schemes,regions,contexts,kdamonds}_store() functions are both call > > checkpatch complains as below: > > WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) > #10: > These nr_{schemes,regions,contexts,kdamonds}_store() functions are both call I fix that sort of thing. A lot ;) > > kstrtoint() to get relative values from sysfs interface, if it return an > > error, there get kobject instance would be meaningless through 'container_of'. > > I was thinking the compiler could do that kind of optimization on its own, so I > preferred to make the code shorter. Yes, the compiler will do this. > This change makes the code slightly longer, while the benefit of the change is > unclear. I'd like to keep it as is unless we get some clear benefit of this? I find it a readability improvement. Puts the initialization in a more appropriate place and avoids those nasty tricks to prevent unreasonable line lengths.