From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7F4C3337BBC for ; Thu, 4 Dec 2025 10:55:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764845747; cv=none; b=MQw1YmbgO+159pVoS53g0SQvC0zmR9uoeYHDuPuOVPNzF7VeXdEbnlO2mM0OsTkwP1kaXuts5IHqNfMEqREobp3wZAh55ZYlNwg2J5tjrGAqI8r0Cio83hKtK1ttA8Fwx9kjQWVbd8dts3s/9WRZarzXxX+rnCGH16GEwF+CEjA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764845747; c=relaxed/simple; bh=y2vwFI9raDV2YvXfP8kQgQ+aoZpmsNWYPT3nrlCdWmo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sl5j7fMdlHsA7g1RUmKtrQQWyj7KCydg4Ongw/t9sz8G8Z8LDygT1cLvtwcNKbKRuD/qOouGSURAYdExDviz4ciUnbmovhK52aT0VHOERDjMBjXtghnn99EbJq8213ySDitXIXDJ1ipF3hSbkkYORGvenKaDxxGoeM2RSb6aJjA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VW5P673G; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VW5P673G" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DA1AC19422; Thu, 4 Dec 2025 10:55:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1764845746; bh=y2vwFI9raDV2YvXfP8kQgQ+aoZpmsNWYPT3nrlCdWmo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VW5P673GaBh+Qi/ztsZOYHNu2q/6Id59fygY4NVFE9oTEhZ/piN0RvZ8RLRxyg2jI DdgEOdicv5OPougkOi85CFWY0i/v3MZjsSXKdCHMfhZqFE4sFyL1WpMGZMy8oPEERW Uwv6irjD/ceWY6yIm+6g31nkstoTJHEyPA50/XUiECxNSpKljOhZ6eGfVvcKOtoydn kVIeWKCScX8EJfUXZHzpd/lIqBXPcT8l4MWMiGqFVQGZZNhCv+Sg+KDAc+Ct3mEcp/ MisxldTI6+mnCnX8qA7yYeSFexn8ezMFZk/CWb43mH9wYIOI9g+TBhhx1uL29c8Brj T07Wtu1JiTg0g== Date: Thu, 4 Dec 2025 12:55:38 +0200 From: Mike Rapoport To: Arnd Bergmann Cc: Hugh Dickins , Andrew Morton , Pratyush Yadav , Pasha Tatashin , Arnd Bergmann , Baolin Wang , Kairui Song , David Hildenbrand , Christian Brauner , Lorenzo Stoakes , Kemeng Shi , Guo Weikang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] mm: shmem: avoid build warning for CONFIG_SHMEM=n Message-ID: References: <20251204102905.1048000-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251204102905.1048000-1-arnd@kernel.org> On Thu, Dec 04, 2025 at 11:28:59AM +0100, 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 Acked-by: Mike Rapoport (Microsoft) > --- > v2: make shmem_unacct_size() inline as well. -- Sincerely yours, Mike.