Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2994435pxm; Mon, 28 Feb 2022 09:56:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyT1eIUdUjh9ruXbfcvArdl7g3bf8NUQ0A2JUzcpNMzK9jiodcdz2jK93mewj9o9y0Nb9c X-Received: by 2002:a17:906:9547:b0:6d5:b3de:11e2 with SMTP id g7-20020a170906954700b006d5b3de11e2mr16628915ejy.630.1646070989297; Mon, 28 Feb 2022 09:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646070989; cv=none; d=google.com; s=arc-20160816; b=CdN/L42V+/atZnfu3oUVIm448eX5RTL3nR65c9bztITosVFdfQtTPWve8zqBqnlrOx Qap8uUEMBIzcMR+R8FgUSQV0cesJUJC8QWqrxlMJfTlrXtrzm11Ralx4lR+J/MZB+3ms 3JCReyJLF4bO4xpDW4Vjajhc8SRI09CLrWMCQnfqk/gXJ5A69/a3sAZfYMgmdP2qReu+ 96EUs7YmdM/i6Px69HkS0+Yv1S6bCdz6h13mVl3g8wT5RsP9+0gUkd5uiF6a6WzhuO74 qrZYIQKl1eTTPCdWfR1xBmqw/gS0NoUUPcxWu/WyR1QgaSF+Ea2SXZz1R2wabj71cwn7 nAnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IRc/v5RBhjywblCaCu+qbO7MMR+S4MDqe0h9NB7l5U4=; b=trCl9nzmdCdiMHEYxv1/NHXpyRjfqTfVUz+umf7iv1ZodS3jxIxfkqA4+siHiaL+WY BJonjw3nmje8vtnYwKtS5PUaZlGotXuPFvRnpp9hdY/4vECMMGW9guv+Z+Ls2HBJLQj4 LpaWi85WeLVn648UivfCTbx9qOJJpRpRt5UMJECWaCPbyTi1TILc76ZsQW8j7xZLeRL1 cLhnFq8m8+p+4qMo8tUjXdboO0HYRKkkCcNlSvknPhIbenfDrpEx1JeuIbS8tRMz5Tdp Pir6thC+o1b6mgdXRRg4Oitow4ioRKgiw4cyhplxtMXpXTtchRz9OXIehoKLUSkoWxT7 PUag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qlvqPJLn; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a170906431700b006b4141761f1si6668978ejm.262.2022.02.28.09.56.07; Mon, 28 Feb 2022 09:56:29 -0800 (PST) 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=@linaro.org header.s=google header.b=qlvqPJLn; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237551AbiB1QRm (ORCPT + 99 others); Mon, 28 Feb 2022 11:17:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235727AbiB1QRi (ORCPT ); Mon, 28 Feb 2022 11:17:38 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0226870F74 for ; Mon, 28 Feb 2022 08:16:59 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id w27so22252908lfa.5 for ; Mon, 28 Feb 2022 08:16:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IRc/v5RBhjywblCaCu+qbO7MMR+S4MDqe0h9NB7l5U4=; b=qlvqPJLnwrw7v4sX5xzvIhieHQlASu2+KK8v/TE0ycWHA4g0hKZzF8AQIhmfPdWZ/X Jzr3qYL9R8XGmXmWplbuJrwDXWVI39bTF4/Ce2BAMfG22MYlXnGFR/PrcgwIwPvcrN4k nJ+HtLG6CeWccZEuOFd6WJ+ivGt0OKv4OUwjF2YB6CP2JpHE3nsVaJw9E01q3G39bD11 r3P0oixp2Bf7o+l6g7li6dfpheKa9NQMGZiiA3u1DC6S3V01K6hFVAgYO5YM7TXu8jnj 2Z/jwMgHEenqSLB5EzjYBm0EiVJrKCU4OgTSGnmmwqmPdNAOHT6Rk8ivhmSmkytAsIte AsTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IRc/v5RBhjywblCaCu+qbO7MMR+S4MDqe0h9NB7l5U4=; b=zduEEYN5MMB5ODCCGwFRe/RQSJzJy/Oz2d1EWJtC47Xb/O2Gu/xi2YCGtGo+RWBTB/ zb4AIzppa+QwBJABGi+OJp2wXkVoeuEp+8syJXmo3nV2+NlkhZYKiaVCBWJd3EFHYirT MZeuHohpHyd1wvr3ANJiidHh7S6QH9TF6Y3tYu/+tTY8ou0CsKd+kVbk58ZkW2OzqtAg QDpvkOTE/jXP1bg1h+I9yKeB1EzMlaAaDtnMyBFPFlZIclfiDGxL1rDtwDDFWinnvaiX 3JfRvE9CTlN+KNhxMg9u0Ayvw1f9JB1dJWLBF1+03v+cGbZbXqGU2NOm/PeqT3ujYtgO 19Rg== X-Gm-Message-State: AOAM533b8mAMT/4Bmtozj85WApIGBBYbG9uEVZRpKGrsLMmkXabUS0GW NNQpIl+tHvJnJ5gM+VLy/K8+UV279J5HBE2lZAQSQg== X-Received: by 2002:ac2:5de4:0:b0:443:5b80:d4c4 with SMTP id z4-20020ac25de4000000b004435b80d4c4mr13014007lfq.373.1646065016130; Mon, 28 Feb 2022 08:16:56 -0800 (PST) MIME-Version: 1.0 References: <20220224095517.30872-1-jslaby@suse.cz> <20220224095558.30929-1-jslaby@suse.cz> <20220224095558.30929-4-jslaby@suse.cz> In-Reply-To: <20220224095558.30929-4-jslaby@suse.cz> From: Ulf Hansson Date: Mon, 28 Feb 2022 17:16:20 +0100 Message-ID: Subject: Re: [PATCH 4/5] sdio_uart: make use of UART_LCR_WLEN() + tty_get_char_size() To: Jiri Slaby Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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, 24 Feb 2022 at 10:56, Jiri Slaby wrote: > > Having a generic UART_LCR_WLEN() macro and the tty_get_char_size() > helper, we can remove all those repeated switch-cases in drivers. > > Signed-off-by: Jiri Slaby > Cc: Ulf Hansson > Cc: linux-mmc@vger.kernel.org Acked-by: Ulf Hansson Kind regards Uffe > --- > drivers/mmc/core/sdio_uart.c | 16 +--------------- > 1 file changed, 1 insertion(+), 15 deletions(-) > > diff --git a/drivers/mmc/core/sdio_uart.c b/drivers/mmc/core/sdio_uart.c > index 04c0823e0359..e6eb5bd6e440 100644 > --- a/drivers/mmc/core/sdio_uart.c > +++ b/drivers/mmc/core/sdio_uart.c > @@ -250,21 +250,7 @@ static void sdio_uart_change_speed(struct sdio_uart_port *port, > unsigned char cval, fcr = 0; > unsigned int baud, quot; > > - switch (termios->c_cflag & CSIZE) { > - case CS5: > - cval = UART_LCR_WLEN5; > - break; > - case CS6: > - cval = UART_LCR_WLEN6; > - break; > - case CS7: > - cval = UART_LCR_WLEN7; > - break; > - default: > - case CS8: > - cval = UART_LCR_WLEN8; > - break; > - } > + cval = UART_LCR_WLEN(tty_get_char_size(termios->c_cflag)); > > if (termios->c_cflag & CSTOPB) > cval |= UART_LCR_STOP; > -- > 2.35.1 >