Re: [RFC PATCH 02/13] scsi: ufshpb: Init part I - Read HPB config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-05-15 03:30, Avri Altman wrote:
> +struct ufshpb_lun_config *ufshpb_luns_conf;
> +struct ufshpb_lun *ufshpb_luns;
> +static unsigned long ufshpb_lun_map[BITS_TO_LONGS(UFSHPB_MAX_LUNS)];
> +static u8 ufshpb_lun_lookup[UFSHPB_MAX_LUNS];
> +
> +/**
> + * ufshpb_remove - ufshpb cleanup
> + *
> + * Should be called when unloading the driver.
> + */
> +void ufshpb_remove(struct ufs_hba *hba)
> +{
> +	kfree(ufshpb_conf);
> +	kfree(ufshpb_luns_conf);
> +	kfree(ufshpb_luns);
> +	ufshcd_query_flag(hba, UPIU_QUERY_OPCODE_SET_FLAG,
> +			  QUERY_FLAG_IDN_HPB_RESET, 0, NULL);
> +}
> +
> +static int ufshpb_hpb_init(void)
> +{
> +	u8 num_hpb_luns = ufshpb_conf->num_hpb_luns;
> +	int i;
> +
> +	ufshpb_luns = kcalloc(num_hpb_luns, sizeof(*ufshpb_luns), GFP_KERNEL);
> +	if (!ufshpb_luns)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < num_hpb_luns; i++) {
> +		struct ufshpb_lun *hpb = ufshpb_luns + i;
> +
> +		hpb->lun = (ufshpb_luns_conf + i)->lun;
> +	}
> +
> +	return 0;
> +}

Do the ufshpb_lun... data structures perhaps duplicate SCSI core data
structures? If so, please don't introduce duplicates of SCSI core data
structures.

Thanks,

Bart.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux