Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp523389ima; Sat, 20 Oct 2018 12:23:24 -0700 (PDT) X-Google-Smtp-Source: ACcGV61JvpsOOShZkhzHPiiLP6Vb3HSt8FCtar18L+RolRLVY9mfYDxwGDEQLLgpVqOo4nVJja8E X-Received: by 2002:a65:4b82:: with SMTP id t2-v6mr5873139pgq.240.1540063404701; Sat, 20 Oct 2018 12:23:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540063404; cv=none; d=google.com; s=arc-20160816; b=I34kFpYKlUhQXYAzJ9SpKoziNdI2pxyuZJ3uiHeZ34tSmmuZcRnlD+ZLeeHrGSa+rG Lk54qSIPluw6k2YYARHfIWvKxSxFHS62Pl9+3ANfkvaGW2L9l/r9rZng0ed6hDaFhy4h xPGT6L67TGGpnL9H8KnIaG2GQHSQVgDaidgWWr+yx2ExM4qxA2KR7iJuGBabyYj+zjax N/eaZLHROjnM8QOoJ61eZ0GhZfhJu1wyDUDJkIrnIYS7VRTHtB4nwZGWA2ZdGaLfa2OI G+CdxBigmtCWoY8+5wvBcNebSF7XmhGv4TtrWhQxxhOtZCYImjhIGssngZWy7RWfRnFf 7pFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vx35n2531/MdQTw9awOXhGNhgdkehCgifWKslgBHphs=; b=THxtHElrCrieXrgoo8Zp1boiLdyHe3VF695RqNOdV0mEktkDp4dXZT73YkoylaDYCL xzTjOzcUtDy25P7eMNWDD6ZGU+GXYpGLjxvior0q7aOzoNrt+Punpbq8hbnoh9uIYTKn 6lnvGV1jkmFSnl6PmxUmw2FwRzx35edCqjzYqcK1bMp5X55D5D2O3aC6fGztrJhBdej2 a+GYPjaEljDDsczbeITb2dWVUxFbdFYSrbNxqBcBToTdOFCkyLRzmw8ykIqApN1Q5Q5j 2Cyq+AnwvDfdUhN/WwpY9TIi0eHrA71cauaU3Vl5R9ojzta9insTZqW4/bxl0J7EiFf5 +mPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=TU2HxXkM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1-v6si18671551pld.217.2018.10.20.12.23.07; Sat, 20 Oct 2018 12:23:24 -0700 (PDT) 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=@oracle.com header.s=corp-2018-07-02 header.b=TU2HxXkM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727512AbeJUDeI (ORCPT + 99 others); Sat, 20 Oct 2018 23:34:08 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:45232 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726507AbeJUDeI (ORCPT ); Sat, 20 Oct 2018 23:34:08 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9KJFJGc186934; Sat, 20 Oct 2018 19:22:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2018-07-02; bh=vx35n2531/MdQTw9awOXhGNhgdkehCgifWKslgBHphs=; b=TU2HxXkMvV2Saf4hqX4ViHm/RGBeiv+AP+UpF/e8N+9MJnWAotvpEGZVo1mXeopk72aO nro/z6CiIKQqSStJyoMna6SQSdyJVTNYo7e+ehpImYZ2bDPgAVeVCg98nJsb2b4/wawA RxZrlnU4QeEyD9Fi72KGc6WFCXnVXIUqcGnj3xAjtlcxSo9Sm+DFoS+JK2p3YyczH2Jn yyxl9K+oCS9N6O7He2zVUqNXVqEkJZMdGA4IbURfoD93y/Ni6ZGCcbgXZWmgc9ZGry8e x60xrNtaWPJDQTR0BFbFG3Gm97qwikY7N+nd7C4CAFzVacYcDIJnpZPcgWSRH6ngC6fn AQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2n7ustsbck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 20 Oct 2018 19:22:29 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9KJMSI4011025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 20 Oct 2018 19:22:28 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9KJMPuv019123; Sat, 20 Oct 2018 19:22:25 GMT Received: from mwanda (/129.205.6.86) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 20 Oct 2018 12:22:24 -0700 Date: Sat, 20 Oct 2018 22:22:07 +0300 From: Dan Carpenter To: Miguel Ojeda Cc: olaf@aepfle.de, sthemmin@microsoft.com, Greg KH , jasowang@redhat.com, linux-kernel , Stable@vger.kernel.org, Michael.H.Kelley@microsoft.com, Robo Bot , devel@linuxdriverproject.org, vkuznets@redhat.com, haiyangz@microsoft.com Subject: Re: [PATCH 3/5] Drivers: hv: kvp: Fix the recent regression caused by incorrect clean-up Message-ID: <20181020192207.a6mne4npklprlyym@mwanda> References: <20181017031241.669-1-kys@linuxonhyperv.com> <20181017031406.773-1-kys@linuxonhyperv.com> <20181017031406.773-3-kys@linuxonhyperv.com> <20181017050705.GE22447@kroah.com> <20181017062255.oiu44y4zuuwilan3@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9052 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810200181 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Oct 20, 2018 at 04:42:07PM +0200, Miguel Ojeda wrote: > +On Wed, Oct 17, 2018 at 8:25 AM Dan Carpenter wrote: > > > > It's not common at all. It should be wrapped in a macro and put into > > compiler.h. > > > > But I hope it does become adopted. It's better than randomly grepping > > for non-standard comments. > > Using an attribute is indeed better whenever possible. In C++17 it is > an standard attribute and there have been proposals to include some of > them for C as well since 2016 at least, e.g. the latest for > fallthrough at: > > http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2268.pdf > > I have taken a quick look into supporting it (typing it here to save > it on the mailing list :-), and we have: > > * gcc >= 7.1 supports -Wimplicit-fallthrough with > __attribute__((fallthrough)), the comment syntax and the C++ > [[fallthrough]] syntax. > * gcc < 7.1 complains about empty declarations (it does not know > about attributes for null statements) and also > -Wdeclaration-after-statement. I'm not sure I understand about empty decalarations. The idea is that we would do: case 3: frob(); __fall_through(); case 4: frob(); #if GCC > 7.1 #define __fall_through() __attribute__((fallthrough)) #else #define __fall_through() #endif So long as GCC and static analysis tools understand about the attribute that's enought to catch the bugs. No one cares what clang and icc do. We would just disable the fall through warnings on those until they are updated to support the fallthrough attribute. We wouldn't update all the fall through comments until later, but going forward people could use the __fall_through() macro if they want. regards, dan carpenter