Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp597956ybz; Fri, 24 Apr 2020 06:08:29 -0700 (PDT) X-Google-Smtp-Source: APiQypI7Ce1xXJc4mZlj5Fj4Z2473tYGHci/P5cofKOuEV+ap5DajIbF96zRR8Sda0jitTxFk/sh X-Received: by 2002:a17:906:74c:: with SMTP id z12mr7288252ejb.87.1587733709397; Fri, 24 Apr 2020 06:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587733709; cv=none; d=google.com; s=arc-20160816; b=IJ25V+S5Gsag6ebEoqeo1b6gC2qAcO9xirvNfS1SZzBUx/W7RdsSqU6aZaltnOqQFQ asiOzftHak8frhyJ220oS56T5zQVMAWKMipJbyh2b0fZvgoZvUL42EmueYNHLex8kFgx tBiOzVawObR5Bh3r7R60DtpFtF8cJ+BFDrO1MymGarvtReUQvULYsMZX7Q1/erQA7/86 m7jvrm7VwMFU8oIUD9cGMPQKcD+vKBm6MnHfgxJDabUq05gIL3IkrQpb5zXzair5SXOx uQnsIS6ebqswC9mTYxnz/w49VxbIiVKkQt05n31W3XyjJo867d4HHRFrKoQSYS8edQ1U MOJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Ucj1qd4GhtdOx8IKawu4lWoJ6ekcaVb3slVG96Se8kI=; b=inWo9boqg+D/3GylNAvc4t7mt5pqs/oT0+gJlKVZfnykLjGsYxbRFg9KUrJ3Cqe6nH wbI4GAEi6LvP25onTHLLT4PGuAQembYDrKcjUt1gLLEOyTxA+rX40yGPVRG/7WFCyHAf tmVKu2X1nsAbYaE1lQXkuhvLJIhUtj2EC8fRrqDsvxjFHZqY1yhxSWlGtzjCoBYld0BM B2aoLZ7DtjMdPlQlnv56wgquWDtNjTbBrStKVmVZKpHfk9HeNGeQSilykRxxuxpoUMMq cEOfv0Frk+nFmAG8a2agI47j97zftbvRw2ELiU2IAIxBN5KvIXxPV2Z2qq28MkPmqxDB Acpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si3157943edn.236.2020.04.24.06.07.33; Fri, 24 Apr 2020 06:08:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727112AbgDXNE2 (ORCPT + 99 others); Fri, 24 Apr 2020 09:04:28 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:50751 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgDXNE1 (ORCPT ); Fri, 24 Apr 2020 09:04:27 -0400 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jRy0C-0007Vi-69; Fri, 24 Apr 2020 13:04:20 +0000 From: Colin King To: Dragos Bogdan , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , linux-iio@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] iio: adc: ad7476: remove redundant null check on an array Date: Fri, 24 Apr 2020 14:04:19 +0100 Message-Id: <20200424130419.22940-1-colin.king@canonical.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King The null check on st->chip_info->convst_channel is redundant because convst_channel is a 2 element array of struct iio_chan_spec objects and this can never be null. Fix this by removing the null check. Addresses-Coverity: ("Array compared against 0") Signed-off-by: Colin Ian King --- drivers/iio/adc/ad7476.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c index e9984a38fc4c..4e816d714ad2 100644 --- a/drivers/iio/adc/ad7476.c +++ b/drivers/iio/adc/ad7476.c @@ -309,7 +309,7 @@ static int ad7476_probe(struct spi_device *spi) indio_dev->num_channels = 2; indio_dev->info = &ad7476_info; - if (st->convst_gpio && st->chip_info->convst_channel) + if (st->convst_gpio) indio_dev->channels = st->chip_info->convst_channel; /* Setup default message */ -- 2.25.1