Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753133AbdICPt7 (ORCPT ); Sun, 3 Sep 2017 11:49:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:36214 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753049AbdICPt5 (ORCPT ); Sun, 3 Sep 2017 11:49:57 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8BFD921A6A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=jic23@kernel.org Date: Sun, 3 Sep 2017 16:49:53 +0100 From: Jonathan Cameron To: Peter Meerwald-Stadler Cc: "Gustavo A. R. Silva" , Hartmut Knaack , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: imu: inv_mpu6050: fix missing break in switch Message-ID: <20170903164953.68459334@archlinux> In-Reply-To: References: <20170822191324.GA15477@embeddedgus> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1432 Lines: 44 On Wed, 23 Aug 2017 08:41:43 +0200 (CEST) Peter Meerwald-Stadler wrote: > > Add missing break statement to prevent the code for case > > IIO_CHAN_INFO_CALIBBIAS falling through to the default case. > > > > Also, add a break to the default case for the switch within > > case IIO_CHAN_INFO_CALIBBIAS. > > fix seems to be cosmetic only... > > > Addresses-Coverity-ID: 1357377 > > Signed-off-by: Gustavo A. R. Silva Indeed only cosmetic, but if it makes static analysis more productive by removing a trivial case, it is worth having. Applied to the togreg branch of iio.git - will be pushed out as testing just as soon as I catch up with my backlog. Jonathan > > --- > > This issue was reported by Coverity and it was tested by compilation only. > > Please, verify if this is an actual bug. > > > > drivers/iio/imu/inv_mpu6050/inv_mpu_core.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c > > index 44830bc..6d2268a 100644 > > --- a/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c > > +++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_core.c > > @@ -542,7 +542,9 @@ static int inv_mpu6050_write_raw(struct iio_dev *indio_dev, > > break; > > default: > > result = -EINVAL; > > + break; > > } > > + break; > > default: > > result = -EINVAL; > > break; > > >