@@ -820,7 +820,7 @@ static void i915_error_object_free(struct drm_i915_error_object *obj)
kfree(obj);
}
-static __always_inline void free_param(const char *type, void *x)
+static __always_inline void free_param(const char *type, const void *x)
{
if (!__builtin_strcmp(type, "char *"))
kfree(*(void **)x);
@@ -1680,7 +1680,7 @@ static void i915_capture_gen_state(struct drm_i915_private *dev_priv,
sizeof(error->device_info));
}
-static __always_inline void dup_param(const char *type, void *x)
+static __always_inline void dup_param(const char *type, const void *x)
{
if (!__builtin_strcmp(type, "char *"))
*(void **)x = kstrdup(*(void **)x, GFP_ATOMIC);
@@ -1696,7 +1696,7 @@ static int capture(void *data)
ktime_to_timeval(ktime_sub(ktime_get(),
error->i915->gt.last_init_time));
- error->params = i915_modparams;
+ memcpy(&error->params, &i915_modparams, sizeof(i915_modparams));
#define DUP(T, x) dup_param(#T, &error->params.x);
I915_PARAMS_FOR_EACH(DUP);
#undef DUP
We are planning to enforce "read_mostly" access to modparams. Let start handle modparams as it was already defined as const. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> --- drivers/gpu/drm/i915/i915_gpu_error.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)