Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp28628imu; Thu, 8 Nov 2018 14:09:58 -0800 (PST) X-Google-Smtp-Source: AJdET5cjHpaZpWs5U+Yb8Jm0iQGWsvp692gDazhcgNRD5Qg5NsMN6GPRTptwxy3I8ScF3SBh37Fy X-Received: by 2002:a17:902:5a4:: with SMTP id f33-v6mr6137977plf.324.1541714998131; Thu, 08 Nov 2018 14:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541714998; cv=none; d=google.com; s=arc-20160816; b=YBZHZAr7wOpXszmppVFWIyFqFcTw2qjlX219HZSKrUY8mOYD03UW0GlG36IHK7quc+ odglflwd8/b/ZwkvkO/28z/6h6+lxdmyDML2CpRZ/Hx9aIr5c90ZddG367lsqM8jzwCq 4czao9Kk8e7kxOIqBAo5j2IOAUQoe8p2BwH+upVwczBvVzJ962B5yUDGOzjeJWyxwJCD OtX5bLnsOX51TgQQBJ73GcELp64wtzpBDr+XjKZAfDhk9dd8w2ARw72r2yVkM54TqHcU KQTWK+Hpq8NRvf/iUWR85FVRl42yR3EpcPyXHLlzVh6yhJUacZJSdQFye44wORbupFyB La3A== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KDKRc4UWDtDil8EiOgvlhM4IlTcWujDWfY0qKd3rbO8=; b=Unm4mKUHFILPQIsDEb6vWFXl8c7/WDPiCW8YDn9GC2YgPr3hnjZwAcwJHJqOEOmL+m pkAlsOebUGXTt7/rjIMu+fLRK2gr3+74VNpuo8f7VGsGxYYqpxehhOouMYQ1xq5tn80h 5eiUXE3Im9fpHJMAw8s/6ajyTGJ6O0wmOUNw/qMI6kOFjjtRjYFB0uFMbUCduC855NNJ brqqjs5jKMDyp3VjyIRsc0Srlga2Ty5PGgAZl80EaA7VQQc3/ani6b9QatQihUfZ5/ON ODt3q38qxXF9OICfbu9LPaHXvQlZZU8QUc1RYiJbhIUqhdNFObX0MiTZzoJgO2qL14Ub JB9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bYRlRnJb; 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 n17-v6si4578467pgk.501.2018.11.08.14.09.35; Thu, 08 Nov 2018 14:09:58 -0800 (PST) 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=bYRlRnJb; 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 S1732022AbeKIHoJ (ORCPT + 99 others); Fri, 9 Nov 2018 02:44:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:36898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731993AbeKIHoI (ORCPT ); Fri, 9 Nov 2018 02:44:08 -0500 Received: from localhost (unknown [208.72.13.198]) (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 2D03920844; Thu, 8 Nov 2018 22:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714797; bh=gcqHY5aIm04UA8dEeIUVGNzUs+UaQ8PEG/qN3PZKjKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bYRlRnJbDOeUABcZ3dRd0G7lSYqtyVSbrChsCloRUYSJGf22ZlSfDVzjmj0qpGxCs jWgJ6L4oOcH72igg7Cr18kQaMv5Ode9GecdFcXYuyyOFXjfrX4c6CTnf3Tzn7J88zN 1P0yYOOGA+oQU1pguk0U95FvBooO1t+hQhe+s2uI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Jonathan Cameron , Sasha Levin Subject: [PATCH 4.9 106/171] iio: pressure: zpa2326: Remove always-true check which confuses gcc Date: Thu, 8 Nov 2018 13:51:16 -0800 Message-Id: <20181108215135.053360626@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215127.257643509@linuxfoundation.org> References: <20181108215127.257643509@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit f61dfff2f5b9fcb087bf5c444bc44b444709588f ] With gcc 4.1.2: drivers/iio/pressure/zpa2326.c: In function ‘zpa2326_wait_oneshot_completion’: drivers/iio/pressure/zpa2326.c:868: warning: ‘ret’ may be used uninitialized in this function When testing for "timeout < 0", timeout is already guaranteed to be strict negative, so the branch is always taken, and ret is thus always initialized. But (some version of) gcc is not smart enough to notice. Remove the check to fix this. As there is no other code in between assigning the error codes and returning them, the error codes can be returned immediately, and the intermediate variable can be dropped. Drop the "else" to please checkpatch. Fixes: e7215fe4d51e69c9 ("iio: pressure: zpa2326: report interrupted case as failure") Signed-off-by: Geert Uytterhoeven Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/pressure/zpa2326.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/pressure/zpa2326.c b/drivers/iio/pressure/zpa2326.c index 2a4a62ebfd8d..cc002b958f7e 100644 --- a/drivers/iio/pressure/zpa2326.c +++ b/drivers/iio/pressure/zpa2326.c @@ -869,7 +869,6 @@ complete: static int zpa2326_wait_oneshot_completion(const struct iio_dev *indio_dev, struct zpa2326_private *private) { - int ret; unsigned int val; long timeout; @@ -891,14 +890,11 @@ static int zpa2326_wait_oneshot_completion(const struct iio_dev *indio_dev, /* Timed out. */ zpa2326_warn(indio_dev, "no one shot interrupt occurred (%ld)", timeout); - ret = -ETIME; - } else if (timeout < 0) { - zpa2326_warn(indio_dev, - "wait for one shot interrupt cancelled"); - ret = -ERESTARTSYS; + return -ETIME; } - return ret; + zpa2326_warn(indio_dev, "wait for one shot interrupt cancelled"); + return -ERESTARTSYS; } static int zpa2326_init_managed_irq(struct device *parent, -- 2.17.1