Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbdLDSLQ (ORCPT ); Mon, 4 Dec 2017 13:11:16 -0500 Received: from mail-it0-f43.google.com ([209.85.214.43]:44432 "EHLO mail-it0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbdLDSLP (ORCPT ); Mon, 4 Dec 2017 13:11:15 -0500 X-Google-Smtp-Source: AGs4zMZACCqNgCwAjLS/YBmhpuv8TkP0V0KXTxedn5cr1kFz3FLrBBn3wgzYQKAs6Ixw+xiU1HRiPuBdJOG//tGn6aM= MIME-Version: 1.0 X-Originating-IP: [2a02:168:5635:0:39d2:f87e:2033:9f6] In-Reply-To: <20171204092045.Horde.5M1LmPnqkpe4as2CWf9PPSh@gator4166.hostgator.com> References: <20171127221701.GA15983@embeddedor.com> <1512383705.4394.18.camel@linux.intel.com> <20171204092045.Horde.5M1LmPnqkpe4as2CWf9PPSh@gator4166.hostgator.com> From: Daniel Vetter Date: Mon, 4 Dec 2017 19:11:12 +0100 X-Google-Sender-Auth: XsbfxckPRdZNSDiUzgJPrNNrmok Message-ID: Subject: Re: [Intel-gfx] [PATCH] drm/i915: Mark expected switch fall-throughs To: "Gustavo A. R. Silva" Cc: Joonas Lahtinen , Kees Cook , David Airlie , intel-gfx , Linux Kernel Mailing List , dri-devel , Rodrigo Vivi Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1702 Lines: 62 On Mon, Dec 4, 2017 at 4:20 PM, Gustavo A. R. Silva wrote: > Hi Joonas, > > Quoting Joonas Lahtinen : > >> On Mon, 2017-11-27 at 16:17 -0600, Gustavo A. R. Silva wrote: >>> >>> In preparation to enabling -Wimplicit-fallthrough, mark switch cases >>> where we are expecting to fall through. >> >> >> I have to say I'm totally not sold on regexps matching comment >> contents. Was something more explicit ever considered? Like: >> >> #define FALLTHROUGH __attribute__((fallthrough)); >> >> With the appropriate version checks, of course. >> > > One of the arguments is that comments lets us leverage the existing static > analyzers. > > We've been discussing this during the last week, feel free to join the > discussion: > > http://www.spinics.net/lists/kernel/msg2659908.html > http://www.spinics.net/lists/kernel/msg2659906.html If we go with existing rules, then either pls patch coding style, or be a bit more liberal in what you accept. E.g. fallthrough vs fall through seems a bit a bikeshed (and will be an endless source of work for you). I'd also claim that "this shouldn't happen, dump a backtrace and hope for the best" style macros like i915's MISSING_CASE or WARN_ON (as the only thing) should count as an auto-fallthrough annotation. >From a quick look, that would cover everything in your patch. -Daniel > > Thanks! > -- > Gustavo A. R. Silva > > > > > > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch