Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp847933pxv; Thu, 24 Jun 2021 23:02:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqQ/MBTzOAGE8CyKqG7JCiKz7aLvtIZPdlnvyakrMNAEZHTID0wPtWGGG1+XClUFmE4/vo X-Received: by 2002:a02:cc52:: with SMTP id i18mr8039687jaq.47.1624600949366; Thu, 24 Jun 2021 23:02:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624600949; cv=none; d=google.com; s=arc-20160816; b=Js8oB41a3JN5L3ky2CTec4XMnK8C0BZcYnF9YJUW1IeEpdQqsPWl969D5RnHvaIa17 e9T2CfA8C7JTbPy1m4ORhgZeeq4vDnIyoxE5kS8qM8yttHk1A7X4nm4O8wg2wlXmb+Vl 1+rR1E84Hf/ymUjlobNr02ZkGRGwLnhJz2gV6myoqWCJI+nMZCJWCQHbrn9eKUFMM0lb kmowJQs826DiD4Hy+3ozmLkcaK5uUrnAnnmBJezRFABZKDo9bD1Y+4NxauzvNOP6oaIi i0XQvdK3vxtWdBenCjB2DrbzWGjw+KI+fxNFzgCnoblnPLg9yNUl1Kbs5BGXJM5+FInS gPGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=a2BnCJpAPmMnW016bHj05vszYD4Yd+B9qTL6NPUz9K0=; b=wr2hlShFdEY37G0GKLP1qgKylp7nHdRS8v6sdnuHK1uLG1XmieXsIqePrXADUkDOLk DcwJmmxlEhkmAAj+ftDsAs5LeVXBaLw3BcsTh9ZBzmF8rTGwq1QEcaflKhYq03Cv3Wbh pz0sz0Bi9/hVWajhVFYR9XaF7WyVPaiFuiEMHyzsd+33/5Y9A7fsleLkO5a/QY5qsZY0 s21uliL+iV+LbmrloyOU/2nLTA3t7NlJLLlFRBq8VtBwcV4sqVxHRygEG3ws1Qk8mJmE d8QHePYSuc7xvAIRewK8iKy0Dgw5FmVsWkyPB3RH04QHO9sVCoCMJMZK/lOaDTGXZamP Ksbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si5627508jaj.103.2021.06.24.23.02.17; Thu, 24 Jun 2021 23:02:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230404AbhFYGEA (ORCPT + 99 others); Fri, 25 Jun 2021 02:04:00 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]:41751 "EHLO mail-wr1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbhFYGEA (ORCPT ); Fri, 25 Jun 2021 02:04:00 -0400 Received: by mail-wr1-f47.google.com with SMTP id f15so9245463wro.8; Thu, 24 Jun 2021 23:01:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=a2BnCJpAPmMnW016bHj05vszYD4Yd+B9qTL6NPUz9K0=; b=KU2rYbWUY7WKqPEZxG+rzyKN7/JAye/vW7WVNPzmcw2JvhGUhJLxtlIR1EjoCcFcvk 4BpoiJXuGfoCy750xKuIwOTk/Zg6ZWaVpdsInCIyrwIpsLmxgloLmoHO4iqoz/NoiCO7 u/sx4+f3s8zqnWlAcOulpqBLmFbWMWrTvdlDc13QAWaLqkAEHo5EkTZEzXDj3u1OM+Sd CpQy8ejIxTViA+06D10TE20CLBNVxR/Y959Y/QR1YKRY8WRV08qn80WX4PvvA4BWTrLl zj66KVK3Q8aS1/U7KTlclPhBFqq3vFCVTvT4MqUnIL1+t5/b7FYyj3fVSIu0updnXFI8 QBzg== X-Gm-Message-State: AOAM531X8WFth3gnTsaoG8cgix0h1us9zgakMd8CA+uZIVJS5RRkwH+q r2zpq/wxX3IzK8bsOck/OE57sTjugfM= X-Received: by 2002:adf:ef0d:: with SMTP id e13mr8723147wro.155.1624600897617; Thu, 24 Jun 2021 23:01:37 -0700 (PDT) Received: from [192.168.1.49] (185-219-167-24-static.vivo.cz. [185.219.167.24]) by smtp.gmail.com with ESMTPSA id o2sm5130226wrp.53.2021.06.24.23.01.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 24 Jun 2021 23:01:37 -0700 (PDT) Subject: Re: [PATCH v2] serial: amba-pl011: add RS485 support To: Lino Sanfilippo , Greg KH Cc: linux@armlinux.org.uk, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210618145153.1906-1-LinoSanfilippo@gmx.de> <5d7a4351-2adc-ea31-3290-91d91bd5a5d4@gmx.de> From: Jiri Slaby Message-ID: Date: Fri, 25 Jun 2021 08:01:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <5d7a4351-2adc-ea31-3290-91d91bd5a5d4@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25. 06. 21, 2:15, Lino Sanfilippo wrote: >>> +static int pl011_rs485_config(struct uart_port *port, >>> + struct serial_rs485 *rs485) >>> +{ >>> + struct uart_amba_port *uap = >>> + container_of(port, struct uart_amba_port, port); >>> + >>> + /* pick sane settings if the user hasn't */ >>> + if (!!(rs485->flags & SER_RS485_RTS_ON_SEND) == >> >> Why the !! in an if statement? >> >>> + !!(rs485->flags & SER_RS485_RTS_AFTER_SEND)) { >> >> Same here, why? >> > > This was copied from serial8250_em485_config(). But I think we can simply use > > if (rs485->flags & SER_RS485_RTS_AFTER_SEND) > rs485->flags &= ~SER_RS485_RTS_ON_SEND; > else > rs485->flags |= SER_RS485_RTS_ON_SEND; > > instead. I will adjust the code accordingly. This is different. You want to set ON_SEND when none is set. And unset AFTER_SEND when both are set. In your code, when both are set, you leave AFTER_SEND. regards, -- js suse labs