Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4011499ybl; Mon, 3 Feb 2020 10:48:44 -0800 (PST) X-Google-Smtp-Source: APXvYqzqddhZ+MawWj8FUXhDQMQAy536Jz/aXgjzeddOZBcyIsMmrGjFBd7xzB2oUTOQzdj+r9fb X-Received: by 2002:a9d:12cf:: with SMTP id g73mr17775447otg.329.1580755724064; Mon, 03 Feb 2020 10:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580755724; cv=none; d=google.com; s=arc-20160816; b=hWyzJkAfdO5GtZRuj4oIPhe+86YRELPBOxUR28TV49FlhFP1HXeJrbUthNhrpIVnZ/ qcOeCHSikyo3pZV47EJdf9SPkvuXfhjGIpwqcgzCiQbAFMxWT4rrGvtoGRTN7c54J3AJ Jtqa/TzHJmdcjLzCRAUB+7KSn9pisnyIdlDHe5ZMpQyH7188HK6N4t9aY0HDemJGSxuI WWEsZS671jGZcNurQ986ybxfoYl1uSqQoBgQxxKhfv0/RRs6K3O/duZ0aXfT+y291lX2 MbdMAfhvgcXU7aXdkaOAZrPLVNI+ihHcTygxXKq8kl0yXf1mMNrlgMFVyCbr8ffN5bpM +C+Q== 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=yFWU01s7N+NOv9zKiL1VnV8kT90ftaJVNBTPzZo0LfrneJWOECepSau6JOZ2LTwHnv 546tCKZ9IrqJSWOELGbH33A8DoVFLy63JkuOBQ9UnGGYePtNpMu+l8p+Ff43tlHhFGFQ bFkqVy0CnRFzKX5186Z50Fr5km5saxypTcQxG9EHFS8EA2mCgg8eO1M/t+CrCecmyE3B Uxnud1ySlw5+/TSD7Pxyu2fYFae5PAbpqhQmqoYFQZL8E3DimJteyR7V7neUX8bUaYsI 6vDd0iaCBH/XiDo6Qx2eSYDlCX/1pmHg3ySG4P45j8Lebza0YzujIbe3If08JyarF8Sc tRlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Yhv0mvL4; 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 w13si1988547oiw.106.2020.02.03.10.48.32; Mon, 03 Feb 2020 10:48:44 -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=Yhv0mvL4; 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 S1730655AbgBCQf5 (ORCPT + 98 others); Mon, 3 Feb 2020 11:35:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:50980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731097AbgBCQfz (ORCPT ); Mon, 3 Feb 2020 11:35:55 -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 D3B6320CC7; Mon, 3 Feb 2020 16:35:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580747755; bh=3X1PU6uQea7BRgZqf4K6xrZwu/6yQq6UNJ+3wSZR3WY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Yhv0mvL4be622Xr3TPz4QUVX6eQFb2TBjEAIcLekQmpza/0KmBXjHdEaCGAbmRcms CsRIRlvCdm3OSQTzlpNqsQe7yfe031nFWGQttVtH4n2gqirofNXz5BTGX1wvnHdpD4 QGUs65EpkTHCLSiC6Ng1lEjM7sSuu4zxXjW0Gy/Q= 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 5.4 54/90] wireless: wext: avoid gcc -O3 warning Date: Mon, 3 Feb 2020 16:19:57 +0000 Message-Id: <20200203161924.377160222@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203161917.612554987@linuxfoundation.org> References: <20200203161917.612554987@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