Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1065058yba; Fri, 3 May 2019 15:26:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwraWu8i8Q/b0QihyHwx69SbLJaqeFj4tHpWp/fqKf2JLQrX3xxPI7WPivsKNh+hBrjZ9S7 X-Received: by 2002:a65:5cc8:: with SMTP id b8mr13375836pgt.36.1556922411282; Fri, 03 May 2019 15:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556922411; cv=none; d=google.com; s=arc-20160816; b=dLpDy2PgMoFIL2E6sY1Vv/0PZP5rtj6kG0nAaEkI0vhipe4zPUEm8joCH8BOM0g1+q 2j6s8XdFSx/XtoL9TXNYnIkZoDfN3vi6w2VGrS/txcAUao6/vFSrGMBn01eVgxHisHDM zXGyK0K/0yCHGEeXzQtXk6F7KqPWKL++PvxEU0NzYVxLFcY5ZkIHg4ZPDe6aGqi7nZUx 496d+jbPXiEZHJW1dOLc1qdfXp5EvozX9Ei9KaE3Cv8eOKcIINgETwqZiKP8z3o6ilCN AbPqH9WyXh0Ryf9J76V9mpnZlWNk1labvfSFW+c06qcOAmboHAyLB4np/RjUD0BhWi/C YGYg== 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=SAG93eFHh+qaETzoOcFQNdt8rlclJfMfJCEB5tyPneU=; b=eawEhCRLmQJqYu/30TP1xT+HrvZhjggoi+iWmz4nhUaLZF0P31xcq2ywI/jAdKHWr9 z0TqcZ469U8JSasn0jh2O3fP1GsP8nToIR1+wd4aCFfEyGVDsD83LEP4G5RJRYDIdiBt 0ghPG817jDdOkbHZ20PoicJopKdxL8bUROuAVABUuqfCNk7Wn7gzA0W1TIFag7K4jpjR zjziLXnpZ8AfflSHon9oEBGFlE2ab6ch+74bADQpYR+/dQzFygbMA5+Ti+iN11xPX0PA 0CBuvyLzMBXyVEGwdaV0hlwsnaTglhgvwm7k9Pac0gl44K0HYS3MVeHAlRbgM1onNp6g AYPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=cxRMJufi; 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 s19si4271632pgj.235.2019.05.03.15.26.36; Fri, 03 May 2019 15:26:51 -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=cxRMJufi; 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 S1726444AbfECWPk (ORCPT + 99 others); Fri, 3 May 2019 18:15:40 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:46693 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726042AbfECWPj (ORCPT ); Fri, 3 May 2019 18:15:39 -0400 Received: by mail-qt1-f193.google.com with SMTP id i31so8488515qti.13; Fri, 03 May 2019 15:15:39 -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=SAG93eFHh+qaETzoOcFQNdt8rlclJfMfJCEB5tyPneU=; b=cxRMJufioKVdvfnJKfWHBXy6aUljGfxrLWnsauz+050JKcWB0haJPWdy0XJ3iBvW+Y svO5sSi08Sbc+rOJkObJqDwPph9vSPQoyflUwSt0ZOcbeJH+atKZxoZ98zBxY2qN5IOv hucZoLfhj7xtykRJhiwXWK0vJ/5+0weq/mTzoE3Ge591qXyOnsAZVAjWOmD+bN7/2Edf UmPQZ2hQLydG6WVM6AoQUCqxxX0MAMCzsLSVBTjh9qgRM5CEjzfi1eWBTauTms96wQDO QmL0grDYx7346Ad4PNAtBT/X4o4OIyE5ifb0K7zHfKV3qGvKn280hfiVDyQ5Sz7TWpy1 j4qg== 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=SAG93eFHh+qaETzoOcFQNdt8rlclJfMfJCEB5tyPneU=; b=FUc0vbkkYd+HbHIXpJajzCHgJ0uyFdUt9iMRO+55azxgFpWb9loAA4lJHkmhvinalB d28VQn8bDMx4RCr38VApmhhlCp8DNQycd2YyZ0pQeORmc7CDKm8GKlems3g4k+M+rnI8 aQltGCKyUiVgd3Xlg/k+8Ofdz2TYdzYgxyQf53cGFFFPURVvYbvMB/ke7M9B7QyJjzhZ y46ncjdYtI3pg1cj0T+PiIVNC9B5BP5eFZ9r7Njp8kC0dgiSY77QCC8T1jJ7sNrT3LKp RzYxYHMYxYcft77W1/fUHD7Mtvw3v2eqh4SzbMWw08q12djQQdXk0rObXLsmtHr/DNZH +rjA== X-Gm-Message-State: APjAAAUgSN36s81bADPjO8hz94DK+M6TGYojs+d3uFmlfCwErALhPZ56 boJdEydhrZIISG3vumfLBHM= X-Received: by 2002:a0c:92af:: with SMTP id b44mr4193122qvb.141.1556921738622; Fri, 03 May 2019 15:15:38 -0700 (PDT) Received: from smtp.gmail.com ([143.107.45.1]) by smtp.gmail.com with ESMTPSA id t26sm1807490qkm.82.2019.05.03.15.15.34 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 03 May 2019 15:15:37 -0700 (PDT) Date: Fri, 3 May 2019 19:15:25 -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 3/4] staging: iio: ad7150: simplify i2c SMBus return treatment Message-ID: <18725f7ddc3ac42b1c781b1848b05fabd4bd8320.1556919363.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 | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/staging/iio/cdc/ad7150.c b/drivers/staging/iio/cdc/ad7150.c index 4ba46fb6ac02..3a4572a9e5ec 100644 --- a/drivers/staging/iio/cdc/ad7150.c +++ b/drivers/staging/iio/cdc/ad7150.c @@ -201,16 +201,12 @@ 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, + else + 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