Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3994551imm; Mon, 14 May 2018 00:38:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqCF1ntXra/nsrJjModF55wFS+inizUULF/uyxdMVg+xUIx/ZpAvk16YE18rnsmtnu9T4tu X-Received: by 2002:a63:3d0a:: with SMTP id k10-v6mr7693551pga.11.1526283497567; Mon, 14 May 2018 00:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526283497; cv=none; d=google.com; s=arc-20160816; b=KhUWFejzs0JBNnWmByQ1h0CIPiNS9OYzAXvwqB4TsEKcsFIGF2SAL8SdA3GPqav40J 5V2SUlpr/oNz4Ou9Q3qNVbqOyLXDm6FPwcklt431NRwmymB0ad+y6ulcePjSxkOd+gs9 Xoc9vhAo2XThmj8Dl5GaAr2WrS3PXkmgcxaqUuDaXEEqNOv8BagpI0YlyRhkYmsHwEG3 EQOG0YgMNrxRA0bWF+JBZUFMtGD1C8y3AZwjooJwFBxJLeTPmdF50uBA3f0fVehp+47a H3/0BX5v2nuxOzYzbH/tOF4eYXPdrg8oJnl4nhT9JSpMjqbtR0bES5HD7Q4CZDUROvq2 5OVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:dkim-signature:arc-authentication-results; bh=aAAsEZMBE1z8+PC/IxQGz7JtTmJdRqWU9p1nM+6nRwQ=; b=OmpNgErYIAaiq2etaSIN62VCWunXnSPWNpBtCzuNQFiFWYwn3b/jRRCjs5AfgUlUEK /U6q0t6xRwSgmO/hgl3TyzMxCH9vWPVvld1kJPMOAWte4dPsvBjf7M80oYqTwKNUjTRf O3ObQkRSXNr5bX7xHhyE+5vhTQqYROArHQAnQUwW03cQO3wdPT1cNlHdRNtmsRudpHHK 8PFp3zdWk0VIgHwQywWm1Xqf8fMMM97rhLm8K7EWG9ttf7HzRfIi/AGRGBwo0OqyTcQL kdwoKL45t9F486KgQ6U8LDeg5TRMPUHnVMxNq/loOGb86pK+dooZcGSVVDYhJLn4Vp3D MsgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kapsi.fi header.s=20161220 header.b=v4F1LWB/; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r3-v6si8684824plb.336.2018.05.14.00.38.03; Mon, 14 May 2018 00:38:17 -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=@kapsi.fi header.s=20161220 header.b=v4F1LWB/; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753051AbeENHgq (ORCPT + 99 others); Mon, 14 May 2018 03:36:46 -0400 Received: from mail.kapsi.fi ([91.232.154.25]:33727 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752990AbeENHgn (ORCPT ); Mon, 14 May 2018 03:36:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject; bh=aAAsEZMBE1z8+PC/IxQGz7JtTmJdRqWU9p1nM+6nRwQ=; b=v4F1LWB/lL4vZe4fXRh2NIF/rSnWcK1VoeGqIp0jDtfZHVH8+pcB678fr0yvbzSOLCDuk5cLhW1DmV5XOfdg4QsJA4zk0D4OPUnccP6wduYkdT1zDBtuC6VhErsQ28WQHTv2pdTtkr9Bd39nv39Csqn+0fxc0gi+ct/4hPSE1ZKBx231m6KomYhJw/ilMugki22mIS2BDkphDmnGjQdMoip84Mba4EsMI92AbsmJdvn7jfe30D4PQalnLI0z+jr9xzkTmeqiviQwHbY/T47H8AgNUk1nx+GfLnPbC6dQ+vysRc02kghezVdZvXxUXxUk6golJUamFNYgpg5KTUDu9Q==; Received: from [62.209.167.43] (helo=[10.21.26.144]) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1fI82C-00065L-7U; Mon, 14 May 2018 10:36:40 +0300 Subject: Re: [PATCH 6/8] serial: Add Tegra Combined UART driver To: Andy Shevchenko References: <20180508114403.14499-1-mperttunen@nvidia.com> <20180508114403.14499-7-mperttunen@nvidia.com> <662ce972-56a9-9daa-d332-faa08b89c05a@kapsi.fi> 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 From: Mikko Perttunen Message-ID: <513a6287-9bb3-1441-b3ea-6866f2e74c99@kapsi.fi> Date: Mon, 14 May 2018 10:36:35 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 62.209.167.43 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14.05.2018 01:20, Andy Shevchenko wrote: > 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. It's my personal style, being explicit about unused variables in this way - I don't consider them ugly. But I can certainly remove them for the next version. > >>>> +} > >>>> + 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. I'll see if I can refactor it out. > >>>> +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. May be - it's just a habit, maybe from other projects where the warning is enabled. > >> >>> >>>> + 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. > Ok, I'll change this. Thanks, Mikko