dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const
@ 2020-03-16 16:42 Geert Uytterhoeven
  2020-03-20 12:28 ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2020-03-16 16:42 UTC (permalink / raw)
  To: Noralf Trønnes, Maarten Lankhorst, Maxime Ripard,
	Thomas Zimmermann, David Airlie, Daniel Vetter
  Cc: Geert Uytterhoeven, dri-devel

mipi_dbi_command_stackbuf() copies the passed buffer data, so it can be
const.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/gpu/drm/drm_mipi_dbi.c | 3 ++-
 include/drm/drm_mipi_dbi.h     | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
index 558baf989f5a8432..89e911ccea06cf99 100644
--- a/drivers/gpu/drm/drm_mipi_dbi.c
+++ b/drivers/gpu/drm/drm_mipi_dbi.c
@@ -169,7 +169,8 @@ int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
 EXPORT_SYMBOL(mipi_dbi_command_buf);
 
 /* This should only be used by mipi_dbi_command() */
-int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
+int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
+			      size_t len)
 {
 	u8 *buf;
 	int ret;
diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
index 33f325f5af2b921f..9333b9086c30bd3c 100644
--- a/include/drm/drm_mipi_dbi.h
+++ b/include/drm/drm_mipi_dbi.h
@@ -170,7 +170,8 @@ int mipi_dbi_spi_transfer(struct spi_device *spi, u32 speed_hz,
 
 int mipi_dbi_command_read(struct mipi_dbi *dbi, u8 cmd, u8 *val);
 int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
-int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
+int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
+			      size_t len);
 int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
 		      struct drm_rect *clip, bool swap);
 /**
@@ -187,7 +188,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
  */
 #define mipi_dbi_command(dbi, cmd, seq...) \
 ({ \
-	u8 d[] = { seq }; \
+	const u8 d[] = { seq }; \
 	mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
 })
 
-- 
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] 4+ messages in thread

* Re: [PATCH] drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const
  2020-03-16 16:42 [PATCH] drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const Geert Uytterhoeven
@ 2020-03-20 12:28 ` Sam Ravnborg
  2020-03-20 12:35   ` Noralf Trønnes
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2020-03-20 12:28 UTC (permalink / raw)
  To: Geert Uytterhoeven, Noralf Trønnes
  Cc: Thomas Zimmermann, David Airlie, dri-devel

Hi Noralf.

On Mon, Mar 16, 2020 at 05:42:49PM +0100, Geert Uytterhoeven wrote:
> mipi_dbi_command_stackbuf() copies the passed buffer data, so it can be
> const.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

OK to merge?
Looks good to me and build did not break.

	Sam

> ---
>  drivers/gpu/drm/drm_mipi_dbi.c | 3 ++-
>  include/drm/drm_mipi_dbi.h     | 5 +++--
>  2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
> index 558baf989f5a8432..89e911ccea06cf99 100644
> --- a/drivers/gpu/drm/drm_mipi_dbi.c
> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
> @@ -169,7 +169,8 @@ int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
>  EXPORT_SYMBOL(mipi_dbi_command_buf);
>  
>  /* This should only be used by mipi_dbi_command() */
> -int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
> +int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
> +			      size_t len)
>  {
>  	u8 *buf;
>  	int ret;
> diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
> index 33f325f5af2b921f..9333b9086c30bd3c 100644
> --- a/include/drm/drm_mipi_dbi.h
> +++ b/include/drm/drm_mipi_dbi.h
> @@ -170,7 +170,8 @@ int mipi_dbi_spi_transfer(struct spi_device *spi, u32 speed_hz,
>  
>  int mipi_dbi_command_read(struct mipi_dbi *dbi, u8 cmd, u8 *val);
>  int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
> -int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
> +int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
> +			      size_t len);
>  int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
>  		      struct drm_rect *clip, bool swap);
>  /**
> @@ -187,7 +188,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
>   */
>  #define mipi_dbi_command(dbi, cmd, seq...) \
>  ({ \
> -	u8 d[] = { seq }; \
> +	const u8 d[] = { seq }; \
>  	mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
>  })
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const
  2020-03-20 12:28 ` Sam Ravnborg
@ 2020-03-20 12:35   ` Noralf Trønnes
  2020-03-21 21:01     ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Noralf Trønnes @ 2020-03-20 12:35 UTC (permalink / raw)
  To: Sam Ravnborg, Geert Uytterhoeven
  Cc: Thomas Zimmermann, David Airlie, dri-devel



Den 20.03.2020 13.28, skrev Sam Ravnborg:
> Hi Noralf.
> 
> On Mon, Mar 16, 2020 at 05:42:49PM +0100, Geert Uytterhoeven wrote:
>> mipi_dbi_command_stackbuf() copies the passed buffer data, so it can be
>> const.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> 
> OK to merge?
> Looks good to me and build did not break.

Sure, I planned to look at it this weekend, but if you can apply it, great.

Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

Noralf.

> 
> 	Sam
> 
>> ---
>>  drivers/gpu/drm/drm_mipi_dbi.c | 3 ++-
>>  include/drm/drm_mipi_dbi.h     | 5 +++--
>>  2 files changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
>> index 558baf989f5a8432..89e911ccea06cf99 100644
>> --- a/drivers/gpu/drm/drm_mipi_dbi.c
>> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
>> @@ -169,7 +169,8 @@ int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
>>  EXPORT_SYMBOL(mipi_dbi_command_buf);
>>  
>>  /* This should only be used by mipi_dbi_command() */
>> -int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
>> +int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
>> +			      size_t len)
>>  {
>>  	u8 *buf;
>>  	int ret;
>> diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
>> index 33f325f5af2b921f..9333b9086c30bd3c 100644
>> --- a/include/drm/drm_mipi_dbi.h
>> +++ b/include/drm/drm_mipi_dbi.h
>> @@ -170,7 +170,8 @@ int mipi_dbi_spi_transfer(struct spi_device *spi, u32 speed_hz,
>>  
>>  int mipi_dbi_command_read(struct mipi_dbi *dbi, u8 cmd, u8 *val);
>>  int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
>> -int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
>> +int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
>> +			      size_t len);
>>  int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
>>  		      struct drm_rect *clip, bool swap);
>>  /**
>> @@ -187,7 +188,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
>>   */
>>  #define mipi_dbi_command(dbi, cmd, seq...) \
>>  ({ \
>> -	u8 d[] = { seq }; \
>> +	const u8 d[] = { seq }; \
>>  	mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
>>  })
>>  
>> -- 
>> 2.17.1
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const
  2020-03-20 12:35   ` Noralf Trønnes
@ 2020-03-21 21:01     ` Sam Ravnborg
  0 siblings, 0 replies; 4+ messages in thread
From: Sam Ravnborg @ 2020-03-21 21:01 UTC (permalink / raw)
  To: Noralf Trønnes
  Cc: David Airlie, dri-devel, Thomas Zimmermann, Geert Uytterhoeven

On Fri, Mar 20, 2020 at 01:35:31PM +0100, Noralf Trønnes wrote:
> 
> 
> Den 20.03.2020 13.28, skrev Sam Ravnborg:
> > Hi Noralf.
> > 
> > On Mon, Mar 16, 2020 at 05:42:49PM +0100, Geert Uytterhoeven wrote:
> >> mipi_dbi_command_stackbuf() copies the passed buffer data, so it can be
> >> const.
> >>
> >> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > 
> > OK to merge?
> > Looks good to me and build did not break.
> 
> Sure, I planned to look at it this weekend, but if you can apply it, great.
> 
> Reviewed-by: Noralf Trønnes <noralf@tronnes.org>

Applied to drm-misc-next.

	Sam

> 
> Noralf.
> 
> > 
> > 	Sam
> > 
> >> ---
> >>  drivers/gpu/drm/drm_mipi_dbi.c | 3 ++-
> >>  include/drm/drm_mipi_dbi.h     | 5 +++--
> >>  2 files changed, 5 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c
> >> index 558baf989f5a8432..89e911ccea06cf99 100644
> >> --- a/drivers/gpu/drm/drm_mipi_dbi.c
> >> +++ b/drivers/gpu/drm/drm_mipi_dbi.c
> >> @@ -169,7 +169,8 @@ int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
> >>  EXPORT_SYMBOL(mipi_dbi_command_buf);
> >>  
> >>  /* This should only be used by mipi_dbi_command() */
> >> -int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len)
> >> +int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
> >> +			      size_t len)
> >>  {
> >>  	u8 *buf;
> >>  	int ret;
> >> diff --git a/include/drm/drm_mipi_dbi.h b/include/drm/drm_mipi_dbi.h
> >> index 33f325f5af2b921f..9333b9086c30bd3c 100644
> >> --- a/include/drm/drm_mipi_dbi.h
> >> +++ b/include/drm/drm_mipi_dbi.h
> >> @@ -170,7 +170,8 @@ int mipi_dbi_spi_transfer(struct spi_device *spi, u32 speed_hz,
> >>  
> >>  int mipi_dbi_command_read(struct mipi_dbi *dbi, u8 cmd, u8 *val);
> >>  int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
> >> -int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len);
> >> +int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data,
> >> +			      size_t len);
> >>  int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
> >>  		      struct drm_rect *clip, bool swap);
> >>  /**
> >> @@ -187,7 +188,7 @@ int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb,
> >>   */
> >>  #define mipi_dbi_command(dbi, cmd, seq...) \
> >>  ({ \
> >> -	u8 d[] = { seq }; \
> >> +	const u8 d[] = { seq }; \
> >>  	mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \
> >>  })
> >>  
> >> -- 
> >> 2.17.1
> >>
> >> _______________________________________________
> >> dri-devel mailing list
> >> dri-devel@lists.freedesktop.org
> >> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-03-21 21:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-16 16:42 [PATCH] drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const Geert Uytterhoeven
2020-03-20 12:28 ` Sam Ravnborg
2020-03-20 12:35   ` Noralf Trønnes
2020-03-21 21:01     ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).