diff mbox series

[2/2] drm/amd/display: dc_link: code clean up on detect_dp function

Message ID 9961afca2cf831ac688025a63b7cd35dd0908fac.1582752490.git.melissa.srw@gmail.com (mailing list archive)
State New, archived
Headers show
Series drm/amd/display: dc_link: cleaning up some code style issues | expand

Commit Message

Melissa Wen Feb. 26, 2020, 10:08 p.m. UTC
Removes codestyle issues on detect_dp function as suggested by
checkpatch.pl.

CHECK: Lines should not end with a '('
WARNING: Missing a blank line after declarations
WARNING: line over 80 characters
CHECK: Alignment should match open parenthesis

Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 35 +++++++++----------
 1 file changed, 16 insertions(+), 19 deletions(-)

Comments

Liu, Zhan Feb. 27, 2020, 6:39 p.m. UTC | #1
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Melissa Wen
> Sent: 2020/February/26, Wednesday 5:08 PM
> To: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo)
> <Sunpeng.Li@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> <David1.Zhou@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter
> <daniel@ffwll.ch>; Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Cc: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH 2/2] drm/amd/display: dc_link: code clean up on detect_dp
> function
> 
> Removes codestyle issues on detect_dp function as suggested by
> checkpatch.pl.
> 
> CHECK: Lines should not end with a '('
> WARNING: Missing a blank line after declarations
> WARNING: line over 80 characters
> CHECK: Alignment should match open parenthesis
> 
> Signed-off-by: Melissa Wen <melissa.srw@gmail.com>

Thank you Melissa for your contribution! Will apply it.

This patch is:
Reviewed-by: Zhan Liu <zhan.liu@amd.com>

> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 35 +++++++++----------
>  1 file changed, 16 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 0f28b5694144..adb717f02c9c 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -585,14 +585,14 @@ static void
> read_current_link_settings_on_detect(struct dc_link *link)
>  		LINK_SPREAD_05_DOWNSPREAD_30KHZ :
> LINK_SPREAD_DISABLED;  }
> 
> -static bool detect_dp(
> -	struct dc_link *link,
> -	struct display_sink_capability *sink_caps,
> -	bool *converter_disable_audio,
> -	struct audio_support *audio_support,
> -	enum dc_detect_reason reason)
> +static bool detect_dp(struct dc_link *link,
> +		      struct display_sink_capability *sink_caps,
> +		      bool *converter_disable_audio,
> +		      struct audio_support *audio_support,
> +		      enum dc_detect_reason reason)
>  {
>  	bool boot = false;
> +
>  	sink_caps->signal = link_detect_sink(link, reason);
>  	sink_caps->transaction_type =
>  		get_ddc_transaction_type(sink_caps->signal);
> @@ -606,9 +606,8 @@ static bool detect_dp(
>  			sink_caps->signal =
> SIGNAL_TYPE_DISPLAY_PORT_MST;
>  			link->type = dc_connection_mst_branch;
> 
> -			dal_ddc_service_set_transaction_type(
> -							link->ddc,
> -							sink_caps-
> >transaction_type);
> +			dal_ddc_service_set_transaction_type(link->ddc,
> +							     sink_caps-
> >transaction_type);
> 
>  			/*
>  			 * This call will initiate MST topology discovery.
> Which @@ -637,13 +636,10 @@ static bool detect_dp(
>  			if (reason == DETECT_REASON_BOOT)
>  				boot = true;
> 
> -			dm_helpers_dp_update_branch_info(
> -				link->ctx,
> -				link);
> +			dm_helpers_dp_update_branch_info(link->ctx, link);
> 
> -			if (!dm_helpers_dp_mst_start_top_mgr(
> -				link->ctx,
> -				link, boot)) {
> +			if (!dm_helpers_dp_mst_start_top_mgr(link->ctx,
> +							     link, boot)) {
>  				/* MST not supported */
>  				link->type = dc_connection_single;
>  				sink_caps->signal =
> SIGNAL_TYPE_DISPLAY_PORT; @@ -651,7 +647,7 @@ static bool detect_dp(
>  		}
> 
>  		if (link->type != dc_connection_mst_branch &&
> -			is_dp_active_dongle(link)) {
> +		    is_dp_active_dongle(link)) {
>  			/* DP active dongles */
>  			link->type = dc_connection_active_dongle;
>  			if (!link->dpcd_caps.sink_count.bits.SINK_COUNT)
> { @@ -662,14 +658,15 @@ static bool detect_dp(
>  				return true;
>  			}
> 
> -			if (link->dpcd_caps.dongle_type !=
> DISPLAY_DONGLE_DP_HDMI_CONVERTER)
> +			if (link->dpcd_caps.dongle_type !=
> +			    DISPLAY_DONGLE_DP_HDMI_CONVERTER)
>  				*converter_disable_audio = true;
>  		}
>  	} else {
>  		/* DP passive dongles */
>  		sink_caps->signal = dp_passive_dongle_detection(link->ddc,
> -				sink_caps,
> -				audio_support);
> +								sink_caps,
> +
> 	audio_support);
>  	}
> 
>  	return true;
> --
> 2.25.0
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
Liu, Zhan Feb. 27, 2020, 6:48 p.m. UTC | #2
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Liu,
> Zhan
> Sent: 2020/February/27, Thursday 1:40 PM
> To: Melissa Wen <melissa.srw@gmail.com>; Wentland, Harry
> <Harry.Wentland@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>;
> Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian
> <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> <David1.Zhou@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter
> <daniel@ffwll.ch>; Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; linux-
> kernel@vger.kernel.org
> Subject: RE: [PATCH 2/2] drm/amd/display: dc_link: code clean up on
> detect_dp function
> 
> 
> > -----Original Message-----
> > From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> > Melissa Wen
> > Sent: 2020/February/26, Wednesday 5:08 PM
> > To: Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo)
> > <Sunpeng.Li@amd.com>; Deucher, Alexander
> <Alexander.Deucher@amd.com>;
> > Koenig, Christian <Christian.Koenig@amd.com>; Zhou, David(ChunMing)
> > <David1.Zhou@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter
> > <daniel@ffwll.ch>; Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > Cc: dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org;
> > linux- kernel@vger.kernel.org
> > Subject: [PATCH 2/2] drm/amd/display: dc_link: code clean up on
> > detect_dp function
> >
> > Removes codestyle issues on detect_dp function as suggested by
> > checkpatch.pl.
> >
> > CHECK: Lines should not end with a '('
> > WARNING: Missing a blank line after declarations
> > WARNING: line over 80 characters
> > CHECK: Alignment should match open parenthesis
> >
> > Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
> 
> Thank you Melissa for your contribution! Will apply it.
> 
> This patch is:
> Reviewed-by: Zhan Liu <zhan.liu@amd.com>

Sorry I didn't see Rodrigo already replied your email. Please send us a V2, then we will review your V2 patch.

And again, thank you so much for your contribution!

Zhan

> 
> > ---
> >  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 35
> > +++++++++----------
> >  1 file changed, 16 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > index 0f28b5694144..adb717f02c9c 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > @@ -585,14 +585,14 @@ static void
> > read_current_link_settings_on_detect(struct dc_link *link)
> >  		LINK_SPREAD_05_DOWNSPREAD_30KHZ :
> > LINK_SPREAD_DISABLED;  }
> >
> > -static bool detect_dp(
> > -	struct dc_link *link,
> > -	struct display_sink_capability *sink_caps,
> > -	bool *converter_disable_audio,
> > -	struct audio_support *audio_support,
> > -	enum dc_detect_reason reason)
> > +static bool detect_dp(struct dc_link *link,
> > +		      struct display_sink_capability *sink_caps,
> > +		      bool *converter_disable_audio,
> > +		      struct audio_support *audio_support,
> > +		      enum dc_detect_reason reason)
> >  {
> >  	bool boot = false;
> > +
> >  	sink_caps->signal = link_detect_sink(link, reason);
> >  	sink_caps->transaction_type =
> >  		get_ddc_transaction_type(sink_caps->signal);
> > @@ -606,9 +606,8 @@ static bool detect_dp(
> >  			sink_caps->signal =
> > SIGNAL_TYPE_DISPLAY_PORT_MST;
> >  			link->type = dc_connection_mst_branch;
> >
> > -			dal_ddc_service_set_transaction_type(
> > -							link->ddc,
> > -							sink_caps-
> > >transaction_type);
> > +			dal_ddc_service_set_transaction_type(link->ddc,
> > +							     sink_caps-
> > >transaction_type);
> >
> >  			/*
> >  			 * This call will initiate MST topology discovery.
> > Which @@ -637,13 +636,10 @@ static bool detect_dp(
> >  			if (reason == DETECT_REASON_BOOT)
> >  				boot = true;
> >
> > -			dm_helpers_dp_update_branch_info(
> > -				link->ctx,
> > -				link);
> > +			dm_helpers_dp_update_branch_info(link->ctx, link);
> >
> > -			if (!dm_helpers_dp_mst_start_top_mgr(
> > -				link->ctx,
> > -				link, boot)) {
> > +			if (!dm_helpers_dp_mst_start_top_mgr(link->ctx,
> > +							     link, boot)) {
> >  				/* MST not supported */
> >  				link->type = dc_connection_single;
> >  				sink_caps->signal =
> > SIGNAL_TYPE_DISPLAY_PORT; @@ -651,7 +647,7 @@ static bool
> detect_dp(
> >  		}
> >
> >  		if (link->type != dc_connection_mst_branch &&
> > -			is_dp_active_dongle(link)) {
> > +		    is_dp_active_dongle(link)) {
> >  			/* DP active dongles */
> >  			link->type = dc_connection_active_dongle;
> >  			if (!link->dpcd_caps.sink_count.bits.SINK_COUNT)
> > { @@ -662,14 +658,15 @@ static bool detect_dp(
> >  				return true;
> >  			}
> >
> > -			if (link->dpcd_caps.dongle_type !=
> > DISPLAY_DONGLE_DP_HDMI_CONVERTER)
> > +			if (link->dpcd_caps.dongle_type !=
> > +			    DISPLAY_DONGLE_DP_HDMI_CONVERTER)
> >  				*converter_disable_audio = true;
> >  		}
> >  	} else {
> >  		/* DP passive dongles */
> >  		sink_caps->signal = dp_passive_dongle_detection(link->ddc,
> > -				sink_caps,
> > -				audio_support);
> > +								sink_caps,
> > +
> > 	audio_support);
> >  	}
> >
> >  	return true;
> > --
> > 2.25.0
> >
> > _______________________________________________
> > amd-gfx mailing list
> > amd-gfx@lists.freedesktop.org
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
diff mbox series

Patch

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 0f28b5694144..adb717f02c9c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -585,14 +585,14 @@  static void read_current_link_settings_on_detect(struct dc_link *link)
 		LINK_SPREAD_05_DOWNSPREAD_30KHZ : LINK_SPREAD_DISABLED;
 }
 
-static bool detect_dp(
-	struct dc_link *link,
-	struct display_sink_capability *sink_caps,
-	bool *converter_disable_audio,
-	struct audio_support *audio_support,
-	enum dc_detect_reason reason)
+static bool detect_dp(struct dc_link *link,
+		      struct display_sink_capability *sink_caps,
+		      bool *converter_disable_audio,
+		      struct audio_support *audio_support,
+		      enum dc_detect_reason reason)
 {
 	bool boot = false;
+
 	sink_caps->signal = link_detect_sink(link, reason);
 	sink_caps->transaction_type =
 		get_ddc_transaction_type(sink_caps->signal);
@@ -606,9 +606,8 @@  static bool detect_dp(
 			sink_caps->signal = SIGNAL_TYPE_DISPLAY_PORT_MST;
 			link->type = dc_connection_mst_branch;
 
-			dal_ddc_service_set_transaction_type(
-							link->ddc,
-							sink_caps->transaction_type);
+			dal_ddc_service_set_transaction_type(link->ddc,
+							     sink_caps->transaction_type);
 
 			/*
 			 * This call will initiate MST topology discovery. Which
@@ -637,13 +636,10 @@  static bool detect_dp(
 			if (reason == DETECT_REASON_BOOT)
 				boot = true;
 
-			dm_helpers_dp_update_branch_info(
-				link->ctx,
-				link);
+			dm_helpers_dp_update_branch_info(link->ctx, link);
 
-			if (!dm_helpers_dp_mst_start_top_mgr(
-				link->ctx,
-				link, boot)) {
+			if (!dm_helpers_dp_mst_start_top_mgr(link->ctx,
+							     link, boot)) {
 				/* MST not supported */
 				link->type = dc_connection_single;
 				sink_caps->signal = SIGNAL_TYPE_DISPLAY_PORT;
@@ -651,7 +647,7 @@  static bool detect_dp(
 		}
 
 		if (link->type != dc_connection_mst_branch &&
-			is_dp_active_dongle(link)) {
+		    is_dp_active_dongle(link)) {
 			/* DP active dongles */
 			link->type = dc_connection_active_dongle;
 			if (!link->dpcd_caps.sink_count.bits.SINK_COUNT) {
@@ -662,14 +658,15 @@  static bool detect_dp(
 				return true;
 			}
 
-			if (link->dpcd_caps.dongle_type != DISPLAY_DONGLE_DP_HDMI_CONVERTER)
+			if (link->dpcd_caps.dongle_type !=
+			    DISPLAY_DONGLE_DP_HDMI_CONVERTER)
 				*converter_disable_audio = true;
 		}
 	} else {
 		/* DP passive dongles */
 		sink_caps->signal = dp_passive_dongle_detection(link->ddc,
-				sink_caps,
-				audio_support);
+								sink_caps,
+								audio_support);
 	}
 
 	return true;