Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp568541iof; Mon, 6 Jun 2022 08:39:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJydD4JTWjWasNWAAP6UQ4ScvK0j8fBjlb1G1G/7/SNjKG0S7uOtD8OhCsutFUZ2xiu4YZjd X-Received: by 2002:a17:90a:bb92:b0:1e2:f8a0:b0cf with SMTP id v18-20020a17090abb9200b001e2f8a0b0cfmr27025508pjr.28.1654529954041; Mon, 06 Jun 2022 08:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654529954; cv=none; d=google.com; s=arc-20160816; b=bGb+pyb7qA95B7fg058Uxnat2ncPmIY5aF48dz4d28hXaeSXh5r1OkDhIYYPnJBt7s BR2uK+RJF/q6L+Gs3bdhz83RVLWvobOw+tIBSQnAc+8aNlsa2HEYxeEim7kSOzmCBajx L7WtfT1/X5fn45FXksbiezpPltvUt9J56zo3HcUXnsZswm58v+bwsx18rqgevEsCY36N 0HJmWnAeUPfZZAjug21WBgRXqlj53R5CWzMJf6cc7AcKMQyUAZODy0i2FyUCZz0lL2Fn lIvbi4NnDV7P5DO1+QKhjKeDBx6/idoaQzwztMWptABgDYQPRBq/R3N7UJsPUxgXO/cC ZokQ== 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=LkVR1NuQxjBXrvEq17FZVgpSOEkLzSQoABYmEhvkVmQ=; b=b6D/QL+gDPO4z39sGOrpiH6NeY9fD8WluhYYioJNKV23fDH8rvhtAy+vR5YjFvtJ3H FxMsFHkowWtnDDzKGd5OIbZj7qApNGCAJspaF6XvlIfynEyiPI7RT8SOQDqKKjmMkbKJ lbH+lMDG/vtbR7InUsR0MEPNM+7BtK1cZofmyvpJuPt5uCuqiJIEtIY74w9Se6NQ6wkc Fym+oXQwQA8c4ti6df304it9RHRKga1pyWLTgyG9PAERX3frCmAOGnLzZJViYBBoGMXa Ls1HwH+qVGQaG8bSa8ZUzW14qhOOYBOoYcKi+ERKRivaVqAiKMIMIi9sD6IlCnmNpVEa ZZEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CaTMDhM8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id x6-20020a1709028ec600b001617f6d5e36si19762059plo.23.2022.06.06.08.39.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 08:39:14 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=CaTMDhM8; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 E571D2BCC93; Mon, 6 Jun 2022 08:24:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240486AbiFFPYi (ORCPT + 99 others); Mon, 6 Jun 2022 11:24:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240469AbiFFPYf (ORCPT ); Mon, 6 Jun 2022 11:24:35 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D92332B4595 for ; Mon, 6 Jun 2022 08:24:33 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id s12so22429582ejx.3 for ; Mon, 06 Jun 2022 08:24:33 -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=LkVR1NuQxjBXrvEq17FZVgpSOEkLzSQoABYmEhvkVmQ=; b=CaTMDhM8HArxhiM8wuEqYHguZd+Ow22R1fzwTFrTbpk5PuHjMdCTcfeVrzdHIBRYSW yQNBz17J5+HBN+JQkvdk3ejN61UBjSKi8HGWzdDLxf7gpdfUKwE+ucqdU6his7L0ZH2k A21jL8g4RkA9McGN05TmIXlJWekmGVckhdO8Dw04vJtoZhmIuWa+pd+axtIYooJ68K2a G9VYdMM/w9Uzgul5i1HfXU/AAHIbg4fhtv3hz55FfvkYzgRcJQ4FXjFmVwTDFOZjgSQS Q3teYiu6BRLeqyvOE2ZQd6AsRq3y5OaXApsexu0doVKJNt3+VAU9BR5H05k0eEJuW6pQ BXhQ== 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=LkVR1NuQxjBXrvEq17FZVgpSOEkLzSQoABYmEhvkVmQ=; b=OQEmeXGMgCw04nN0F2QNSzkD0ixwSKFcL3rN0lLl/iGogaX9c8+BF/MFOo2Kd3PqdY VObxXlgAiSQynD39Ee4BNwduoYc9fvR6pK5Ycv61D93aAqWWIdTWjAnSRTqvWD/+7c+p Ju0uBQg6JVaWimZgYdQ9UyRVHWXQcNfNT2TQ30AKxl6fHxLbUcwSS0cmXGLk1Bna0l2k nWbikw4ViL4dR0vnlnmbnrAThKkMhzWBPUaGQVDxsVBgWWOvqvTnicorjvyeo7ChhxsE kLO3ksD88AL4bP8+4E3vyP6yDOHUCZ1H09DX8qsJ8xNCub2k17T2CZbxkWzkfT7UWazV TBFw== X-Gm-Message-State: AOAM532+VXS8weoJD604qjZKkG8PSXnvdoKy9Bg821aIuFUsgSxSTkW3 vbVDAV2fqGBb8HFInYsHnN5w8ZlHtCVUhp38C5moDa3ncLeVLg== X-Received: by 2002:a17:906:4d50:b0:70d:afd4:1e63 with SMTP id b16-20020a1709064d5000b0070dafd41e63mr17459197ejv.618.1654529071847; Mon, 06 Jun 2022 08:24:31 -0700 (PDT) MIME-Version: 1.0 References: <20220606141051.285823-1-tzungbi@kernel.org> <20220606141051.285823-5-tzungbi@kernel.org> In-Reply-To: <20220606141051.285823-5-tzungbi@kernel.org> From: Guenter Roeck Date: Mon, 6 Jun 2022 08:24:20 -0700 Message-ID: Subject: Re: [PATCH 04/13] platform/chrome: cros_ec_proto: assign buffer size from protocol info To: Tzung-Bi Shih Cc: Benson Leung , Guenter Roeck , chrome-platform@lists.linux.dev, 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 Mon, Jun 6, 2022 at 7:12 AM Tzung-Bi Shih wrote: > > `din_size` is calculated from `ec_dev->max_response`. > `ec_dev->max_response` is further calculated from the protocol info. > > To make it clear, assign `din_size` and `dout_size` from protocol info > directly. > > Signed-off-by: Tzung-Bi Shih Reviewed-by: Guenter Roeck > --- > drivers/platform/chrome/cros_ec_proto.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > > diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c > index 65191af5139c..629dce3e6ab3 100644 > --- a/drivers/platform/chrome/cros_ec_proto.c > +++ b/drivers/platform/chrome/cros_ec_proto.c > @@ -449,12 +449,8 @@ int cros_ec_query_all(struct cros_ec_device *ec_dev) > "using proto v%u\n", > ec_dev->proto_version); > > - ec_dev->din_size = ec_dev->max_response + > - sizeof(struct ec_host_response) + > - EC_MAX_RESPONSE_OVERHEAD; > - ec_dev->dout_size = ec_dev->max_request + > - sizeof(struct ec_host_request) + > - EC_MAX_REQUEST_OVERHEAD; > + ec_dev->din_size = proto_info->max_response_packet_size + EC_MAX_RESPONSE_OVERHEAD; > + ec_dev->dout_size = proto_info->max_request_packet_size + EC_MAX_REQUEST_OVERHEAD; > > /* > * Check for PD > -- > 2.36.1.255.ge46751e96f-goog >