Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915/dmc: simplify stepping info initialization

Having intel_get_stepping_info() return the pointer that was passed in
isn't necessary. Just use a pointer to the local variable instead.

The initialization to ** didn't make a difference, because it was always
overridden.

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://patch.msgid.link/c9affb82fd3e9fb464778013bb7c8fab06232bfd.1773663208.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+5 -7
+5 -7
drivers/gpu/drm/i915/display/intel_dmc.c
··· 418 418 return has_dmc_id_fw(display, DMC_FW_MAIN); 419 419 } 420 420 421 - static const struct stepping_info * 422 - intel_get_stepping_info(struct intel_display *display, 423 - struct stepping_info *si) 421 + static void initialize_stepping_info(struct intel_display *display, struct stepping_info *si) 424 422 { 425 423 const char *step_name = intel_step_name(INTEL_DISPLAY_STEP(display)); 426 424 427 425 si->stepping = step_name[0]; 428 426 si->substepping = step_name[1]; 429 - return si; 430 427 } 431 428 432 429 static void gen9_set_dc_state_debugmask(struct intel_display *display) ··· 1271 1274 struct intel_css_header *css_header; 1272 1275 struct intel_package_header *package_header; 1273 1276 struct intel_dmc_header_base *dmc_header; 1274 - struct stepping_info display_info = { '*', '*'}; 1275 - const struct stepping_info *si = intel_get_stepping_info(display, &display_info); 1277 + struct stepping_info si = {}; 1276 1278 enum intel_dmc_id dmc_id; 1277 1279 u32 readcount = 0; 1278 1280 u32 r, offset; 1279 1281 1280 1282 if (!fw) 1281 1283 return -EINVAL; 1284 + 1285 + initialize_stepping_info(display, &si); 1282 1286 1283 1287 /* Extract CSS Header information */ 1284 1288 css_header = (struct intel_css_header *)fw->data; ··· 1291 1293 1292 1294 /* Extract Package Header information */ 1293 1295 package_header = (struct intel_package_header *)&fw->data[readcount]; 1294 - r = parse_dmc_fw_package(dmc, package_header, si, fw->size - readcount); 1296 + r = parse_dmc_fw_package(dmc, package_header, &si, fw->size - readcount); 1295 1297 if (!r) 1296 1298 return -EINVAL; 1297 1299