struct stm_drvdata *drvdata;
        struct resource *res = &adev->res;
        struct resource ch_res;
-       size_t res_size, bitmap_size;
+       size_t bitmap_size;
        struct coresight_desc desc = { 0 };
        struct device_node *np = adev->dev.of_node;
 
 
        drvdata->write_bytes = stm_fundamental_data_size(drvdata);
 
-       if (boot_nr_channel) {
+       if (boot_nr_channel)
                drvdata->numsp = boot_nr_channel;
-               res_size = min((resource_size_t)(boot_nr_channel *
-                                 BYTES_PER_CHANNEL), resource_size(res));
-       } else {
+       else
                drvdata->numsp = stm_num_stimulus_port(drvdata);
-               res_size = min((resource_size_t)(drvdata->numsp *
-                                BYTES_PER_CHANNEL), resource_size(res));
-       }
+
        bitmap_size = BITS_TO_LONGS(drvdata->numsp) * sizeof(long);
 
        guaranteed = devm_kzalloc(dev, bitmap_size, GFP_KERNEL);