From patchwork Tue Jan 7 21:43:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11321909 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7B32930 for ; Tue, 7 Jan 2020 21:44:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BBF4B206DB for ; Tue, 7 Jan 2020 21:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727170AbgAGVoI (ORCPT ); Tue, 7 Jan 2020 16:44:08 -0500 Received: from mout.kundenserver.de ([217.72.192.74]:33119 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726594AbgAGVoI (ORCPT ); Tue, 7 Jan 2020 16:44:08 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1MqJyX-1jTAsg2bXn-00nOpV; Tue, 07 Jan 2020 22:43:57 +0100 From: Arnd Bergmann To: Greg Kroah-Hartman Cc: Oleksandr Natalenko , Arnd Bergmann , Colin Ian King , YueHaibing , Masahiro Yamada , "Ben Dooks (Codethink)" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: host: oxu210hp-hcd: fix gcc warning Date: Tue, 7 Jan 2020 22:43:46 +0100 Message-Id: <20200107214354.1008937-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:u/ytrvgdvpHgxcX8GjwpWa6Af54BI3w1VDFyYZI9vnfeynUjOy3 ofGBPPWyyjdYVlh872IwYSN7PvKXmMh0PRXqYLWKWO5881hshyH2kNXawfh/aSluCSu2J+Z XWYRqos4H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sLNw== Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org gcc -O3 warns about correct code: inlined from 'oxu_hub_control.constprop' at drivers/usb/host/oxu210hp-hcd.c:3652:3: include/linux/string.h:411:9: error: argument 1 null where non-null expected [-Werror=nonnull] return __builtin_memset(p, c, size); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/usb/host/oxu210hp-hcd.c: In function 'oxu_hub_control.constprop': include/linux/string.h:411:9: note: in a call to built-in function '__builtin_memset' Expand the code slightly to let gcc better understand it and not warn any more. Fixes: mmtom ("init/Kconfig: enable -O3 for all arches") Signed-off-by: Arnd Bergmann --- drivers/usb/host/oxu210hp-hcd.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index fe09b8626329..120666a0d590 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c @@ -2783,11 +2783,15 @@ static void ehci_port_power(struct oxu_hcd *oxu, int is_on) return; oxu_dbg(oxu, "...power%s ports...\n", is_on ? "up" : "down"); - for (port = HCS_N_PORTS(oxu->hcs_params); port > 0; ) - (void) oxu_hub_control(oxu_to_hcd(oxu), - is_on ? SetPortFeature : ClearPortFeature, - USB_PORT_FEAT_POWER, - port--, NULL, 0); + for (port = HCS_N_PORTS(oxu->hcs_params); port > 0; ) { + if (is_on) + oxu_hub_control(oxu_to_hcd(oxu), SetPortFeature, + USB_PORT_FEAT_POWER, port--, NULL, 0); + else + oxu_hub_control(oxu_to_hcd(oxu), ClearPortFeature, + USB_PORT_FEAT_POWER, port--, NULL, 0); + } + msleep(20); }