Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1754537pxp; Mon, 7 Mar 2022 01:29:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxfshUEii4/v2BpH3lPsLE2lj8jDNBMNOI1h0os5CC33sj96Es2OiqTmZ54TxpQyJzA9Ua8 X-Received: by 2002:a05:6402:f07:b0:415:ce36:d414 with SMTP id i7-20020a0564020f0700b00415ce36d414mr10016687eda.233.1646645367926; Mon, 07 Mar 2022 01:29:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646645367; cv=none; d=google.com; s=arc-20160816; b=cY3sIT5IVtwYUInsiRR+h5a/lF5UFIon1fGzaP75sSzUU4uqTFr2F8hvH2zLmzIwzi 1MoPSa/Im1DHqpaYwizuJ3+3aHjrQX9+Wb1GK2RjwvgJdzS6/Lg7OkZ9XPveGSGNXGMY XePeULCvO0azu6FTpnrc7FHl/5dyl/D8YFucNBMePLbVLQAWGIqZwsfiEpJGO/WuPqxy G0XBReK96M2XH+bphr8U8U6CtAy90eHliSkh3K5QhUMKj/gk2dxZAg423cV/LIqePOgq 06ndD+C81ooBHLnDaObnxdKkqRcAE7V7QpgBYiFRAvzDAJ2eZt9AokbTyuXrmqtJW47p Og9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=eR7Mc9vi/w7iGpwa309YiCzl9zkdxojESdgSBLZGEv4=; b=O842lZoXC7ZM9QgY+k2BfER1st+mWfyFTcjHNHmBoUaBU09TsXkaHw/3InBNUSudsa NUPB3/H0OruPLcwKvnBPQzdVX3i5/astNEojqmc9W5g4cQfwK5rvyWh9QFc/RKaP4Hlf YYQoIWrvu1EY0ZfGj6n6XVTTn0oSUw56A0DN9Xks2WUmOjA5Na5hHTpIS5oJZ9ZgIeUD S/0cHUFr/k2w6xP49+1DV1B1FUOUefoGzoyunP9WqpJqz6TztmnR4okAAeXK4h1Ex2dS B6T+xvgKr72MJyCdWdWcJVMzVmfddyeuNHKXD6oOCN7x8BshKL0xt5Q/AFbCYK7a0jFL SesA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=sNowG0pJ; 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=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h2-20020a1709062dc200b006a727211d5csi6554633eji.152.2022.03.07.01.29.04; Mon, 07 Mar 2022 01:29:27 -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=@canonical.com header.s=20210705 header.b=sNowG0pJ; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236062AbiCGIJd (ORCPT + 99 others); Mon, 7 Mar 2022 03:09:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236064AbiCGIJR (ORCPT ); Mon, 7 Mar 2022 03:09:17 -0500 Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3750193DF for ; Mon, 7 Mar 2022 00:08:23 -0800 (PST) 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 8FE183F610 for ; Mon, 7 Mar 2022 08:08:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1646640502; bh=eR7Mc9vi/w7iGpwa309YiCzl9zkdxojESdgSBLZGEv4=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=sNowG0pJ2TSSnt9f6dK0Ww1LZSh1q8kAb99umQalH2q9mH0wEKBo9MenhslcAedR/ W3L2ZpGwQDu6+1eBObRj0iJdl+Dqt9B6wdQNg/PMy2MNB0p4NIKWnL8gJfvLe254HB zC1Tnfxe27a//jq4nRh6aLayAiIor4u368l1TY5h5ENmpdCPJvZ10L3lO3dHHnD6Fv weynCKoOaRknIL3VbnzeM6cTKRwzVlz1igzkBiyaeUOCQgilnve65sd7BzDB5Y4cgq EZD2q1y//mQzOiNTdcmZERyCd/vkrC1QkAhoIIiV4Oa8l+FxVOPfJnqVYskuwf2ok1 khaYAdL4m2sGw== Received: by mail-ej1-f69.google.com with SMTP id m4-20020a170906160400b006be3f85906eso6613781ejd.23 for ; Mon, 07 Mar 2022 00:08:22 -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:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eR7Mc9vi/w7iGpwa309YiCzl9zkdxojESdgSBLZGEv4=; b=Myl4oVEPc/Zv7jS2carE60Lq7XR9drj4yR5ewItllkwnp2tvppjIIltc2W02FewTfn ZnVIed2Kv29Crz4A6b2vT3w6WYvwdvtaQS/LdF19YHO2DqmJR0aPBJExfxjV60geeBP3 A3OenQKM1yDSzIxO778dpiAijtj+0ceGchlaiWYu4OdGonLEiNxJTgCx0UpS3ih/S+5A teFj+bD7W2pHLVrUoVysACTXcLmnASVAIXPJhr2+zGKTc0OXTUMC2STabCxRaeXYVhRL GpN5tICLnTeAU45MOglWj6gUSNAFW9vmzoVZnjs13p6I5ImExVrOcvRN6ezKcAorCWsA 3oTA== X-Gm-Message-State: AOAM531/XJKHBfR+FrOaypTwy6rxpRi9VFBnCER7gxFfTpZNEECfI/lQ 7YfgiumJM/bvAPryNf0hhruX5mLQY3F+Z1mAFmNunfYaCejAe2+9GTmByL9swOYgWJQTOcjNvZ5 NCLdmuei2YeD0SwryX3P5kme6FPnwx3N8FCs8Yw7VTQ== X-Received: by 2002:a05:6402:239b:b0:415:a36e:99c0 with SMTP id j27-20020a056402239b00b00415a36e99c0mr9870068eda.283.1646640500563; Mon, 07 Mar 2022 00:08:20 -0800 (PST) X-Received: by 2002:a05:6402:239b:b0:415:a36e:99c0 with SMTP id j27-20020a056402239b00b00415a36e99c0mr9870056eda.283.1646640500396; Mon, 07 Mar 2022 00:08:20 -0800 (PST) Received: from localhost.localdomain (xdsl-188-155-174-239.adslplus.ch. [188.155.174.239]) by smtp.gmail.com with ESMTPSA id fs6-20020a170907600600b006da8ec6e4a6sm4444584ejc.26.2022.03.07.00.08.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Mar 2022 00:08:19 -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 Subject: [PATCH v2 1/7] tty: serial: samsung: embed s3c24xx_uart_info in parent structure Date: Mon, 7 Mar 2022 09:08:04 +0100 Message-Id: <20220307080810.53847-2-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> References: <20220307080810.53847-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 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 --- 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, -- 2.32.0