intel/dev: Assert the number of slices is not zero
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Thu, 5 Apr 2018 07:38:46 +0000 (10:38 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Tue, 10 Apr 2018 22:49:56 +0000 (01:49 +0300)
Fixes: c1900f5b intel: devinfo: add helper functions to fill...
CID: 1433511
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/dev/gen_device_info.c

index f7cb94f17951c0061928254f224d7a9383652c24..dfeab6e6060a338fd759d9648304282f22637921 100644 (file)
@@ -1047,7 +1047,7 @@ gen_device_info_update_from_topology(struct gen_device_info *devinfo,
    /* We expect the total number of EUs to be uniformly distributed throughout
     * the subslices.
     */
-   assert((n_eus % n_subslices) == 0);
+   assert(n_subslices && (n_eus % n_subslices) == 0);
    devinfo->num_eu_per_subslice = n_eus / n_subslices;
 }