Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1029037iob; Fri, 13 May 2022 20:14:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx3I5PZR4/JEdO/jQCtLsHc96OrGR9zIhhAhxCTLToIbYFLqiXJ0qXW+AMSom2Tu2Yx3ZD X-Received: by 2002:a05:6000:1847:b0:20c:61a8:4dd3 with SMTP id c7-20020a056000184700b0020c61a84dd3mr6239662wri.205.1652498063139; Fri, 13 May 2022 20:14:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652498063; cv=none; d=google.com; s=arc-20160816; b=oX8VIs4xUkh4HbSHZwMLyq4R43BkylfL9Ch1zl6rdPlNLxP25offHihvvOjicj696h rTEXZFtYTOn9v/9DNDveJcjs6552rrG3x1HNIdmoF2+obqCXGybEFercIOcKmt3nfZ3V bcchrDhe7Zq4H9AuhvN7qofdQzoeuM+qZwnhnLm2ejnlrEDKSwrUH/8Sqgg3LAlPFoBO 52n73cunCq9ze+k9l/BJIDjuhoz3u8uCChg7tAoXMSQHNhXE+zQ7zvrnsHiRtP9laM5w xI6unpIJsxKlEGiVS8q2To1yZiM4lHFf2Jg4B+XKVg86GXRmbM9EyZEIjKQJUNvyn0UI sxzA== 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=+XvPMge8GrQx5gO2KcAEj9ecLQjDwShTO+vRI9VUWdM=; b=JxiDDMoI0PMRaTnktMwPSN3G97AFiPGyEPU2Uu2gWvry1Ekc16F5GvqgJO6ef9eip9 ucSKRWjgCSuQvU1KahLdOmSivfwdnb+NMX6svqGTPGyoajj8tkY5xQB+xmPmqriqT0v/ 8i+z8xtEzWNeoBV5sXUT8RtOe5dTh90kjMTfOSIL0Mv28B5wDK+fYLvQ1htiUnOZy1bp oUO2R2AosAZvxrI0mn+kpAmaawLgaFMRQLmcuS3vhKy8pv5oo6QXvzUe0JQ8xktHu2t7 Wean+sPRF7ukXHlmIdQYn3PuduyFVGfBIDZunGPQLBQ87gYgGBr8XNJ6pI3BIzAb57lU HwuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=AdeM+wd9; 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 c2-20020adfed82000000b0020c72cc8c98si3217655wro.302.2022.05.13.20.14.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:14:23 -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=AdeM+wd9; 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 1BFB13D923B; Fri, 13 May 2022 16:53:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355626AbiELOxv (ORCPT + 99 others); Thu, 12 May 2022 10:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351615AbiELOxu (ORCPT ); Thu, 12 May 2022 10:53:50 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4476246DA0 for ; Thu, 12 May 2022 07:53:48 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id z2so10781839ejj.3 for ; Thu, 12 May 2022 07:53:48 -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=+XvPMge8GrQx5gO2KcAEj9ecLQjDwShTO+vRI9VUWdM=; b=AdeM+wd9VggiptdGj4RlKrq1Zoo5M7tYT3f+1hw3KBsuT0NlLz8HDkN9enALA6YUgM 4LmTl7YdtM6Gqknm6oJrxF86dlzGfvj0zhXoaViAfDDi91bMpxqQGpppi1RtNV3+Bavl FrusBYZ2HYsLB4m2+WwRZe9HSPiWzO98UPRWijcCsYdvoM35T4aUbxfuk0l6jG51jn/q J4504prHIlTda4/dbJzTvSV7M3SWPD5hrrWC5XbJ4MsJpphdrQG5C9LAlgURXMBUpgXp HiY0kU18wRukU3+bOcjOXDVRb+F6bjRztYM6uHospU4WWRHfhqk+yJzHSThFRJ0QJcYN Rb/g== 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=+XvPMge8GrQx5gO2KcAEj9ecLQjDwShTO+vRI9VUWdM=; b=Qw0ssBRcznIZ8vTlmA1+XP4NH/hKtz1az+7Q80GYh1ubcE6O9ZytiXJujkZO5/6FRo oSMs6azXwro2p/2xvOrerARYlziJNzctiZi0bHkRhzjF47x4IffFLZb9ndvn8JQA//fQ X81Dtq4+ICgu+rXcxjzkB4AfsaosPo19AAydBiz8zeSF4YyUAQKSZcYN/IV5fDEWhX1o CgrHnDFtLV1OMhyHbSSISeECxxeKq+1DwgA+l7fOcFxyVaSFU6wRz0qFoUaOulGkLfyN xeD8a7sMreEX4c6KCEOlaptHGPztUC7RuiHtjxRzfqatP67IjINF8x9aEufnd4GUsSQE SEeQ== X-Gm-Message-State: AOAM533Vzxbfh1rwGsY+W6EA4pJ69n8i+QOpA2FAZYfkvtooGJ+SDXn/ hXALq3N89NbgftehvfFGuObpGepYz1b/l6B6ShMLDQ== X-Received: by 2002:a17:907:1b1f:b0:6f0:21ec:6051 with SMTP id mp31-20020a1709071b1f00b006f021ec6051mr235589ejc.533.1652367228047; Thu, 12 May 2022 07:53:48 -0700 (PDT) MIME-Version: 1.0 References: <20220512083627.885338-1-tzungbi@kernel.org> <20220512083627.885338-2-tzungbi@kernel.org> In-Reply-To: <20220512083627.885338-2-tzungbi@kernel.org> From: Guenter Roeck Date: Thu, 12 May 2022 07:53:36 -0700 Message-ID: Subject: Re: [PATCH 1/6] platform/chrome: cros_ec_proto: drop unneeded BUG_ON() in prepare_packet() 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 Thu, May 12, 2022 at 1:36 AM Tzung-Bi Shih wrote: > > prepare_packet() gets called if `ec_dev->proto_version` > 2. For now, it > must be equivalent to EC_HOST_REQUEST_VERSION. > > Drop the BUG_ON(). > > Signed-off-by: Tzung-Bi Shih An alternative would be to return -EPROTO, but given the context this is just a waste of code space. Reviewed-by: Guenter Roeck > --- > drivers/platform/chrome/cros_ec_proto.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/platform/chrome/cros_ec_proto.c b/drivers/platform/chrome/cros_ec_proto.c > index ac1419881ff3..db1c8ba43171 100644 > --- a/drivers/platform/chrome/cros_ec_proto.c > +++ b/drivers/platform/chrome/cros_ec_proto.c > @@ -60,7 +60,6 @@ static int prepare_packet(struct cros_ec_device *ec_dev, > int i; > u8 csum = 0; > > - BUG_ON(ec_dev->proto_version != EC_HOST_REQUEST_VERSION); > BUG_ON(msg->outsize + sizeof(*request) > ec_dev->dout_size); > > out = ec_dev->dout; > -- > 2.36.0.512.ge40c2bad7a-goog >