Re: [PATCH v2 4/5] [SCSI] ufshcd: SCSI error handling

From: Hillf Danton
Date: Sat Feb 25 2012 - 23:47:17 EST


On Fri, Feb 24, 2012 at 3:19 PM, Santosh Y <santoshsy@xxxxxxxxx> wrote:
> +/**
> + * ufshcd_is_tmq_full - checks if the task management slots are full
> + * @hba: per adapter instance
> + *
> + * Returns maximum number of task management request slots in case of
> + * task management queue full or returns the free slot number
> + */
> +static inline int ufshcd_is_tmq_full(struct ufs_hba *hba)

This helper function is named to be misleading, little to do with
its functionality as full is checked at callsite.

-hd

> +{
> + Â Â Â return find_first_zero_bit(&hba->outstanding_tasks, hba->nutmrs);
> +}
> +
[...]
> + Â Â Â host = hba->host;
> +
> + Â Â Â spin_lock_irqsave(host->host_lock, flags);
> +
> + Â Â Â /* If task management queue is full */
> + Â Â Â free_slot = ufshcd_is_tmq_full(hba);
> + Â Â Â if (free_slot >= hba->nutmrs) {
> + Â Â Â Â Â Â Â spin_unlock_irqrestore(host->host_lock, flags);
> + Â Â Â Â Â Â Â dev_err(&hba->pdev->dev, "Task management queue full\n");
> + Â Â Â Â Â Â Â err = FAILED;
> + Â Â Â Â Â Â Â goto out;
> + Â Â Â }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/