Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4470268ybx; Mon, 4 Nov 2019 13:58:58 -0800 (PST) X-Google-Smtp-Source: APXvYqxBNK7VI2jnDAhiOgLpS+5V78btX21YjwtWH5eZKv5fYgxUZO6KIl0SdX7qU+OWELp9BvRc X-Received: by 2002:a17:906:684a:: with SMTP id a10mr2173820ejs.160.1572904738337; Mon, 04 Nov 2019 13:58:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572904738; cv=none; d=google.com; s=arc-20160816; b=T1rAMkxDh15HK1tZOl1FeLskU7eWIh9dWZT0FZTFhG1ne/0puBYs0+k0mrI+2Afq+6 IxLi26tV+wcvofNr+cDW2cqrClrMpkxBCjzEk+P6ltvSqTD/xTVc4qkmkHWV75CAt+uI 5Dqb+BJCNJmH8Lbc1r1DvoSeVts/4rzM6d21XievMCRiF3NZ/mlTutI5bOmsWP3miE/H ntp/jEzgOnH0hh7SmoXFgkfiJ8u7FADv8izDAD0ozJxfxSTzjVg7h0uxutOX/o3xWnAR tXZuY//wx+u87pxHxrdcpJvRama0AscDhp2H4nVfmSh6tR3DsBzQl73vDqTtecbCuZpP jN2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cvCz6LYZe58jagKNYQouLx1G76KNcidSfpyAtGkBqbc=; b=wKs4mR9Sgn18uBRW+j7uK4nGAKX9FrBOFTgPyZlX2fN+FzHuoEQpH3YnJova40F8D1 0XMR8dQf4kwqSHdgKh3mGgiMdwaPn0tDaW9IM7V5ZqpOfTDZ+TsJ+ZCi9X0TRQGLav1T L8vJ6owbusMQtqqt97Pt8y1nlKTb36yeSU5hVYCOrxhRuPl2xHMsgPRKfoT2fJmyPhEl heh0jmGYMoVUt2VUzVbOhJhb68JWWUa9fTNyHVN0s3roid//FlXpp66vn9GeIl1nB8qS ZRrxK1kgzvIb7Df6cKnjOHCBuqTRzBjn35SiJ+VRbZRiS+1rxzFWY8Vl/cTPZ+vVNFUN BLYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zwx0t1wL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uz29si12799721ejb.68.2019.11.04.13.58.35; Mon, 04 Nov 2019 13:58:58 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zwx0t1wL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388429AbfKDV4k (ORCPT + 99 others); Mon, 4 Nov 2019 16:56:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:52232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388407AbfKDV4h (ORCPT ); Mon, 4 Nov 2019 16:56:37 -0500 Received: from localhost (6.204-14-84.ripe.coltfrance.com [84.14.204.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2012D217F4; Mon, 4 Nov 2019 21:56:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904596; bh=vo9KI/6ReG4GAX0/NrUSIFMAlhImi0q1vwrXi1egK4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zwx0t1wLZozDkXRi+/5No8M9r94UTLz91pjNIbiN2trp3LTxZ8llkpsWj8WsLQCX9 Jl2o8fAFKJEfEXb2DKFpYygu1tv34Ut1tnstx2WLCr99XYusPYnL88GXCiCgSAUdMC +5obBxqUECzTGRHvwNoSiYe11eNBq0w3v/AxuXGs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christian Borntraeger , Vasily Gorbik , Sasha Levin Subject: [PATCH 4.14 55/95] s390/uaccess: avoid (false positive) compiler warnings Date: Mon, 4 Nov 2019 22:44:53 +0100 Message-Id: <20191104212105.778612650@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104212038.056365853@linuxfoundation.org> References: <20191104212038.056365853@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christian Borntraeger [ Upstream commit 062795fcdcb2d22822fb42644b1d76a8ad8439b3 ] Depending on inlining decisions by the compiler, __get/put_user_fn might become out of line. Then the compiler is no longer able to tell that size can only be 1,2,4 or 8 due to the check in __get/put_user resulting in false positives like ./arch/s390/include/asm/uaccess.h: In function ‘__put_user_fn’: ./arch/s390/include/asm/uaccess.h:113:9: warning: ‘rc’ may be used uninitialized in this function [-Wmaybe-uninitialized] 113 | return rc; | ^~ ./arch/s390/include/asm/uaccess.h: In function ‘__get_user_fn’: ./arch/s390/include/asm/uaccess.h:143:9: warning: ‘rc’ may be used uninitialized in this function [-Wmaybe-uninitialized] 143 | return rc; | ^~ These functions are supposed to be always inlined. Mark it as such. Signed-off-by: Christian Borntraeger Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- arch/s390/include/asm/uaccess.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/s390/include/asm/uaccess.h b/arch/s390/include/asm/uaccess.h index 689eae8d38591..bd7a19a0aecf7 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h @@ -95,7 +95,7 @@ raw_copy_to_user(void __user *to, const void *from, unsigned long n); __rc; \ }) -static inline int __put_user_fn(void *x, void __user *ptr, unsigned long size) +static __always_inline int __put_user_fn(void *x, void __user *ptr, unsigned long size) { unsigned long spec = 0x810000UL; int rc; @@ -125,7 +125,7 @@ static inline int __put_user_fn(void *x, void __user *ptr, unsigned long size) return rc; } -static inline int __get_user_fn(void *x, const void __user *ptr, unsigned long size) +static __always_inline int __get_user_fn(void *x, const void __user *ptr, unsigned long size) { unsigned long spec = 0x81UL; int rc; -- 2.20.1