Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp519111rwe; Fri, 26 Aug 2022 09:07:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR4kpNOOR6zvBuQwgJ6uBl1C4yhmcHcQIhRuD+j+MCM3bYEJBYRFjqHDZE2zwJwmh5mw7PiW X-Received: by 2002:a17:90a:c782:b0:1f7:a6cf:2f41 with SMTP id gn2-20020a17090ac78200b001f7a6cf2f41mr5128012pjb.128.1661530056835; Fri, 26 Aug 2022 09:07:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661530056; cv=none; d=google.com; s=arc-20160816; b=kBqL5V3NhR+qVlyM0UW4LDyweFfdmnB6/w4XSgCwOpXcW3JEo/JeuqE4+S4cqZan8X A17h1NyHM0db/7ybSVW/jvYtvjhyoNnDlYkMFlRBvlVRy2XefFnYS0Hw5+gbOILvfm59 4x5+9oL9TfFfdaI5MI8QTegH9PXF1KYSJ0YLV4IQBq8ynRHMQJV+L+jz/Odrfrqo1o6y cgl2gQx7WrCe7a9jwmIYoNuNMixrP4EGzkMMIy9rSSf24bJyIm7mZDy3rzoNPeANufLo CIBYR283wR5lJgCtabIzG+YcrncsctvuwJTvHsy+TEsYd2yOjRQu1IGHUjJS/RV2S4jC 7bwA== 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=VoZZLFDbWcdv8jm5ypqJnq3zDL5dbLMry5IM4+TKOHU=; b=J/rugoEZXcDV3vC6jztIBOvdsocK3XnhB5AljJGxWAeT3SQCFhH1pNjEpTqFFyP09Q Rt4Ud3tx78HUNwzR7py+saLut9FRpPQF604wH/CszrZmibvrW86Iwg/4fyXdKyWcEWxx +rRYk1NKAOUxCmNJSgREjk/F/WJ/CfTXIh+NrfHDsXacZcAfiINKl+3zwINxnJ/pg2e5 lxD0TqSUTbLlDj5lVvYT9lSJI11usD16URCyZ/Wx3JB3RAu50EJ2EJ6cgnn9hfwwSDNL z/ZHp5yFI2Btd+fDuLFofmKRlaS3G5OJuTj6sHeASwcWJ9xPHLb9nTDotHzauBjjurh2 jHig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RZWfljlS; 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 d15-20020a170903230f00b0016ee3b6681esi2016387plh.75.2022.08.26.09.07.25; Fri, 26 Aug 2022 09:07:36 -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=RZWfljlS; 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 S1344636AbiHZPyh (ORCPT + 99 others); Fri, 26 Aug 2022 11:54:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344606AbiHZPyc (ORCPT ); Fri, 26 Aug 2022 11:54:32 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA441D076E; Fri, 26 Aug 2022 08:54:31 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id f4so1419481qkl.7; Fri, 26 Aug 2022 08:54:31 -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=VoZZLFDbWcdv8jm5ypqJnq3zDL5dbLMry5IM4+TKOHU=; b=RZWfljlS2yVC7jjEUkW2mCrFIs87PdpSGPxhOzMEUQ/nOdUtXO7EVRhu6PlQbgfoyQ o0ynanbHMIkqYmxYfn24DyXGzAoZ+Gfoa/3piKJOFOx5e/e6YxRhhZhpxAzdGyB9VXp/ cIb/iUcPrBiUl66uQR5c8rD6HLvlQcbuvhAEsXSRx0MDD8Az7IAV7vy3j+jdaeoPbZ4j rodnmGgwyg+zsobw0x0mkMPwzSXz8CMg9noZhgq3Jw1hWEQ8kDgD0AMsCQ9UCbh8+x2K eMaM/FLtU730nYNwKgxNe4Ei27zg3ZtYnvm8nzPacW9Zo2ZvC1NxhI6YhthBGuuXk332 6zLg== 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=VoZZLFDbWcdv8jm5ypqJnq3zDL5dbLMry5IM4+TKOHU=; b=nqcy6qv/sfciNtL2xxJet2bfYPyAIn48E+RP4hYFPAyioVAS8gRJxix6iE8YU0PIvI bRxzdZkaFIuAjYrPmTsPm7qEPbrV1mJStZopcq5ocDuIGhgjGIeqWIjnenVasZuV9toO RU63pM0lxdRQbFBIFOs3EHz3PseanEF5an+6pgfaSODUL4Dta1YtktTb4U8UlwGt6dYK 06+jmWhElsqFlzPbC0Yv/5T+WhPNR8tfG+hWBuNnaiXSNVlNqe/0xLLN7ejyq+7IDo5e oBrSc4JV38RqVaoyIF6/h3o5/nPxDuOGjGV/lASBVjxng3hoorFQNchx2c4TDbHJ/Okt fMvA== X-Gm-Message-State: ACgBeo2Qi8qhr5HBig13rPVHizm6PmKODxAp+eFHhxlno+e/cbZG3o7/ SAYIwhfpMUAdh9PX8lTew9LhmkkhRr3nhbYgZ8qwYki+Foo= X-Received: by 2002:a05:620a:2987:b0:6ba:dc04:11ae with SMTP id r7-20020a05620a298700b006badc0411aemr252697qkp.748.1661529270876; Fri, 26 Aug 2022 08:54:30 -0700 (PDT) MIME-Version: 1.0 References: <20220825085810.7290-1-ilpo.jarvinen@linux.intel.com> <20220825085810.7290-3-ilpo.jarvinen@linux.intel.com> In-Reply-To: <20220825085810.7290-3-ilpo.jarvinen@linux.intel.com> From: Andy Shevchenko Date: Fri, 26 Aug 2022 18:53:55 +0300 Message-ID: Subject: Re: [PATCH 2/5] serial: cpm_uart: 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:58 AM Ilpo J=C3=A4rvinen wrote: > > The number of bits can be calculated using helpers in core, no need for > the driver to do it on its own. > > The mode register is programmed with frame bits minus 1, rearrange the > comments related to that "feature" closer to the actual write. ... > + out_be16(&smcp->smc_smcmr, smcr_mk_clen(tty_get_frame_siz= e(termios->c_cflag) - 1) | > + cval | SMCMR_SM_UART | prev_mo= de); > } else { > out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_f= ifosize); > out_be16(&pinfo->sccup->scc_maxidl, maxidl); > - out_be16(&sccp->scc_psmr, (sbits << 12) | scval); > + out_be16(&sccp->scc_psmr, (UART_LCR_WLEN(tty_get_char_siz= e(termios->c_cflag)) > + << 12) | scval); Seems it's better to calc it beforehand in the temporary variable for both branches of the conditional and fix a bit strange indentation here. > } --=20 With Best Regards, Andy Shevchenko