Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp347158pxu; Thu, 7 Jan 2021 06:38:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyPi8PH1ONybSZ2bpUrpQWad6zvkndfyNxDeGMXBIcW4Wfurzejqidzg7SMDkBPZzng1i74 X-Received: by 2002:aa7:dac5:: with SMTP id x5mr1958747eds.198.1610030290932; Thu, 07 Jan 2021 06:38:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030290; cv=none; d=google.com; s=arc-20160816; b=htoypdxvj2sl5Jyg2OWtNr1QiT3bHdXwnFh0qCjDCo1wzfS+sASRiBz5Hos8oVpN42 FEnmFEZxuyreaWwNKcfYXuHl9/YKiEYRjDIXw6aGV5yGpdGHuHPjzxvXjuRF9GWWX/hb W0GdsOmCJyU+57j/t/C9LSVXZ6oEKS58RWEwt9bHL0TSRLvzGfV2XzR5CfNWw1ZzCTu8 ejGFNsuHllYhrRI8Ynr6Wt2WIVYvuERkwq1fG/lGRWHfz9PiGgFtOacGBXDwRGWXEZQc RDkJqbdHdLKqA/RUNfVEnckWvup9Zn+LU1GyWKhrdpuyJ+OB/utP0aqP0dYA+6XDu7+J AwVg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FeuJaa7ZmsIko892g4980duNFtPMc68i4IvpdCsjbwQ=; b=kiHbdwbmU0vq72vlgxtV88wRnUD6Sez/5pK1/DDm9aSm2i00nBS9g/mDhuDbKBChAE Jqr3ZL+flV5Yblisn5SFqg0zAM/UBgb45uxfo74qcq0qShI6hRMhN3pp54SV0VNJerT9 fjMD70xN1Qk8+chgG7dn0W603zUYBD7l0q5/c/91FAw1Dr1zcPUBMxbyXa6rBGd/aRbE rLp98ukX/eIDzdkYvzQKXrwvrrLfZMD8kRhoa0/jEMOl0oFqPYTWszgJQernOG9w05EM Ohp3u2eI+a7WA3n+l2I4a8WCI71hXaHhAe4h3v1c6qmkR7VZXsknvvs/h+8WkX8EW2tl iWNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wpFJWwsC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l14si2463008edv.597.2021.01.07.06.37.47; Thu, 07 Jan 2021 06:38:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wpFJWwsC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728997AbhAGOf6 (ORCPT + 99 others); Thu, 7 Jan 2021 09:35:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:47110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728920AbhAGOdK (ORCPT ); Thu, 7 Jan 2021 09:33:10 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 49C4923358; Thu, 7 Jan 2021 14:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029949; bh=7TBz14ywOEcasArJ3v4XMJ+eqqqNZQCMOT2FiI5FyeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wpFJWwsCyVgBKaabLOTjshW52QIEmybIJMvNmkp0Ob6rg5Ta5tTGlQtEncm/Yn2UL J0083QPCV3WE/pz5EuVgm9K8WzC4uYnaXPm0uhlyRRiLTpw1pzaTsoIbUnb7Bi9z3f XVocVrt3fVqGkvRFzIx27MKauuQbGa6Ea38CjJ1g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Poimboeuf , Randy Dunlap , Peter Zijlstra , Andrew Morton , Linus Torvalds Subject: [PATCH 5.4 06/13] kdev_t: always inline major/minor helper functions Date: Thu, 7 Jan 2021 15:33:25 +0100 Message-Id: <20210107143050.782120333@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143049.929352526@linuxfoundation.org> References: <20210107143049.929352526@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josh Poimboeuf commit aa8c7db494d0a83ecae583aa193f1134ef25d506 upstream. Silly GCC doesn't always inline these trivial functions. Fixes the following warning: arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0xd8: call to new_encode_dev() with UACCESS enabled Link: https://lkml.kernel.org/r/984353b44a4484d86ba9f73884b7306232e25e30.1608737428.git.jpoimboe@redhat.com Signed-off-by: Josh Poimboeuf Reported-by: Randy Dunlap Acked-by: Randy Dunlap [build-tested] Cc: Peter Zijlstra Cc: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- include/linux/kdev_t.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) --- a/include/linux/kdev_t.h +++ b/include/linux/kdev_t.h @@ -21,61 +21,61 @@ }) /* acceptable for old filesystems */ -static inline bool old_valid_dev(dev_t dev) +static __always_inline bool old_valid_dev(dev_t dev) { return MAJOR(dev) < 256 && MINOR(dev) < 256; } -static inline u16 old_encode_dev(dev_t dev) +static __always_inline u16 old_encode_dev(dev_t dev) { return (MAJOR(dev) << 8) | MINOR(dev); } -static inline dev_t old_decode_dev(u16 val) +static __always_inline dev_t old_decode_dev(u16 val) { return MKDEV((val >> 8) & 255, val & 255); } -static inline u32 new_encode_dev(dev_t dev) +static __always_inline u32 new_encode_dev(dev_t dev) { unsigned major = MAJOR(dev); unsigned minor = MINOR(dev); return (minor & 0xff) | (major << 8) | ((minor & ~0xff) << 12); } -static inline dev_t new_decode_dev(u32 dev) +static __always_inline dev_t new_decode_dev(u32 dev) { unsigned major = (dev & 0xfff00) >> 8; unsigned minor = (dev & 0xff) | ((dev >> 12) & 0xfff00); return MKDEV(major, minor); } -static inline u64 huge_encode_dev(dev_t dev) +static __always_inline u64 huge_encode_dev(dev_t dev) { return new_encode_dev(dev); } -static inline dev_t huge_decode_dev(u64 dev) +static __always_inline dev_t huge_decode_dev(u64 dev) { return new_decode_dev(dev); } -static inline int sysv_valid_dev(dev_t dev) +static __always_inline int sysv_valid_dev(dev_t dev) { return MAJOR(dev) < (1<<14) && MINOR(dev) < (1<<18); } -static inline u32 sysv_encode_dev(dev_t dev) +static __always_inline u32 sysv_encode_dev(dev_t dev) { return MINOR(dev) | (MAJOR(dev) << 18); } -static inline unsigned sysv_major(u32 dev) +static __always_inline unsigned sysv_major(u32 dev) { return (dev >> 18) & 0x3fff; } -static inline unsigned sysv_minor(u32 dev) +static __always_inline unsigned sysv_minor(u32 dev) { return dev & 0x3ffff; }