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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D698CC433EF for ; Sun, 27 Feb 2022 22:49:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231342AbiB0Wtz (ORCPT ); Sun, 27 Feb 2022 17:49:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232118AbiB0Wtz (ORCPT ); Sun, 27 Feb 2022 17:49:55 -0500 Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6025B5A080; Sun, 27 Feb 2022 14:49:17 -0800 (PST) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 21RMhqmu022704; Sun, 27 Feb 2022 16:43:53 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 21RMhqks022703; Sun, 27 Feb 2022 16:43:52 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Sun, 27 Feb 2022 16:43:52 -0600 From: Segher Boessenkool To: Arnd Bergmann Cc: Linus Torvalds , Jakob , Linux Kernel Mailing List , linux-arch , Greg Kroah-Hartman , Thomas Gleixner , Andy Shevchenko , Andrew Morton , Kees Cook , Mike Rapoport , "Gustavo A. R. Silva" , Brian Johannesmeyer , Cristiano Giuffrida , "Bos, H.J." Subject: Re: [RFC PATCH 03/13] usb: remove the usage of the list iterator after the loop Message-ID: <20220227224352.GA614@gate.crashing.org> References: <20220217184829.1991035-1-jakobkoschel@gmail.com> <20220217184829.1991035-4-jakobkoschel@gmail.com> <6DFD3D91-B82C-469C-8771-860C09BD8623@gmail.com> <20220226124249.GU614@gate.crashing.org> <20220227010956.GW614@gate.crashing.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Sun, Feb 27, 2022 at 10:28:41PM +0100, Arnd Bergmann wrote: > On Sun, Feb 27, 2022 at 2:09 AM Segher Boessenkool > wrote: > > > > So imo we should just never do this by default, not just if the nasty > > -fwrapv or nastier -fno-strict-overflow is used, just like we suggest > > in our own documentation. The only valid reason -Wshift-negative-value > > is in -Wextra is it warns for situations that always are undefined > > behaviour (even if not in GCC). > > Ok, I just realized that this is specific to the i915 driver because > that, unlike > most of the kernel builds with -Wextra by default. -Wextra is enabled when > users ask for a 'make W=1' build in linux, and i915 is one of just three > drivers that enable an equivalent set of warnings, the other ones > being greybus and btrfs. > > This means to work around the extra warnings, we also just need to disable > it in the W=1 part of scripts/Makefile.extrawarn, as well as the three drivers > that copy those options, but not the default warnings that don't include them. Ah good, all of the workaround in one simple place, neat. > > Could you open a GCC PR for this? The current situation is quite > > suboptimal, and what we document as our implementation choice is much > > more useful! > > I hope I managed to capture the issue in > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104711 That looks fine. Thank you! (I attached the testcase to the bug itself, we prefer it that way, maybe godbolt will go away some day, who knows.) Segher