Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp520173rwe; Fri, 26 Aug 2022 09:08:29 -0700 (PDT) X-Google-Smtp-Source: AA6agR5isNZUrkU8k2vYmqp1D78wGglgdN7VuEnCVMuvDb1jcWmwR4ugxQ9q/GK/d/2ges9IgoWb X-Received: by 2002:a17:907:7e9e:b0:73d:ae12:5f11 with SMTP id qb30-20020a1709077e9e00b0073dae125f11mr6035636ejc.176.1661530109227; Fri, 26 Aug 2022 09:08:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661530109; cv=none; d=google.com; s=arc-20160816; b=vWEQYSIOMmgaESZoiKyKnBswukxHysItfC+QsC0l84UIxAkN112Mxhgl/8nrFYFu+T WPAI7WoiOkZUhOxS8RyLE6QFrhjU3ZcG6g8MpGHL1kTLwatxn6sDSYpHFKXjfC7oylwd 1WD37bDH5Cvkvc3LTnh573EFV4rnSMqlh8gCK2KlDKkf9QMTguBl+DufxVXz2dkOwvr1 1lMj7kKDSkpPckhfpJaeRzLU1tzehDisP/faFDCvcUiiPF0mVredIs/vgLJGD/ageM5j b+z9PwrlYnOj19migRDCNe1gh8K7WnH7EHjQnssDvf1Fwlk6W8H/fVW+uTszbi+Jl3Pc abAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=qBPPfnbpmPdM2QlLk+XM/BmeuhyavLK4nk3zz2G6eCg=; b=pXZmtuETE87PLTNi7XSru2jbLlGorv02cTtU+4Qu61TD1oqHq8/J8X5jB4fGSPW/Qv XC5u+ybxeUGHrDCYBSsMNpVQI/sbiADR7Yea9b3hxU6wXYTwuS/XFGBUCspaPIhU7+zR qwXhI5wLXJYU9SQ0QLjd3BDjB/gpfh8kh5H16OthmrzX8oaAzFO+tUe4EmOU1dJyg7dP bQrPkw4um5uVhFCwM5uzs0pGnEmUBFHmlS+X+/fODy+GyiJD6CkV5ccOZMIgsVguxOc+ 3/rQYHQfIG4kdf8aSQ3xX+pFuJv4Vfog+fRy1er0Q6Ust5/o258JNnPGmNwT8dBEuAMm HnIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CPiZTaQc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a05640227cf00b00447e24ce5ffsi1817332ede.194.2022.08.26.09.08.02; Fri, 26 Aug 2022 09:08:29 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=CPiZTaQc; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344664AbiHZP5I (ORCPT + 99 others); Fri, 26 Aug 2022 11:57:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237300AbiHZP5G (ORCPT ); Fri, 26 Aug 2022 11:57:06 -0400 Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E94C3D0759; Fri, 26 Aug 2022 08:57:03 -0700 (PDT) Received: by mail-qv1-xf2b.google.com with SMTP id n14so1362224qvq.10; Fri, 26 Aug 2022 08:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=qBPPfnbpmPdM2QlLk+XM/BmeuhyavLK4nk3zz2G6eCg=; b=CPiZTaQckYJmCF3Q8lHsgnadiiRUmfxnEosw9kbKq+Tx54CgTIWc07+Je8TKtqoLYF Ut9NVZUS+L8ODkeF+6U1FQ25NeZsKLXxkwWchf/CGSy6/MNn2RcPTRAmrWDyw+zajf7C kLbo0s3aUU27qTkUuWyKTQbool5HIt4pI5xwpXNuTIacAH3gTjouw5i50PiaIkauIq3Q 0uHhzUncrQQ1CViqPEcGHtwV5OxkEnO8v/AjNEedQTawJlvnfI/9UCBMaLV+K8Ub4XrA 641IWD+XkJECh5gW/3stcHyDeQLkssuJcIQjSraeUjd9UHm88vQ9TT8qe2Hpt+kemift Azeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=qBPPfnbpmPdM2QlLk+XM/BmeuhyavLK4nk3zz2G6eCg=; b=nyLelDtl2pZjKRxO9i50ko1PUVolgxNfVGmL/MKxWO1tUcHLmlPPWYuNu7x3PsYIKu sQVJYXf/ShVqNOOyIREPEvOCMRvyat3KW7hW1aaHt3SjQAOQWUo2AgvnZgTSEQuZPGMo PhBz1HNwOp6RsEsOKR1vM8VV6Nl2aCj63OAf0ET3Jyy6/Kq/+Op6rl0cwJpvvso2vQe3 Or2GdPos8qJArN+ROIt4KFNY14RYC9puPzU2XEBNKXB6UNL/+lr6SfTCEXhc+pHJFoEo LZT95sjMMQEifYLBAY9Lf93E8oY2G8hjeoR0vSPD3QLQDcoUaGGl+BR49xOqcK0BlPwY wJQg== X-Gm-Message-State: ACgBeo2K6Y6ciQmnD6Tu8JDcT36tbw5YlRvaK2LPNRM+YMSc2/evbWKz ieSTa8+9VbRClbVQGV1evO5zfdmVvJh5p/fhPNNPqAcW/3Q= X-Received: by 2002:a05:6214:c22:b0:497:10a8:3067 with SMTP id a2-20020a0562140c2200b0049710a83067mr267440qvd.48.1661529423003; Fri, 26 Aug 2022 08:57:03 -0700 (PDT) MIME-Version: 1.0 References: <20220825085810.7290-1-ilpo.jarvinen@linux.intel.com> <20220825085810.7290-4-ilpo.jarvinen@linux.intel.com> In-Reply-To: <20220825085810.7290-4-ilpo.jarvinen@linux.intel.com> From: Andy Shevchenko Date: Fri, 26 Aug 2022 18:56:27 +0300 Message-ID: Subject: Re: [PATCH 3/5] serial: fsl_lpuart: Remove custom frame size calculation To: =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= Cc: Greg Kroah-Hartman , Jiri Slaby , "open list:SERIAL DRIVERS" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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, Aug 25, 2022 at 11:59 AM Ilpo J=C3=A4rvinen wrote: > > The number of bits can be calculated using tty_get_frame_size(), no > need for the driver to do it on its own. ... > struct dma_slave_config dma_rx_sconfig =3D {}; > struct circ_buf *ring =3D &sport->rx_ring; > int ret, nent; > - int bits, baud; > + int baud; > struct tty_port *port =3D &sport->port.state->port; > struct tty_struct *tty =3D port->tty; > struct ktermios *termios =3D &tty->termios; > struct dma_chan *chan =3D sport->dma_rx_chan; > > baud =3D tty_get_baud_rate(tty); You can move baud and join with the assignment, right? At the same time provide a temporary variable for bits here with the assign= ment. > - bits =3D (termios->c_cflag & CSIZE) =3D=3D CS7 ? 9 : 10; > - if (termios->c_cflag & PARENB) > - bits++; > - > /* > * Calculate length of one DMA buffer size to keep latency below > * 10ms at any baud rate. > */ > - sport->rx_dma_rng_buf_len =3D (DMA_RX_TIMEOUT * baud / bits / 10= 00) * 2; This will be left untouched. > + sport->rx_dma_rng_buf_len =3D (DMA_RX_TIMEOUT * baud / tty_get_fr= ame_size(termios->c_cflag) / > + 1000) * 2; And no strange indentation. --=20 With Best Regards, Andy Shevchenko