Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4022309ybl; Mon, 3 Feb 2020 11:02:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx//Q1ZQo31eXCeIVYXW8VE4ygJj0hurPvIzaRfQ7s0lGcsL7k1KQE6R/8yNC76x+7fJVWM X-Received: by 2002:aca:2806:: with SMTP id 6mr348145oix.64.1580756553679; Mon, 03 Feb 2020 11:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580756553; cv=none; d=google.com; s=arc-20160816; b=a4SsGLl5cLvyvhlrwPaPvkLaOAKRmzMFdsUbphXzF2Ha/N5Outzu6QZwd4+3/iMPse eq/+EMyblMuu2RyzYg4OMGEiEw/mTcCcMAdmDbtd3Q/Wrf3NhNNrFL+Jrf4pfSLYY8Ml usR8OW5v1W7wAmYD+Ujefz2nIsv0J0cslHvrWKie7AWqpDOja++wjPcPfCPO77/x6h8d 5l7UtwVjm8QC3342A6Ow1NN+0CQEXxJfpy8rS/fvfL7JNHdAZFUlXnehuo4A1cLI727O oebb6PvF92mRAzlc2MkFuba24D5ZdStqoVcIOldWZ3Y+a8/YdIckJEK3r64opLsId9Kk u+tA== 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=07jzSPjaAqQrj8xCCD/SPCDOR83oL2OO9kxCJZs9bd0=; b=R3kvHdHmVa7tFY5f8GguOOjt2AGFA5TWyp/Y/GFPAwYINLER5w8SQdnwiVxYr1OrtU JsFLR/YyJ0+Ad8+kGmLC7Npe/Gb+8zvGbcfj2It4cUh/w6nhQwc8E6LOVuUzLm7BigGi ZEzCTePjV0Xe97SGS5WQzVkctZ9Bqyauif76PiXAXDnkZzSkq4UeccCgtc427ns9e9Hp wNSxw4hbRo8/+cjgsCEIHD4J7ocgoJy5TrOY/ttF3A4Fa8Lt2EjWjE62rHUEoa2IX6Te Y/ty6s6GC1qIm0l6+ZVvQbgMSbI4jyD0qXRSzFdSqkDl3zXEGrlQDZA89YssS5UwgT2w cFrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dEbWf8aA; 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 x11si8535630otp.285.2020.02.03.11.02.19; Mon, 03 Feb 2020 11:02:33 -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=dEbWf8aA; 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 S1729260AbgBCQWT (ORCPT + 99 others); Mon, 3 Feb 2020 11:22:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:33694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728601AbgBCQVl (ORCPT ); Mon, 3 Feb 2020 11:21:41 -0500 Received: from localhost (unknown [104.132.45.99]) (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 A24D52080C; Mon, 3 Feb 2020 16:21:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580746900; bh=FbqL9DxWWj8vs/OxbIAQM1UlvvUfqLzpDxKU81KI42M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dEbWf8aAlK/UQeq35T8tr0boSLiq3hPk/RTkAx/g5NoIozbA+KT46NNcWHPGAtv7d l+lLnExyY2oPmexWDt8tshTZAPeP+JZGmnSrDlukIm/Qy7mzzTxYDoHKmcwskIkOhy MCiFa1s7IZGUmWrlLKtQtGg5G49MgumJU+MtHLFU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Johannes Berg , Sasha Levin Subject: [PATCH 4.4 37/53] wireless: wext: avoid gcc -O3 warning Date: Mon, 3 Feb 2020 16:19:29 +0000 Message-Id: <20200203161909.602727646@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203161902.714326084@linuxfoundation.org> References: <20200203161902.714326084@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: Arnd Bergmann [ Upstream commit e16119655c9e6c4aa5767cd971baa9c491f41b13 ] After the introduction of CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3, the wext code produces a bogus warning: In function 'iw_handler_get_iwstats', inlined from 'ioctl_standard_call' at net/wireless/wext-core.c:1015:9, inlined from 'wireless_process_ioctl' at net/wireless/wext-core.c:935:10, inlined from 'wext_ioctl_dispatch.part.8' at net/wireless/wext-core.c:986:8, inlined from 'wext_handle_ioctl': net/wireless/wext-core.c:671:3: error: argument 1 null where non-null expected [-Werror=nonnull] memcpy(extra, stats, sizeof(struct iw_statistics)); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from arch/x86/include/asm/string.h:5, net/wireless/wext-core.c: In function 'wext_handle_ioctl': arch/x86/include/asm/string_64.h:14:14: note: in a call to function 'memcpy' declared here The problem is that ioctl_standard_call() sometimes calls the handler with a NULL argument that would cause a problem for iw_handler_get_iwstats. However, iw_handler_get_iwstats never actually gets called that way. Marking that function as noinline avoids the warning and leads to slightly smaller object code as well. Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20200107200741.3588770-1-arnd@arndb.de Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/wext-core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/wireless/wext-core.c b/net/wireless/wext-core.c index b50ee5d622e14..843d2cf1e6a6c 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c @@ -656,7 +656,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev) return NULL; } -static int iw_handler_get_iwstats(struct net_device * dev, +/* noinline to avoid a bogus warning with -O3 */ +static noinline int iw_handler_get_iwstats(struct net_device * dev, struct iw_request_info * info, union iwreq_data * wrqu, char * extra) -- 2.20.1