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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18677C38145 for ; Thu, 8 Sep 2022 22:10:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A28958D0003; Thu, 8 Sep 2022 18:10:45 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9D7518D0001; Thu, 8 Sep 2022 18:10:45 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8C6068D0003; Thu, 8 Sep 2022 18:10:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 7AF338D0001 for ; Thu, 8 Sep 2022 18:10:45 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4433740445 for ; Thu, 8 Sep 2022 22:10:45 +0000 (UTC) X-FDA: 79890313650.29.A207862 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf14.hostedemail.com (Postfix) with ESMTP id EB7D310007A for ; Thu, 8 Sep 2022 22:10:44 +0000 (UTC) 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 26C5761E30; 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662675045; a=rsa-sha256; cv=none; b=cHcnobQvNX7MMO5lgQ4N7yP96qaSgpj+fGrwRMkbeIsDZ5BHPqYAZ7q0pXgu2EjtO4rjO4 8JOx0bynMcN1B8kMLMoocCHbIVZCz7TK02laZWfwuGOrVpd80a86myo2hB8wgIByF5U2hZ +zu7SDDvHZReteLhcwXWhM/yxWyT/Mo= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=w3vl4Md4; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662675045; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mQ087S2Fa03QiaIbJ7I0+Cq3rnfIuI/LW9yk+xl3sp0=; b=7XDwXTf8R9apvH/5tQR8WDDUhVf0Nw//YjYKYfL7pw7LifaIbxppVmqpe3Ym4QbixgjDYt Hb0SNxAxMH2V68Mfg6i1gGpln3iHfuQtjsd4v4hEk8Uh5iwwVVewWxqL70pLrIfHxOR12C 08z7qqFv3c0CfHXoC7OF28ko6Agm5io= X-Rspamd-Queue-Id: EB7D310007A Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=w3vl4Md4; spf=pass (imf14.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam06 X-Stat-Signature: wxycyhsjwr3z4pqix4aykqi7fxapsp8y X-HE-Tag: 1662675044-499626 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.