Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp597170imm; Wed, 10 Oct 2018 00:53:44 -0700 (PDT) X-Google-Smtp-Source: ACcGV63W34cQ9XF8fCKoifzxELjTbLjektpAPhT9SC8qLtt81wT++gn6UaE4OQe1ot5/W5XKqoft X-Received: by 2002:a62:2741:: with SMTP id n62-v6mr26671394pfn.138.1539158024124; Wed, 10 Oct 2018 00:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539158024; cv=none; d=google.com; s=arc-20160816; b=rw0JuMlIw4IBrvWbZQV+WGeeain0BNvNUk5Xw8Xti/cWRNe5Tn/B5MQaqSGiqEa/Wm lzY5ahe1+3AnlKufMllyvCCvSyJv8Frn9/Rxh5NXTXFL54xjoiZyF2v/jBPwLL6SW1Q0 YUeroR1VKGAAR09rFJ8bz9VWPmPP+hTLe5gKdbe/aiE06FZp8KtoZ9xq+uAxBFyv83DO 5n0/GQo+GHKOh+8vLSNB+tWz/wr+9zmQETFt8zcFwmHpWqicmqSHy674zuk+PjTzzvlP ALzCy5LEp2UzQ9pizmsPe6/cPn1JnYrVeP30Cq25cpRjuOSJM4Dbscf2Acx+UVekcf96 KB0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ducCvaY0sUVlKqm7bJ3vn/1bCxA0Xxy78UnvNJd6N3w=; b=E3zLPasKlxc59bYc9A5CJYxoucEaprbaOFMAHNJSTlZSew5B+BBv4ek31VLUxXUdMa kkqaFmwSuKXnXeDITFae5uVU1bboAyLBkGPG0VOa41loFYI7tqeFb+fmYU/YAnPqUNci TTltKMCxakRR7THBTl3tnlvLDVtWWs6Nl2E0c0mCr9hFXVaAUyLQ9yGcwz39Zmiml88N vIKtLumlckjR2nx8MRlCPhPIVR3EDlvxjQPRGT4y/aQ1KSfQoPyPXCi9NKP+ujW77E65 TIBLRGSCygpCzJcjazcewZpx6QrLafEekeeOkwzMrYrbK6ql0F6rtDIScBc9+agVVOn7 qSuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@konsulko.com header.s=google header.b=mx4LYVpt; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p17-v6si23635662pgk.58.2018.10.10.00.53.29; Wed, 10 Oct 2018 00:53:44 -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=@konsulko.com header.s=google header.b=mx4LYVpt; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbeJJPMi (ORCPT + 99 others); Wed, 10 Oct 2018 11:12:38 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:39517 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbeJJPMi (ORCPT ); Wed, 10 Oct 2018 11:12:38 -0400 Received: by mail-it1-f193.google.com with SMTP id w200-v6so6653531itc.4 for ; Wed, 10 Oct 2018 00:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ducCvaY0sUVlKqm7bJ3vn/1bCxA0Xxy78UnvNJd6N3w=; b=mx4LYVptTUO3j2b2cZ6OudFW3xInTanZYoCMex4NLsks6A/FVK154Vvxjipmu9i46F aH5n7sMTyv8QRQGgT0SzS56Y5kcSRYbqluHqdh4xcsHjNeFwEG30RX7J1oOlc7UJobER cSSZ5BX2YqZKScklMUuCxIr2XblFur0s3nnQw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ducCvaY0sUVlKqm7bJ3vn/1bCxA0Xxy78UnvNJd6N3w=; b=GXqn1e/eonSPxTcHAhvH4rDTJBOj62MJYP85ZT6virWwOWGHojeX/KVnvljeGsDP1G xHw1vlKyIuGM0yv0lLiAWxYDgqskJPx1a4HdkBR8Pgnt0Ksl4Q3up/tB754LgcX4s9BG bGEGup/ST1tmxIwKYsP/Kz7J62PgBrNrwoT7bviBbFhXjFYd+MlWVmVG7YBlIyz5xBjM D2XCM+bsNCc79MTFR/LdrfqJFEBbZ0dVQuuaQjvIauIIFKkYPp15lU28xFhl81cObaPY 8ZTiPI7tO6CiG/XXa+tOste2jFpV+Nc2+OC5Iw/k4jaJ6ekafQsiO6qKgJ5jE6H2zO0d f5tw== X-Gm-Message-State: ABuFfoh2cnosdlbIT8GHq4PFm4/TuQc1MBElhr0y+fHvqIHcFAzyFIN8 FbzzdhkofWQ0i+iK0mwejadUWF/q3ojlKTCFyvprHA== X-Received: by 2002:a24:e34a:: with SMTP id d71-v6mr3943646ith.155.1539157900924; Wed, 10 Oct 2018 00:51:40 -0700 (PDT) MIME-Version: 1.0 References: <20181008210904.9362-1-colin.king@canonical.com> In-Reply-To: <20181008210904.9362-1-colin.king@canonical.com> From: Matt Ranostay Date: Wed, 10 Oct 2018 15:51:29 +0800 Message-ID: Subject: Re: [PATCH] iio: adc: ina2xx: fix missing break statement To: colin.king@canonical.com Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , stefan.bruens@rwth-aachen.de, linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 9, 2018 at 5:09 AM Colin King wrote: > > From: Colin Ian King > > The IIO_CHAN_INFO_SCALE case is missing a break statement and in > the unlikely event that chan->address is not matched in the nested > switch statement then the code falls through to the following > IIO_CHAN_INFO_HARDWAREGAIN case. Fix this by adding the missing > break. While we are fixing this, it's probably a good idea to > add in a break statement to the IIO_CHAN_INFO_HARDWAREGAIN case > too (this is a moot point). > > Detected by CoverityScan, CID#1462408 ("Missing break in switch") I'm not familiar with running Coverity scans myself, but is this CID some publicly accessible report? If it is an in-house scan then it should be dropped IMHO - Matt > > Fixes: ca6a2d86acae ("iio: adc: ina2xx: Allow setting Shunt Voltage PGA gain and Bus Voltage range") > Signed-off-by: Colin Ian King > --- > drivers/iio/adc/ina2xx-adc.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/adc/ina2xx-adc.c b/drivers/iio/adc/ina2xx-adc.c > index d1239624187d..9bc5986780b9 100644 > --- a/drivers/iio/adc/ina2xx-adc.c > +++ b/drivers/iio/adc/ina2xx-adc.c > @@ -250,6 +250,7 @@ static int ina2xx_read_raw(struct iio_dev *indio_dev, > *val2 = chip->shunt_resistor_uohm; > return IIO_VAL_FRACTIONAL; > } > + break; > > case IIO_CHAN_INFO_HARDWAREGAIN: > switch (chan->address) { > @@ -262,6 +263,7 @@ static int ina2xx_read_raw(struct iio_dev *indio_dev, > *val = chip->range_vbus == 32 ? 1 : 2; > return IIO_VAL_INT; > } > + break; > } > > return -EINVAL; > -- > 2.17.1 >