Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp345088pxu; Thu, 7 Jan 2021 06:35:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyJiaWVVL6MIVG9NkynJHycvs6R/BcUA7yI08Ss30XT/lnkFehFDiTng6/sX+Hf472I4+MD X-Received: by 2002:a17:906:5e0f:: with SMTP id n15mr6553336eju.459.1610030133754; Thu, 07 Jan 2021 06:35:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030133; cv=none; d=google.com; s=arc-20160816; b=w0AlxadXDVjEX1l6z+knes5QKzNgE60uKPZOmIhzv3aoh9h7n2uu0NFovUNdgizgQ1 GcT+XaEUZbFSLQisf7TiavU9EnoLj853xLj+ZyLJreueL+nuJ/bup4DfyzrRwxZhSy6L ddI1smytXPGQrF1zbCL1V7WflnhKmhkMy7kyS91U8xOHjtGlZBcU79Suhl2+j73Pripx xZoIYgjvUxv/Z9Fm00pr7wkMywkN4FSd+QzMk8Ux+cyRyDJH3cCzw7kBnwZ+KZZQ7khn oTsP/888x5Ql7wweed6smJj8Zv6LjiGwroUEHiItF4Aj5KSqf1XzeYUbmuelYa3hUTZ2 OFYQ== 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=xRra0/GgCObfM9v/BJfkVTer83zTXGQWBhd54h4mlJAlshC2NY1whf2IF8U/utGDYb 8NiZREe07tk2HAiF5JRbYe3cv0S8Y/B2g7gJV7Oar5gJ1yb/wkP9s5RwPZIKpfr+0azc 1K2Y//sbi6O75C9YhUrb2E9x06HejISehtfTJrr0AkvYgk75rXYRNhRDEXcZQJGuIv8s 6fqGixhKbQvirt/pSlMdHCCW4i/JI+fzjWJ83O0+PpY3rez281XmHJTLeJdG5wPvtNGw mwrqFefWQ6jnWKJvG4eg4ediuQTT6wCD0GoVrzcJ6Gylwb8fIgDBiu1dXS+j3ZZ99skA fIOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=R0zjtofX; 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 v23si2355676ejy.208.2021.01.07.06.35.10; Thu, 07 Jan 2021 06:35:33 -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=R0zjtofX; 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 S1729297AbhAGOcU (ORCPT + 99 others); Thu, 7 Jan 2021 09:32:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:46364 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729266AbhAGOcR (ORCPT ); Thu, 7 Jan 2021 09:32:17 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0BE0233A1; Thu, 7 Jan 2021 14:31:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029872; bh=7TBz14ywOEcasArJ3v4XMJ+eqqqNZQCMOT2FiI5FyeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R0zjtofX5oVdo8enajPSY1m7fQfeJvewE1vq08ixjuH8dLiTgAuaXXdX9QWhDze1A A18b42o4CGdrpFm78LS2q6P9fQHUBrsoT/eMa/aMCYVykjjNfhrpfiAauySSNyQ4bR b3ryudVlhJPk4wnJ8iBBwTVGewP9jHp1I9BvO/K0= 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 4.14 26/29] kdev_t: always inline major/minor helper functions Date: Thu, 7 Jan 2021 15:31:41 +0100 Message-Id: <20210107143056.699307166@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143052.973437064@linuxfoundation.org> References: <20210107143052.973437064@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; }