diff mbox series

[02/60] video: hdmi: Change return type of hdmi_avi_infoframe_init() to void

Message ID 20190707180852.5512-3-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series drm/omap: Replace custom display drivers with drm_bridge and drm_panel | expand

Commit Message

Laurent Pinchart July 7, 2019, 6:07 p.m. UTC
The hdmi_avi_infoframe_init() never needs to return an error, change its
return type to void.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/drm_edid.c | 5 +----
 drivers/video/hdmi.c       | 9 ++-------
 include/linux/hdmi.h       | 2 +-
 3 files changed, 4 insertions(+), 12 deletions(-)

Comments

Laurent Pinchart July 7, 2019, 6:14 p.m. UTC | #1
Sorry, forgot to CC Bartlomiej on this patch.

On Sun, Jul 07, 2019 at 09:07:54PM +0300, Laurent Pinchart wrote:
> The hdmi_avi_infoframe_init() never needs to return an error, change its
> return type to void.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 5 +----
>  drivers/video/hdmi.c       | 9 ++-------
>  include/linux/hdmi.h       | 2 +-
>  3 files changed, 4 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index d2e7a5334c3f..a7d3189ea8f3 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -5086,14 +5086,11 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>  					 const struct drm_display_mode *mode)
>  {
>  	enum hdmi_picture_aspect picture_aspect;
> -	int err;
>  
>  	if (!frame || !mode)
>  		return -EINVAL;
>  
> -	err = hdmi_avi_infoframe_init(frame);
> -	if (err < 0)
> -		return err;
> +	hdmi_avi_infoframe_init(frame);
>  
>  	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
>  		frame->pixel_repeat = 1;
> diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
> index b939bc28d886..54fb7cf11d1a 100644
> --- a/drivers/video/hdmi.c
> +++ b/drivers/video/hdmi.c
> @@ -56,15 +56,13 @@ static void hdmi_infoframe_set_checksum(void *buffer, size_t size)
>   *
>   * Returns 0 on success or a negative error code on failure.
>   */
> -int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame)
> +void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame)
>  {
>  	memset(frame, 0, sizeof(*frame));
>  
>  	frame->type = HDMI_INFOFRAME_TYPE_AVI;
>  	frame->version = 2;
>  	frame->length = HDMI_AVI_INFOFRAME_SIZE;
> -
> -	return 0;
>  }
>  EXPORT_SYMBOL(hdmi_avi_infoframe_init);
>  
> @@ -1553,7 +1551,6 @@ static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame,
>  				     const void *buffer, size_t size)
>  {
>  	const u8 *ptr = buffer;
> -	int ret;
>  
>  	if (size < HDMI_INFOFRAME_SIZE(AVI))
>  		return -EINVAL;
> @@ -1566,9 +1563,7 @@ static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame,
>  	if (hdmi_infoframe_checksum(buffer, HDMI_INFOFRAME_SIZE(AVI)) != 0)
>  		return -EINVAL;
>  
> -	ret = hdmi_avi_infoframe_init(frame);
> -	if (ret)
> -		return ret;
> +	hdmi_avi_infoframe_init(frame);
>  
>  	ptr += HDMI_INFOFRAME_HEADER_SIZE;
>  
> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
> index 9918a6c910c5..9613d796cfb1 100644
> --- a/include/linux/hdmi.h
> +++ b/include/linux/hdmi.h
> @@ -207,7 +207,7 @@ struct hdmi_drm_infoframe {
>  	u16 max_fall;
>  };
>  
> -int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
> +void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
>  ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
>  				size_t size);
>  ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame,
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Ilia Mirkin July 7, 2019, 6:21 p.m. UTC | #2
On Sun, Jul 7, 2019 at 2:15 PM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Sorry, forgot to CC Bartlomiej on this patch.
>
> On Sun, Jul 07, 2019 at 09:07:54PM +0300, Laurent Pinchart wrote:
> > The hdmi_avi_infoframe_init() never needs to return an error, change its
> > return type to void.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  drivers/gpu/drm/drm_edid.c | 5 +----
> >  drivers/video/hdmi.c       | 9 ++-------
> >  include/linux/hdmi.h       | 2 +-
> >  3 files changed, 4 insertions(+), 12 deletions(-)
> >
> > diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
> > index b939bc28d886..54fb7cf11d1a 100644
> > --- a/drivers/video/hdmi.c
> > +++ b/drivers/video/hdmi.c
> > @@ -56,15 +56,13 @@ static void hdmi_infoframe_set_checksum(void *buffer, size_t size)
> >   *
> >   * Returns 0 on success or a negative error code on failure.

Probably want to adjust this text too, then?

[I have no opinion on whether this patch is good or bad, just happened
to notice the inconsistency.]

Cheers,

  -ilia

> >   */
> > -int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame)
> > +void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame)
> >  {
> >       memset(frame, 0, sizeof(*frame));
> >
> >       frame->type = HDMI_INFOFRAME_TYPE_AVI;
> >       frame->version = 2;
> >       frame->length = HDMI_AVI_INFOFRAME_SIZE;
> > -
> > -     return 0;
> >  }
> >  EXPORT_SYMBOL(hdmi_avi_infoframe_init);
> >
Andrzej Hajda July 9, 2019, 1:22 p.m. UTC | #3
On 07.07.2019 20:07, Laurent Pinchart wrote:
> The hdmi_avi_infoframe_init() never needs to return an error, change its
> return type to void.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>

 --
Regards
Andrzej
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index d2e7a5334c3f..a7d3189ea8f3 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -5086,14 +5086,11 @@  drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 					 const struct drm_display_mode *mode)
 {
 	enum hdmi_picture_aspect picture_aspect;
-	int err;
 
 	if (!frame || !mode)
 		return -EINVAL;
 
-	err = hdmi_avi_infoframe_init(frame);
-	if (err < 0)
-		return err;
+	hdmi_avi_infoframe_init(frame);
 
 	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
 		frame->pixel_repeat = 1;
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index b939bc28d886..54fb7cf11d1a 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -56,15 +56,13 @@  static void hdmi_infoframe_set_checksum(void *buffer, size_t size)
  *
  * Returns 0 on success or a negative error code on failure.
  */
-int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame)
+void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame)
 {
 	memset(frame, 0, sizeof(*frame));
 
 	frame->type = HDMI_INFOFRAME_TYPE_AVI;
 	frame->version = 2;
 	frame->length = HDMI_AVI_INFOFRAME_SIZE;
-
-	return 0;
 }
 EXPORT_SYMBOL(hdmi_avi_infoframe_init);
 
@@ -1553,7 +1551,6 @@  static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame,
 				     const void *buffer, size_t size)
 {
 	const u8 *ptr = buffer;
-	int ret;
 
 	if (size < HDMI_INFOFRAME_SIZE(AVI))
 		return -EINVAL;
@@ -1566,9 +1563,7 @@  static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame,
 	if (hdmi_infoframe_checksum(buffer, HDMI_INFOFRAME_SIZE(AVI)) != 0)
 		return -EINVAL;
 
-	ret = hdmi_avi_infoframe_init(frame);
-	if (ret)
-		return ret;
+	hdmi_avi_infoframe_init(frame);
 
 	ptr += HDMI_INFOFRAME_HEADER_SIZE;
 
diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
index 9918a6c910c5..9613d796cfb1 100644
--- a/include/linux/hdmi.h
+++ b/include/linux/hdmi.h
@@ -207,7 +207,7 @@  struct hdmi_drm_infoframe {
 	u16 max_fall;
 };
 
-int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
+void hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame);
 ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
 				size_t size);
 ssize_t hdmi_avi_infoframe_pack_only(const struct hdmi_avi_infoframe *frame,