> + /* > + * fallback to default mapping if driver doesn't provide > + * get_queue_affinity callback > + */ > + if (!get_queue_affinity) { > + fallback = true; > + goto fallback; > + } > + > + for (queue = 0; queue < qmap->nr_queues; queue++) { > + mask = get_queue_affinity(dev_data, dev_off, queue); > + if (!mask) > + goto fallback; > + > + for_each_cpu(cpu, mask) > + qmap->mq_map[cpu] = qmap->queue_offset + queue; > + } > + > + return 0; > + > +fallback: > + if (!fallback) { > + WARN_ON_ONCE(qmap->nr_queues > 1); > + blk_mq_clear_mq_map(qmap); > + return 0; > + } > + return blk_mq_map_queues(qmap); Please remove the NULL get_affinity case and let the callers handle the fallback. Also I think it makes sense to leave the !mask fallback case to the callers as well to simplify the calling conventions.