Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp349856pxu; Thu, 7 Jan 2021 06:41:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyH7/w91w6kWcM+EWgXOqCe4KmLwLQ3NFAdkPZSq8Tn6Gujn+by33lvsJhE9vHSKOTihXJ5 X-Received: by 2002:a17:906:b2da:: with SMTP id cf26mr6693161ejb.176.1610030490946; Thu, 07 Jan 2021 06:41:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610030490; cv=none; d=google.com; s=arc-20160816; b=Fh+Q05gvHaUNjlgvW1te6oOyjYhmNnWt+jg+HcD9Wb26P10qYrp1fZhJ2y402auK89 3aYtUJ3SyBVrgBQMpfClK9MRQPlmhGP7hIgtaH/bC1oInxcxij6HAoarrVdjqwAs7zmx 1uYSTJhbIZfozMemNIv93J5YstRkk/YY6RIdAly078iasq3z0NwrmKRo5Tob+sJKq4U1 Nhmuy9sAXzs1mkpnQgjqhP642y2ivjrqtq3jYELjHVLrm9KtSbcV1UbxTv6DTvMRIqGN fY5kOANbYZ8ncuw9v/Nx+KgC74N0UMu8vkBYdpsnfFHX7qNUb39348D5W+V1lPFAKdmm THdw== 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=0BQMQOXRfSRO8N5IVO2j4piVm3CwUHSSI4O1apqHY6FoZx14S+9a2zfK5n4buJfu0D KZakP9kZ6inRnj8a2C7X/4GUefTUqaQ2tWZDGCvLTLduysCxi6XlFrBVDK9KjyPFwz+5 APxILs+SBZd8xJxsUoWEvsz4npaaD2U0n4q5aYHudWqvfEkvTwIqvXcvvPgXQF/8KCQB 1apCWXTtQ4qsnFSWMzRSDaQwSQCM60tW7pJel9WC7l0ZJPYwLuK1OVDrqTG2lPNzyM2N BwpGrLB29ML2UJ4/4WAyJ3UbTrDD4VyTM/QOBjWSAYjqJDnYuD0yFNtuPxMMAHVZUtcf GCOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vUU5EaQi; 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 n1si2343280edq.466.2021.01.07.06.41.05; Thu, 07 Jan 2021 06:41:30 -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=vUU5EaQi; 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 S1729645AbhAGOhE (ORCPT + 99 others); Thu, 7 Jan 2021 09:37:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:45348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729220AbhAGOcJ (ORCPT ); Thu, 7 Jan 2021 09:32:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CE0A6233ED; Thu, 7 Jan 2021 14:31:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610029907; bh=7TBz14ywOEcasArJ3v4XMJ+eqqqNZQCMOT2FiI5FyeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vUU5EaQip9W50fSVd+PRoMkPbe/mSsNtJMQ5Hi3xrwu7bzKwOgrVKTrC7V5c4WqKm fGqLVgJrMnbMG77m4W/0NkppN1Wz2F0AejSjcLRK50P83nU4QThPh3dY7ymRYRjeV2 Z74ky+Pgi/mTCt4NEwTMekKBZ5JQtFHP4FyVvC9U= 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.19 5/8] kdev_t: always inline major/minor helper functions Date: Thu, 7 Jan 2021 15:32:05 +0100 Message-Id: <20210107143048.305792599@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210107143047.586006010@linuxfoundation.org> References: <20210107143047.586006010@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; }