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 AF10DC433F5 for ; Thu, 2 Dec 2021 03:34:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C23766B0074; Wed, 1 Dec 2021 22:34:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BD2036B0075; Wed, 1 Dec 2021 22:34:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC12D6B007B; Wed, 1 Dec 2021 22:34:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0224.hostedemail.com [216.40.44.224]) by kanga.kvack.org (Postfix) with ESMTP id 9C2D66B0074 for ; Wed, 1 Dec 2021 22:34:23 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 60D0B18029DA1 for ; Thu, 2 Dec 2021 03:34:13 +0000 (UTC) X-FDA: 78871435986.17.D0B025F Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf23.hostedemail.com (Postfix) with ESMTP id E72999000093 for ; Thu, 2 Dec 2021 03:34:12 +0000 (UTC) Received: from mail.kernel.org (unknown [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 836BAB82148; Thu, 2 Dec 2021 03:34:11 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id E636860462; Thu, 2 Dec 2021 03:34:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1638416050; bh=GFhA6a6jxPu8jPXpjfkYA7r+8JEEnY9B1Rox7fKpTvM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=RV5LMnFWUKiSVzxMKibLzhfCYq+/UMPHoBGucBm0TwHD30C0ar533yVyE7LXpF8r0 F05fCGLGiBANnHtpsmYaMLaXdVVeisS3q7R9M+j/v7fo+9hFFf8iveB55QhQoZD/kf SYIabqVNBkOBCWdL5u9I07zzt+U8t3rMPWMMj74M= Date: Wed, 1 Dec 2021 19:34:08 -0800 From: Andrew Morton To: Yixuan Cao Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: fix the type of a parameter Message-Id: <20211201193408.49c88f8281d14fb2c61f9ee6@linux-foundation.org> In-Reply-To: <20211201181236.2315-1-caoyixuan2019@email.szu.edu.cn> References: <20211201181236.2315-1-caoyixuan2019@email.szu.edu.cn> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: a17org73kywhah6mrzhb4kkt59ojgfep X-Rspamd-Queue-Id: E72999000093 X-Rspamd-Server: rspam07 Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=RV5LMnFW; spf=pass (imf23.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1638416052-539923 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, 2 Dec 2021 02:12:36 +0800 Yixuan Cao wrote: > The type of "last_migrate_reason" in struct page_owner is short. > However, the type of "reason" in the argument list of following functions > __set_page_owner_migrate_reason > set_page_owner_migrate_reason > > is int, which is inconsistent. Well. I'd say "no", because `int' is a natural type and the packing of that scalar into a `short' is an expedient little space-saving hack (ie, an "implementation detail") which should be hidden from callers rather than propagated back up the call stack. However, all these `int's should be of type `enum migrate_reason'. And the lowest-level hack of stuffing that enum into a `short' should remain an implementation detail, hidden from callers.