* [PATCH] video: fbdev: sh_mobile_lcdcfb: use designated initializers
@ 2016-12-17 1:02 ` Kees Cook
0 siblings, 0 replies; 19+ messages in thread
From: Kees Cook @ 2016-12-17 1:02 UTC (permalink / raw)
To: linux-kernel; +Cc: Kees Cook, linux-fbdev
Prepare to mark sensitive kernel structures for randomization by making
sure they're using designated initializers. These were identified during
allyesconfig builds of x86, arm, and arm64, with most initializer fixes
extracted from grsecurity.
Signed-off-by: Kees Cook <keescook@chromium.org>
---
drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index 82c0a8caa9b8..42499a1afa07 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
}
static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
- lcdc_sys_write_index,
- lcdc_sys_write_data,
- lcdc_sys_read_data,
+ .write_index = lcdc_sys_write_index,
+ .write_data = lcdc_sys_write_data,
+ .read_data = lcdc_sys_read_data,
};
static int sh_mobile_lcdc_sginit(struct fb_info *info,
--
2.7.4
--
Kees Cook
Nexus Security
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: use designated initializers
2016-12-17 1:02 ` Kees Cook
@ 2016-12-19 13:11 ` Bartlomiej Zolnierkiewicz
-1 siblings, 0 replies; 19+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2016-12-19 13:11 UTC (permalink / raw)
To: Kees Cook; +Cc: linux-kernel, linux-fbdev
Hi,
On Friday, December 16, 2016 05:02:03 PM Kees Cook wrote:
> Prepare to mark sensitive kernel structures for randomization by making
> sure they're using designated initializers. These were identified during
> allyesconfig builds of x86, arm, and arm64, with most initializer fixes
> extracted from grsecurity.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
I have same request as Ingo for x86/floppy patch:
please align the two columns vertically while at it.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> index 82c0a8caa9b8..42499a1afa07 100644
> --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> @@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
> }
>
> static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
> - lcdc_sys_write_index,
> - lcdc_sys_write_data,
> - lcdc_sys_read_data,
> + .write_index = lcdc_sys_write_index,
> + .write_data = lcdc_sys_write_data,
> + .read_data = lcdc_sys_read_data,
> };
>
> static int sh_mobile_lcdc_sginit(struct fb_info *info,
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: use designated initializers
@ 2016-12-19 13:11 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 19+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2016-12-19 13:11 UTC (permalink / raw)
To: Kees Cook; +Cc: linux-kernel, linux-fbdev
Hi,
On Friday, December 16, 2016 05:02:03 PM Kees Cook wrote:
> Prepare to mark sensitive kernel structures for randomization by making
> sure they're using designated initializers. These were identified during
> allyesconfig builds of x86, arm, and arm64, with most initializer fixes
> extracted from grsecurity.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
I have same request as Ingo for x86/floppy patch:
please align the two columns vertically while at it.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
> ---
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> index 82c0a8caa9b8..42499a1afa07 100644
> --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> @@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
> }
>
> static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
> - lcdc_sys_write_index,
> - lcdc_sys_write_data,
> - lcdc_sys_read_data,
> + .write_index = lcdc_sys_write_index,
> + .write_data = lcdc_sys_write_data,
> + .read_data = lcdc_sys_read_data,
> };
>
> static int sh_mobile_lcdc_sginit(struct fb_info *info,
^ permalink raw reply [flat|nested] 19+ messages in thread
* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: use designated initializers
2016-12-17 1:02 ` Kees Cook
@ 2016-12-19 16:13 ` Geert Uytterhoeven
-1 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2016-12-19 16:13 UTC (permalink / raw)
To: Kees Cook
Cc: linux-kernel@vger.kernel.org, Linux Fbdev development list,
Linux-Renesas
On Sat, Dec 17, 2016 at 2:02 AM, Kees Cook <keescook@chromium.org> wrote:
> Prepare to mark sensitive kernel structures for randomization by making
> sure they're using designated initializers. These were identified during
> allyesconfig builds of x86, arm, and arm64, with most initializer fixes
> extracted from grsecurity.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> index 82c0a8caa9b8..42499a1afa07 100644
> --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> @@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
> }
>
> static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
> - lcdc_sys_write_index,
> - lcdc_sys_write_data,
> - lcdc_sys_read_data,
> + .write_index = lcdc_sys_write_index,
> + .write_data = lcdc_sys_write_data,
> + .read_data = lcdc_sys_read_data,
> };
>
> static int sh_mobile_lcdc_sginit(struct fb_info *info,
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: use designated initializers
@ 2016-12-19 16:13 ` Geert Uytterhoeven
0 siblings, 0 replies; 19+ messages in thread
From: Geert Uytterhoeven @ 2016-12-19 16:13 UTC (permalink / raw)
To: Kees Cook
Cc: linux-kernel@vger.kernel.org, Linux Fbdev development list,
Linux-Renesas
On Sat, Dec 17, 2016 at 2:02 AM, Kees Cook <keescook@chromium.org> wrote:
> Prepare to mark sensitive kernel structures for randomization by making
> sure they're using designated initializers. These were identified during
> allyesconfig builds of x86, arm, and arm64, with most initializer fixes
> extracted from grsecurity.
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> index 82c0a8caa9b8..42499a1afa07 100644
> --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> @@ -439,9 +439,9 @@ static unsigned long lcdc_sys_read_data(void *handle)
> }
>
> static struct sh_mobile_lcdc_sys_bus_ops sh_mobile_lcdc_sys_bus_ops = {
> - lcdc_sys_write_index,
> - lcdc_sys_write_data,
> - lcdc_sys_read_data,
> + .write_index = lcdc_sys_write_index,
> + .write_data = lcdc_sys_write_data,
> + .read_data = lcdc_sys_read_data,
> };
>
> static int sh_mobile_lcdc_sginit(struct fb_info *info,
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 19+ messages in thread
* [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/clk_di
@ 2020-10-14 8:57 ` Xu Wang
0 siblings, 0 replies; 19+ messages in thread
From: Xu Wang @ 2020-10-14 8:57 UTC (permalink / raw)
To: b.zolnierkie, gustavoars, arnd, daniel.vetter, jani.nikula,
dri-devel, linux-fbdev
Cc: linux-kernel
Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index c1043420dbd3..c0952cc96bdb 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv *priv,
static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
{
if (atomic_inc_and_test(&priv->hw_usecnt)) {
- if (priv->dot_clk)
- clk_prepare_enable(priv->dot_clk);
+ clk_prepare_enable(priv->dot_clk);
pm_runtime_get_sync(priv->dev);
}
}
@@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
{
if (atomic_sub_return(1, &priv->hw_usecnt) = -1) {
pm_runtime_put(priv->dev);
- if (priv->dot_clk)
- clk_disable_unprepare(priv->dot_clk);
+ clk_disable_unprepare(priv->dot_clk);
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
@ 2020-10-14 8:57 ` Xu Wang
0 siblings, 0 replies; 19+ messages in thread
From: Xu Wang @ 2020-10-14 8:57 UTC (permalink / raw)
To: b.zolnierkie, gustavoars, arnd, daniel.vetter, jani.nikula,
dri-devel, linux-fbdev
Cc: linux-kernel
Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index c1043420dbd3..c0952cc96bdb 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv *priv,
static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
{
if (atomic_inc_and_test(&priv->hw_usecnt)) {
- if (priv->dot_clk)
- clk_prepare_enable(priv->dot_clk);
+ clk_prepare_enable(priv->dot_clk);
pm_runtime_get_sync(priv->dev);
}
}
@@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
{
if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
pm_runtime_put(priv->dev);
- if (priv->dot_clk)
- clk_disable_unprepare(priv->dot_clk);
+ clk_disable_unprepare(priv->dot_clk);
}
}
--
2.17.1
^ permalink raw reply related [flat|nested] 19+ messages in thread* [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
@ 2020-10-14 8:57 ` Xu Wang
0 siblings, 0 replies; 19+ messages in thread
From: Xu Wang @ 2020-10-14 8:57 UTC (permalink / raw)
To: b.zolnierkie, gustavoars, arnd, daniel.vetter, jani.nikula,
dri-devel, linux-fbdev
Cc: linux-kernel
Because clk_prepare_enable() and clk_disable_unprepare() already checked
NULL clock parameter, so the additional checks are unnecessary, just
remove them.
Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
---
drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index c1043420dbd3..c0952cc96bdb 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv *priv,
static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
{
if (atomic_inc_and_test(&priv->hw_usecnt)) {
- if (priv->dot_clk)
- clk_prepare_enable(priv->dot_clk);
+ clk_prepare_enable(priv->dot_clk);
pm_runtime_get_sync(priv->dev);
}
}
@@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct sh_mobile_lcdc_priv *priv)
{
if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
pm_runtime_put(priv->dev);
- if (priv->dot_clk)
- clk_disable_unprepare(priv->dot_clk);
+ clk_disable_unprepare(priv->dot_clk);
}
}
--
2.17.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/cl
2020-10-14 8:57 ` Xu Wang
(?)
@ 2020-10-15 8:10 ` Thomas Zimmermann
-1 siblings, 0 replies; 19+ messages in thread
From: Thomas Zimmermann @ 2020-10-15 8:10 UTC (permalink / raw)
To: Xu Wang
Cc: linux-fbdev, arnd, b.zolnierkie, jani.nikula, daniel.vetter,
gustavoars, dri-devel, linux-kernel
On Wed, 14 Oct 2020 08:57:22 +0000 Xu Wang <vulab@iscas.ac.cn> wrote:
> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c1043420dbd3..c0952cc96bdb
> 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> @@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv
> *priv, static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
> {
> if (atomic_inc_and_test(&priv->hw_usecnt)) {
> - if (priv->dot_clk)
> - clk_prepare_enable(priv->dot_clk);
> + clk_prepare_enable(priv->dot_clk);
> pm_runtime_get_sync(priv->dev);
> }
> }
> @@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct
> sh_mobile_lcdc_priv *priv) {
> if (atomic_sub_return(1, &priv->hw_usecnt) = -1) {
> pm_runtime_put(priv->dev);
> - if (priv->dot_clk)
> - clk_disable_unprepare(priv->dot_clk);
> + clk_disable_unprepare(priv->dot_clk);
> }
> }
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
@ 2020-10-15 8:10 ` Thomas Zimmermann
0 siblings, 0 replies; 19+ messages in thread
From: Thomas Zimmermann @ 2020-10-15 8:10 UTC (permalink / raw)
To: Xu Wang
Cc: b.zolnierkie, gustavoars, arnd, daniel.vetter, jani.nikula,
dri-devel, linux-fbdev, linux-kernel
On Wed, 14 Oct 2020 08:57:22 +0000 Xu Wang <vulab@iscas.ac.cn> wrote:
> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c1043420dbd3..c0952cc96bdb
> 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> @@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv
> *priv, static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
> {
> if (atomic_inc_and_test(&priv->hw_usecnt)) {
> - if (priv->dot_clk)
> - clk_prepare_enable(priv->dot_clk);
> + clk_prepare_enable(priv->dot_clk);
> pm_runtime_get_sync(priv->dev);
> }
> }
> @@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct
> sh_mobile_lcdc_priv *priv) {
> if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
> pm_runtime_put(priv->dev);
> - if (priv->dot_clk)
> - clk_disable_unprepare(priv->dot_clk);
> + clk_disable_unprepare(priv->dot_clk);
> }
> }
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
@ 2020-10-15 8:10 ` Thomas Zimmermann
0 siblings, 0 replies; 19+ messages in thread
From: Thomas Zimmermann @ 2020-10-15 8:10 UTC (permalink / raw)
To: Xu Wang
Cc: linux-fbdev, arnd, b.zolnierkie, jani.nikula, daniel.vetter,
gustavoars, dri-devel, linux-kernel
On Wed, 14 Oct 2020 08:57:22 +0000 Xu Wang <vulab@iscas.ac.cn> wrote:
> Because clk_prepare_enable() and clk_disable_unprepare() already checked
> NULL clock parameter, so the additional checks are unnecessary, just
> remove them.
>
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c1043420dbd3..c0952cc96bdb
> 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> @@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv
> *priv, static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
> {
> if (atomic_inc_and_test(&priv->hw_usecnt)) {
> - if (priv->dot_clk)
> - clk_prepare_enable(priv->dot_clk);
> + clk_prepare_enable(priv->dot_clk);
> pm_runtime_get_sync(priv->dev);
> }
> }
> @@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct
> sh_mobile_lcdc_priv *priv) {
> if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
> pm_runtime_put(priv->dev);
> - if (priv->dot_clk)
> - clk_disable_unprepare(priv->dot_clk);
> + clk_disable_unprepare(priv->dot_clk);
> }
> }
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/cl
2020-10-15 8:10 ` Thomas Zimmermann
(?)
@ 2020-10-16 10:56 ` Thomas Zimmermann
-1 siblings, 0 replies; 19+ messages in thread
From: Thomas Zimmermann @ 2020-10-16 10:56 UTC (permalink / raw)
To: Xu Wang
Cc: linux-fbdev, arnd, b.zolnierkie, jani.nikula, daniel.vetter,
gustavoars, dri-devel, linux-kernel
On Thu, 15 Oct 2020 10:10:15 +0200 Thomas Zimmermann <tzimmermann@suse.de>
wrote:
> On Wed, 14 Oct 2020 08:57:22 +0000 Xu Wang <vulab@iscas.ac.cn> wrote:
>
> > Because clk_prepare_enable() and clk_disable_unprepare() already checked
> > NULL clock parameter, so the additional checks are unnecessary, just
> > remove them.
> >
> > Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
Merged into drm-misc-next. Thanks!
> > ---
> > drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c1043420dbd3..c0952cc96bdb
> > 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > @@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv
> > *priv, static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
> > {
> > if (atomic_inc_and_test(&priv->hw_usecnt)) {
> > - if (priv->dot_clk)
> > - clk_prepare_enable(priv->dot_clk);
> > + clk_prepare_enable(priv->dot_clk);
> > pm_runtime_get_sync(priv->dev);
> > }
> > }
> > @@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct
> > sh_mobile_lcdc_priv *priv) {
> > if (atomic_sub_return(1, &priv->hw_usecnt) = -1) {
> > pm_runtime_put(priv->dev);
> > - if (priv->dot_clk)
> > - clk_disable_unprepare(priv->dot_clk);
> > + clk_disable_unprepare(priv->dot_clk);
> > }
> > }
> >
>
>
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
@ 2020-10-16 10:56 ` Thomas Zimmermann
0 siblings, 0 replies; 19+ messages in thread
From: Thomas Zimmermann @ 2020-10-16 10:56 UTC (permalink / raw)
To: Xu Wang
Cc: linux-fbdev, arnd, b.zolnierkie, jani.nikula, daniel.vetter,
gustavoars, dri-devel, linux-kernel
On Thu, 15 Oct 2020 10:10:15 +0200 Thomas Zimmermann <tzimmermann@suse.de>
wrote:
> On Wed, 14 Oct 2020 08:57:22 +0000 Xu Wang <vulab@iscas.ac.cn> wrote:
>
> > Because clk_prepare_enable() and clk_disable_unprepare() already checked
> > NULL clock parameter, so the additional checks are unnecessary, just
> > remove them.
> >
> > Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
Merged into drm-misc-next. Thanks!
> > ---
> > drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c1043420dbd3..c0952cc96bdb
> > 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > @@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv
> > *priv, static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
> > {
> > if (atomic_inc_and_test(&priv->hw_usecnt)) {
> > - if (priv->dot_clk)
> > - clk_prepare_enable(priv->dot_clk);
> > + clk_prepare_enable(priv->dot_clk);
> > pm_runtime_get_sync(priv->dev);
> > }
> > }
> > @@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct
> > sh_mobile_lcdc_priv *priv) {
> > if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
> > pm_runtime_put(priv->dev);
> > - if (priv->dot_clk)
> > - clk_disable_unprepare(priv->dot_clk);
> > + clk_disable_unprepare(priv->dot_clk);
> > }
> > }
> >
>
>
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
^ permalink raw reply [flat|nested] 19+ messages in thread* Re: [PATCH] video: fbdev: sh_mobile_lcdcfb: Remove redundant null check before clk_prepare_enable/clk_disable_unprepare
@ 2020-10-16 10:56 ` Thomas Zimmermann
0 siblings, 0 replies; 19+ messages in thread
From: Thomas Zimmermann @ 2020-10-16 10:56 UTC (permalink / raw)
To: Xu Wang
Cc: linux-fbdev, arnd, b.zolnierkie, jani.nikula, daniel.vetter,
gustavoars, dri-devel, linux-kernel
On Thu, 15 Oct 2020 10:10:15 +0200 Thomas Zimmermann <tzimmermann@suse.de>
wrote:
> On Wed, 14 Oct 2020 08:57:22 +0000 Xu Wang <vulab@iscas.ac.cn> wrote:
>
> > Because clk_prepare_enable() and clk_disable_unprepare() already checked
> > NULL clock parameter, so the additional checks are unnecessary, just
> > remove them.
> >
> > Signed-off-by: Xu Wang <vulab@iscas.ac.cn>
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
Merged into drm-misc-next. Thanks!
> > ---
> > drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++----
> > 1 file changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > b/drivers/video/fbdev/sh_mobile_lcdcfb.c index c1043420dbd3..c0952cc96bdb
> > 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
> > @@ -341,8 +341,7 @@ static void lcdc_wait_bit(struct sh_mobile_lcdc_priv
> > *priv, static void sh_mobile_lcdc_clk_on(struct sh_mobile_lcdc_priv *priv)
> > {
> > if (atomic_inc_and_test(&priv->hw_usecnt)) {
> > - if (priv->dot_clk)
> > - clk_prepare_enable(priv->dot_clk);
> > + clk_prepare_enable(priv->dot_clk);
> > pm_runtime_get_sync(priv->dev);
> > }
> > }
> > @@ -351,8 +350,7 @@ static void sh_mobile_lcdc_clk_off(struct
> > sh_mobile_lcdc_priv *priv) {
> > if (atomic_sub_return(1, &priv->hw_usecnt) == -1) {
> > pm_runtime_put(priv->dev);
> > - if (priv->dot_clk)
> > - clk_disable_unprepare(priv->dot_clk);
> > + clk_disable_unprepare(priv->dot_clk);
> > }
> > }
> >
>
>
>
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 19+ messages in thread