Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp2554678rdh; Sun, 29 Oct 2023 23:57:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRDFSdepq6d0tFN/mFxW3P3WQGabQFuXzD0RERwFQ+scAnbULka7NWN5a4wZyoXLT9cwiZ X-Received: by 2002:a05:6830:2693:b0:6b9:14bf:7097 with SMTP id l19-20020a056830269300b006b914bf7097mr10604355otu.9.1698649064779; Sun, 29 Oct 2023 23:57:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698649064; cv=none; d=google.com; s=arc-20160816; b=CtQHCbOf/LU6Td8uirx60nNB53bWRlglRzx0ind4yZG2jUeMPEHciFD/GAnHylnPgU 7TmRurWgneYSgTq6e2Cscm9Eo5xyJC3hZ7em3ksqGvzqq9yHjyWlnVkOiQ2OSgnjE9lg KAy80CmbM51UTRUuQM8T2Eqvm1u/E4QZ4cW2tFNWPot7BYIwn/zmKod1t6+f5MtZc0XZ sX3HdMVpJ5I5K4iwTcUcbYS/oC/4Y8gVY9AKM+Mqy+9bfQExdQCnK8AVppNhF7q1g6vT 32CmpA3yBMzCC3JFkg7AR2n7PsnTihVk0m1LPzJ2l+xZhHHUkR3XpRFw5yjIzJDlDTXU GDPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:content-language:references:cc:to:subject:user-agent :mime-version:date:message-id; bh=m29Lpsnchv+SLhsboWKoc8+kL8Yq7DtSoxfgk0klPSA=; fh=Dohtn8zJcMCIEnkl+6aNEtJyXLcnoEqLwY28K3Wa0As=; b=mhr84/ixhT1Z7sCjwOM8xPMnnqhIVcFnAbzlrwXYmszPXf+KIma/vp7RZffsOazuuH KrYs+z4ZZX/DjKOlCX0KeUJIZ/5cEeJgg2HBu6YM7WIhhOj31gr5E4/Ys5n/huh+W32K 76YsQxr7n5YhsKk5SmX3I9vpA/NTfcx145NWaQ6O7LyVZZBbE6RqXheM6+xgZX6y1v0E rn7q13tUThJuUHpFaUtG828u+kF3L4104pSKgJP7tXb8/FzXeBDii1wm0n8OQN0zm5tY yi6prWpafftVIJwTm7ZliaMBjwFhoRD0l4XxlhhyZBHQaj1WIHydrQ8yTfGuefUjYGUO PNOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id g22-20020a056a001a1600b006c081a3fe4dsi4555077pfv.259.2023.10.29.23.57.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Oct 2023 23:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 61DFF8051180; Sun, 29 Oct 2023 23:57:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232013AbjJ3G5e (ORCPT + 99 others); Mon, 30 Oct 2023 02:57:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231615AbjJ3G5V (ORCPT ); Mon, 30 Oct 2023 02:57:21 -0400 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D10FF7; Sun, 29 Oct 2023 23:57:10 -0700 (PDT) Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-32dc9ff4a8fso2595211f8f.1; Sun, 29 Oct 2023 23:57:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698649028; x=1699253828; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=m29Lpsnchv+SLhsboWKoc8+kL8Yq7DtSoxfgk0klPSA=; b=NGSaCb9sFeWlAIv0kuU3IIuy1U2UxgQ5+u75r1jpeFsPQ3XA426GtQUlfmbv2TufbN /GtkiqLCC+Y4Xi5QpiWIy0a/xuUwDgGs9yDJOatXj3AjfDQhIBR+9SPV0pveVIjdc2AD R4N3d/MXfljIb+eVe5VPm10tjx1/urfLThXa3MVKovNTV6Eio5oqPy7Fa9B3IeLzSfY0 tbCI7osg+fWboKEpRiojhjeb8bPbX8izNiGIm8NSnZ9e4V6MRhAaMaNcVy/MG7Ze42/B 6kftiMYNJI4n+9DCWpAzNY0RCjtAOYK3LHE5Ash5KXDVC0rp81RbbHjFPmo8eax54yJl qBoQ== X-Gm-Message-State: AOJu0YyXbF247bWrqm7NENSEdI8qOoP4YYYwf3e5D3400qRWQt7CFZvz A6Pkzir8+/kId+AIUNXUMa604UcjpDw= X-Received: by 2002:a5d:570f:0:b0:32d:9787:53b6 with SMTP id a15-20020a5d570f000000b0032d978753b6mr6336863wrv.44.1698649028183; Sun, 29 Oct 2023 23:57:08 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:59? ([2a0b:e7c0:0:107::aaaa:59]) by smtp.gmail.com with ESMTPSA id w16-20020adfee50000000b0032db1d741a6sm7493811wro.99.2023.10.29.23.57.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Oct 2023 23:57:07 -0700 (PDT) Message-ID: <52c48e40-0c1e-48ff-9ff0-3dbca4b04f91@kernel.org> Date: Mon, 30 Oct 2023 07:57:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] tty: serial: Add RS422 flag to struct serial_rs485 To: Crescent CY Hsieh , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org References: <20231030053632.5109-1-crescentcy.hsieh@moxa.com> Content-Language: en-US From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jwlvuwyfo5mh7w5iMfnZE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pyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20231030053632.5109-1-crescentcy.hsieh@moxa.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sun, 29 Oct 2023 23:57:42 -0700 (PDT) On 30. 10. 23, 6:36, Crescent CY Hsieh wrote: > @@ -1371,11 +1371,26 @@ static void uart_sanitize_serial_rs485(struct uart_port *port, struct serial_rs4 > { > u32 supported_flags = port->rs485_supported.flags; > > - if (!(rs485->flags & SER_RS485_ENABLED)) { > + if (!(rs485->flags & (SER_RS485_ENABLED | SER_RS422_ENABLED))) { > memset(rs485, 0, sizeof(*rs485)); > return; > } > > + /* Pick sane setting if the user enables both interfaces */ > + if (rs485->flags & (SER_RS485_ENABLED | SER_RS422_ENABLED)) { This would have to be: if (rs485->flags & (SER_RS485_ENABLED | SER_RS422_ENABLED) == SER_RS485_ENABLED | SER_RS422_ENABLED) But your previous version: rs485->flags & SER_RS485_ENABLED && rs485->flags & SER_RS422_ENABLED looked better in this case. thanks, -- js suse labs