Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2685719iof; Wed, 8 Jun 2022 09:54:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTCahNvZYvIPFRXfTkWnTPylTt/aAysYWA8VsjeC2aIk/AHqWfCcD7NaZcSYzK5HY70EKw X-Received: by 2002:a17:902:9887:b0:151:6e1c:7082 with SMTP id s7-20020a170902988700b001516e1c7082mr34079854plp.162.1654707261692; Wed, 08 Jun 2022 09:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654707261; cv=none; d=google.com; s=arc-20160816; b=mTrZxzCV+ml5bDaoG7iEPESXpxjcwJz8nnNpX0LS2Tms6VTUyMroi4LfIHYeIQRQJm 7XhYnlU1ECiT2mAxPfBX7aOB8lfOK3olN2u2i9HQR/gSCV4xzs9V5GkQaPqYBIbkQJ/v iAkNSZRZoNZ4mAvIgVHegnwfm9WAZ865EtIFyPAAqDj/6b9W8LY5rumPLr/cjPx4ZFQV 3Xqd1yLr8jyP0lTS4fkU0JvO3lnQyMlxAv1IsbZRTg7QK52+6UQsWht/yK+CKlVTh6QS 90Rl0qf5AjlhrEupyXkSQbVIJ0UjOGIvM0LDLyPstLJ5tPRzg3iUZGkJ9gvPTnjNRZr/ 2Bew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=8z7UL87qNPTqb+Q3KPHmVnfDvzgXsjCKSbw/KgXuHW8=; b=rfniwR5j0x5V0xJmgzr+SZTshBnR5pH66CfZ8MTnVCOVjKrReGg8Qqn72qacyOkw2s zgP8+/U3Yfi/hMLGHNrPb1u2GqPgyoTSPP0Vc7GLmMHbJftFA0pluBx+oCW13pt0Vk19 YHFbO1eQtmkQmq4F6oCZnZYID51SbhCnDUKqGV1IgmbnkDdQby1Lfq/3XCVnVx8+6SwC ijvpzLWglNWgxcLKlCCYiKov8PKlljFp5It2cawlu2iG9V0jE2uJhl1aOSbJxSG3FIVf IFZBg1hK9eVcpNipFYr/Jb1ytjApFpQFUXsCyWWaSqGXjXRHFz0NhFsZcMSQ2TF2h4rP go7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nuXw81uW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id j3-20020a170902da8300b00162039486e4si19470762plx.319.2022.06.08.09.54.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 09:54:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nuXw81uW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7AE4F2B1A8; Wed, 8 Jun 2022 09:26:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245430AbiFHQ0u (ORCPT + 99 others); Wed, 8 Jun 2022 12:26:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245393AbiFHQ0n (ORCPT ); Wed, 8 Jun 2022 12:26:43 -0400 Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F288A13EAC for ; Wed, 8 Jun 2022 09:26:38 -0700 (PDT) Received: by mail-ed1-x535.google.com with SMTP id x5so22728324edi.2 for ; Wed, 08 Jun 2022 09:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8z7UL87qNPTqb+Q3KPHmVnfDvzgXsjCKSbw/KgXuHW8=; b=nuXw81uWjcRA3iwjIPUWjjPWyYPm5FPGVF8S1Tr25dWvIRloo6TQdefzttqaK/WyEv 6DTjUBANjKXLyWZSM7zPGHUDuAx3/9At5QmWNdQzkzuz9W8dBWd2b44Fye14M6JLxX11 nCVMKTBomK7opo6KD58DUr+X86bTGm4o+ETeFlELCjTEFfG99b8v9MK7m3HYHmyXZUaj nPA7fuTHuwC9melcOmht9C3Y9GRhqy+Ih4i28GqZA0m8fmfkVju0bAKf+1P1S4kPqU6E /RuufGpmPhphjH38kFkntEU5i4o9MM2/gaogP2sxHEjOI0t4ROZgwDgMQiaWAewu9Doc 0YTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8z7UL87qNPTqb+Q3KPHmVnfDvzgXsjCKSbw/KgXuHW8=; b=KimOHC0RvrCRjCydWjZUUS6/wAuvEJXGhn7lyO1HRnlZc4teDrk65D9z3fTaM3djav yptPEXn4uMn127VXH0Tz3+0GYWTkk/moSIsJHHqZw15dTdk6DAWZx/SkWY1IDopf/mdQ CdsUY13ZoU0S4X3lc/qQwUco8+3NZddwPixLQ5q9P6xAfrvugtrmlK3z1nwBSF8mlE76 w3gKa/Pt6u+fy9edZVdzo8zrg3paaQdook3GfiSX+wZjdSFliEFjaxZo6hH9TM87bB/R Fm2EtXrgAKmXRGKFebH3Frr0s38DVz8jJq9Ht1ztYd7Fs4VV4u4qgGZiQfNPjeozC/Sk 9vZg== X-Gm-Message-State: AOAM533obIj4rFYM1Q7d4HNxCjtLcaod3L/bIIvi1uYI2jclbCb+opPg FAbzM+0ECokzEGm6t4Xkld+N0LpRmnih3wfH09BaHg== X-Received: by 2002:a05:6402:f14:b0:42d:f989:4a21 with SMTP id i20-20020a0564020f1400b0042df9894a21mr40418553eda.168.1654705597304; Wed, 08 Jun 2022 09:26:37 -0700 (PDT) MIME-Version: 1.0 References: <20220608110734.2928245-1-tzungbi@kernel.org> <20220608110734.2928245-22-tzungbi@kernel.org> In-Reply-To: <20220608110734.2928245-22-tzungbi@kernel.org> From: Guenter Roeck Date: Wed, 8 Jun 2022 09:26:26 -0700 Message-ID: Subject: Re: [PATCH v3 21/23] platform/chrome: cros_ec_proto: return 0 on getting wake mask success To: Tzung-Bi Shih Cc: Benson Leung , Guenter Roeck , "open list:CHROME HARDWARE PLATFORM SUPPORT" , linux-kernel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 8, 2022 at 4:08 AM Tzung-Bi Shih wrote: > > cros_ec_get_host_event_wake_mask() used to return value from > send_command() which is number of bytes for input payload on success > (i.e. sizeof(struct ec_response_host_event_mask)). > > However, the callers don't need to know how many bytes are available. > > Don't return number of available bytes. Instead, return 0 on success; > otherwise, negative integers on error. > > Signed-off-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck > --- > Changes from v2: > - Separate Kunit test to another patch. > > Changes from v1: > - Return 0 on success; otherwise, negative intergers. > > drivers/platform/chrome/cros_ec_proto.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c > index 9e95f9e4b2f8..68a411e84744 100644 > --- a/drivers/platform/chrome/cros_ec_proto.c > +++ b/drivers/platform/chrome/cros_ec_proto.c > @@ -236,7 +236,7 @@ EXPORT_SYMBOL(cros_ec_check_result); > * > * @ec_dev: EC device to call > * @msg: message structure to use > - * @mask: result when function returns >=0. > + * @mask: result when function returns 0. > * > * LOCKING: > * the caller has ec_dev->lock mutex, or the caller knows there is > @@ -266,6 +266,7 @@ static int cros_ec_get_host_event_wake_mask(struct cros_ec_device *ec_dev, uint3 > if (ret > 0) { > r = (struct ec_response_host_event_mask *)msg->data; > *mask = r->mask; > + ret = 0; > } > > exit: > -- > 2.36.1.255.ge46751e96f-goog >