From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B673CA9ED3 for ; Mon, 4 Nov 2019 22:27:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 286E92080F for ; Mon, 4 Nov 2019 22:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572906446; bh=JRJyAaXRNWqpl26dWw+2me9hgFmc8J7yvtbT0XQ5nbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=gQFJ6RPXjxGmh+jHrisnVGAAdnBUyQ6vo8pSxrWMRSEFJvCtmMohCSP/3WVdZl6Qq IIe31OMsGpFq5WlKDjEEyydzEV7sgKvpL2VDHddflCURRZmFRUMMaXcLQvj0JGvrZQ dzf5IFf8G8TQmNHngEGvbMvqJ/y8LI6wx+GnfEdU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388132AbfKDW1V (ORCPT ); Mon, 4 Nov 2019 17:27:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:42668 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387712AbfKDVu3 (ORCPT ); Mon, 4 Nov 2019 16:50:29 -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 02B0A2190F; Mon, 4 Nov 2019 21:50:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572904228; bh=JRJyAaXRNWqpl26dWw+2me9hgFmc8J7yvtbT0XQ5nbo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UyrK2ote6XD/KLy/ayxC+cSt6XRVZjSr5xg1BzyxMhOMxwtqLKkNK1jRYNu1LFpM9 CQNs3M5DE+n4B6k+KQWPbGGPkLcAMMjI6iuB6T0LWK3Zlhm68lWTGBoXS6SGwM3SEZ XanGWlitc2PbQAkRa9n6Umc7IkO/eXRCO9Z2g5oc= 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.9 29/62] s390/uaccess: avoid (false positive) compiler warnings Date: Mon, 4 Nov 2019 22:44:51 +0100 Message-Id: <20191104211928.509792270@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191104211901.387893698@linuxfoundation.org> References: <20191104211901.387893698@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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 a7ef702201260..31b2913372b56 100644 --- a/arch/s390/include/asm/uaccess.h +++ b/arch/s390/include/asm/uaccess.h @@ -151,7 +151,7 @@ unsigned long __must_check __copy_to_user(void __user *to, const void *from, __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; @@ -181,7 +181,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