Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1036081iob; Fri, 13 May 2022 20:31:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNZgOq9Q4cAHLpAtnz3VRLw9bGRd39ZiECIZudZZcNtp9o24F9R3gLPxCfAPz7TGHXhpaA X-Received: by 2002:a05:6000:1f8d:b0:20c:dc4b:3f95 with SMTP id bw13-20020a0560001f8d00b0020cdc4b3f95mr6163111wrb.659.1652499107435; Fri, 13 May 2022 20:31:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652499107; cv=none; d=google.com; s=arc-20160816; b=jtWekAy4MQZoNsCXO71lFWo31/th2MiOBZXyj1f/GtS2vO1RwW5cIpb4b9Sp6UA+F8 D4KYMAHQdlFl5kTjruMsiqUbNz7YwpomslCHwr3z/8mK42a3DDpvselKzlbBpfpQHC8e 2hIIUH+vwUEaxGG+GID/z0pZUhf2NeRkSIzs7ypLEvAe0EtSebyqQJi2qmu60DvLsQ+T vhVcv2gq6GdgAtgivtLDeBmS/P7R2gGtaaAok1tNxviRVwYV5d8uiRMyv57gOGTdHx1R sN0k6GMcg4JlQDiakby/Rz4k92eINvXwPX1UWPPCk/3PB2l/lzxh3d6Iv3tgsol/Tuwu AhGA== 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=CGvrUyHu8ge1QuqqAmL63DRBp3yl5wUwac/5FO1sKeY=; b=Tb6jA21xZ+dmy8Juz2uXeoyu3dzOcn6epMTKWO+oAHFr5OsmxhHjU8h7668jNEgNkl yXoqoIL8cpUh8ujroeU4Qm/McGxcYAleEeeeOi1qvjxB5PsrDpjPs53vf8zEdUYIIfJx qST81rnNZVTvha3+UnrspHMV7YM3nJfpsop81tnNJZe24PRJtlpWIGdkyT94YIgDPDb2 5IWa4RhnFSQCXPbA8arPRASzlK1Dmrl7QCuOuWO79YE17WfJzG1oxfCEsJHzZpPanbSi W9tpB5DwHjX7kNPwrPwgNTkXWVZlXFSEq5KWl9gIEBW+ogx5oM04AHteDjWQVNNCEI3V q4uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=oQmz+qjm; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o3-20020a5d4083000000b0020407d8b68fsi3745008wrp.77.2022.05.13.20.31.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 May 2022 20:31:47 -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=@gmail.com header.s=20210112 header.b=oQmz+qjm; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 99F6442A550; Fri, 13 May 2022 17:08:04 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354895AbiEMGbf (ORCPT + 99 others); Fri, 13 May 2022 02:31:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243588AbiEMGbd (ORCPT ); Fri, 13 May 2022 02:31:33 -0400 Received: from mail-yw1-x112d.google.com (mail-yw1-x112d.google.com [IPv6:2607:f8b0:4864:20::112d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25DD72927AA; Thu, 12 May 2022 23:31:32 -0700 (PDT) Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-2fb965b34easo80427547b3.1; Thu, 12 May 2022 23:31:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CGvrUyHu8ge1QuqqAmL63DRBp3yl5wUwac/5FO1sKeY=; b=oQmz+qjmHskm+Y8UlEZiyXLMJ4W4szxyvCIySAtwgyv6QhEuAAtZL4Shb17etrlx1n 7jDEmA0an/VeE4V6iukJuOY16FaQJyVgzHONtaJaLpvDTT5udn9YqPkKHSdyMiT01CmF n54VKqJCKcxvEKrUM8gFgt59mXaQYfaUOLgmQO5+eIA0+lS5yPh5fv8b/uktUxnQj9iq nfDEUlan1k5xXS6sxy9qGDd4/JvOW6k1FLoI9OSgkUkSlmXEiWKjOU37jJY2vUfeUa6o g//obQv64jyhFyRcJ0wafMfrsJQV11SIXLPIxoCnWtmwGdNeaQ8eR+azyglrVaHdOyHE 4ULA== 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=CGvrUyHu8ge1QuqqAmL63DRBp3yl5wUwac/5FO1sKeY=; b=RGXZoWrvh6iEH/NYY8uGL9QqVHVxtUi04Ki6jcBfcSaVEXjZ3Os26G0VqjfQQoZA6t wpyFP5F4zVYvRz2jE8+vWJ+FhLwQnyZ0BiiWIiHBd/yoacUddafjMbOfUntRVkwNHVi8 mLBAYRs/Zo2rXblw0KYhBeCoz9qltAl7q/fNzXvRU0z+z9lCquLnJuS9Uy2+O6n3NMHA oOkFScIqA883WTWWNgNu0ACBNXblAnoZEX9BF/lPPsGk/xFhgcJnyRXhMrG7Kda/WOd7 1ntbDXsF/OXAU/ObRVqO250ChrogQmybD2Tzu9mlbtCFz9nYIZqYzBRBX14I9Zed2zEf Ye3g== X-Gm-Message-State: AOAM531O6RkwbgKWvTI0C44LEFES5Nfu1NYZctW4jMxmqK0dhnpEI57Y g4ZKAuq1ipgEADbK63tZuPbvfBSKGy2qJy8zpMo= X-Received: by 2002:a81:ff12:0:b0:2db:2d8a:9769 with SMTP id k18-20020a81ff12000000b002db2d8a9769mr4082875ywn.172.1652423491370; Thu, 12 May 2022 23:31:31 -0700 (PDT) MIME-Version: 1.0 References: <20220512182921.193462-1-max@enpas.org> In-Reply-To: From: Vincent Mailhol Date: Fri, 13 May 2022 15:31:20 +0900 Message-ID: Subject: Re: [PATCH v6] can, tty: can327 CAN/ldisc driver for ELM327 based OBD-II adapters To: Max Staudt Cc: Wolfgang Grandegger , Marc Kleine-Budde , linux-can@vger.kernel.org, Greg Kroah-Hartman , Oliver Neukum , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 Fri. 13 May 2022 at 11:38, Vincent Mailhol wrote: [...] > > + case ELM327_STATE_RECEIVING: > > + /* Find delimiting feedback lines. */ > > + for (len = 0; > > + (len < elm->rxfill) && (elm->rxbuf[len] != '\r'); > > + len++) { > > + /* empty loop */ > > Question of taste but would prefer a while look with the len++ in the > body (if you prefer to do as above, no need to argue, just keep it > like it is). Actually, what about this? len = strnchr(elm->rxbuf, elm->rxfill, '\r');