diff options
author | Jani Nikula <jani.nikula@intel.com> | 2018-12-27 16:33:37 +0200 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2018-12-31 15:26:39 +0200 |
commit | 4081cef923e0ac0bb4dbc24da838c91f2ea8d737 (patch) | |
tree | 6322ac05b1597fcb8448506859797a54802dca26 /drivers/gpu/drm/i915/i915_gpu_error.c | |
parent | caa5915bb3c1e61bd895383364011a8921fee053 (diff) | |
download | linux-stable-4081cef923e0ac0bb4dbc24da838c91f2ea8d737.tar.gz linux-stable-4081cef923e0ac0bb4dbc24da838c91f2ea8d737.tar.bz2 linux-stable-4081cef923e0ac0bb4dbc24da838c91f2ea8d737.zip |
drm/i915: add a helper to make a copy of i915_params
Abstract the one user in anticipation of more.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/c6a94b4da8dc723df025b1f602fe46d76d00d53f.1545920737.git.jani.nikula@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gpu_error.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gpu_error.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c index 63df41d93379..8c04479c1586 100644 --- a/drivers/gpu/drm/i915/i915_gpu_error.c +++ b/drivers/gpu/drm/i915/i915_gpu_error.c @@ -1834,18 +1834,9 @@ static void capture_gen_state(struct i915_gpu_state *error) error->driver_caps = i915->caps; } -static __always_inline void dup_param(const char *type, void *x) -{ - if (!__builtin_strcmp(type, "char *")) - *(void **)x = kstrdup(*(void **)x, GFP_ATOMIC); -} - static void capture_params(struct i915_gpu_state *error) { - error->params = i915_modparams; -#define DUP(T, x, ...) dup_param(#T, &error->params.x); - I915_PARAMS_FOR_EACH(DUP); -#undef DUP + i915_params_copy(&error->params, &i915_modparams); } static unsigned long capture_find_epoch(const struct i915_gpu_state *error) |