All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark yao <mark.yao@rock-chips.com>
To: Bhumika Goyal <bhumirks@gmail.com>,
	julia.lawall@lip6.fr, maxime.ripard@free-electrons.com,
	airlied@linux.ie, wens@csie.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, heiko@sntech.de,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 1/2] drm/rockchip: add const to drm_encoder_helper_funcs structures
Date: Wed, 21 Jun 2017 08:48:52 +0800	[thread overview]
Message-ID: <5949C274.6050806@rock-chips.com> (raw)
In-Reply-To: <1497964080-27301-2-git-send-email-bhumirks@gmail.com>

On 2017年06月20日 21:07, Bhumika Goyal wrote:
> Add const to drm_encoder_helper_funcs structures as they are only passed
> as an argument to the function drm_encoder_helper_add and this argument
> is of type const. So, add const to these structures. Also, fix line over
> 80 characters warning while adding const.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>   drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 ++-
>   drivers/gpu/drm/rockchip/inno_hdmi.c            | 2 +-
>   2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index 9606121..96c6c10 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -252,7 +252,8 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder,
>   	return 0;
>   }
>   
> -static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
> +static
> +const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {

I don't think split static and const into two line is a good idea, it's 
ugly. I'm ok over 80 characters with good-looking.
Or split like following:
static const struct drm_encoder_helper_funcs
rockchip_dp_encoder_helper_funcs = {

>   	.mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
>   	.mode_set = rockchip_dp_drm_encoder_mode_set,
>   	.enable = rockchip_dp_drm_encoder_enable,
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index 7d9b75e..4ab9fad 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -530,7 +530,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
>   	return 0;
>   }
>   
> -static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
> +static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
>   	.enable     = inno_hdmi_encoder_enable,
>   	.disable    = inno_hdmi_encoder_disable,
>   	.mode_fixup = inno_hdmi_encoder_mode_fixup,

Thanks

-- 
Mark Yao

WARNING: multiple messages have this Message-ID (diff)
From: Mark yao <mark.yao@rock-chips.com>
To: Bhumika Goyal <bhumirks@gmail.com>,
	julia.lawall@lip6.fr, maxime.ripard@free-electrons.com,
	airlied@linux.ie, wens@csie.org, dri-devel@lists.freedesktop.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, heiko@sntech.de,
	linux-rockchip@lists.infradead.org
Subject: Re: [PATCH 1/2] drm/rockchip: add const to drm_encoder_helper_funcs structures
Date: Wed, 21 Jun 2017 08:48:52 +0800	[thread overview]
Message-ID: <5949C274.6050806@rock-chips.com> (raw)
In-Reply-To: <1497964080-27301-2-git-send-email-bhumirks@gmail.com>

On 2017年06月20日 21:07, Bhumika Goyal wrote:
> Add const to drm_encoder_helper_funcs structures as they are only passed
> as an argument to the function drm_encoder_helper_add and this argument
> is of type const. So, add const to these structures. Also, fix line over
> 80 characters warning while adding const.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>   drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 ++-
>   drivers/gpu/drm/rockchip/inno_hdmi.c            | 2 +-
>   2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index 9606121..96c6c10 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -252,7 +252,8 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder,
>   	return 0;
>   }
>   
> -static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
> +static
> +const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {

I don't think split static and const into two line is a good idea, it's 
ugly. I'm ok over 80 characters with good-looking.
Or split like following:
static const struct drm_encoder_helper_funcs
rockchip_dp_encoder_helper_funcs = {

>   	.mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
>   	.mode_set = rockchip_dp_drm_encoder_mode_set,
>   	.enable = rockchip_dp_drm_encoder_enable,
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index 7d9b75e..4ab9fad 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -530,7 +530,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
>   	return 0;
>   }
>   
> -static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
> +static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
>   	.enable     = inno_hdmi_encoder_enable,
>   	.disable    = inno_hdmi_encoder_disable,
>   	.mode_fixup = inno_hdmi_encoder_mode_fixup,

Thanks

-- 
Mark Yao


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: mark.yao@rock-chips.com (Mark yao)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] drm/rockchip: add const to drm_encoder_helper_funcs structures
Date: Wed, 21 Jun 2017 08:48:52 +0800	[thread overview]
Message-ID: <5949C274.6050806@rock-chips.com> (raw)
In-Reply-To: <1497964080-27301-2-git-send-email-bhumirks@gmail.com>

On 2017?06?20? 21:07, Bhumika Goyal wrote:
> Add const to drm_encoder_helper_funcs structures as they are only passed
> as an argument to the function drm_encoder_helper_add and this argument
> is of type const. So, add const to these structures. Also, fix line over
> 80 characters warning while adding const.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>   drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 3 ++-
>   drivers/gpu/drm/rockchip/inno_hdmi.c            | 2 +-
>   2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> index 9606121..96c6c10 100644
> --- a/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> +++ b/drivers/gpu/drm/rockchip/analogix_dp-rockchip.c
> @@ -252,7 +252,8 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder,
>   	return 0;
>   }
>   
> -static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
> +static
> +const struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {

I don't think split static and const into two line is a good idea, it's 
ugly. I'm ok over 80 characters with good-looking.
Or split like following:
static const struct drm_encoder_helper_funcs
rockchip_dp_encoder_helper_funcs = {

>   	.mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
>   	.mode_set = rockchip_dp_drm_encoder_mode_set,
>   	.enable = rockchip_dp_drm_encoder_enable,
> diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c
> index 7d9b75e..4ab9fad 100644
> --- a/drivers/gpu/drm/rockchip/inno_hdmi.c
> +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c
> @@ -530,7 +530,7 @@ inno_hdmi_encoder_atomic_check(struct drm_encoder *encoder,
>   	return 0;
>   }
>   
> -static struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
> +static const struct drm_encoder_helper_funcs inno_hdmi_encoder_helper_funcs = {
>   	.enable     = inno_hdmi_encoder_enable,
>   	.disable    = inno_hdmi_encoder_disable,
>   	.mode_fixup = inno_hdmi_encoder_mode_fixup,

Thanks

-- 
?ark Yao

  reply	other threads:[~2017-06-21  0:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-20 13:07 [PATCH 0/2] drm: constify drm_encoder_helper_funcs structures Bhumika Goyal
2017-06-20 13:07 ` Bhumika Goyal
2017-06-20 13:07 ` [PATCH 1/2] drm/rockchip: add const to " Bhumika Goyal
2017-06-20 13:07   ` Bhumika Goyal
2017-06-21  0:48   ` Mark yao [this message]
2017-06-21  0:48     ` Mark yao
2017-06-21  0:48     ` Mark yao
2017-06-21  6:08     ` Bhumika Goyal
2017-06-21  6:08       ` Bhumika Goyal
2017-06-20 13:08 ` [PATCH 2/2] drm/sun4i: " Bhumika Goyal
2017-06-20 13:08   ` Bhumika Goyal
2017-06-20 13:35   ` Maxime Ripard
2017-06-20 13:35     ` Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5949C274.6050806@rock-chips.com \
    --to=mark.yao@rock-chips.com \
    --cc=airlied@linux.ie \
    --cc=bhumirks@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=heiko@sntech.de \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=maxime.ripard@free-electrons.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.