Commit 3aec4009 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Greg Kroah-Hartman

tty: serial: samsung: reduce number of casts

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: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20220308080919.152715-4-krzysztof.kozlowski@canonical.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7483189d
...@@ -2634,9 +2634,9 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = { ...@@ -2634,9 +2634,9 @@ static struct s3c24xx_serial_drv_data s3c2410_serial_drv_data = {
.ufcon = S3C2410_UFCON_DEFAULT, .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 #else
#define S3C2410_SERIAL_DRV_DATA (kernel_ulong_t)NULL #define S3C2410_SERIAL_DRV_DATA NULL
#endif #endif
#ifdef CONFIG_CPU_S3C2412 #ifdef CONFIG_CPU_S3C2412
...@@ -2663,9 +2663,9 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = { ...@@ -2663,9 +2663,9 @@ static struct s3c24xx_serial_drv_data s3c2412_serial_drv_data = {
.ufcon = S3C2410_UFCON_DEFAULT, .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 #else
#define S3C2412_SERIAL_DRV_DATA (kernel_ulong_t)NULL #define S3C2412_SERIAL_DRV_DATA NULL
#endif #endif
#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \ #if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2416) || \
...@@ -2694,9 +2694,9 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = { ...@@ -2694,9 +2694,9 @@ static struct s3c24xx_serial_drv_data s3c2440_serial_drv_data = {
.ufcon = S3C2410_UFCON_DEFAULT, .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 #else
#define S3C2440_SERIAL_DRV_DATA (kernel_ulong_t)NULL #define S3C2440_SERIAL_DRV_DATA NULL
#endif #endif
#if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410) #if defined(CONFIG_CPU_S3C6400) || defined(CONFIG_CPU_S3C6410)
...@@ -2723,9 +2723,9 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = { ...@@ -2723,9 +2723,9 @@ static struct s3c24xx_serial_drv_data s3c6400_serial_drv_data = {
.ufcon = S3C2410_UFCON_DEFAULT, .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 #else
#define S3C6400_SERIAL_DRV_DATA (kernel_ulong_t)NULL #define S3C6400_SERIAL_DRV_DATA NULL
#endif #endif
#ifdef CONFIG_CPU_S5PV210 #ifdef CONFIG_CPU_S5PV210
...@@ -2752,9 +2752,9 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = { ...@@ -2752,9 +2752,9 @@ static struct s3c24xx_serial_drv_data s5pv210_serial_drv_data = {
}, },
.fifosize = { 256, 64, 16, 16 }, .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 #else
#define S5PV210_SERIAL_DRV_DATA (kernel_ulong_t)NULL #define S5PV210_SERIAL_DRV_DATA NULL
#endif #endif
#if defined(CONFIG_ARCH_EXYNOS) #if defined(CONFIG_ARCH_EXYNOS)
...@@ -2796,14 +2796,14 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = { ...@@ -2796,14 +2796,14 @@ static struct s3c24xx_serial_drv_data exynos850_serial_drv_data = {
.fifosize = { 256, 64, 64, 64 }, .fifosize = { 256, 64, 64, 64 },
}; };
#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos4210_serial_drv_data) #define EXYNOS4210_SERIAL_DRV_DATA (&exynos4210_serial_drv_data)
#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos5433_serial_drv_data) #define EXYNOS5433_SERIAL_DRV_DATA (&exynos5433_serial_drv_data)
#define EXYNOS850_SERIAL_DRV_DATA ((kernel_ulong_t)&exynos850_serial_drv_data) #define EXYNOS850_SERIAL_DRV_DATA (&exynos850_serial_drv_data)
#else #else
#define EXYNOS4210_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) #define EXYNOS4210_SERIAL_DRV_DATA NULL
#define EXYNOS5433_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) #define EXYNOS5433_SERIAL_DRV_DATA NULL
#define EXYNOS850_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) #define EXYNOS850_SERIAL_DRV_DATA NULL
#endif #endif
#ifdef CONFIG_ARCH_APPLE #ifdef CONFIG_ARCH_APPLE
...@@ -2829,39 +2829,39 @@ static struct s3c24xx_serial_drv_data s5l_serial_drv_data = { ...@@ -2829,39 +2829,39 @@ static struct s3c24xx_serial_drv_data s5l_serial_drv_data = {
.ufcon = S3C2410_UFCON_DEFAULT, .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 #else
#define S5L_SERIAL_DRV_DATA ((kernel_ulong_t)NULL) #define S5L_SERIAL_DRV_DATA NULL
#endif #endif
static const struct platform_device_id s3c24xx_serial_driver_ids[] = { static const struct platform_device_id s3c24xx_serial_driver_ids[] = {
{ {
.name = "s3c2410-uart", .name = "s3c2410-uart",
.driver_data = S3C2410_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)S3C2410_SERIAL_DRV_DATA,
}, { }, {
.name = "s3c2412-uart", .name = "s3c2412-uart",
.driver_data = S3C2412_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)S3C2412_SERIAL_DRV_DATA,
}, { }, {
.name = "s3c2440-uart", .name = "s3c2440-uart",
.driver_data = S3C2440_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)S3C2440_SERIAL_DRV_DATA,
}, { }, {
.name = "s3c6400-uart", .name = "s3c6400-uart",
.driver_data = S3C6400_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)S3C6400_SERIAL_DRV_DATA,
}, { }, {
.name = "s5pv210-uart", .name = "s5pv210-uart",
.driver_data = S5PV210_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)S5PV210_SERIAL_DRV_DATA,
}, { }, {
.name = "exynos4210-uart", .name = "exynos4210-uart",
.driver_data = EXYNOS4210_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)EXYNOS4210_SERIAL_DRV_DATA,
}, { }, {
.name = "exynos5433-uart", .name = "exynos5433-uart",
.driver_data = EXYNOS5433_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)EXYNOS5433_SERIAL_DRV_DATA,
}, { }, {
.name = "s5l-uart", .name = "s5l-uart",
.driver_data = S5L_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)S5L_SERIAL_DRV_DATA,
}, { }, {
.name = "exynos850-uart", .name = "exynos850-uart",
.driver_data = EXYNOS850_SERIAL_DRV_DATA, .driver_data = (kernel_ulong_t)EXYNOS850_SERIAL_DRV_DATA,
}, },
{ }, { },
}; };
...@@ -2870,23 +2870,23 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_serial_driver_ids); ...@@ -2870,23 +2870,23 @@ MODULE_DEVICE_TABLE(platform, s3c24xx_serial_driver_ids);
#ifdef CONFIG_OF #ifdef CONFIG_OF
static const struct of_device_id s3c24xx_uart_dt_match[] = { static const struct of_device_id s3c24xx_uart_dt_match[] = {
{ .compatible = "samsung,s3c2410-uart", { .compatible = "samsung,s3c2410-uart",
.data = (void *)S3C2410_SERIAL_DRV_DATA }, .data = S3C2410_SERIAL_DRV_DATA },
{ .compatible = "samsung,s3c2412-uart", { .compatible = "samsung,s3c2412-uart",
.data = (void *)S3C2412_SERIAL_DRV_DATA }, .data = S3C2412_SERIAL_DRV_DATA },
{ .compatible = "samsung,s3c2440-uart", { .compatible = "samsung,s3c2440-uart",
.data = (void *)S3C2440_SERIAL_DRV_DATA }, .data = S3C2440_SERIAL_DRV_DATA },
{ .compatible = "samsung,s3c6400-uart", { .compatible = "samsung,s3c6400-uart",
.data = (void *)S3C6400_SERIAL_DRV_DATA }, .data = S3C6400_SERIAL_DRV_DATA },
{ .compatible = "samsung,s5pv210-uart", { .compatible = "samsung,s5pv210-uart",
.data = (void *)S5PV210_SERIAL_DRV_DATA }, .data = S5PV210_SERIAL_DRV_DATA },
{ .compatible = "samsung,exynos4210-uart", { .compatible = "samsung,exynos4210-uart",
.data = (void *)EXYNOS4210_SERIAL_DRV_DATA }, .data = EXYNOS4210_SERIAL_DRV_DATA },
{ .compatible = "samsung,exynos5433-uart", { .compatible = "samsung,exynos5433-uart",
.data = (void *)EXYNOS5433_SERIAL_DRV_DATA }, .data = EXYNOS5433_SERIAL_DRV_DATA },
{ .compatible = "apple,s5l-uart", { .compatible = "apple,s5l-uart",
.data = (void *)S5L_SERIAL_DRV_DATA }, .data = S5L_SERIAL_DRV_DATA },
{ .compatible = "samsung,exynos850-uart", { .compatible = "samsung,exynos850-uart",
.data = (void *)EXYNOS850_SERIAL_DRV_DATA }, .data = EXYNOS850_SERIAL_DRV_DATA },
{}, {},
}; };
MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match); MODULE_DEVICE_TABLE(of, s3c24xx_uart_dt_match);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment