Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1182165iog; Tue, 14 Jun 2022 00:26:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuyda+pbQ62MdXBJyxZgnrFKlqYFP3sE3E8aH7bYPaUEjQW6ZiV2pXdouGVQGWgQTXaek/ X-Received: by 2002:a17:906:b31a:b0:709:115:453d with SMTP id n26-20020a170906b31a00b007090115453dmr2994485ejz.227.1655191567095; Tue, 14 Jun 2022 00:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655191567; cv=none; d=google.com; s=arc-20160816; b=C+4+g4gevYQ65EeAJ5pv8OkUlEIQYJdmATE8zEiRvtYfFHvOBWNiHZ51mIRYnav8gQ XQKtaifN3P1XMcH1gNnQaNpKDurp4a0J9xwfZRdwxCjRxvSQq5FwmgVB6zArgDfwZHXG aeBS235yR3UMY6ycVRw15bc7Zj97bazof7EBKmx1JkpBilTOqwZbEMUdvoBAtsrPnCMp FaWAqM/FqI0IrxEbtSKSizbuRx02K8L9RGCJWhUDIzDzldO0X3WH2IsdFtiitnI+yVfx hoawQg4dqNBsuBGpv8H08OvLdIKEpZHLq1rSfFlRtH9HZmmeXSA8UPdS66HuEOU4Aj2k eA8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=NvQ3dMwjcZJAfiBKK1jqRDaoalQrrTMUhjsMmAaJDGA=; b=bqGzRwTRAveQ0Yk53SZ+gNmToiPeX6AxygvypGDDCY1TWn4NgrZ0T9skcumRNJ++CM 3i8deBQtwdxdlzpsctVs70EGtCI4M2wQkBo7HncwCHQr+0hfHN1nvNKWZOpxJbhtch7U YF1JOjxzv4yoSGXzvTjQB7+ULG43FHCDCESJhcAekt7GLqh6I9veQuM6X1RBI/AJV51O l6BH3ijz6H8VfaHvwfnqlpuZy0d8HCWCSjkEsxnVZeXXO8TfvswG5vKr9i779zAXpX+E S21XQ1RvUON0lNSVP0RLIuLS6ryKGeg6Os3EeEsaxaGOjXy1vubxlnAq6OW5xFKdr+c7 flzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k15-20020a1709063fcf00b006ff14f50ae3si8631654ejj.354.2022.06.14.00.25.40; Tue, 14 Jun 2022 00:26:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354210AbiFNHXI (ORCPT + 99 others); Tue, 14 Jun 2022 03:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354132AbiFNHXE (ORCPT ); Tue, 14 Jun 2022 03:23:04 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B93EE2DD43 for ; Tue, 14 Jun 2022 00:22:56 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o10sq-0002zC-HD; Tue, 14 Jun 2022 09:22:40 +0200 Received: from pengutronix.de (unknown [IPv6:2a01:4f8:1c1c:29e9:22:41ff:fe00:1400]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id BFCE09460D; Tue, 14 Jun 2022 07:22:37 +0000 (UTC) Date: Tue, 14 Jun 2022 09:22:37 +0200 From: Marc Kleine-Budde To: Dario Binacchi Cc: linux-kernel@vger.kernel.org, michael@amarulasolutions.com, Amarula patchwork , Oliver Hartkopp , "David S. Miller" , Eric Dumazet , Greg Kroah-Hartman , Jakub Kicinski , Jiri Slaby , Paolo Abeni , Sebastian Andrzej Siewior , Vincent Mailhol , Wolfgang Grandegger , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v3 13/13] can: slcan: extend the protocol with CAN state info Message-ID: <20220614072237.d6crkhtqmbgjlw4e@pengutronix.de> References: <20220612213927.3004444-1-dario.binacchi@amarulasolutions.com> <20220612213927.3004444-14-dario.binacchi@amarulasolutions.com> <20220613073706.rk3bve57zi2p3nnz@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6ycy5ldwkhbkgvki" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 --6ycy5ldwkhbkgvki Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 14.06.2022 08:29:57, Dario Binacchi wrote: > > > + cmd[SLC_STATE_BE_TXCNT_LEN] =3D 0; > > > + if (kstrtou32(cmd, 10, &txerr)) > > > + return; > > > + > > > + *cmd =3D 0; > > > + cmd -=3D SLC_STATE_BE_RXCNT_LEN; > > > + if (kstrtou32(cmd, 10, &rxerr)) > > > + return; > > > > Why do you parse TX first and then RX? >=20 > Since adding the end-of-string character to the counter to be decoded > invalidates the next one. > If I had started from the rx counter, I would have found the > transmission counter always at 0. Thanks for the explanation. regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --6ycy5ldwkhbkgvki Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEBsvAIBsPu6mG7thcrX5LkNig010FAmKoNzoACgkQrX5LkNig 0117wQf/StmunxwhYlB9+A2hn7jBIh3c9dpjj8trKdaPs90i/hSL9awW0mAxFOOp xy9qN4B3nWyl2lK3sJAEQgRPEJgmvybSP2hqh7+jS8lxsyIEtOIn37nyn/ZpwLrD actsLV/9Nml+3JZcqss1hgF3fu6WMzpy+fuvokqps3wwU7nDA6CzJLfVBSCDHMQq iTlsqQWV06RugoXVwDAeR/IznLVkXXJGLQM7YL2i1zxwMU1NUwQHyz/gFFcwkMau h3rjb22EaUIJqguYrzI6KNkeo0rbPrEkmUIjwfV+A/J2A7aQ328f/tuJlPS4lOnZ /XS16dNKvjmrX4GoRbtXzvumwz8R9Q== =xAw3 -----END PGP SIGNATURE----- --6ycy5ldwkhbkgvki--