From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E35933C1AA for ; Thu, 4 Dec 2025 12:38:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.110 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764851901; cv=none; b=DUa7hY5tZtpGRhBgHQeHhjBBQ6fm7A8jzJxOD9yoC2+s7xb0zSdI4pCiU0apT/FXcqnWnRVIQTZdneu1b+NqnE+rAmKaUEeH+QfGkDccKXQDw2nNT6OUHQimuBrUkdRqsQVTd+PQsQ1VkUew+pcz7HRDphgZ8pBy9sMoQJ7IpsA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764851901; c=relaxed/simple; bh=UuIGbeazcOFxIpCIaKybpvxaZus4s42KefrnDWgTbLc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=SVvDrgPFf9AKWY9CAJJu4pcVSoEQBKM2ljlBusqXGwfya5F8CC06YGB78y4RxqD8AgI3y7q2ZmA5rjlJ/fEchCi4JgkY/uip27lJc52XTVWgtAp+e8DOg/k6zqXFkU6JY9srD8uxXTl8OzvCljZ1vVXorLCynHS4XJabN+on80k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=INK5L/HF; arc=none smtp.client-ip=115.124.30.110 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="INK5L/HF" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1764851890; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=9WMDl+O9DzyplDmfOZSSNkC9lG7nQ5YodxncbmLOYqU=; b=INK5L/HFMbpSMFwLPyzw4jeQxMAUjgbdOBUjGCkoij9yCUR0NhWq5+tNLDM3Vc2P/pcWY/pP4LZSUClM2rz7ElCswM5pJ+PnykCAiLjap3LF+QrwLRTy325qMYNtR+zBxIJTmh9wJUYlgS9BUgSNf43Hi8MwXY9oaqJcm9WZT+0= Received: from 30.28.193.34(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0Wu4Jrgm_1764851888 cluster:ay36) by smtp.aliyun-inc.com; Thu, 04 Dec 2025 20:38:09 +0800 Message-ID: Date: Thu, 4 Dec 2025 20:38:07 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [v2] mm: shmem: avoid build warning for CONFIG_SHMEM=n To: Arnd Bergmann , Hugh Dickins , Andrew Morton , Pratyush Yadav , "Mike Rapoport (Microsoft)" , Pasha Tatashin Cc: Arnd Bergmann , Kairui Song , David Hildenbrand , Christian Brauner , Lorenzo Stoakes , Kemeng Shi , Guo Weikang , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20251204102905.1048000-1-arnd@kernel.org> From: Baolin Wang In-Reply-To: <20251204102905.1048000-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/12/4 18:28, Arnd Bergmann wrote: > From: Arnd Bergmann > > The newly added 'flags' variable is unused and causes a warning if > CONFIG_SHMEM is disabled, since the shmem_acct_size() macro it is passed > into does nothing: > > mm/shmem.c: In function '__shmem_file_setup': > mm/shmem.c:5816:23: error: unused variable 'flags' [-Werror=unused-variable] > 5816 | unsigned long flags = (vm_flags & VM_NORESERVE) ? SHMEM_F_NORESERVE : 0; > | ^~~~~ > > Replace the two macros with equivalent inline functions tto get the > argument checking. > > Fixes: 6ff1610ced56 ("mm: shmem: use SHMEM_F_* flags instead of VM_* flags") > Signed-off-by: Arnd Bergmann > --- > v2: make shmem_unacct_size() inline as well. > --- LGTM. Thanks. Reviewed-by: Baolin Wang