Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4385556imb; Wed, 6 Mar 2019 12:06:50 -0800 (PST) X-Google-Smtp-Source: APXvYqzCLONSlr/npm5qUIhRvolVYhiAPbN/vystn1+M56OI5OXoFHoXfK/f8e8O0dpJ6K7CAd4F X-Received: by 2002:a62:2ad1:: with SMTP id q200mr8818751pfq.34.1551902809999; Wed, 06 Mar 2019 12:06:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551902809; cv=none; d=google.com; s=arc-20160816; b=qKtRyA7W9cMx2pz8pvxAsoG/FXJ/KY18vRd71exx8uIHACnAGyMAT5+BIDB8+PsWfM EsW6IfTMvpwioCQCSvOg+JDWhBWzQA52sgocfbO7g2L72uo6h5Fw+6REhlbOiYUBew2d aMwH5UmLkuisXkrof72Qq7qUO2fbEgoZO98qrJxs8cr1TbKuZhibd5OjlEo4zR75Trxn D0hu3VX39hNgDKb1I0HKn9eD9nx+KIZEHPzNZtk11YeljwwG2c2OxPw2D8YYATy1WrwP errdzkh+ErwQE+T2TZKQY9yx3PQnw/dPeDrsC52m1fr4fFLd+1tyIc25zHhoGbtPsQL5 YF8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:organization:from:subject:cc:to :dkim-signature; bh=fr7D4Rs1y0bsowizgCo34pLfBPffKHe7r20bIqHzoZQ=; b=RVQ03E1ldfno/R3x2V2F3QuGjxwZhp9yTyInMdnNL0972L/1pxxeoyk8h1O9CDXj7b UNZgXVst8cm5RXKh/+ui8AI3kPRITKmUheL7OMZL4xEzQMNNXiCiSsJEKUhOSHSoW8dq 3qKuH2Ra/yfYfh0PbuzDs6UCiYZlK2qFRM9rdHg8sOGkbbcQpXvraIks2YSaEh6hAacE BGW+g07Xh82VskB2IfZX+8maYoVCEkD4mOAopSTgZSzFbFZIADCoLSZ/I647GzgNby6M p2XaBm/bYfZ+ExaY/NVzQoDFd4Ne4aXE3IT/8lXv3h3nUhCQ+k0Ifq88C5bLI6v7z3Ns EaYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=lYHeCI8P; 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 m6si2252352pfh.271.2019.03.06.12.06.31; Wed, 06 Mar 2019 12:06:49 -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=lYHeCI8P; 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 S1730439AbfCFRkE (ORCPT + 99 others); Wed, 6 Mar 2019 12:40:04 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:46740 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbfCFRkE (ORCPT ); Wed, 6 Mar 2019 12:40:04 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x26HXgnD196522; Wed, 6 Mar 2019 17:39:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=to : cc : subject : from : references : date : in-reply-to : message-id : mime-version : content-type; s=corp-2018-07-02; bh=fr7D4Rs1y0bsowizgCo34pLfBPffKHe7r20bIqHzoZQ=; b=lYHeCI8PMTwf+4GdtBRKB/bJgSwXWFr3R6DK07wdsGQnfhfIzr1YKoJc7XQCJcnGfv/k klXIpAoXS5xvZMxJcB4HMgDNYzhKDoedzhW6WLfYxVbvxaTqKrDBjFq9ggZc5lgN9Lkz FloXiRLQVD+4LUsCjDOLUxp+mAHQd7DtpGlLoobLp5x8a4VuaE37/Q+Z5utKiXdNnKNH tgDmRRqXZYbRoABRID9Wg8mMsOdygdWoDDzRLdnFmpwJr9+X2QwtjYauEwFbxtnSmXTR irZSoH1qCIdfxXUTLu67IuqJmRVvvEZ9Og67sVc+StngzLBd3vQhuI5ITl3petD0hACQ AA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2120.oracle.com with ESMTP id 2qyjfrn52p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 06 Mar 2019 17:39:46 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x26HdjNO024254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 6 Mar 2019 17:39:45 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x26HdhEe004381; Wed, 6 Mar 2019 17:39:44 GMT Received: from ca-mkp.ca.oracle.com (/10.159.214.123) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Mar 2019 09:39:43 -0800 To: Finn Thain Cc: "Gustavo A. R. Silva" , Michael Schmitz , "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook Subject: Re: [PATCH v2] scsi: NCR5380: Mark expected switch fall-through From: "Martin K. Petersen" Organization: Oracle Corporation References: <20190228202759.GA5883@embeddedor> Date: Wed, 06 Mar 2019 12:39:40 -0500 In-Reply-To: (Finn Thain's message of "Fri, 1 Mar 2019 12:16:57 +1100 (AEDT)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9187 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903060122 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Finn, Please submit this as a formal patch. Thanks! > Here's an alternative patch, which has the virtue that a simple heuristic > will work. This patch does not require that other static analysis tools > will follow gcc's weird rules about hyphens. (I assume they don't but I > didn't check.) > > diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c > index 7fed9bb72784..fe0535affc14 100644 > --- a/drivers/scsi/NCR5380.c > +++ b/drivers/scsi/NCR5380.c > @@ -1932,13 +1932,13 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) > if (!hostdata->connected) > return; > > - /* Fall through to reject message */ > - > + /* Reject message */ > + /* Fall through */ > + default: > /* > * If we get something weird that we aren't expecting, > - * reject it. > + * log it. > */ > - default: > if (tmp == EXTENDED_MESSAGE) > scmd_printk(KERN_INFO, cmd, > "rejecting unknown extended message code %02x, length %d\n", -- Martin K. Petersen Oracle Linux Engineering