Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3590708imm; Sun, 13 May 2018 15:22:22 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpVuKnMj+3mQoV5Dq2mKoRTRJQ2YSQMrqMl5SdY6VLPir6FWoKFWJFm5YIYUSDrK5ZHyxjk X-Received: by 2002:a17:902:bccc:: with SMTP id o12-v6mr6569969pls.56.1526250141973; Sun, 13 May 2018 15:22:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526250141; cv=none; d=google.com; s=arc-20160816; b=C2ERywDbgZ0lnUZO6NHptlfad0+Msg4Xq5tHBj8Q90ikNkiELkdmycYZtghG0L7ZHX X2oNA/8l+oR4ktkXbHwXp/M6EG4vQv9hIXP+iV79tUMCslsLV1ybfQqypKu/toz8e2UY tel8jW2f9YohplzO+2k3utwI9COYdykAkrJ1wDPfZLnds0qo0JcLAXDAvWzDm+AicoKC K5irECaOTgkVCUdsMgQ/L6USta+atJj8M6TvQ/heEe1B14RMaBS5e/5njWEWmyWCw3eo G/kPcT2XvgVjkcZ62egF3VGHMKK2pZ7J8SIHhJCU+XSy7YTh94Ilw1RH/S+KGV51/PdD Ah2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=DupyX5oikYw5MGNsSyGeUnsWzCZ8WEB2sOBs8PaEYRg=; b=qDvDiurLjtYG2Z6c400qO8It9VzE6Ziz3gYFmaw4scEUGGaBlPtRqRZ4tD1UkIrpet DoMRzscTCXSaB9vdty6vY1QTld+ZG2q7zvkhVw7sCHo/fDcFz90/lLNzZtdbvKVsetWO AaOmOh6WFc7t1cTdbEJa4OH/cHoGUNbrtnwU38UHSFe41DawnWc/lMxYieY4MjJxLyki 5KDOZNrt0RmI0cTQFSspCXLKktGXEWPlq3aeVD+Nx0V74nKygZGF20LG3hobhAECxmIi AWTGt8PQRLSyxZEgNa+6XZmAgelqSgdlk2Q1Mi++8RF4R58FdjpaeN0rp9fGq4j7cgdV xfMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oE6156w1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si7597267pls.289.2018.05.13.15.22.07; Sun, 13 May 2018 15:22:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oE6156w1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1752059AbeEMWUM (ORCPT + 99 others); Sun, 13 May 2018 18:20:12 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:36442 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752022AbeEMWUJ (ORCPT ); Sun, 13 May 2018 18:20:09 -0400 Received: by mail-qt0-f194.google.com with SMTP id q6-v6so13856551qtn.3; Sun, 13 May 2018 15:20:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DupyX5oikYw5MGNsSyGeUnsWzCZ8WEB2sOBs8PaEYRg=; b=oE6156w1QmMKN+n0GQiS328gHIpRgVLnnqwB5HzwI8hnfZhfFw8iu9RSq7ZSxTy+py NDL4wdMHIePW07caa8lXwsS8TvhHYco4DhMnu/N08vLFNAi6F6yq7gqemvPBd+eBSLD0 o2E7d6ObvLvAHysjg8548RaSXaDCCGIxJzkpvG1XiCxndnV2O6RedrCf5LjcYO90kn58 0X/c0h+Qz7nGtxy0+X5JpijSFmpYRmOmc/aY5k1fvWPLxwQXvq+24eGeABX5Ykd9LOlS WpvvcbpFib3zRNFkTjMDVmp9x356j2Hz4TPugZovoJ7Uow1rYVpyh1NNaN/LRLxBK9hA dvdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DupyX5oikYw5MGNsSyGeUnsWzCZ8WEB2sOBs8PaEYRg=; b=L9LZr9pk6dv0qhi64pVpYFuMAlqsz8FDvGSO1cfyNT8axwaSNbT3EWkxFy/PpCM/kW Oo+Qs4HPyniiBWKoY9eDJcOK+SxVMUHRi2KTwf3Uo9affowWm82P38ExMym5ywm5P8Bn F+Y6x9DGUYP+Qnc1WzhlPvDyKPxtyC9N9IfrvGVTXJMAWcPQS2MYAAHl5GoZdg0g5KQT 3POHLgXkNLAceHrXs/SFFGueUIqyuEngevojYE2s5IExF5qa4i2pcS53e3gPqbeXFpDX h2UC5RzA2TRwADxV3KI4zK733XB/YmY5c+GGA3AG8UwGFQ3/cz96C0qgC/T7xxuLjDJg 1qZQ== X-Gm-Message-State: ALKqPweyYhIiVcYd8Ifg83vfn2mV1TjC3KKt+TKlq+VRaAgmD5EGohit CS8ouc4LweLqALat98IMh6BRBT1j5ih0cQg554M= X-Received: by 2002:a0c:f88e:: with SMTP id u14-v6mr6668033qvn.61.1526250008427; Sun, 13 May 2018 15:20:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.12.152.150 with HTTP; Sun, 13 May 2018 15:20:07 -0700 (PDT) In-Reply-To: <662ce972-56a9-9daa-d332-faa08b89c05a@kapsi.fi> References: <20180508114403.14499-1-mperttunen@nvidia.com> <20180508114403.14499-7-mperttunen@nvidia.com> <662ce972-56a9-9daa-d332-faa08b89c05a@kapsi.fi> From: Andy Shevchenko Date: Mon, 14 May 2018 01:20:07 +0300 Message-ID: Subject: Re: [PATCH 6/8] serial: Add Tegra Combined UART driver To: Mikko Perttunen Cc: Mikko Perttunen , Rob Herring , Mark Rutland , Jassi Brar , Greg Kroah-Hartman , Thierry Reding , Jon Hunter , araza@nvidia.com, devicetree , "open list:SERIAL DRIVERS" , linux-tegra@vger.kernel.org, linux-arm Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 13, 2018 at 9:04 PM, Mikko Perttunen wrote: > On 05/13/2018 05:16 PM, Andy Shevchenko wrote: >> >> On Tue, May 8, 2018 at 2:44 PM, Mikko Perttunen >> wrote: >>> >>> The Tegra Combined UART (TCU) is a mailbox-based mechanism that allows >>> multiplexing multiple "virtual UARTs" into a single hardware serial >>> port. The TCU is the primary serial port on Tegra194 devices. >>> >>> Add a TCU driver utilizing the mailbox framework, as the used mailboxes >>> are part of Tegra HSP blocks that are already controlled by the Tegra >>> HSP mailbox driver. >>> +static void tegra_tcu_uart_set_mctrl(struct uart_port *port, unsigned >>> int mctrl) >>> +{ >> >> >>> + (void)port; >>> + (void)mctrl; >> >> >> Huh? > > > The serial core calls these callbacks without checking if they are set. They > don't make sense for this driver so they are stubbed out. My question why do you need these ugly lines? I'm pretty sure no other driver with stubs using such style. >>> +} >>> + if (written == 3) { >>> + value |= 3 << 24; >>> + value |= BIT(26); >>> + mbox_send_message(tcu->tx, &value); >> >> >>> + } >> >> >> (1) >> >>> + } >>> + >>> + if (written) { >>> + value |= written << 24; >>> + value |= BIT(26); >>> + mbox_send_message(tcu->tx, &value); >>> + } >> >> >> (2) >> >> These are code duplications. > > > Indeed - the length of the duplicated code is so short, and the instances > are so close to each other, that I don't find it necessary (or clearer) to > have an extra function. It makes sense. Consider to refactor other way w/o duplication then. >>> +static void tegra_tcu_uart_set_termios(struct uart_port *port, >>> + struct ktermios *new, >>> + struct ktermios *old) >>> +{ >>> + (void)port; >>> + (void)new; >>> + (void)old; >>> +} >> >> >> Remove those unused stub contents. > > > Sure. I had these here so that we don't get unused parameter warnings, but I > can just as well remove the parameter names. What warnings? How did you get them? We have them disabled as far as I know even with W=1. > >> >>> + return uart_set_options(&tegra_tcu_uart_port, cons, >>> + 115200, 'n', 8, 'n'); >> >> >> Can't it be one line? > > > It would be a total of 81 characters in length on one line, so no. So, yes. 1 character doesn't prevent us make the readability better. Please, put to one line. -- With Best Regards, Andy Shevchenko