Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1159913ybi; Fri, 14 Jun 2019 09:35:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqxhJIzDyVn9cMoXyBtpdPx2p9pUuOv66OP8XS7l6Iac83/qp86RyU2/VVOVaOcrCBHZrXNB X-Received: by 2002:aa7:940c:: with SMTP id x12mr71183151pfo.80.1560530105777; Fri, 14 Jun 2019 09:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560530105; cv=none; d=google.com; s=arc-20160816; b=HzJZTauYMw/RyL+Zt82wqD0c4/SRzbrUjQScugWeRekISYkA1K8cLB9yAqRzxhiu+i seVzTG4OZCrUtoC3GiyRv/QH2+LgOpBuPT91shmIWRq0H6ybKmHQgJi3f1Wsngmq1iQc IlWqwhxvCmM2zKHVz9cfi8aQSUSAJc/LAL8ZYgwzgGSQypdrqZpdHVZ9WxU4S1vf11bP KyAGrc33hcqe8xP7QeFqdinZQsHrPRqFqKuBWAIJzrmzU9lC7smO2pSes5JEheCbis+q npV5awSr1fx0oojSF+3SjvwxfZuKahBxaYPYcwzyLcdG/RRcMzwo1qs/UDJ0hpZbC5tW EQKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=G8wdXxU4tFwUoWKvXvo7dS/CRtSW8huyMcBERdfUB8k=; b=wIaFDewtQ1RjNt6Jgpgg31yaqWRXNCLTXGEsXKpZvtL6gqpAWsFYW7UuChbnEzLDFd wBluTyfQgtami01ytTrabCcWZv3WT0T6J/6LVVCU2uLvKUSTn5vaGTSZI1J9Ksz7eJrA sdAYQZh7RjjwLujtdJrnpKZ8kc9ZP/U10YS+Fs7GhfYnhFEr5GaiY++0txUZmxw9xnFc PM2gYprXZohfegnOeTf3Avg8mgNHyqm7ZsWTKYV9yR1xGxhi2xQSS4Ex4qhP+UZmzuJC haDFskREf0oLWmkBOCmFTIRW8T4tkJKi/x38b8aUTxbJQaqL19N/t3GosKMPuVCTySE3 ymJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Yl+QfPgK; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d4si2733885pjs.67.2019.06.14.09.34.49; Fri, 14 Jun 2019 09:35:05 -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=@gmail.com header.s=20161025 header.b=Yl+QfPgK; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726187AbfFNQdE (ORCPT + 99 others); Fri, 14 Jun 2019 12:33:04 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33798 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725859AbfFNQdD (ORCPT ); Fri, 14 Jun 2019 12:33:03 -0400 Received: by mail-wr1-f68.google.com with SMTP id k11so3210221wrl.1; Fri, 14 Jun 2019 09:33:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=G8wdXxU4tFwUoWKvXvo7dS/CRtSW8huyMcBERdfUB8k=; b=Yl+QfPgKpr+w0DEtuQQNPcyl2qeLjOBYDIKp7qPHRYTQ2Liqly1IWx6TPG9HZGj5C/ kzHtRmn3uQ8RfnpiHyhiBAvq9b+p5U01g64vn3NOHFIIWqC75V9gfDdJm+DsV7tRgM++ StaP/9lRzyvgwUGCHgDrTsvEWx1SHHg9+SD8y1LA5acWvJj+cTyGvZVtsPLw0ty78FTF /GcJGyxhLkQLXyX/53RIz61bmYj3W6MSNaihi4DbW5RAG+UFGzcPaQjBct4quzL4fzgr Qdj50s+hsQvSM9jXCyxoWxtLvyUSr6mhifh7cn9uxsJPJQ3CZ7IznZCSejysmb9FVAyS 0Gtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=G8wdXxU4tFwUoWKvXvo7dS/CRtSW8huyMcBERdfUB8k=; b=GRJ/z9s6B+5amioAeXIQr/KLXiPboHLo9PdFiJnYWecdZwdnG3kIAFwEEpFKXVpmKh Vp35Z6siSPOiWGrp+aZiT5R2bBdNc+E1iz6YhKvSRkEYoDNRstrOzc7i7XmJJZfRWVG4 BLFuBC6tzDdwxJv00pc4rRe+nJ60/N+I8cA9En70GcBIWlXPAJd7EpVdhpSZBQIhpYbP T228AgXfCWwJwwOzSX6O0DKSGhpoAkgWspVhq6GYbCpT7w72yA+87blncjHbufX75/lp A3I7k3Ihcx8w0hwAfcqYf4ghwmLGA52a2hx3Y+M62AHkDsevTlsMXZMKxNwT7pxHF1sW ejDA== X-Gm-Message-State: APjAAAVhO+Hu28p6hXeOpC/tTHzMQFXc4kA+XjjQccaP/PPD+UEX33vh oak5x0rq9Rum4DWfzNxSRdY= X-Received: by 2002:a5d:5491:: with SMTP id h17mr6626926wrv.182.1560529982167; Fri, 14 Jun 2019 09:33:02 -0700 (PDT) Received: from smtp.gmail.com (1.77.115.89.rev.vodafone.pt. [89.115.77.1]) by smtp.gmail.com with ESMTPSA id d10sm5126806wrp.74.2019.06.14.09.33.00 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 09:33:01 -0700 (PDT) Date: Fri, 14 Jun 2019 13:32:54 -0300 From: Melissa Wen To: Lars-Peter Clausen , Michael Hennerich , Stefan Popa , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Greg Kroah-Hartman , Barry Song <21cnbao@gmail.com> Cc: linux-iio@vger.kernel.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, kernel-usp@googlegroups.com Subject: [PATCH v2 2/3] staging: iio: ad7150: simplify i2c SMBus return treatment Message-ID: <90e8a25eca0825878d55fe0a9e760906b4689035.1560529045.git.melissa.srw@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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, -- 2.20.1