diff mbox

[2/7] drm/nouveau: replace drm_get_connector_name() with direct name field use

Message ID b135d56e95a6f5fb67cf8a79a78f899cdcb78fef.1401110921.git.jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula May 26, 2014, 1:35 p.m. UTC
Generated using semantic patch:

@@
expression E;
@@

- drm_get_connector_name(E)
+ E->name

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/nouveau/dispnv04/dac.c      | 2 +-
 drivers/gpu/drm/nouveau/dispnv04/dfp.c      | 2 +-
 drivers/gpu/drm/nouveau/dispnv04/disp.c     | 2 +-
 drivers/gpu/drm/nouveau/dispnv04/tvnv04.c   | 3 ++-
 drivers/gpu/drm/nouveau/dispnv04/tvnv17.c   | 3 +--
 drivers/gpu/drm/nouveau/nouveau_connector.c | 8 ++++----
 drivers/gpu/drm/nouveau/nv50_display.c      | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

Comments

Ilia Mirkin May 26, 2014, 3:50 p.m. UTC | #1
On Mon, May 26, 2014 at 9:35 AM, Jani Nikula <jani.nikula@intel.com> wrote:
> Generated using semantic patch:
>
> @@
> expression E;
> @@
>
> - drm_get_connector_name(E)
> + E->name
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/nouveau/dispnv04/dac.c      | 2 +-
>  drivers/gpu/drm/nouveau/dispnv04/dfp.c      | 2 +-
>  drivers/gpu/drm/nouveau/dispnv04/disp.c     | 2 +-
>  drivers/gpu/drm/nouveau/dispnv04/tvnv04.c   | 3 ++-
>  drivers/gpu/drm/nouveau/dispnv04/tvnv17.c   | 3 +--
>  drivers/gpu/drm/nouveau/nouveau_connector.c | 8 ++++----
>  drivers/gpu/drm/nouveau/nv50_display.c      | 2 +-
>  7 files changed, 11 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c
> index 434b920f6bd4..d4d95df2b3c6 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/dac.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c
> @@ -414,7 +414,7 @@ static void nv04_dac_commit(struct drm_encoder *encoder)
>         helper->dpms(encoder, DRM_MODE_DPMS_ON);
>
>         NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
> -                drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
> +                (&nouveau_encoder_connector_get(nv_encoder)->base)->name,

That looks pretty vile... how about

nouveau_encoder_connector_get(nv_encoder)->base.name

Here and below.

>                  nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
>  }
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c
> index a2d669b4acf2..0615efde05ad 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/dfp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c
> @@ -477,7 +477,7 @@ static void nv04_dfp_commit(struct drm_encoder *encoder)
>         helper->dpms(encoder, DRM_MODE_DPMS_ON);
>
>         NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
> -                drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
> +                (&nouveau_encoder_connector_get(nv_encoder)->base)->name,
>                  nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
>  }
>
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
> index 2f1ed61f7c8c..4342fdaee707 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
> @@ -115,7 +115,7 @@ nv04_display_create(struct drm_device *dev)
>                                  &dev->mode_config.connector_list, head) {
>                 if (!connector->encoder_ids[0]) {
>                         NV_WARN(drm, "%s has no encoders, removing\n",
> -                               drm_get_connector_name(connector));
> +                               connector->name);
>                         connector->funcs->destroy(connector);
>                 }
>         }
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
> index 244822df8ffc..6b13e1d3c570 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
> @@ -171,7 +171,8 @@ static void nv04_tv_commit(struct drm_encoder *encoder)
>         helper->dpms(encoder, DRM_MODE_DPMS_ON);
>
>         NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
> -                drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base), nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
> +                (&nouveau_encoder_connector_get(nv_encoder)->base)->name,
> +                nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
>  }
>
>  static void nv04_tv_destroy(struct drm_encoder *encoder)
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
> index acef48f4a4ea..9026ab97098f 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
> @@ -612,8 +612,7 @@ static void nv17_tv_commit(struct drm_encoder *encoder)
>         helper->dpms(encoder, DRM_MODE_DPMS_ON);
>
>         NV_INFO(drm, "Output %s is running on CRTC %d using output %c\n",
> -               drm_get_connector_name(
> -                       &nouveau_encoder_connector_get(nv_encoder)->base),
> +               (&nouveau_encoder_connector_get(nv_encoder)->base)->name,
>                 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
>  }
>
> diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
> index d07ce028af51..6ecea9b2b15a 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_connector.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
> @@ -265,14 +265,14 @@ nouveau_connector_detect(struct drm_connector *connector, bool force)
>                                                         nv_connector->edid);
>                 if (!nv_connector->edid) {
>                         NV_ERROR(drm, "DDC responded, but no EDID for %s\n",
> -                                drm_get_connector_name(connector));
> +                                connector->name);
>                         goto detect_analog;
>                 }
>
>                 if (nv_encoder->dcb->type == DCB_OUTPUT_DP &&
>                     !nouveau_dp_detect(to_drm_encoder(nv_encoder))) {
>                         NV_ERROR(drm, "Detected %s, but failed init\n",
> -                                drm_get_connector_name(connector));
> +                                connector->name);
>                         conn_status = connector_status_disconnected;
>                         goto out;
>                 }
> @@ -437,7 +437,7 @@ nouveau_connector_force(struct drm_connector *connector)
>         nv_encoder = find_encoder(connector, type);
>         if (!nv_encoder) {
>                 NV_ERROR(drm, "can't find encoder to force %s on!\n",
> -                        drm_get_connector_name(connector));
> +                        connector->name);
>                 connector->status = connector_status_disconnected;
>                 return;
>         }
> @@ -923,7 +923,7 @@ nouveau_connector_hotplug_work(struct work_struct *work)
>         bool plugged = gpio->get(gpio, 0, nv_connector->hpd.func, 0xff);
>
>         NV_DEBUG(drm, "%splugged %s\n", plugged ? "" : "un",
> -                drm_get_connector_name(connector));
> +                connector->name);
>
>         if (plugged)
>                 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
> diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
> index 58af547b0b93..79f6dc724a85 100644
> --- a/drivers/gpu/drm/nouveau/nv50_display.c
> +++ b/drivers/gpu/drm/nouveau/nv50_display.c
> @@ -2295,7 +2295,7 @@ nv50_display_create(struct drm_device *dev)
>                         continue;
>
>                 NV_WARN(drm, "%s has no encoders, removing\n",
> -                       drm_get_connector_name(connector));
> +                       connector->name);
>                 connector->funcs->destroy(connector);
>         }
>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Jani Nikula May 26, 2014, 6:41 p.m. UTC | #2
On Mon, 26 May 2014, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> On Mon, May 26, 2014 at 9:35 AM, Jani Nikula <jani.nikula@intel.com> wrote:
>> Generated using semantic patch:
>>
>> @@
>> expression E;
>> @@
>>
>> - drm_get_connector_name(E)
>> + E->name
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> ---
>>  drivers/gpu/drm/nouveau/dispnv04/dac.c      | 2 +-
>>  drivers/gpu/drm/nouveau/dispnv04/dfp.c      | 2 +-
>>  drivers/gpu/drm/nouveau/dispnv04/disp.c     | 2 +-
>>  drivers/gpu/drm/nouveau/dispnv04/tvnv04.c   | 3 ++-
>>  drivers/gpu/drm/nouveau/dispnv04/tvnv17.c   | 3 +--
>>  drivers/gpu/drm/nouveau/nouveau_connector.c | 8 ++++----
>>  drivers/gpu/drm/nouveau/nv50_display.c      | 2 +-
>>  7 files changed, 11 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/nouveau/dispnv04/dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c
>> index 434b920f6bd4..d4d95df2b3c6 100644
>> --- a/drivers/gpu/drm/nouveau/dispnv04/dac.c
>> +++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c
>> @@ -414,7 +414,7 @@ static void nv04_dac_commit(struct drm_encoder *encoder)
>>         helper->dpms(encoder, DRM_MODE_DPMS_ON);
>>
>>         NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
>> -                drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
>> +                (&nouveau_encoder_connector_get(nv_encoder)->base)->name,
>
> That looks pretty vile... how about
>
> nouveau_encoder_connector_get(nv_encoder)->base.name

Ugh, agreed. Let me see if I can tweak the semantic patch, or if I need
to do it manually.

Thanks,
Jani.
diff mbox

Patch

diff --git a/drivers/gpu/drm/nouveau/dispnv04/dac.c b/drivers/gpu/drm/nouveau/dispnv04/dac.c
index 434b920f6bd4..d4d95df2b3c6 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/dac.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/dac.c
@@ -414,7 +414,7 @@  static void nv04_dac_commit(struct drm_encoder *encoder)
 	helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
 	NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
-		 drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
+		 (&nouveau_encoder_connector_get(nv_encoder)->base)->name,
 		 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
 }
 
diff --git a/drivers/gpu/drm/nouveau/dispnv04/dfp.c b/drivers/gpu/drm/nouveau/dispnv04/dfp.c
index a2d669b4acf2..0615efde05ad 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/dfp.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/dfp.c
@@ -477,7 +477,7 @@  static void nv04_dfp_commit(struct drm_encoder *encoder)
 	helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
 	NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
-		 drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base),
+		 (&nouveau_encoder_connector_get(nv_encoder)->base)->name,
 		 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
 }
 
diff --git a/drivers/gpu/drm/nouveau/dispnv04/disp.c b/drivers/gpu/drm/nouveau/dispnv04/disp.c
index 2f1ed61f7c8c..4342fdaee707 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/disp.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/disp.c
@@ -115,7 +115,7 @@  nv04_display_create(struct drm_device *dev)
 				 &dev->mode_config.connector_list, head) {
 		if (!connector->encoder_ids[0]) {
 			NV_WARN(drm, "%s has no encoders, removing\n",
-				drm_get_connector_name(connector));
+				connector->name);
 			connector->funcs->destroy(connector);
 		}
 	}
diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
index 244822df8ffc..6b13e1d3c570 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
@@ -171,7 +171,8 @@  static void nv04_tv_commit(struct drm_encoder *encoder)
 	helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
 	NV_DEBUG(drm, "Output %s is running on CRTC %d using output %c\n",
-		 drm_get_connector_name(&nouveau_encoder_connector_get(nv_encoder)->base), nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
+		 (&nouveau_encoder_connector_get(nv_encoder)->base)->name,
+		 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
 }
 
 static void nv04_tv_destroy(struct drm_encoder *encoder)
diff --git a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
index acef48f4a4ea..9026ab97098f 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
@@ -612,8 +612,7 @@  static void nv17_tv_commit(struct drm_encoder *encoder)
 	helper->dpms(encoder, DRM_MODE_DPMS_ON);
 
 	NV_INFO(drm, "Output %s is running on CRTC %d using output %c\n",
-		drm_get_connector_name(
-			&nouveau_encoder_connector_get(nv_encoder)->base),
+		(&nouveau_encoder_connector_get(nv_encoder)->base)->name,
 		nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
 }
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index d07ce028af51..6ecea9b2b15a 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -265,14 +265,14 @@  nouveau_connector_detect(struct drm_connector *connector, bool force)
 							nv_connector->edid);
 		if (!nv_connector->edid) {
 			NV_ERROR(drm, "DDC responded, but no EDID for %s\n",
-				 drm_get_connector_name(connector));
+				 connector->name);
 			goto detect_analog;
 		}
 
 		if (nv_encoder->dcb->type == DCB_OUTPUT_DP &&
 		    !nouveau_dp_detect(to_drm_encoder(nv_encoder))) {
 			NV_ERROR(drm, "Detected %s, but failed init\n",
-				 drm_get_connector_name(connector));
+				 connector->name);
 			conn_status = connector_status_disconnected;
 			goto out;
 		}
@@ -437,7 +437,7 @@  nouveau_connector_force(struct drm_connector *connector)
 	nv_encoder = find_encoder(connector, type);
 	if (!nv_encoder) {
 		NV_ERROR(drm, "can't find encoder to force %s on!\n",
-			 drm_get_connector_name(connector));
+			 connector->name);
 		connector->status = connector_status_disconnected;
 		return;
 	}
@@ -923,7 +923,7 @@  nouveau_connector_hotplug_work(struct work_struct *work)
 	bool plugged = gpio->get(gpio, 0, nv_connector->hpd.func, 0xff);
 
 	NV_DEBUG(drm, "%splugged %s\n", plugged ? "" : "un",
-		 drm_get_connector_name(connector));
+		 connector->name);
 
 	if (plugged)
 		drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c
index 58af547b0b93..79f6dc724a85 100644
--- a/drivers/gpu/drm/nouveau/nv50_display.c
+++ b/drivers/gpu/drm/nouveau/nv50_display.c
@@ -2295,7 +2295,7 @@  nv50_display_create(struct drm_device *dev)
 			continue;
 
 		NV_WARN(drm, "%s has no encoders, removing\n",
-			drm_get_connector_name(connector));
+			connector->name);
 		connector->funcs->destroy(connector);
 	}