Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp766057imu; Wed, 23 Jan 2019 05:23:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN46RGOheYwkjvs8VKnpbLsL1rHmtOPPZS4zAPE27jWrZuoxwEPnxqATY/3ImG9o5Q0bRvHe X-Received: by 2002:a17:902:145:: with SMTP id 63mr2206097plb.256.1548249837894; Wed, 23 Jan 2019 05:23:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548249837; cv=none; d=google.com; s=arc-20160816; b=PRnqWxkz1zQnaX9qkmXDCeIheBpnGLNd9NyOHcuedTvc9G4KWXUhL1Vo/I7fqld5a+ 2yIkwSnhLKMH+00qmsNePZzhy4D42Th383B8JatMo1NUid662UqDUmvhbTigB4Y5KaIu BlYKu3FsoXKmVI/wRKCxkwwKsdNfLB4i/AXmebluX7vPaiswzQ5D7wL6NifnF5Qa1jt5 FDMHOrbc+p+fqDlt1Sc51YCZNA566rMrE9Z926WSzdN+3/T9Vc4+5ijSiWVeojks7/E2 Wl9QFrH3kwshWbCiuCV6oVpqaRACwReXmEPdxlnp1EfjW5ZTP5EtFQ7xWmLm2j6KDNCK 4BQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=/orrWMYiF7s/PRi+ZWvmsxRG9vOAxGOt71oInJg9hNg=; b=Sxb6695tdVP7xk41PXB5xO7dxU4jEayNrpuMPAR8BZTVvd4/d8tFsVGDqN95aad0KY 4qazev1vn+QZZtLRw40FHQC9V2eqEajQCVic+WKiuh4iXtxHFHs37etm0EGnlxKx2tke YzSVAHFqniaOXkZMT/3aIDnvZRP8q7uc7DVoEKhClpW8tM42s8nhc6Trd1VMuOnNdjKz gKhuq+r9QfuwIZzTQ4oHgoOzoVgyuSh/bJafNZKejWx+LsSFcCGPKzburFz9sqM50G/s WA9p80yizlbBALQWu1t++fngeknmBcn68Wyj1E4F/VcDALnoDi3IkK0lKwuvh5FaD7Vo Aofw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=J4j9p4oT; 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 1si17883649plo.195.2019.01.23.05.23.42; Wed, 23 Jan 2019 05:23:57 -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=@oracle.com header.s=corp-2018-07-02 header.b=J4j9p4oT; 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 S1726266AbfAWNWV (ORCPT + 99 others); Wed, 23 Jan 2019 08:22:21 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:34290 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726100AbfAWNWV (ORCPT ); Wed, 23 Jan 2019 08:22:21 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id x0NDEDgj194366; Wed, 23 Jan 2019 13:21:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=content-type : mime-version : subject : from : in-reply-to : date : cc : content-transfer-encoding : message-id : references : to; s=corp-2018-07-02; bh=/orrWMYiF7s/PRi+ZWvmsxRG9vOAxGOt71oInJg9hNg=; b=J4j9p4oTJs9pHPAPfdQosv62OUDUwbW5iXWImy9Xw5mkyPLorUzfOSwXG+Pz6Hl5NkSB r7g+cah0pLD+GMOXDTDQdNhx+bMpNRm2LLyU9F20GAsJFQVtmT/suPsxYFEXGtq/+DCh uc3umUX8CMgBbaeBa5BjmTn+0doBsH3eKQ/6NTtiNWekzhHOiqwHTzopHj1udcUsoUbu CfmWSxPue6oO+dsjgXBfHS8BkBBNTVRS9Ko5wG+R1LWAtsKn2yZiZviqliYhxRl88FMt MXd8Lp84GXpqP7gVP7pBVDCL4TvlNExDf+B/GpnjEtfCBFjUbF6X2nF7pQcL8uSnoZ4G xQ== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2q3sdehx71-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 13:21:50 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x0NDLmbp005483 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Jan 2019 13:21:49 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x0NDLjiW011995; Wed, 23 Jan 2019 13:21:46 GMT Received: from [192.168.0.110] (/73.243.10.6) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Jan 2019 05:21:45 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH 1/3] treewide: Lift switch variables out of switches From: William Kucharski In-Reply-To: Date: Wed, 23 Jan 2019 06:21:44 -0700 Cc: Greg KH , Kees Cook , kernel list , Ard Biesheuvel , Laura Abbott , Alexander Popov , xen-devel , dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-wired-lan , Network Development , linux-usb@vger.kernel.org, linux-fsdevel@vger.kernel.org, Linux-MM , dev@openvswitch.org, linux-kbuild@vger.kernel.org, linux-security-module , Kernel Hardening Content-Transfer-Encoding: quoted-printable Message-Id: <536BB69D-6E93-4E32-8303-16D92E07D8AA@oracle.com> References: <20190123110349.35882-1-keescook@chromium.org> <20190123110349.35882-2-keescook@chromium.org> <20190123115829.GA31385@kroah.com> To: Jann Horn X-Mailer: Apple Mail (2.3445.102.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9144 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=809 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901230100 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jan 23, 2019, at 5:09 AM, Jann Horn wrote: >=20 > AFAICS this only applies to switch statements (because they jump to a > case and don't execute stuff at the start of the block), not blocks > after if/while/... . It bothers me that we are going out of our way to deprecate valid C = constructs in favor of placing the declarations elsewhere. As current compiler warnings would catch any reference before = initialization usage anyway, it seems like we are letting a compiler warning rather = than the language standard dictate syntax. Certainly if we want to make it a best practice coding style issue we = can, and then an appropriate note explaining why should be added to Documentation/process/coding-style.rst.=