Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp172894lqs; Thu, 13 Jun 2024 07:10:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWWV7fSA9eTLtJcpbFrSuXE8SL9GHXYoraZMPoYZfhEeQIpOzcwC6Y2KGCqWrQoh4T1UPOug6RY5sMy6s0k25snKYRYSVeKCvyzsiplCA== X-Google-Smtp-Source: AGHT+IG063ZLMhCOU4j2lYDQM5eOEANtA2Oeluk8u8aZckRyj0RqYOtK2l6vr14JMuxzEB6lnEY7 X-Received: by 2002:a17:903:188:b0:1f7:1c84:13cc with SMTP id d9443c01a7336-1f83b713848mr55419015ad.42.1718287844628; Thu, 13 Jun 2024 07:10:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718287844; cv=pass; d=google.com; s=arc-20160816; b=t9CiRFNI0X3jgvjHSEpy0b7iLqmkzS4Dni/+652N3jlV5eU6PEzZ59XKNw+5ftsYDv 5s15kVaZQMeLHyib5XQt45/0s7rCJt7XvM/JQEuVcobaNRNnusaSNxjQ9dN6Irmx7ZWW 6HSZEgyPdwa3uQwtS6G5RfPstqyadGETdZ96PNZ1+/Of6izFU2GivWcpS/EHwNGxqZlP 60pifC57AALTmhZ6u11D8iG0LxHnUhIjoQmtwKvX3c8ejZlEdcB0b/rD6FG7e7Z5J2eS ShrfeEhevD8mOxVuZedph7OSJsSJYEIlPO9mj3C/OQQkop2ffjIALz3RLWlah1J+taB+ Fqvw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=tFttpI6mxFfYOQDKQEDFzq5Zkmvl1Km0kHopsmHSaog=; fh=TPeTN598CTHoegmNDyWIZg457ndjSKVl9JqsZ758Ndo=; b=mRxCs84OZ0eFj6CM8sIfDqETcGXQik14bbBzhFvaOFMlOHJRo9RPcmBGtaRXuoamXV hJJRyiiPbnV3RPqYjz7RgxOHvwri9z+5j/rkDkkf2EgHNWtPfTMObZmzXIvUQ9WQhfVV uaeD2CziMKPIb5FlhsAUw6SvPJTPpRWXmJYhMxwUN7GEh0VYoF/V3RQV+DuCNvc90x6b 6LbYRpcHY8PFlUw/oVnu1tZdbi2pltWVbr3qzR1RAE6itLwUflOYXVVnoV7RU7A7JZYM T6eG+T1DdE71wlW6dGInNPAX/iolFe/Sxz+oanc1y227NSiu84XAIJS4owSYQXYJnCGC W4qA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qT0p5zPW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f855efb166si13758785ad.445.2024.06.13.07.10.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 07:10:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qT0p5zPW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-213380-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 4B89FB2189F for ; Thu, 13 Jun 2024 13:55:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 457B7145325; Thu, 13 Jun 2024 13:55:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="qT0p5zPW" Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D771F22092 for ; Thu, 13 Jun 2024 13:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286921; cv=none; b=Q3Q614ZTtknTe3tirlTnMI43M0dhiRqyPUZSpNOQ4uml31XCXHiMYUu04DTfdTic37afES65H3pIuVQYPcHxGr3xubW7dJKC0EWOC07quBEiGm2VaW+aSiZQ9csypT0Gcjwj7LkbgMGYz4fBPx8sBd2c/xJlE+6Pkg0tGVDuw6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718286921; c=relaxed/simple; bh=vVwvkMaZAYjZyqicTOx1nxvLkCMqD5e221Va8hSK8uU=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=JxPznDdtHxTcZr5KjbC91iVmPFJjdBQRwav7tmaePWZ3tvEAOZ3DeCOeV8xjcLJaiYPC+uQe8MA2EdusfobCP+LUdOnG/u4+4d9KaLHcXgaHK1QLH3Ff50AQbSepAnpkRgiuw4s0oIcnfHAG4RMpsBh56ZIV8icl3jmlTB3LzOA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=qT0p5zPW; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-35f1bc63981so1367357f8f.1 for ; Thu, 13 Jun 2024 06:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718286918; x=1718891718; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=tFttpI6mxFfYOQDKQEDFzq5Zkmvl1Km0kHopsmHSaog=; b=qT0p5zPWDtKGsdaCoo476S6sv2vV/B8udGV6WKk8x0iZhvfE41y8mzu+tqLtIG1sCF YpbksmzcPpDrLJJg551lMYRJ1+N0telVYmcaX+rC50uDSezNMFeB3X1T6/71a0pPICTz 0OigWGBqqWmyJ5a4XGUBcr+bmg5mnYK7ifb1ctMCmoDib/yq+xTvGYoJ2T9CXcx18cJv 4C8XSECqx/UgZLQ2xHv6TADKGTA1W+kg3EJcxwKyQ1RfgbpP6LkPOoHlFUv6clR7RLF4 hbubJkEn93iPbSvvsDx1ov7KskcFQ439hE2Jj+jgb0zQ56hfWTSZq/70LXQ7vjpyZDNP b6LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718286918; x=1718891718; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=tFttpI6mxFfYOQDKQEDFzq5Zkmvl1Km0kHopsmHSaog=; b=bw+uQHUKCmHjcTN09YmrG1CIrWX3mVzi5beicWCnY5XCx4F9DqjX+GwDmbi3nLhFpd vgk6gkejEJ4BmLwA1Rkd/dgnoYFDG+dGF/mCIusobDzADvtw+oizS8pWy1wBYJfpXqmt Bnv18Tdc2tO+gJTIaCaEkCLqYqOg/a3yURmNZDsosDYLR6NJx50jFbohh4R6F8UOnqVK sRR534iDnVqXqCdvfPhk6xMVs7z94xavt8F/ScaCAG04zlXY3tAvf1Zf3q5slGDvSh39 S9SZ/lWefHZUfTR2cBtEMBtjOQ0HvP5SIWMlmizk74vC4rnLF2DjjkCKEaQznSp72Hgn IUDQ== X-Forwarded-Encrypted: i=1; AJvYcCVy2K8cA22VDG7sqS4ZhYpRd3+A1QuLGtIPHc9S6lnvUKQDKGD+8TOq4iDVjhznkJTsATTb1aKZyUmxD5wyFjBMQ2LeuRpfVhr12m0J X-Gm-Message-State: AOJu0Yx+6LVp2xD+JqEB73nR6YFGSBuv7XymXosceJWsG/sJzOEIg3Rf 4/p+oQg90eN7ex/4aaZgTp9dLH3hkgtF+eTxOF3KSweeNYHANPz95NbB92Q2f5Q= X-Received: by 2002:adf:e646:0:b0:35f:e890:fbe1 with SMTP id ffacd0b85a97d-360718df02amr2564058f8f.19.1718286917900; Thu, 13 Jun 2024 06:55:17 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3607510315csm1778848f8f.90.2024.06.13.06.55.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 06:55:17 -0700 (PDT) Date: Thu, 13 Jun 2024 16:55:14 +0300 From: Dan Carpenter To: Ben Walsh Cc: Benson Leung , Tzung-Bi Shih , Guenter Roeck , chrome-platform@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] platform/chrome: cros_ec_lpc: Fix error code in cros_ec_lpc_mec_read_bytes() Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Mailer: git-send-email haha only kidding We changed these functions to returning negative error codes, but this first error path was accidentally overlooked. It leads to a Smatch warning: drivers/platform/chrome/cros_ec_lpc.c:181 ec_response_timed_out() error: uninitialized symbol 'data'. Fix this by returning the error code instead of success. Fixes: 68dbac0a58ef ("platform/chrome: cros_ec_lpc: MEC access can return error code") Signed-off-by: Dan Carpenter --- drivers/platform/chrome/cros_ec_lpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c index ebe9fb143840..f0470248b109 100644 --- a/drivers/platform/chrome/cros_ec_lpc.c +++ b/drivers/platform/chrome/cros_ec_lpc.c @@ -139,7 +139,7 @@ static int cros_ec_lpc_mec_read_bytes(unsigned int offset, unsigned int length, int in_range = cros_ec_lpc_mec_in_range(offset, length); if (in_range < 0) - return 0; + return in_range; return in_range ? cros_ec_lpc_io_bytes_mec(MEC_IO_READ, @@ -158,7 +158,7 @@ static int cros_ec_lpc_mec_write_bytes(unsigned int offset, unsigned int length, int in_range = cros_ec_lpc_mec_in_range(offset, length); if (in_range < 0) - return 0; + return in_range; return in_range ? cros_ec_lpc_io_bytes_mec(MEC_IO_WRITE, -- 2.43.0