From patchwork Tue Mar 8 08:09:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773230 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 40731C433F5 for ; Tue, 8 Mar 2022 08:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/KHmeCK1PK2Zm5o014/k0DcqMVevQiiaGYkWSF0KWlY=; b=XEOpkMuQsmBrFL ZpzX7IYswVJSg+VfNGL15IPT5CQCl3lvir6/qylbjTcuNjPN2/7Kfj/AqBZqlcQgn9Ljiq/vGTNxU yej0ivmxQqyf6OKEB124kKir7anXXZLZBgFL236crWc8LtwJ0J5FHz/HfZO6hKmVTm1VaPylsSG89 471k+bxFzupdz4F9NmTwz/5bhKqpdJw40fBidPpT8XsR2KVatR3Mc0nKzko8bM8zRCrmCts+Cugau +EQrDpo7uu0qMQOc/hqC837UqREBT3qLNMCYm8wopCFt6Zuqluy03dyrPZwhnF5zb5SAWo5lyzwE/ e2F4sMtPBgigXPv7F1Pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUua-003A1w-So; Tue, 08 Mar 2022 08:09:41 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuM-0039va-68 for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:27 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id D940B3F61D for ; Tue, 8 Mar 2022 08:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726964; bh=Dwp/aQOBQEXJT+052j4TYlKoFTeM490hQz5ZQ8IolK4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ga3GPsOFNsS5up1jCcOmGAT7iFyTwaSprsPZdJfPu1lruXQvTNmFPCnCNCi4fb/y1 /XRLDxK7T0xuy1vehluyhG2Un1697A0w3dLcarIdrVN0VAOO4DxbaZ9LljSDpEe0H1 p+7+WgsbfHb8OJqopoJXJjTwqMKaHz7Lh4HvjxkLXa46aYCfn2cubb5w69hQttMWX/ f8A2t+LbuDnvc0y/8g6TwN5PF97SUfhhP8KHMwzdp65toHg6LYM9AraRQWpHESUFj8 yViGq0L7B+YayjZtG6WeM9pUS/7sdr+u5nrGH5uQoPVDiFEe4LXxfPHGg8/HizyJgG fdalovUvcpT6A== Received: by mail-ej1-f70.google.com with SMTP id d7-20020a1709061f4700b006bbf73a7becso8242122ejk.17 for ; Tue, 08 Mar 2022 00:09:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dwp/aQOBQEXJT+052j4TYlKoFTeM490hQz5ZQ8IolK4=; b=eyxCiTRoBgIsb/jwP1PgMY+rM2b+/kwRA/UrGnDJHxdWMergRVfMpt8utcLkawhXnv 3wN5XW3RQFxe0vzRfh0jbpuSolTf6fovLFpiJyDZz3RtRGHHahcmzddLyseLk3LvKlTY Y8hBsryQMDGFkY3biisoVN0fT3qUj8mqtu9GX41HUIFRYeK94KAcQpioXJU+6DQiD2Jj yiYdwl8+ztv4GhfvO3M+doggStsv4BUdtMtC75z0g3Kd6EScSoT2uD5tc5mORV5Agbir Bn0cLPocuSnBA7K7laGRM5k3KFLK+gmp5PSpT5xi/y2IusYPJj+9AP/TfnLl88MEnF/+ S83Q== X-Gm-Message-State: AOAM530xj744Y0ilsxMv2+hd1rbu1W/QRhjDWDrAOu2JSQp/KRqOkSiA RkKJT5BUiyNjBLxRDtfFSxIqNZ/kPy0YO0YIReI74csIDWxKIHWSZktnnxz44Lc/kRQ5XrXUa4G 30wh3E1/IAt+Mk0tPF7j+P3GMMz6kVIhpmKzwBiY221/LqoM4dt9k X-Received: by 2002:a17:907:8688:b0:6d2:c19:e1a0 with SMTP id qa8-20020a170907868800b006d20c19e1a0mr11801073ejc.249.1646726963530; Tue, 08 Mar 2022 00:09:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQGA9AtYeOF5o4ZCAtjuIHASbFdPaBaVMJaKdXkELr+T4yRLutynO8tWxKX7iXVrYNqK6kmw== X-Received: by 2002:a17:907:8688:b0:6d2:c19:e1a0 with SMTP id qa8-20020a170907868800b006d20c19e1a0mr11801059ejc.249.1646726963335; Tue, 08 Mar 2022 00:09:23 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:22 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 1/8] tty: serial: samsung: embed s3c24xx_uart_info in parent structure Date: Tue, 8 Mar 2022 09:09:12 +0100 Message-Id: <20220308080919.152715-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000926_383093_E137FE83 X-CRM114-Status: GOOD ( 17.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Embed "struct s3c24xx_uart_info" directly as a member of "struct s3c24xx_serial_drv_data" instead of keeping it as a pointer. This makes the code clearer (obvious ownership of "struct s3c24xx_serial_drv_data") and saves one pointer. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index d002a4e48ed9..aa5678d03704 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -85,7 +85,7 @@ struct s3c24xx_uart_info { }; struct s3c24xx_serial_drv_data { - struct s3c24xx_uart_info *info; + struct s3c24xx_uart_info info; struct s3c2410_uartcfg *def_cfg; unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; }; @@ -2197,7 +2197,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) } ourport->baudclk = ERR_PTR(-EINVAL); - ourport->info = ourport->drv_data->info; + ourport->info = &ourport->drv_data->info; ourport->cfg = (dev_get_platdata(&pdev->dev)) ? dev_get_platdata(&pdev->dev) : ourport->drv_data->def_cfg; @@ -2616,7 +2616,7 @@ static struct console s3c24xx_serial_console = { #ifdef CONFIG_CPU_S3C2410 static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C2410 UART", .type = TYPE_S3C24XX, .port_type = PORT_S3C2410, @@ -2644,7 +2644,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { #ifdef CONFIG_CPU_S3C2412 static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C2412 UART", .type = TYPE_S3C24XX, .port_type = PORT_S3C2412, @@ -2674,7 +2674,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \ defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2442) static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C2440 UART", .type = TYPE_S3C24XX, .port_type = PORT_S3C2440, @@ -2704,7 +2704,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S3C6400 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, @@ -2733,7 +2733,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { #ifdef CONFIG_CPU_S5PV210 static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Samsung S5PV210 UART", .type = TYPE_S3C6400, .port_type = PORT_S3C6400, @@ -2762,7 +2762,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { #if defined(CONFIG_ARCH_EXYNOS) #define EXYNOS_COMMON_SERIAL_DRV_DATA() \ - .info = &(struct s3c24xx_uart_info) { \ + .info = { \ .name = "Samsung Exynos UART", \ .type = TYPE_S3C6400, \ .port_type = PORT_S3C6400, \ @@ -2811,7 +2811,7 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { #ifdef CONFIG_ARCH_APPLE static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { - .info = &(struct s3c24xx_uart_info) { + .info = { .name = "Apple S5L UART", .type = TYPE_APPLE_S5L, .port_type = PORT_8250, From patchwork Tue Mar 8 08:09:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773231 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AFB23C433EF for ; Tue, 8 Mar 2022 08:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3y1WGacrXrmgeMgVD6ILVqs0MDJHshorXEewpeVOCdI=; b=XkWAMXqXpcObCo Cph2B6Q2XDdD3pe9xc1IHpHJh4A0s5glJO1rKqKR4lxfIKyWUWRhoQz3bm0USzDjNJmiiMfmhf5eE jA0cf4Jk9tUKQAc6BsdGi1nuGikmR/3oiP7hRKIJismr6Yxxa5p5LzkGHoLQZLFCBB+piebm+Rbrr Gijkktj7H3MBKmJYsrqx/3y1MzTdVw8Tx1G77HVD7QiJWxBS1hNboeDSBvUU+Ot5+ibsGSmYBm39p Pi4mMYoVNiYNqSgOGWirjiSXYSChh9D4xfZMrIxSkuGeNQKGWFsngOkDevCWrK23HudgSes2AVNbI 3KACK46tEFms8hYdSjOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUum-003A5H-3Q; Tue, 08 Mar 2022 08:09:52 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuM-0039vo-Bs for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:27 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 22FBF3F621 for ; Tue, 8 Mar 2022 08:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726965; bh=RaO5N5+xpc6qv0C5C+2+SP0aJMALLkB4br4l3fJLsRI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BdgUOyLggHdP9lzIgR65TSCLNFsbrhCJxfwBq9I+iSu1TljH75CFwmoH4zwRfHknE 91DaYOqkWzQca3UfMc0wgNFDbmUtNptGs9E1oy2Mo4XKcJCYrj+1whz7DoYnY/nybz XcUxP5cf9mwfKEGumdk9wbyV3/zCaFOCrjXGjWClNVgLMkvQXT4Is5W2bnYIEuWLmc jxCjPFnNElUfo/TH6fM8QltQ3UpXsdovC5Y7iIZvlB4Fx2LpmjQoKHNxq2aO7Nh2Jf r59g/PifU2Sy0KMemr7Docc8q2tTKfjvmecG79Npr14oZi4F+PeOHYwCzQQA4ENVzt 7zJFKdQVCQuUA== Received: by mail-ej1-f72.google.com with SMTP id go11-20020a1709070d8b00b006cf0d933739so8248098ejc.5 for ; Tue, 08 Mar 2022 00:09:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RaO5N5+xpc6qv0C5C+2+SP0aJMALLkB4br4l3fJLsRI=; b=6rjWFQhJtlV/9y7Br85mQlgRODrac30xsUWxZk1M6FAO1nkO9NHt5rTjIwYi1jqlI3 jlxtKScWWG7ucQBmXOB9ZlmLu4fS6kJPVM34RhS/htNHqBdZ7yzWJQEP59rMY/NNkd4W CSetHq/+aRtHwmZg3JWG6zuvGTmEEdUluDb7T3HOEYWfD+W8UhI2TLelSPtjPs8GbK+1 UNaYBkuEsMk47SKLZfgUuUon2gl0zlp+0BRBsxgE/d+rmZ6gnGTD4z4HKorguAcpChoX FtCSnHyOoKBMm00eoTCtAz135nPoJgwviKekhHoSxizinR8EV+LomeR0jsblghkpkqAJ iCTQ== X-Gm-Message-State: AOAM5310quxFLk8g3VJaAVY8Fz+w/jv5kzroVBOf4k1JsFYEUPgSiCPr sPe/foRIidu4bVApobhVi7Wr2azY7CorYXEuUxwdD3ZIOb7vCRa6tuY4JqY0BNqLyXxTX1BnTc2 T5kp+VBCzTIy7T9qEOo+9xXG/MIno9grJRXOD4a8Tub9ZN5L/DgmO X-Received: by 2002:a17:906:7d83:b0:6ce:fee:9256 with SMTP id v3-20020a1709067d8300b006ce0fee9256mr12751418ejo.647.1646726964792; Tue, 08 Mar 2022 00:09:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6SJAGGC/ezAoZpSp4TpDtyzbSfuJ1xdN0lOAmzmlE3wQWBFRDDMvLFPw6x2SrFrtTdkAZ4g== X-Received: by 2002:a17:906:7d83:b0:6ce:fee:9256 with SMTP id v3-20020a1709067d8300b006ce0fee9256mr12751408ejo.647.1646726964615; Tue, 08 Mar 2022 00:09:24 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:23 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 2/8] tty: serial: samsung: embed s3c2410_uartcfg in parent structure Date: Tue, 8 Mar 2022 09:09:13 +0100 Message-Id: <20220308080919.152715-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000926_558953_08A4C8DA X-CRM114-Status: GOOD ( 16.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Embed "struct s3c2410_uartcfg" directly as a member of "struct s3c24xx_serial_drv_data" instead of keeping it as a pointer. This makes the code clearer (obvious ownership of "s3c2410_uartcfg s3c24xx_serial_drv_data") and saves one pointer. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index aa5678d03704..a9a75b5b9705 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -86,7 +86,7 @@ struct s3c24xx_uart_info { struct s3c24xx_serial_drv_data { struct s3c24xx_uart_info info; - struct s3c2410_uartcfg *def_cfg; + struct s3c2410_uartcfg def_cfg; unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; }; @@ -2200,7 +2200,7 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) ourport->info = &ourport->drv_data->info; ourport->cfg = (dev_get_platdata(&pdev->dev)) ? dev_get_platdata(&pdev->dev) : - ourport->drv_data->def_cfg; + &ourport->drv_data->def_cfg; switch (ourport->info->type) { case TYPE_S3C24XX: @@ -2632,7 +2632,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .clksel_mask = S3C2410_UCON_CLKMASK, .clksel_shift = S3C2410_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2661,7 +2661,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .clksel_mask = S3C2412_UCON_CLKMASK, .clksel_shift = S3C2412_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2692,7 +2692,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .clksel_shift = S3C2412_UCON_CLKSHIFT, .ucon_mask = S3C2440_UCON0_DIVMASK, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2721,7 +2721,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .clksel_mask = S3C6400_UCON_CLKMASK, .clksel_shift = S3C6400_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S3C2410_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, @@ -2749,7 +2749,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .clksel_mask = S5PV210_UCON_CLKMASK, .clksel_shift = S5PV210_UCON_CLKSHIFT, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = S5PV210_UCON_DEFAULT, .ufcon = S5PV210_UFCON_DEFAULT, }, @@ -2778,7 +2778,7 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .clksel_mask = 0, \ .clksel_shift = 0, \ }, \ - .def_cfg = &(struct s3c2410_uartcfg) { \ + .def_cfg = { \ .ucon = S5PV210_UCON_DEFAULT, \ .ufcon = S5PV210_UFCON_DEFAULT, \ .has_fracval = 1, \ @@ -2827,7 +2827,7 @@ static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .clksel_mask = 0, .clksel_shift = 0, }, - .def_cfg = &(struct s3c2410_uartcfg) { + .def_cfg = { .ucon = APPLE_S5L_UCON_DEFAULT, .ufcon = S3C2410_UFCON_DEFAULT, }, From patchwork Tue Mar 8 08:09:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773232 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0B83BC433EF for ; Tue, 8 Mar 2022 08:11:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=at5E/FuxDhJ+A3ceNRLebp2BbhRK6TZLhv1Iwxp8oRo=; b=WixrKA2sSMs07y WEU0Emffo1Z/WgXunuG9F8Kayx6lr89RIkYsHqhZcF/xP98BqDNXcXTW/speYwe16e7uRbNUnNzYf w8DPN69qycPcxpnDdMEpLsmtZAm/spXjXAehe8SA/RFID20ByFTwdQYT+e+LedeKnCKbYC1bQm3Ew of5LqWWf87jds6w9pdDdyXeeWCiJYkWUJ7lNc/CWjx37hTjAo0920wAvzP8WI0nPjvVyIwQkNuvSn wtWHZXTgO4pTsaHucKGzI/bsk8g91b9w9it+hFxGNYP//OhJUovLbun7+2cj4B9s3M/PLCXXKg9Cd vpVMOyy/ew0FOuwiiDjA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUux-003AA6-2c; Tue, 08 Mar 2022 08:10:03 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuO-0039wZ-G2 for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:30 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 560C03F5F1 for ; Tue, 8 Mar 2022 08:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726967; bh=JiKqSLqC9cz+DomuU4Hx2hld8wGUXAiXEgnja8m8/QA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=qzy/0jMcFKkiyIMBaRsMnDlK80QqGFhkG5okvxsHwVU7zS+ry8KP5SVoW279J8+eI TlwUhhYq7rCEvWLnV11AmIWulN7GatZz8+NV7atHS64bF17f40y++mdLPKj2es875y PGJwNw/3060PHr3xnaT/+ek/j+ImdkKT9FmDqc0jx43ehXzVulvJXalBtJwYS7rOuh E5ZG2l803VglgfLNPsxzfOL1x+l3t99M7g0iJQc6egsfSKiSV5R4Lv8Dx/J0gDZ9PK bYXAfS78kwtOCC611FJGPYUT0fGEBgrpe4ksXfiAgik9D6B7mMdlWNuLq+BTs3xBDN kEiUMzR5ubemQ== Received: by mail-ej1-f69.google.com with SMTP id hq34-20020a1709073f2200b006d677c94909so8288789ejc.8 for ; Tue, 08 Mar 2022 00:09:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JiKqSLqC9cz+DomuU4Hx2hld8wGUXAiXEgnja8m8/QA=; b=AMd+ASO+6j/lATA1nncAXqB9pExEyB1BOuuoEgH0Ymqiz/iYS/HZEDBau0qkKFp1kN t6TzdYHzy4CFbh10EyrZ4LMyXrqUkcNlocn4F+YKyd8yuPjXH8AsuR32yTOQcnbpe+d4 zdgWMCRoC8Bzj5BwEUdPeb6uTerPaljblU6seoTugitPXmgMVsP6t+6CeNWH1ydUpS1Q Yu33o//gG2RKtte756BSRKjWKHP6/nb9zAXgmqnzNvfSI4YuBdWIYVFm19fDqSkE+9ru LzDUXNdaD3U1tyhVCtZnGrazbsIaIREphm8wDp6IfFxUPamJDg43hQHYK6G7HWDsXFb5 j2nQ== X-Gm-Message-State: AOAM530mYTeYAKYeRpFn8+yyzYn9XNDFGVKDN7asFfV+dYW7mhOiSkS3 JYaN4mw9YMXvjP+C6aC0JaBP1hj+yRc1VGkkyaMHleBx+eOui03/N3RZ24IyNL5Zm19gACxa74I mJW4n/d2dTvwI3WAOKtSS6Yg6wF0a4wzzw01B+I/t/RxZgpLew7+e X-Received: by 2002:a17:907:9691:b0:6d1:711d:9050 with SMTP id hd17-20020a170907969100b006d1711d9050mr12786625ejc.755.1646726966826; Tue, 08 Mar 2022 00:09:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyP0hp7rDrHBkxpGSi42kG38akSsQnOk/uybyIcsE8rFLwZ5IzvABPItTpU0pBtDEzT1lGCMw== X-Received: by 2002:a17:907:9691:b0:6d1:711d:9050 with SMTP id hd17-20020a170907969100b006d1711d9050mr12786598ejc.755.1646726966458; Tue, 08 Mar 2022 00:09:26 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:26 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 3/8] tty: serial: samsung: reduce number of casts Date: Tue, 8 Mar 2022 09:09:14 +0100 Message-Id: <20220308080919.152715-4-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000928_704567_031263B0 X-CRM114-Status: GOOD ( 14.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The pointers to instances of "struct s3c24xx_serial_drv_data" are first cast to kernel_ulong_t and then either used directly (in "platform_device_id.driver_data") or cast again to void * (in "of_device_id.data"). One cast can be dropped, so at least for "of_device_id.data" case there will be no casts at all. This makes the code a bit simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/tty/serial/samsung_tty.c | 72 ++++++++++++++++---------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index a9a75b5b9705..66434eb58db8 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2637,9 +2637,9 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C2410_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2410_serial_drv_data) +#define S3C2410_SERIAL_DRV_DATA (&s3c2410_serial_drv_data) #else -#define S3C2410_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C2410_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_CPU_S3C2412 @@ -2666,9 +2666,9 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C2412_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2412_serial_drv_data) +#define S3C2412_SERIAL_DRV_DATA (&s3c2412_serial_drv_data) #else -#define S3C2412_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C2412_SERIAL_DRV_DATA NULL #endif #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \ @@ -2697,9 +2697,9 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C2440_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c2440_serial_drv_data) +#define S3C2440_SERIAL_DRV_DATA (&s3c2440_serial_drv_data) #else -#define S3C2440_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C2440_SERIAL_DRV_DATA NULL #endif #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) @@ -2726,9 +2726,9 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S3C6400_SERIAL_DRV_DATA ((kernel_ulong_t)&s3c6400_serial_drv_data) +#define S3C6400_SERIAL_DRV_DATA (&s3c6400_serial_drv_data) #else -#define S3C6400_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S3C6400_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_CPU_S5PV210 @@ -2755,9 +2755,9 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { }, .fifosize = { 256, 64, 16, 16 }, }; -#define S5PV210_SERIAL_DRV_DATA ((kernel_ulong_t)&s5pv210_serial_drv_data) +#define S5PV210_SERIAL_DRV_DATA (&s5pv210_serial_drv_data) #else -#define S5PV210_SERIAL_DRV_DATA (kernel_ulong_t)NULL +#define S5PV210_SERIAL_DRV_DATA NULL #endif #if defined(CONFIG_ARCH_EXYNOS) @@ -2799,14 +2799,14 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { .fifosize = { 256, 64, 64, 64 }, }; -#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data) -#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos5433_serial_drv_data) -#define EXYNOS850_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos850_serial_drv_data) +#define EXYNOS4210_SERIAL_DRV_DATA (&exynos4210_serial_drv_data) +#define EXYNOS5433_SERIAL_DRV_DATA (&exynos5433_serial_drv_data) +#define EXYNOS850_SERIAL_DRV_DATA (&exynos850_serial_drv_data) #else -#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) -#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) -#define EXYNOS850_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) +#define EXYNOS4210_SERIAL_DRV_DATA NULL +#define EXYNOS5433_SERIAL_DRV_DATA NULL +#define EXYNOS850_SERIAL_DRV_DATA NULL #endif #ifdef CONFIG_ARCH_APPLE @@ -2832,39 +2832,39 @@ static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .ufcon = S3C2410_UFCON_DEFAULT, }, }; -#define S5L_SERIAL_DRV_DATA ((kernel_ulong_t)&s5l_serial_drv_data) +#define S5L_SERIAL_DRV_DATA (&s5l_serial_drv_data) #else -#define S5L_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) +#define S5L_SERIAL_DRV_DATA NULL #endif static const struct platform_device_id s3c24xx_serial_driver_ids[] = { { .name = "s3c2410-uart", - .driver_data = S3C2410_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C2410_SERIAL_DRV_DATA, }, { .name = "s3c2412-uart", - .driver_data = S3C2412_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C2412_SERIAL_DRV_DATA, }, { .name = "s3c2440-uart", - .driver_data = S3C2440_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C2440_SERIAL_DRV_DATA, }, { .name = "s3c6400-uart", - .driver_data = S3C6400_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S3C6400_SERIAL_DRV_DATA, }, { .name = "s5pv210-uart", - .driver_data = S5PV210_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S5PV210_SERIAL_DRV_DATA, }, { .name = "exynos4210-uart", - .driver_data = EXYNOS4210_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)EXYNOS4210_SERIAL_DRV_DATA, }, { .name = "exynos5433-uart", - .driver_data = EXYNOS5433_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)EXYNOS5433_SERIAL_DRV_DATA, }, { .name = "s5l-uart", - .driver_data = S5L_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)S5L_SERIAL_DRV_DATA, }, { .name = "exynos850-uart", - .driver_data = EXYNOS850_SERIAL_DRV_DATA, + .driver_data = (kernel_ulong_t)EXYNOS850_SERIAL_DRV_DATA, }, { }, }; @@ -2873,23 +2873,23 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_serial_driver_ids); #ifdef CONFIG_OF static const struct of_device_id s3c24xx_uart_dt_match[] = { { .compatible = "samsung,s3c2410-uart", - .data = (void *)S3C2410_SERIAL_DRV_DATA }, + .data = S3C2410_SERIAL_DRV_DATA }, { .compatible = "samsung,s3c2412-uart", - .data = (void *)S3C2412_SERIAL_DRV_DATA }, + .data = S3C2412_SERIAL_DRV_DATA }, { .compatible = "samsung,s3c2440-uart", - .data = (void *)S3C2440_SERIAL_DRV_DATA }, + .data = S3C2440_SERIAL_DRV_DATA }, { .compatible = "samsung,s3c6400-uart", - .data = (void *)S3C6400_SERIAL_DRV_DATA }, + .data = S3C6400_SERIAL_DRV_DATA }, { .compatible = "samsung,s5pv210-uart", - .data = (void *)S5PV210_SERIAL_DRV_DATA }, + .data = S5PV210_SERIAL_DRV_DATA }, { .compatible = "samsung,exynos4210-uart", - .data = (void *)EXYNOS4210_SERIAL_DRV_DATA }, + .data = EXYNOS4210_SERIAL_DRV_DATA }, { .compatible = "samsung,exynos5433-uart", - .data = (void *)EXYNOS5433_SERIAL_DRV_DATA }, + .data = EXYNOS5433_SERIAL_DRV_DATA }, { .compatible = "apple,s5l-uart", - .data = (void *)S5L_SERIAL_DRV_DATA }, + .data = S5L_SERIAL_DRV_DATA }, { .compatible = "samsung,exynos850-uart", - .data = (void *)EXYNOS850_SERIAL_DRV_DATA }, + .data = EXYNOS850_SERIAL_DRV_DATA }, {}, }; MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); From patchwork Tue Mar 8 08:09:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6F402C433F5 for ; Tue, 8 Mar 2022 08:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+WuLIqo3psg8Q/wJmxEksaJYtef3B9V4GncBeHCBYRo=; b=wYITTUqDqAXVZA /UQTAltthSBm4/2H3jMJUaOQfCFcC5plKI4pjfa6EtLvtWTMBvtEndlVc9WrSBPTvHrouISkJb2J4 wCkrwqqjJ1+jBWAyJMO6VYqNBaNcw/VkcOM1pZEdYaM0GoymCSnp8JEd0HxzezzOWy1AjzeeuV0z5 btpqWMNX5Guq3OyHZcWXAIn3I3nnMuo0md229XEe3DxZ/c8L+dJfjsmoK5RxJx+ow5WN7iwPf37x3 NN0fCQxMFSdnkAka/p1ejqZH6d7s8tgpzxqqhyB+AwZ4anlDohWeDzGz3Aju6xV7EQ8/GNdErRRW/ xyuqgK1JnjBLB3onkZZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUv8-003ADW-RM; Tue, 08 Mar 2022 08:10:15 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuP-0039wq-FI for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:31 +0000 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 4B1B03F616 for ; Tue, 8 Mar 2022 08:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726968; bh=tfYTw7M8SGNblLSK+OTR7ft1x+niAVfIowhtu3q65AY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HXjJB6B9B6ejGdITG09qJCNIaaq/CcWIRiUKd5IwqDV5xmOgX6TbUBTKCt5PtWdUP /RoLR2JTax1E7McLkeWzlUzm5trNDQnZr79E7iCwXN9MDL+3aW+S0j9CyUjuEFVo7E Y+06/0+dEHC/IOaCftyrIdocS1jCmpSCxiiUM1zolPQyVGnKSD/z4sNya0mJCosypN 8fmlRzlUNcnB1EIc22zkB9TOgWuYNl21C//HKYkDEbbzSpmy9S66TGzubrRt4Zgrsc h+yuDNS7bk1bFv6o0NjwwJu9wbetchyRboMJW68xtW0e2RFngzUnzsi7NeeD98m9OW DeNZYSW92pwOQ== Received: by mail-ej1-f69.google.com with SMTP id qf24-20020a1709077f1800b006ce8c140d3dso8265373ejc.18 for ; Tue, 08 Mar 2022 00:09:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tfYTw7M8SGNblLSK+OTR7ft1x+niAVfIowhtu3q65AY=; b=GpPfkDT+aJpRNFsd727cX5134k+pht+RjfKYSH4ArZhEX3KWb7F+Ptn53XZXg+4gug o4ZPhthwNM9LQfuaMkZl3JFCVyreGQRDm1x5IhYJnAbg6Omb/w/uCmkZwVkBLga1w0kq W075u6q0Sor79D0t3qX8kdTbNhovqvetqNmHRehx7fbV1hVaBmRJ8YNdDI1EJYZcMbcq XcQUqv+rWxRekac3Ldrvn2LW9+wYdrlo6D1Sj52nhcPVQyceZ2Ac9Gom9lTx7IygU9IP Cp7jf1lbxhgZ+yxAJuvj8RW5OACaHJb5wOnQUOnwtGbA21FE6MP5Lkir6xxEFxxyiFYS e7Yg== X-Gm-Message-State: AOAM531ntagNQs/TJqjfmPtB5HwWuChNr+xjuvfz+9yRoaVeBvOAepfV U9dPcZyFnq+5dHC7xfY3IUx4Wz5JQqDK4T4/TvnsdfbrQXOrfBsbMh00X/pw9+Ag30s88CSpF8T gxlv+QkEyTXwgpYLnzGbIyCWKZejYPdHQHb3ji/SUa1WEHrk6iAkB X-Received: by 2002:a17:907:1b09:b0:6d8:faa8:4a06 with SMTP id mp9-20020a1709071b0900b006d8faa84a06mr12097010ejc.701.1646726967879; Tue, 08 Mar 2022 00:09:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJy4S5b8cDkgWsMD2VwX44UQxX1h1DDN2AljrAE6McGdTq0MBRrLMyFtooQYg29GydbisVK9qQ== X-Received: by 2002:a17:907:1b09:b0:6d8:faa8:4a06 with SMTP id mp9-20020a1709071b0900b006d8faa84a06mr12096985ejc.701.1646726967665; Tue, 08 Mar 2022 00:09:27 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:26 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 4/8] tty: serial: samsung: constify s3c24xx_serial_drv_data Date: Tue, 8 Mar 2022 09:09:15 +0100 Message-Id: <20220308080919.152715-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000929_687184_760BC355 X-CRM114-Status: GOOD ( 21.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver data (struct s3c24xx_serial_drv_data) is only used to initialize the driver properly and is not modified. Make it const. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 58 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 66434eb58db8..c4b13f2d6e26 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -136,14 +136,14 @@ struct s3c24xx_uart_port { unsigned int tx_mode; unsigned int rx_mode; - struct s3c24xx_uart_info *info; + const struct s3c24xx_uart_info *info; struct clk *clk; struct clk *baudclk; struct uart_port port; - struct s3c24xx_serial_drv_data *drv_data; + const struct s3c24xx_serial_drv_data *drv_data; /* reference to platform data */ - struct s3c2410_uartcfg *cfg; + const struct s3c2410_uartcfg *cfg; struct s3c24xx_uart_dma *dma; @@ -221,7 +221,7 @@ static inline void s3c24xx_clear_bit(struct uart_port *port, int idx, local_irq_restore(flags); } -static inline struct s3c24xx_uart_port *to_ourport(struct uart_port *port) +static inline struct s3c24xx_uart_port *to_ourport(const struct uart_port *port) { return container_of(port, struct s3c24xx_uart_port, port); } @@ -573,13 +573,13 @@ static void s3c24xx_serial_stop_rx(struct uart_port *port) } } -static inline struct s3c24xx_uart_info +static inline const struct s3c24xx_uart_info *s3c24xx_port_to_info(struct uart_port *port) { return to_ourport(port)->info; } -static inline struct s3c2410_uartcfg +static inline const struct s3c2410_uartcfg *s3c24xx_port_to_cfg(struct uart_port *port) { struct s3c24xx_uart_port *ourport; @@ -594,7 +594,7 @@ static inline struct s3c2410_uartcfg static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport, unsigned long ufstat) { - struct s3c24xx_uart_info *info = ourport->info; + const struct s3c24xx_uart_info *info = ourport->info; if (ufstat & info->rx_fifofull) return ourport->port.fifosize; @@ -986,7 +986,7 @@ static irqreturn_t apple_serial_handle_irq(int irq, void *id) static unsigned int s3c24xx_serial_tx_empty(struct uart_port *port) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned long ufstat = rd_regl(port, S3C2410_UFSTAT); unsigned long ufcon = rd_regl(port, S3C2410_UFCON); @@ -1405,7 +1405,7 @@ static void s3c24xx_serial_pm(struct uart_port *port, unsigned int level, static inline int s3c24xx_serial_getsource(struct uart_port *port) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned int ucon; if (info->num_clks == 1) @@ -1419,7 +1419,7 @@ static inline int s3c24xx_serial_getsource(struct uart_port *port) static void s3c24xx_serial_setsource(struct uart_port *port, unsigned int clk_sel) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned int ucon; if (info->num_clks == 1) @@ -1438,7 +1438,7 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, unsigned int req_baud, struct clk **best_clk, unsigned int *clk_num) { - struct s3c24xx_uart_info *info = ourport->info; + const struct s3c24xx_uart_info *info = ourport->info; struct clk *clk; unsigned long rate; unsigned int cnt, baud, quot, best_quot = 0; @@ -1522,7 +1522,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, struct ktermios *termios, struct ktermios *old) { - struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); + const struct s3c2410_uartcfg *cfg = s3c24xx_port_to_cfg(port); struct s3c24xx_uart_port *ourport = to_ourport(port); struct clk *clk = ERR_PTR(-EINVAL); unsigned long flags; @@ -1691,7 +1691,7 @@ static const char *s3c24xx_serial_type(struct uart_port *port) static void s3c24xx_serial_config_port(struct uart_port *port, int flags) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); if (flags & UART_CONFIG_TYPE) port->type = info->port_type; @@ -1703,7 +1703,7 @@ static void s3c24xx_serial_config_port(struct uart_port *port, int flags) static int s3c24xx_serial_verify_port(struct uart_port *port, struct serial_struct *ser) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); if (ser->type != PORT_UNKNOWN && ser->type != info->port_type) return -EINVAL; @@ -1873,9 +1873,9 @@ s3c24xx_serial_ports[CONFIG_SERIAL_SAMSUNG_UARTS] = { */ static void s3c24xx_serial_resetport(struct uart_port *port, - struct s3c2410_uartcfg *cfg) + const struct s3c2410_uartcfg *cfg) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned long ucon = rd_regl(port, S3C2410_UCON); ucon &= (info->clksel_mask | info->ucon_mask); @@ -1979,7 +1979,7 @@ s3c24xx_serial_cpufreq_deregister(struct s3c24xx_uart_port *port) static int s3c24xx_serial_enable_baudclk(struct s3c24xx_uart_port *ourport) { struct device *dev = ourport->port.dev; - struct s3c24xx_uart_info *info = ourport->info; + const struct s3c24xx_uart_info *info = ourport->info; char clk_name[MAX_CLK_NAME_LENGTH]; unsigned int clk_sel; struct clk *clk; @@ -2021,7 +2021,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, struct platform_device *platdev) { struct uart_port *port = &ourport->port; - struct s3c2410_uartcfg *cfg = ourport->cfg; + const struct s3c2410_uartcfg *cfg = ourport->cfg; struct resource *res; int ret; @@ -2156,7 +2156,7 @@ static const struct of_device_id s3c24xx_uart_dt_match[]; static int probe_index; -static inline struct s3c24xx_serial_drv_data * +static inline const struct s3c24xx_serial_drv_data * s3c24xx_get_driver_data(struct platform_device *pdev) { #ifdef CONFIG_OF @@ -2419,7 +2419,7 @@ static struct uart_port *cons_uart; static int s3c24xx_serial_console_txrdy(struct uart_port *port, unsigned int ufcon) { - struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); + const struct s3c24xx_uart_info *info = s3c24xx_port_to_info(port); unsigned long ufstat, utrstat; if (ufcon & S3C2410_UFCON_FIFOMODE) { @@ -2615,7 +2615,7 @@ static struct console s3c24xx_serial_console = { #endif /* CONFIG_SERIAL_SAMSUNG_CONSOLE */ #ifdef CONFIG_CPU_S3C2410 -static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { .info = { .name = "Samsung S3C2410 UART", .type = TYPE_S3C24XX, @@ -2643,7 +2643,7 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { #endif #ifdef CONFIG_CPU_S3C2412 -static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { .info = { .name = "Samsung S3C2412 UART", .type = TYPE_S3C24XX, @@ -2673,7 +2673,7 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \ defined(CONFIG_CPU_S3C2443) || defined(CONFIG_CPU_S3C2442) -static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { .info = { .name = "Samsung S3C2440 UART", .type = TYPE_S3C24XX, @@ -2703,7 +2703,7 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { #endif #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) -static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { .info = { .name = "Samsung S3C6400 UART", .type = TYPE_S3C6400, @@ -2732,7 +2732,7 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { #endif #ifdef CONFIG_CPU_S5PV210 -static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .info = { .name = "Samsung S5PV210 UART", .type = TYPE_S3C6400, @@ -2784,17 +2784,17 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { .has_fracval = 1, \ } \ -static struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { +static const struct s3c24xx_serial_drv_data exynos4210_serial_drv_data = { EXYNOS_COMMON_SERIAL_DRV_DATA(), .fifosize = { 256, 64, 16, 16 }, }; -static struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = { +static const struct s3c24xx_serial_drv_data exynos5433_serial_drv_data = { EXYNOS_COMMON_SERIAL_DRV_DATA(), .fifosize = { 64, 256, 16, 256 }, }; -static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { +static const struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { EXYNOS_COMMON_SERIAL_DRV_DATA(), .fifosize = { 256, 64, 64, 64 }, }; @@ -2810,7 +2810,7 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { #endif #ifdef CONFIG_ARCH_APPLE -static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { +static const struct s3c24xx_serial_drv_data s5l_serial_drv_data = { .info = { .name = "Apple S5L UART", .type = TYPE_APPLE_S5L, From patchwork Tue Mar 8 08:09:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773234 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 999B0C433EF for ; Tue, 8 Mar 2022 08:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=8BxdPVaIw8/qoaucFOX28gCppnfyiO6FjKMmqAFiCo0=; b=i0yz0IojlH/0s5 BQWQjtu+C1kdLBCZhJmLLPTlbrQ5KCzaABIWKhauBm0R0J1dXmCRViS4bsRZCC3F9+HpjWqQlodS7 D6G3uJKvNgP+lUgruW9He76l+mJ8j0INtn0fOOZhYh4ZQRHJjsU2PCcXhvWoqcHVBkz8XUkfWNrIu 8fWvYsiKLWbJP0tglNdMjpYo0Z+PZGGNof/hefouqSje4fEqByqr9s2wO1207J98/ZfGOKQ5iONre iS0TAiqIaQPOrJ+HMKuTsQNUVWiSYXMJqBw3ySkdxpTLcbxCaQ9CCgP4usorxid2Q8+lkN77pw2Iz epNMJlC4m7ZxXlwLjS5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUvS-003AMa-1v; Tue, 08 Mar 2022 08:10:34 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuQ-0039x7-GC for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:31 +0000 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 4D7BA3F7DF for ; Tue, 8 Mar 2022 08:09:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726969; bh=29Pf3ZsU5JJVOHBIO1WRfRouMVWJymQOmYuJyfmZYy4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LkfbNmA9Vjt18uCAYkD/pVLrecoVDZlQhW5ah475s/GQnogj6tnEjYQ6nHpDib1X3 R3473N8FT7FF25HiCF7EMiaMW6GYb2rCOMD99DeNX7sxtMEEGck8lzy7sT5Q3vpxBI XpwVT0ILex4z0miDeiAXMaognDhTvvCh6Za3ur3q8nAHkbimbx6oDPLOrHBm/uPr/A FAlsUBQA2n30Pq5et4NQzOgBQh3/2PWjbNK7MkxTLiLz3HpdqfNd4kkvD7NbRB7dl9 IbuMAczN6X4DYZi8g9FL42hBwyVVENMDDSSZby3uCMcI2qOufJ7M7nnCTPFuV9pVTh irARfJ5mM/3+Q== Received: by mail-ed1-f71.google.com with SMTP id n11-20020a50cc4b000000b00415e939bf9eso7969672edi.22 for ; Tue, 08 Mar 2022 00:09:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=29Pf3ZsU5JJVOHBIO1WRfRouMVWJymQOmYuJyfmZYy4=; b=6iDyREzbiCEPA5GUzacKEx6ZzJC2MBvKf2vpUM7xM6R8T7nCiVUCEyzaWpQHtRUPPJ 85T42uEuWA+rGAOp5WBWq2ona53pfCKnKvvand3pdj4JPtX0ZNKXP02R2OTZPcVpzBkZ JSYH/X/7alEogLdKcd9ZWLoRitRneF9feyA+CBQMfzFqmF4bEGqWdpfVFhoHrOMQ2q0z twN9hCqlhzAHVlCovey5iBStnHtyZ67I4dI8RnJxt0pvnBGiCpqmWU+3sbAGUU/CTOfr Sqr60rcgoosSvQcWFEiq+raljJXdhhrrCzwxqUxdqdGipS2fVnACn9J/sf1U70ESVpFz XS5w== X-Gm-Message-State: AOAM530Cqi9ltaiTTHLcXkZUgKjLk95u1b/UreVmT/kBFBRQ/L1UruHb h5FdLRwmBUj1U2wzNEPEBFPvQHvXFN83L7FQLwJCQHyPz7UajzeLCFiMPNiqKq3yPGJr94Pfjqn YdfSDeq705Nj2llxRjgkp3LFHLjxdIsNn1JKgZBD21YYnrEdTEwD7 X-Received: by 2002:a17:906:9bd7:b0:6d6:e920:8d04 with SMTP id de23-20020a1709069bd700b006d6e9208d04mr12389912ejc.547.1646726969063; Tue, 08 Mar 2022 00:09:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJzCDpyzVeafJO+tBKmLNUmXCUwu/pvO8ES0IOzwYdYS55Y3KidkwCIqb81SC/LBMvb5FhouCg== X-Received: by 2002:a17:906:9bd7:b0:6d6:e920:8d04 with SMTP id de23-20020a1709069bd700b006d6e9208d04mr12389895ejc.547.1646726968858; Tue, 08 Mar 2022 00:09:28 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:28 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 5/8] tty: serial: samsung: constify UART name Date: Tue, 8 Mar 2022 09:09:16 +0100 Message-Id: <20220308080919.152715-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000930_692799_39086109 X-CRM114-Status: GOOD ( 13.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The UART name from driver data holds only string literals. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index c4b13f2d6e26..7025306f76b7 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -63,7 +63,7 @@ enum s3c24xx_port_type { }; struct s3c24xx_uart_info { - char *name; + const char *name; enum s3c24xx_port_type type; unsigned int port_type; unsigned int fifosize; From patchwork Tue Mar 8 08:09:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9957C433F5 for ; Tue, 8 Mar 2022 08:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=/CDD48irbz3hBpAq07Hivbrvw+0SX6Y0Wu6uxYc5MdQ=; b=VfM0v0ssIprIPL GLxGhsZ708rFlwILIwKOrmEK1gjJI0Sme2sK4Ttw6WJL3mKGNEHM9NX8SugVdgdTouYRMwXa/xwsk +w/2VC+1pVfFMixLF9dp4As0IEXcuDifPswOLgEFrg707T0C0Yxf5k7WCQtXFoF6GzdlP/PItLDG4 49PgdB3paK+eOgwhyDJIgKWlYB1Ot/HeAhHb3K9w07A1CazEbJ3zbRtmPVw5EIsK2PXQ/8702SIsF h6xUICqvxNj0dMnufuOkgrzEPeuOhCDU2jNpP4eO6iQvi7WfgxYzA2SavNcIieP149XV4K+mj9k43 QdPVpGOzsmzAngIWv42A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUvp-003AYh-8U; Tue, 08 Mar 2022 08:10:57 +0000 Received: from smtp-relay-internal-1.canonical.com ([185.125.188.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuS-0039y9-AK for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:33 +0000 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 1BD833F7E5 for ; Tue, 8 Mar 2022 08:09:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726971; bh=Dr4tgo26oKDD7/cFmU+MgZtFQEJoCk73ZvgNX0zaNnk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MW4cS/a3rZ6mGwrKSnHQ9n+eNyJl1EoZSCGCxN/P3foXVGy6W5iqZ3gM7TiTKKrvt W6iXAeVZLcKVfrvMEsePZqimQGUDPrQzjoABVIGYLcrLCxxbhkmM1uohT8hZKEnwaj 9tY6NKr2GJaXu5yRF5uybkXDZztssgVl+rMCNZjK2Ck2C9xoGlOps2mgzjCOfTqjMG CmOlZatxvEnhmYqS9aV3L90kblYY5Oc2PozdxcCk2Agi/wiU82Ss3gYPRd7ERuNEh0 WzxJlLpmdmGL/KFqduwBKDvro+kbRiuY59jfNso5dDmG57E4KsU5zV8unPydIZ+mdM +9/wWiQBGFBrw== Received: by mail-ej1-f70.google.com with SMTP id hr26-20020a1709073f9a00b006d6d1ee8cf8so8176254ejc.19 for ; Tue, 08 Mar 2022 00:09:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Dr4tgo26oKDD7/cFmU+MgZtFQEJoCk73ZvgNX0zaNnk=; b=xiOn1jGyjfhBbH54iKkatNc0JuWx6/KrApRyOaj68HueGv0BhwO+B0G2hppcXQvjcB nUIrt3p/GxlbjHuTMg2RMKXU4qs8BkptQQGYC4LuIx/jlzoNt77sgET9Ej+Wfq2tSiEN wuOnMX2d8JQJpCsJvomEfjuSSkVpRM5LRJcZzEPPaXMbgId02SmtUxIbfjhE2AYtqT18 JNMX1Grxi/gLSPKznkPyimDFH9JKm6uDXVColYrULB9cHwYmjKrfHfNk2aXlswwloWAb gV5R95ZOOxWGcTKPiJ+ADOfstvoeE+VfyLXBxynL6MKhIT99U2EUgTeblFWmrDDFnsh/ lxbg== X-Gm-Message-State: AOAM531x51uWvaf7LNcws+9u13faFaclqg1ivvDaWhzkxwW3SkPs4Qnc tEPqoh9QHNlPf1sJVLVdJCOIB64BlUOmFd1mOfRNVitcuwwc5eWpZParOyQL5O9LJd2dThRG2vF vIjhCUD4O1kCNPIxrSUOoZRPG7kRB8RQhom8PxT0dIstMzeVDskA4 X-Received: by 2002:a17:906:3e90:b0:6b6:829b:577c with SMTP id a16-20020a1709063e9000b006b6829b577cmr12689312ejj.711.1646726970627; Tue, 08 Mar 2022 00:09:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvyuR3mb0kzIzmDG7xL2Oq1O5GTZ5RmEqTaJMl1TSRoKLAqTby19CSrJRxPUdjCfrfwqyzaw== X-Received: by 2002:a17:906:3e90:b0:6b6:829b:577c with SMTP id a16-20020a1709063e9000b006b6829b577cmr12689291ejj.711.1646726970318; Tue, 08 Mar 2022 00:09:30 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:29 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 6/8] tty: serial: samsung: constify s3c24xx_serial_drv_data members Date: Tue, 8 Mar 2022 09:09:17 +0100 Message-Id: <20220308080919.152715-7-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000932_522035_BABDB718 X-CRM114-Status: GOOD ( 14.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver data (struct s3c24xx_serial_drv_data) is never modified, so also its members can be made const. Except code style this has no impact because the structure itself is always a const. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 7025306f76b7..b9783d8fb440 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -85,9 +85,9 @@ struct s3c24xx_uart_info { }; struct s3c24xx_serial_drv_data { - struct s3c24xx_uart_info info; - struct s3c2410_uartcfg def_cfg; - unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; + const struct s3c24xx_uart_info info; + const struct s3c2410_uartcfg def_cfg; + const unsigned int fifosize[CONFIG_SERIAL_SAMSUNG_UARTS]; }; struct s3c24xx_uart_dma { From patchwork Tue Mar 8 08:09:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5C08C433F5 for ; Tue, 8 Mar 2022 08:13:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ulI5cebD1TL80UL5LEkeprKki1b8TlF0TXFJqcJZRV8=; b=kxP3AOirTG4eEm 10/LqZmfWMNgrZDMPgugRWkFGGe8hIg3ndrhdmoidLnDs+6AD7WDuiqVwVhmOjrIuMqqd+1pvfokA Ec7TFJ6WjSYFzHl+79uVmV3rXZ2BsAfs+SUDveAjhq/EFAcm0+K8GRXTyxZusUC7p12QDIhp7ykrO OQXiT7NLwuytxmYYfgupuHB0tI2qS8eSbjUUhRpqyJVTeXyPObU2ejVHerPhnkQlk/SzZjJ+Cgv44 9Agh4UbCSMQjUHmB4vAplOr/eSSnnJn5CTqxZTCeoqbm2fHWd5gYuahsdMPu4oZXxQ5rNWKJF+icm zlMEO8MiVaPhp+9zdh9Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUwP-003AtV-Ho; Tue, 08 Mar 2022 08:11:33 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuT-0039yf-GM for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:35 +0000 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 4AC653F616 for ; Tue, 8 Mar 2022 08:09:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726972; bh=YZ43hLE0duJi88wrK3ybDZb8cX9SjP237BkyHbKYO34=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pDDkeXEo8kI2Eol4WTMcXtArxqTPkn90ZVA6sSq3Lhstfvmok0q7b8QaMqob6ippI GeWhc7q43OUEFC0buXfFBUWq833OfQKDJwtifZV1OBi5WClwqUoGIh8q/dvob2joTC PF/g1y/wVXa/a2xrDHuO1WmejP0t7K1Uvys0FLooAOwapbQp5bjB70vmkR+ZTQ70i8 xDs5l6mwT26ue1g/svXeZLgKooi0mXNOf8Ohsv7vI9wUFd7cKxvDfWaZXetM7Z38U6 StPeJFn2u3QQrdMTXeDVTbWsQiZD7DOZma7MZBSNCDBVcIZB1LX9i0q0TLVsUyUD/p +C/9ObqWceQ8Q== Received: by mail-ed1-f71.google.com with SMTP id o20-20020aa7dd54000000b00413bc19ad08so10156607edw.7 for ; Tue, 08 Mar 2022 00:09:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YZ43hLE0duJi88wrK3ybDZb8cX9SjP237BkyHbKYO34=; b=skEe3Uk8/4hjGspkQnCkJ7MZYdl7e9oe+27ucubQ+hjdbhkPzY2e+j1NvjWgj8ulV1 FDyBXXNQrXiF0cTld+/CpGjz4HuRXCJd7zhFFLkPrUo4ADfOayt/omSCc/zmsyzzaFhF Q/69p7il/tV9313w2DRk6xal3pytwDiYeibdPDP7YUr7jHTp/80Z4/al2l1jWJ9Re5J/ A8LK4vkSqdMR6LLy2mvnwwxpUbObTeHF4mrUGHnILxT+CpJriQnFRZVESmSGYED1kv63 NIRaINOGYts3V0IsBqFQS8LXJb3QDVDWbbzf28qxzbVIX2M1Bcj+XKOk/rWLHo9aOZPd m4ww== X-Gm-Message-State: AOAM531m4jAscwMGVMqt7ltInD0c9U0zMWPriwHdOZ5THzPLEbkL+iyb 2/rDsJM6ScST6sIPsa2V2NzlPhGGIUMFyeRMIG7jeiitKTgEsqklhqM425+EfWpQSPBRvbg7ZgV 8VmsF3aKS20vPHCEZxdqU45NnldlChEbgrpC8kMlE7xtESdNcckG4 X-Received: by 2002:a17:906:e08c:b0:6bb:6f89:7d59 with SMTP id gh12-20020a170906e08c00b006bb6f897d59mr12109652ejb.85.1646726971878; Tue, 08 Mar 2022 00:09:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxGJcW6u1S98RfCw05htwWFvnVS+wlZNMJiHq0b+kovRBJRvSyL9xFWYDEk4pestC9EEEWVA== X-Received: by 2002:a17:906:e08c:b0:6bb:6f89:7d59 with SMTP id gh12-20020a170906e08c00b006bb6f897d59mr12109636ejb.85.1646726971666; Tue, 08 Mar 2022 00:09:31 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:31 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 7/8] tty: serial: samsung: constify variables and pointers Date: Tue, 8 Mar 2022 09:09:18 +0100 Message-Id: <20220308080919.152715-8-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000933_735413_2CF801AB X-CRM114-Status: GOOD ( 18.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Constify variables, data pointed by several pointers and "udivslot_table" static array. This makes code a bit safer. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Jiri Slaby Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index b9783d8fb440..3ffae912217c 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -164,7 +164,7 @@ static void s3c24xx_serial_tx_chars(struct s3c24xx_uart_port *ourport); #define portaddrl(port, reg) \ ((unsigned long *)(unsigned long)((port)->membase + (reg))) -static u32 rd_reg(struct uart_port *port, u32 reg) +static u32 rd_reg(const struct uart_port *port, u32 reg) { switch (port->iotype) { case UPIO_MEM: @@ -179,7 +179,7 @@ static u32 rd_reg(struct uart_port *port, u32 reg) #define rd_regl(port, reg) (readl_relaxed(portaddr(port, reg))) -static void wr_reg(struct uart_port *port, u32 reg, u32 val) +static void wr_reg(const struct uart_port *port, u32 reg, u32 val) { switch (port->iotype) { case UPIO_MEM: @@ -195,7 +195,7 @@ static void wr_reg(struct uart_port *port, u32 reg, u32 val) /* Byte-order aware bit setting/clearing functions. */ -static inline void s3c24xx_set_bit(struct uart_port *port, int idx, +static inline void s3c24xx_set_bit(const struct uart_port *port, int idx, unsigned int reg) { unsigned long flags; @@ -208,7 +208,7 @@ static inline void s3c24xx_set_bit(struct uart_port *port, int idx, local_irq_restore(flags); } -static inline void s3c24xx_clear_bit(struct uart_port *port, int idx, +static inline void s3c24xx_clear_bit(const struct uart_port *port, int idx, unsigned int reg) { unsigned long flags; @@ -221,19 +221,19 @@ static inline void s3c24xx_clear_bit(struct uart_port *port, int idx, local_irq_restore(flags); } -static inline struct s3c24xx_uart_port *to_ourport(const struct uart_port *port) +static inline struct s3c24xx_uart_port *to_ourport(struct uart_port *port) { return container_of(port, struct s3c24xx_uart_port, port); } /* translate a port to the device name */ -static inline const char *s3c24xx_serial_portname(struct uart_port *port) +static inline const char *s3c24xx_serial_portname(const struct uart_port *port) { return to_platform_device(port->dev)->name; } -static int s3c24xx_serial_txempty_nofifo(struct uart_port *port) +static int s3c24xx_serial_txempty_nofifo(const struct uart_port *port) { return rd_regl(port, S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXE; } @@ -358,7 +358,7 @@ static void s3c24xx_serial_tx_dma_complete(void *args) static void enable_tx_dma(struct s3c24xx_uart_port *ourport) { - struct uart_port *port = &ourport->port; + const struct uart_port *port = &ourport->port; u32 ucon; /* Mask Tx interrupt */ @@ -387,7 +387,7 @@ static void enable_tx_dma(struct s3c24xx_uart_port *ourport) static void enable_tx_pio(struct s3c24xx_uart_port *ourport) { - struct uart_port *port = &ourport->port; + const struct uart_port *port = &ourport->port; u32 ucon, ufcon; /* Set ufcon txtrig */ @@ -580,9 +580,9 @@ static inline const struct s3c24xx_uart_info } static inline const struct s3c2410_uartcfg - *s3c24xx_port_to_cfg(struct uart_port *port) + *s3c24xx_port_to_cfg(const struct uart_port *port) { - struct s3c24xx_uart_port *ourport; + const struct s3c24xx_uart_port *ourport; if (port->dev == NULL) return NULL; @@ -591,7 +591,7 @@ static inline const struct s3c2410_uartcfg return ourport->cfg; } -static int s3c24xx_serial_rx_fifocnt(struct s3c24xx_uart_port *ourport, +static int s3c24xx_serial_rx_fifocnt(const struct s3c24xx_uart_port *ourport, unsigned long ufstat) { const struct s3c24xx_uart_info *info = ourport->info; @@ -947,8 +947,8 @@ static irqreturn_t s3c24xx_serial_tx_irq(int irq, void *id) /* interrupt handler for s3c64xx and later SoC's.*/ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id) { - struct s3c24xx_uart_port *ourport = id; - struct uart_port *port = &ourport->port; + const struct s3c24xx_uart_port *ourport = id; + const struct uart_port *port = &ourport->port; unsigned int pend = rd_regl(port, S3C64XX_UINTP); irqreturn_t ret = IRQ_HANDLED; @@ -966,8 +966,8 @@ static irqreturn_t s3c64xx_serial_handle_irq(int irq, void *id) /* interrupt handler for Apple SoC's.*/ static irqreturn_t apple_serial_handle_irq(int irq, void *id) { - struct s3c24xx_uart_port *ourport = id; - struct uart_port *port = &ourport->port; + const struct s3c24xx_uart_port *ourport = id; + const struct uart_port *port = &ourport->port; unsigned int pend = rd_regl(port, S3C2410_UTRSTAT); irqreturn_t ret = IRQ_NONE; @@ -1499,7 +1499,7 @@ static unsigned int s3c24xx_serial_getclk(struct s3c24xx_uart_port *ourport, * This table takes the fractional value of the baud divisor and gives * the recommended setting for the UDIVSLOT register. */ -static u16 udivslot_table[16] = { +static const u16 udivslot_table[16] = { [0] = 0x0000, [1] = 0x0080, [2] = 0x0808, @@ -1675,7 +1675,7 @@ static void s3c24xx_serial_set_termios(struct uart_port *port, static const char *s3c24xx_serial_type(struct uart_port *port) { - struct s3c24xx_uart_port *ourport = to_ourport(port); + const struct s3c24xx_uart_port *ourport = to_ourport(port); switch (ourport->info->type) { case TYPE_S3C24XX: @@ -2450,7 +2450,7 @@ s3c24xx_port_configured(unsigned int ucon) static int s3c24xx_serial_get_poll_char(struct uart_port *port) { - struct s3c24xx_uart_port *ourport = to_ourport(port); + const struct s3c24xx_uart_port *ourport = to_ourport(port); unsigned int ufstat; ufstat = rd_regl(port, S3C2410_UFSTAT); @@ -2935,7 +2935,7 @@ module_exit(samsung_serial_exit); * Early console. */ -static void wr_reg_barrier(struct uart_port *port, u32 reg, u32 val) +static void wr_reg_barrier(const struct uart_port *port, u32 reg, u32 val) { switch (port->iotype) { case UPIO_MEM: @@ -2951,15 +2951,15 @@ struct samsung_early_console_data { u32 txfull_mask; }; -static void samsung_early_busyuart(struct uart_port *port) +static void samsung_early_busyuart(const struct uart_port *port) { while (!(readl(port->membase + S3C2410_UTRSTAT) & S3C2410_UTRSTAT_TXFE)) ; } -static void samsung_early_busyuart_fifo(struct uart_port *port) +static void samsung_early_busyuart_fifo(const struct uart_port *port) { - struct samsung_early_console_data *data = port->private_data; + const struct samsung_early_console_data *data = port->private_data; while (readl(port->membase + S3C2410_UFSTAT) & data->txfull_mask) ; From patchwork Tue Mar 8 08:09:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 12773237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 190B9C433F5 for ; Tue, 8 Mar 2022 08:13:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yqXU6l//+VrR1Q+uh4c/rf/ojYzjGNqQiZV6ZEDqccQ=; b=FkrZQjo4047IYa 0Jn8HHfp6RbbcgOVh1B3fANAjmBo595xf044pYBrZ2JhGKSsCwK6DulAdWCKQfrawG6qAr4KZik12 I0r2280BRYRkw7DZEl6DKQ8kNPSwasO/w9FSiqKVVa0/TmhRVttZ0F/xfPh+TR683nNOCnwromwQ/ Bi9xU/6l42Wb7Vn7XqcS1VlrJcpQLdF1FZJ0QtevBV6FuGpbLdbG36z9J1WgIh06fEPCsr9iuJoSS CHgN0OSyEVS8N4X3jWxL8Z4rtnN6oIhGPFw5txYmgUMom/JAmPiFIL7mWtuEQZ2TRDUY3LJEWLKi8 t2zFfAqDCySA6gfR5mzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUwp-003BC3-9O; Tue, 08 Mar 2022 08:12:00 +0000 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nRUuW-0039za-5a for linux-arm-kernel@lists.infradead.org; Tue, 08 Mar 2022 08:09:37 +0000 Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 92A6D3F605 for ; Tue, 8 Mar 2022 08:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646726973; bh=HBWgDosMAxuyNUJy93OLxsRzmckdD8hfFxFfwNDa3dk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=gTeTFmNS5aebL7Hy7XLUm1mOhREgd7O3FVcgt1QYGhKZYxSTk0tWAjT/Uu5uryPoA WfdfSRFLipFl72xbXy1CV/QECMhWfStoQmy7CNGuIwk+yQOErXny4Imvz3QGPnBHbx HyTpYRFchYhuptwz8ri0GRWC9tGz0wRtIjclmAX0IzcLfNcgEYuhzwfbcxIosOOdv4 1p8odZsdwLxL7rJ1VoVq7ebhArOygBHhCtyh0p1wsLYviFJA5doITv0KvV9In/G0G3 btbNnnZXOYSoB9ikn2gfUfEC6xamK8/kZhGqJTcsTGfcS/bb3GpbzhIeqWjqcWaPKY lRR3IRG8dbuBQ== Received: by mail-ej1-f72.google.com with SMTP id k16-20020a17090632d000b006ae1cdb0f07so8255315ejk.16 for ; Tue, 08 Mar 2022 00:09:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HBWgDosMAxuyNUJy93OLxsRzmckdD8hfFxFfwNDa3dk=; b=DhPO5hSinl28bVJlrJsmERd4yfxzKsBSno6Fj243u+fBVVBf2Mgt+SP58a9YZX2sa8 IdgBgnpaOuBhP+Ig5bzGKpwpSoWSvKv2l8uX4aeVGEULKgEYOdJ5DB0ZSJnzrzv6KzMn HQwPyi3OgNEIUxhRE8nn0ofZQs4CFi1P4pcVTp66hEeqKrqS7JW5IN6FpdhBd4sCsMZt GtVBkCSdZuwpB3iUGTHQI7HUK3GsR4/Ye5PmTwB77chlH8znM8rLpJzlGz4/f2ek7aKR /nv75wKODg4LNRB2PnPNDpEZM2E/vKw3Tz9k+bQdRhSTg+RKkio4IbqdGoEUmoO1OcNr 2koA== X-Gm-Message-State: AOAM531jZHJE0W6lRHLZ6wx8utk8VbKz2s7UBrisSdJLlz4HtOHZaW3D AAIybUERRVrsKFZul55v0G5Qu7NzD9LWeyTTE9xZrJBBqZlWg3UTldn2SfLoujoPuwBMYGtWi7t cHH6HbH40Ag/0ubwyH1T1yM+5tPrYab+WXGZsl5AGrTvL3MYqUnQh X-Received: by 2002:a05:6402:3582:b0:416:6d78:c693 with SMTP id y2-20020a056402358200b004166d78c693mr1885060edc.24.1646726973208; Tue, 08 Mar 2022 00:09:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwX4vanJVIXL0r2uldoJOauafSu6vD8LH4bQI9ff/g3MAlWaGOGZ5yN4YqE3lb73p272nAkog== X-Received: by 2002:a05:6402:3582:b0:416:6d78:c693 with SMTP id y2-20020a056402358200b004166d78c693mr1885050edc.24.1646726973053; Tue, 08 Mar 2022 00:09:33 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id t4-20020a056402524400b00415b90801edsm7385697edd.57.2022.03.08.00.09.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 00:09:32 -0800 (PST) From: Krzysztof Kozlowski To: Krzysztof Kozlowski , Alim Akhtar , Greg Kroah-Hartman , Jiri Slaby , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 8/8] tty: serial: samsung: simplify getting OF match data Date: Tue, 8 Mar 2022 09:09:19 +0100 Message-Id: <20220308080919.152715-9-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> References: <20220308080919.152715-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220308_000936_395333_C2E9895D X-CRM114-Status: GOOD ( 14.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Simplify the code with of_device_get_match_data() and use dev_of_node() to remove ifdef-erry. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Alim Akhtar Tested-by: Alim Akhtar --- drivers/tty/serial/samsung_tty.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c index 3ffae912217c..74d466cc4152 100644 --- a/drivers/tty/serial/samsung_tty.c +++ b/drivers/tty/serial/samsung_tty.c @@ -2150,23 +2150,14 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, /* Device driver serial port probe */ -#ifdef CONFIG_OF -static const struct of_device_id s3c24xx_uart_dt_match[]; -#endif - static int probe_index; static inline const struct s3c24xx_serial_drv_data * s3c24xx_get_driver_data(struct platform_device *pdev) { -#ifdef CONFIG_OF - if (pdev->dev.of_node) { - const struct of_device_id *match; + if (dev_of_node(&pdev->dev)) + return of_device_get_match_data(&pdev->dev); - match = of_match_node(s3c24xx_uart_dt_match, pdev->dev.of_node); - return (struct s3c24xx_serial_drv_data *)match->data; - } -#endif return (struct s3c24xx_serial_drv_data *) platform_get_device_id(pdev)->driver_data; }