Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5057720imu; Mon, 12 Nov 2018 23:58:08 -0800 (PST) X-Google-Smtp-Source: AJdET5csRrwmD+dJeF8hMDvv9i2BDEE3yWcoRN7QF3Z99yuCXbW//EZaiCtPjPDd4rXs4SyA7mK6 X-Received: by 2002:a17:902:bd0b:: with SMTP id p11-v6mr4027789pls.35.1542095888405; Mon, 12 Nov 2018 23:58:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542095888; cv=none; d=google.com; s=arc-20160816; b=MPTqcBnMcyux1wiFyjKOr8O5nK5n8ZrisGcpZqMMrLSZ9x7sN7M3p5nh5iECetEKLW 8t/XM53ZkQL+YoRZoPeJcSPHqZCchIKJgLRfDzFopWulKC3rfG7TimNJb5xKCn1T0kPI 2Kck8Y1i2CKNaubZtew1PoIkOUHsNNx2IQd5RzYhgaSdLx6X6IAxdKGWf8IPFwz6N21R ovKz4HZGKjuIj9fcbaCz99gtTsUlzzwrRGdEPek15Rm/M6lCiDeTbJceudoCKJg4cIaV iJVdVAg3rBuUVbcQtd+razDna6H7oE5l6o/lEUGbvzdCm7ApYA3mELscIITi/v/61B2K iFvw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kF4k6mB5s3YEbDvG1rzcFegqnlbkBTeSfzzPsTM2jBU=; b=iBFcqx/c/7gsZLw7cvntNxGkoxUHkXcoVRRLcuGVoBdbNSitTSHQ16JYns3sR+ejD4 9I4mPejTuUh0Mgd1F37Rp5+J7Fbdzoa+3srivlkPHMO1nJRFC0vEjmoPRWF8kHVR1M0f AS8ZZjFhGbqqVI8JgBweidniLsLiADl5oSWAJ3i53ptIb7DiS/dKZrqTr1IXnmPMXN55 2tbRFt/c23vLi6nxquk1p8xtMOc5hsbABOco7K82muVY6ea7gx1v0Sc7hNFG0HLYPl2O rCffe2x8AFjsYqlsCw+ngIdBHV3d10SGs4j2OoRYzCfYlSjh8DlYzEBMlbIW9JlCR3W2 T2Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AfdZ9kb6; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e33-v6si20692970pld.314.2018.11.12.23.57.52; Mon, 12 Nov 2018 23:58:08 -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=@linaro.org header.s=google header.b=AfdZ9kb6; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731167AbeKMRyN (ORCPT + 99 others); Tue, 13 Nov 2018 12:54:13 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55728 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728379AbeKMRyN (ORCPT ); Tue, 13 Nov 2018 12:54:13 -0500 Received: by mail-wm1-f68.google.com with SMTP id i73-v6so5551130wmd.5 for ; Mon, 12 Nov 2018 23:57:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=kF4k6mB5s3YEbDvG1rzcFegqnlbkBTeSfzzPsTM2jBU=; b=AfdZ9kb6MMLYCkIkhrdvQc3pITlG7gBpS60hYZKs++lXil2Yn6Rm6s2tVcWTcaEVDV SaZSptO4JK40/8ZTh62lmrW5ndDWJ4KlGk9ZFHoYFdroPUVZzaMJp0SFj515aye8sH+A eVth39Obk6gY0XQzbH0HC5jqZLpR8boYKS3yE= 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:content-transfer-encoding :in-reply-to:user-agent; bh=kF4k6mB5s3YEbDvG1rzcFegqnlbkBTeSfzzPsTM2jBU=; b=mRNdqunqQshAVChn4YDnVdqGf7NDRz7V2ZNxwjroDGHm+wvWfxehSnEiOpRtOoV/CU wVWsEk4Rz3Bi9RYiI17/FhKeF7RnAliii1cpeg4hDEy397XlEELYp9gc18lRi4cjrYPe nsvi1bkH5jkAGw4u2YheYDFtfYQOzffGOLYQBqhlv1o1dJ+R5bgAT96sSZodWAQxTii7 93kpAUo36les4r5HsgnZnozELEsjatkm5C/r0/gnS+786XiSzetlgp8Cp3POwxfpkgFm Xozdzjqdpx+ER0LhT6X96fDx0EyMOrFaUyZBLjbAs/tTiN1LULTv1GNCFfmNESTYpAVI HXKQ== X-Gm-Message-State: AGRZ1gI6XbhUhD54ZPtoYTTDp61GGnq06zLhDurEkmlaXZo1rHZEy1kG iT9ag1giIz7/XPpzgrRAR/PkMg== X-Received: by 2002:a1c:adc2:: with SMTP id w185-v6mr2224693wme.103.1542095837004; Mon, 12 Nov 2018 23:57:17 -0800 (PST) Received: from dell ([2.31.167.205]) by smtp.gmail.com with ESMTPSA id x194-v6sm39358770wmd.41.2018.11.12.23.57.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Nov 2018 23:57:16 -0800 (PST) Date: Tue, 13 Nov 2018 07:57:14 +0000 From: Lee Jones To: Brian Norris Cc: Benson Leung , linux-kernel@vger.kernel.org, Olof Johansson , Shawn Nematbakhsh , Alexandru Stan , Gwendal Grignou , Enrico Granata , RaviChandra Sadineni Subject: Re: [PATCH v2 1/2] platform/chrome: straighten out cros_ec_get_{next,host}_event() error codes Message-ID: <20181113075714.GF29388@dell> References: <20181108024939.174321-1-briannorris@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20181108024939.174321-1-briannorris@chromium.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 07 Nov 2018, Brian Norris wrote: > cros_ec_get_next_event() is documented to return 0 for success and > negative for errors. It currently returns negative for some errors, and > non-negative (number of bytes received) for success (including some "no > data available" responses as zero). This mostly works out OK, because the > callers were more or less ignoring the documentation, and only treating > positive values as success (and indepdently checking the modification of > 'wakeup'). > > Let's button this up by avoiding pretending to handle event/wakeup > distinctions when no event info was retrieved (i.e., returned 0 bytes). > And fix the documentation of cros_ec_get_host_event() and > cros_ec_get_next_event() to accurately describe their behavior. > > Signed-off-by: Brian Norris > --- > v1 -> v2: > * don't make as many changes to the API -- just fix the documentation > and a few corner cases instead > --- > drivers/platform/chrome/cros_ec_proto.c | 4 ++-- > include/linux/mfd/cros_ec.h | 6 ++++-- > 2 files changed, 6 insertions(+), 4 deletions(-) Acked-by: Lee Jones -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog