Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0431f93c authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "soc: qcom: pil: Remove unused variable 'seg_id'"

parents 8d1d5331 0a6cf5af
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -896,7 +896,6 @@ static int pil_notify_aop(struct pil_desc *desc, char *status)
static DECLARE_RWSEM(pil_pm_rwsem);

struct pil_seg_data {
	int seg_id;
	struct pil_desc *desc;
	struct pil_seg *seg;
	struct work_struct load_seg_work;
@@ -916,20 +915,27 @@ static void pil_load_seg_work_fn(struct work_struct *work)

static int pil_load_segs(struct pil_desc *desc)
{
	int ret = 0;
	int seg_id = 0;
	struct pil_priv *priv = desc->priv;
	struct pil_seg_data *pil_seg_data;
	struct pil_seg *seg;
	DECLARE_BITMAP(err_map, priv->num_segs);
	unsigned long *err_map;

	pil_seg_data = kcalloc(priv->num_segs, sizeof(*pil_seg_data),
	err_map = kcalloc(BITS_TO_LONGS(priv->num_segs), sizeof(unsigned long),
				GFP_KERNEL);
	if (!pil_seg_data)
	if (!err_map)
		return -ENOMEM;

	pil_seg_data = kcalloc(priv->num_segs, sizeof(*pil_seg_data),
				GFP_KERNEL);
	if (!pil_seg_data) {
		ret = -ENOMEM;
		goto out;
	}

	/* Initialize and spawn a thread for each segment */
	list_for_each_entry(seg, &desc->priv->segs, list) {
		pil_seg_data[seg_id].seg_id = seg_id;
		pil_seg_data[seg_id].desc = desc;
		pil_seg_data[seg_id].seg = seg;

@@ -964,9 +970,11 @@ static int pil_load_segs(struct pil_desc *desc)

	/* Each segment can fail due to different reason. Send a generic err */
	if (!bitmap_empty(err_map, priv->num_segs))
		return -EFAULT;
		ret = -EFAULT;

	return 0;
out:
	kfree(err_map);
	return ret;
}

/**