Re: [PATCH v2 12/12] target: add virtual remote target

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

 



Just some nits.

On 3/7/23 2:07 AM, Dmitry Bogdanov wrote:
> +
> +static int tcm_remote_port_link(
> +	struct se_portal_group *se_tpg,
> +	struct se_lun *lun)
> +{
> +	pr_debug("TCM_Remote_ConfigFS: Port Link LUN %lld Successful\n",
> +		  lun->unpacked_lun);

The l in lun should be one space to the left so it's under the ".
It will then match the other code and checkpatch won't complain.


> +	return 0;
> +}
> +
> +static void tcm_remote_port_unlink(
> +	struct se_portal_group *se_tpg,
> +	struct se_lun *lun)
> +{
> +	pr_debug("TCM_Remote_ConfigFS: Port Unlink LUN %lld Successful\n",
> +		  lun->unpacked_lun);

Same as above.

> +}
> +
> +static struct se_portal_group *tcm_remote_make_tpg(
> +	struct se_wwn *wwn,
> +	const char *name)
> +{
> +	struct tcm_remote_hba *remote_hba = container_of(wwn,
> +			struct tcm_remote_hba, remote_hba_wwn);
> +	struct tcm_remote_tpg *remote_tpg;
> +	unsigned long tpgt;
> +	int ret;
> +
> +	if (strstr(name, "tpgt_") != name) {
> +		pr_err("Unable to locate \"tpgt_#\" directory group\n");
> +		return ERR_PTR(-EINVAL);
> +	}
> +	if (kstrtoul(name+5, 10, &tpgt))

Add spaces so it looks like: "name + 5"



> +}
> +
> +static ssize_t tcm_remote_wwn_version_show(struct config_item *item, char *page)
> +{
> +	return sprintf(page, "TCM Remote Fabric module %s\n", TCM_REMOTE_VERSION);
> +}


Do we need this? I saw other LIO drivers like iscsi, fcoe and loop have them
but they are never updated so it seems useless.

For something like stable trying to manage versions is going to be difficult
as well, so it might just be more confusing.

> +
> +static int __init tcm_remote_fabric_init(void)
> +{
> +	int ret = -ENOMEM;

You can drop the -ENOMEM since we set ret the next line.

> +
> +	ret = target_register_template(&remote_ops);
> +	if (ret)
> +		goto out;
> +
> +	return 0;
> +
> +out:
> +	return ret;
> +}
> +



[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