Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3012314pxb; Mon, 18 Oct 2021 06:35:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJV2FnM7cZ/GDNkx1SC667l7tBNQa6u41nzaFOOQ/aPRysMtp2xLjsQ9B+hfIFMCzKYP8d X-Received: by 2002:a17:902:8bc4:b029:12b:8470:e29e with SMTP id r4-20020a1709028bc4b029012b8470e29emr27226259plo.2.1634564117468; Mon, 18 Oct 2021 06:35:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634564117; cv=none; d=google.com; s=arc-20160816; b=0CG2wRx+d7GajJKz8L7D5DCSpflfOviuonHtBTD1Ekg67dIW06gXLeVQIykt4HNRyB twaw43xTHILQ0UHGOy8RQNcBiVhyzumXNUC8Cx1MBZlVqBIV5tt/PUnLq5ACH39sH1eR EbhXpfsAJashdRstZKlZBd8y/RsSVK0MV1MohzUB2Rmvm8oBNpth0TbhEgUR9RZ1uPJO MsaAgk+Vy5WRgnFpyYAn8o2ySrDG6XVM0BCYsREcn7zf98QeFxRU84WkkCuUqIAAFGlB oQEaKTo9g1xQjwHwpcGEHJzYMOumNNF92UynRnDlKyiZpFslWcDNq+TyJdOTEaA4QB57 rkXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XptYRLIK2CLKZYD6q7Q5MWtH3hHD18UeRz1Xj4pVOH4=; b=iP6mg6Nsc/MxfvHmHXq/iYaW7wPAIheuJl5cl0gI/GXNH2ZkckTIvb9TQkChPn8WFG gwfi80iiedQtCeFkMhykXO/ujZm7brTwhUJaDF5HqX87OVpHeA2/08pA3EXf/z0njZwB guyG4HyXqCArMEr4VvDtWBGJqNE8KqmLOCvyrF5osw/XbJJ80tT937Y0oWlAzhiOva4I jszkGV6r6YxurEE9J12If+CZ35gCZ9GCPwzeGfjgFbN1XJGGRuIsbuRl721C1FYdeOSM ZdYyeUA2t3VI1xIO7Tr3HV1YDhu9ot9XnyAG+xu+tJH7GSs10U02945ing4q0NOXolW6 ej1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vJK0hil4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b18si1571914pgn.420.2021.10.18.06.34.57; Mon, 18 Oct 2021 06:35:17 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=vJK0hil4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233041AbhJRNep (ORCPT + 99 others); Mon, 18 Oct 2021 09:34:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:43392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232718AbhJRNcz (ORCPT ); Mon, 18 Oct 2021 09:32:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E8E1A6137D; Mon, 18 Oct 2021 13:29:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1634563769; bh=LJlDaRBgePqAvT2+QHa8/PRFb0ox9bnspEkX9m8EXJs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vJK0hil4nJ00rMQFNkQRzQ5fd4tZQ+wrh3MFmui+oBooyp+FZkt1U3Qd/Ld95w37N mIlu5Toun0KkX9WxjAd5mWINGlY+4oSgDU+QN/oIbmv0NPwi4Njd+94BqYcFuisCGr ZgQsthRQTp7e4hvQvq2bvoXTrEvRooUPW4bnQB1c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Dan Carpenter , Stable@vger.kernel.org, Jonathan Cameron Subject: [PATCH 4.19 31/50] iio: ssp_sensors: fix error code in ssp_print_mcu_debug() Date: Mon, 18 Oct 2021 15:24:38 +0200 Message-Id: <20211018132327.564462287@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211018132326.529486647@linuxfoundation.org> References: <20211018132326.529486647@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit 4170d3dd1467e9d78cb9af374b19357dc324b328 upstream. The ssp_print_mcu_debug() function should return negative error codes on error. Returning "length" is meaningless. This change does not affect runtime because the callers only care about zero/non-zero. Reported-by: Jonathan Cameron Fixes: 50dd64d57eee ("iio: common: ssp_sensors: Add sensorhub driver") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20210914105333.GA11657@kili Cc: Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- drivers/iio/common/ssp_sensors/ssp_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/iio/common/ssp_sensors/ssp_spi.c +++ b/drivers/iio/common/ssp_sensors/ssp_spi.c @@ -147,7 +147,7 @@ static int ssp_print_mcu_debug(char *dat if (length > received_len - *data_index || length <= 0) { ssp_dbg("[SSP]: MSG From MCU-invalid debug length(%d/%d)\n", length, received_len); - return length ? length : -EPROTO; + return -EPROTO; } ssp_dbg("[SSP]: MSG From MCU - %s\n", &data_frame[*data_index]);