2019-07-10 12:56:17

by Janusz Krzysztofik

[permalink] [raw]
Subject: [RFC PATCH 0/6] Rename functions to match their entry points

Need for this was identified while working on split of driver unbind
path into _remove() and _release() parts. Consistency in function
naming has been recognized as helpful when trying to work out which
phase the code is in.

What I'm still not sure about is desired depth of that modification -
how deep should we go down with renaming to not override meaningfull
function names. Please advise if you think still more deep renaming
makes sense.

Thanks,
Janusz

Janusz Krzysztofik (6):
drm/i915: Rename "_load"/"_unload" to match PCI entry points
drm/i915: Replace "_load" with "_probe" consequently
drm/i915: Propagate "_release" function name suffix down
drm/i915: Propagate "_remove" function name suffix down
drm/i915: Propagate "_probe" function name suffix down
drm/i915: Rename "inject_load_failure" module parameter

drivers/gpu/drm/i915/display/intel_bios.c | 4 +-
drivers/gpu/drm/i915/display/intel_bios.h | 2 +-
.../gpu/drm/i915/display/intel_connector.c | 2 +-
drivers/gpu/drm/i915/display/intel_display.c | 2 +-
.../drm/i915/display/intel_display_power.c | 6 +-
.../drm/i915/display/intel_display_power.h | 2 +-
drivers/gpu/drm/i915/gt/intel_engine_cs.c | 2 +-
drivers/gpu/drm/i915/i915_drv.c | 111 +++++++++---------
drivers/gpu/drm/i915/i915_drv.h | 20 ++--
drivers/gpu/drm/i915/i915_gem.c | 12 +-
drivers/gpu/drm/i915/i915_gem_gtt.c | 4 +-
drivers/gpu/drm/i915/i915_gem_gtt.h | 2 +-
drivers/gpu/drm/i915/i915_params.c | 2 +-
drivers/gpu/drm/i915/i915_params.h | 2 +-
drivers/gpu/drm/i915/i915_pci.c | 6 +-
drivers/gpu/drm/i915/intel_gvt.c | 7 +-
drivers/gpu/drm/i915/intel_gvt.h | 4 +-
drivers/gpu/drm/i915/intel_runtime_pm.c | 2 +-
drivers/gpu/drm/i915/intel_runtime_pm.h | 2 +-
drivers/gpu/drm/i915/intel_uncore.c | 2 +-
drivers/gpu/drm/i915/intel_wopcm.c | 2 +-
21 files changed, 100 insertions(+), 98 deletions(-)

--
2.21.0


2019-07-10 12:59:35

by Janusz Krzysztofik

[permalink] [raw]
Subject: [RFC PATCH 6/6] drm/i915: Rename "inject_load_failure" module parameter

Use the "probe" nomenclature for consistency with internally used names
of functions and variables.

Requires adjustment of IGT tests and possibly affects other user custom
applications.

Signed-off-by: Janusz Krzysztofik <[email protected]>
---
drivers/gpu/drm/i915/i915_drv.c | 10 +++++-----
drivers/gpu/drm/i915/i915_params.c | 2 +-
drivers/gpu/drm/i915/i915_params.h | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 7241a7d14e9b..3bac6be9f37d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -85,13 +85,13 @@ static unsigned int i915_probe_fail_count;

bool __i915_inject_probe_failure(const char *func, int line)
{
- if (i915_probe_fail_count >= i915_modparams.inject_load_failure)
+ if (i915_probe_fail_count >= i915_modparams.inject_probe_failure)
return false;

- if (++i915_probe_fail_count == i915_modparams.inject_load_failure) {
+ if (++i915_probe_fail_count == i915_modparams.inject_probe_failure) {
DRM_INFO("Injecting failure at checkpoint %u [%s:%d]\n",
- i915_modparams.inject_load_failure, func, line);
- i915_modparams.inject_load_failure = 0;
+ i915_modparams.inject_probe_failure, func, line);
+ i915_modparams.inject_probe_failure = 0;
return true;
}

@@ -100,7 +100,7 @@ bool __i915_inject_probe_failure(const char *func, int line)

bool i915_error_injected(void)
{
- return i915_probe_fail_count && !i915_modparams.inject_load_failure;
+ return i915_probe_fail_count && !i915_modparams.inject_probe_failure;
}

#endif
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 296452f9efe4..59a6586dae15 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -165,7 +165,7 @@ i915_param_named_unsafe(enable_dp_mst, bool, 0600,
"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");

#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
-i915_param_named_unsafe(inject_load_failure, uint, 0400,
+i915_param_named_unsafe(inject_probe_failure, uint, 0400,
"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
#endif

diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index d29ade3b7de6..8c887413fc70 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -62,7 +62,7 @@ struct drm_printer;
param(int, mmio_debug, -IS_ENABLED(CONFIG_DRM_I915_DEBUG_MMIO)) \
param(int, edp_vswing, 0) \
param(int, reset, 2) \
- param(unsigned int, inject_load_failure, 0) \
+ param(unsigned int, inject_probe_failure, 0) \
param(int, fastboot, -1) \
param(int, enable_dpcd_backlight, 0) \
param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE) \
--
2.21.0