Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1363240ybi; Sun, 16 Jun 2019 03:21:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyUdkUulPy7sihtgZZ85pIUtsgW03fL4ocdZ4FYSadTpfQ4I7K45ypgs7UZXZ20/vaJbPa X-Received: by 2002:a62:683:: with SMTP id 125mr101583942pfg.168.1560680505954; Sun, 16 Jun 2019 03:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560680505; cv=none; d=google.com; s=arc-20160816; b=XvqriinBgLtkTaFmY3CUicsXtLc82lcI8IXkNeFbAXEQ05PDJLUTq2oqk2n8eYMZgr oGknuqdqLePKTIlpOyNOKxIIJAA4bSnLcIAmJAnCqmSmx8QU0KWm9G4flmuzl5kVjpJ7 07tqJEjSXY6zVFoeifFEllQmfnZoAja38jKMb+2+HBZPnPHZU/xK4KxUdK9Wpixfaq+J arFTjKuQrOEH0QoxfNSX+ybW5fsG7EWNZnwn4Q25sSNNpfLNl7rS+uYRl1TfcAhTknWe j4GWdORqnIv32IRsv+lOl1zl+FLSzo8NpHLskL/L8vuqdGW05XyJvwBoiwmcDba6kZ5J A4Aw== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=d7/ym7uWfrsTt3DCjMeXfutLLEZhQNqc1xZdivF+Fmo=; b=lJ+fiqhQIY6nH1FB4Gk/BBtLUqW21XxhjrP9MrLmT7xbI2mvL3FmiC6kq/uTssg2b+ 4K7JPM4giAPPQj6x83SJYOVkak0tlEU05HqspLmMaO++Pp3YqePfRPt5UE/BpxS6rSsr RtkTxHu8cEYrzH1sk9sTpVS6Gz3AnxcCbt0F7lsMkY+nqVU/S9Hxy5pbn1pGuzjJyjeL YNRz1ZAVwmgjJppuuUg6x6kFvOWnv5iGtG+GvTS+FPn36bYCLh4Qt42iIU9PG+sHkX7I qD8HV2Ukcl9sMukiNgygqu0LdDgFJRLyLEbMx86EzfFcS4YHiOeTo93sQlN/4Q4kCBqx iHXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Mnf1Pj/h"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si7268150plr.381.2019.06.16.03.21.31; Sun, 16 Jun 2019 03:21:45 -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=@kernel.org header.s=default header.b="Mnf1Pj/h"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbfFPKUz (ORCPT + 99 others); Sun, 16 Jun 2019 06:20:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:34766 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725861AbfFPKUz (ORCPT ); Sun, 16 Jun 2019 06:20:55 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 04F092084A; Sun, 16 Jun 2019 10:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560680454; bh=HeAVqFhEnFHaGE/MLt8iG4KF9+eU3HYvjifK8118Rak=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Mnf1Pj/huamHWR6SCw8l2VcZkO3Fh1eunBrqAEP/wKDkhAUUfaux8hWOgKsdOv+TR 6QZq0TcotwXJEGHe5WTci4kjd1ChlSG3g6fiDA9U2TpHKqicsxx5yFiU/QPmZrBENG WFG28OKNi7mHn5KtT1U6V9lDlWbIwSB9sn/xxGgU= Date: Sun, 16 Jun 2019 11:20:48 +0100 From: Jonathan Cameron To: Melissa Wen Cc: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , Barry Song <21cnbao@gmail.com>, linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: Re: [PATCH v2 2/3] staging: iio: ad7150: simplify i2c SMBus return treatment Message-ID: <20190616112048.67082117@archlinux> In-Reply-To: <90e8a25eca0825878d55fe0a9e760906b4689035.1560529045.git.melissa.srw@gmail.com> References: <90e8a25eca0825878d55fe0a9e760906b4689035.1560529045.git.melissa.srw@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Jun 2019 13:32:54 -0300 Melissa Wen wrote: > Since i2c_smbus_write_byte_data returns no-positive value, this commit > making the treatment of its return value less verbose. > > Signed-off-by: Melissa Wen Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it. Thanks, Jonathan > --- > drivers/staging/iio/cdc/ad7150.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c > index 091aa33589d7..7d56f10a19ed 100644 > --- a/drivers/staging/iio/cdc/ad7150.c > +++ b/drivers/staging/iio/cdc/ad7150.c > @@ -202,16 +202,11 @@ static int ad7150_write_event_params(struct iio_dev *indio_dev, > ret = i2c_smbus_write_byte_data(chip->client, > ad7150_addresses[chan][4], > sens); > - if (ret < 0) > + if (ret) > return ret; > - > - ret = i2c_smbus_write_byte_data(chip->client, > + return i2c_smbus_write_byte_data(chip->client, > ad7150_addresses[chan][5], > timeout); > - if (ret < 0) > - return ret; > - > - return 0; > } > > static int ad7150_write_event_config(struct iio_dev *indio_dev,