Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4026269ybl; Mon, 3 Feb 2020 11:06:20 -0800 (PST) X-Google-Smtp-Source: APXvYqwE3N9lqQbbI4t5DeK7w4lUlWEyrVMem3brwV5JYgAA7RSGmoG8sgqcLSdLvqqDpBLuJgJW X-Received: by 2002:aca:5f87:: with SMTP id t129mr391787oib.36.1580756780333; Mon, 03 Feb 2020 11:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580756780; cv=none; d=google.com; s=arc-20160816; b=yfOnvvWqgsCzHWol6TBEc2S8ufmqvJx14DIXC6hI3fMBFp3U/o6EYm0EK95SycW/jQ pXY6/SgVEDVKCTe3HLpBvdG8UOxQvs+P/QYs8vgLM2pIGSTgWSDPvUK7NeRyV0pxrPtN IXoYgBflBVxamqUZEBZYlpxKWIhXzTIb5QPLi5VtfJ4z8nhI592tLIhsO8V/FjUHJbm9 Q0YB00N6qKBY5gpZcfpboDer2esdQKB9I3qd1nxXM9yI6xca5O52IYdFYMC3U89yised JjawYw3v1BRJf2HBM+qKbaV6A0sDDKFiq1cjexdHvB3rtCe/y6Bl1QFz2i/Zf89Y/Fkp 2DUQ== 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=D6HsR384G+SEMaDOYTIMNFZsUicaQEWWKUf53fyY3tE=; b=kWtukTqcrLRi8RKyK9mARPYBV0cVktIVP9hm6TDSQ4GKAElhr4QKVeFase575exBTm SZT4uKj+8HysejuRocuEKCDnuGZr41wzngNorSFgyyYPxgouKnv8nqHag22vrf7RQonp AJM6dxHbC5lseTKF0JPpfIUrMnE2VYNp5Ya6DLxyLvC+Q8gl3hV2EyoDLaDfZVpzNqMP NwHq7Iv5g0YnTxqFewykmTk7rgcVC1FRBy9wK03/gAXQkEEZzp2VogfMReWvC6VSvCF4 1VpePpYTgXP1UdXHxjwySyc8qE40AWS/BOtiAyiVZfiyBRlKfm3FxJlFg31PZ2CHXH81 CXIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IEFk3Jh2; 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 h3si10146258otq.203.2020.02.03.11.06.08; Mon, 03 Feb 2020 11:06:20 -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=IEFk3Jh2; 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 S1730248AbgBCQcs (ORCPT + 99 others); Mon, 3 Feb 2020 11:32:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:46490 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730467AbgBCQco (ORCPT ); Mon, 3 Feb 2020 11:32:44 -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 40B972082E; Mon, 3 Feb 2020 16:32:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580747563; bh=3X1PU6uQea7BRgZqf4K6xrZwu/6yQq6UNJ+3wSZR3WY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IEFk3Jh2AWdCeDcbcttWcbDy3qqHyA3PizqQOxdBLbry7HvM34C1JIiE4iXYG6aM5 b/631mWC0Lu0/tCv2bFmf3WeBxlyaDDTFoKk02NvAu+WtxTtkcFn2BGnonUSk3qf4k Yr1h1CSq4QjsKEFd1nYZNlWIpAEZrOgJy9tER+xI= 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.19 45/70] wireless: wext: avoid gcc -O3 warning Date: Mon, 3 Feb 2020 16:19:57 +0000 Message-Id: <20200203161918.866439075@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203161912.158976871@linuxfoundation.org> References: <20200203161912.158976871@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 5e677dac2a0ce..69102fda9ebd4 100644 --- a/net/wireless/wext-core.c +++ b/net/wireless/wext-core.c @@ -657,7 +657,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