[PATCH] fabrics: Always pass hostid and hostnqn

Daniel Wagner dwagner at suse.de
Wed Apr 17 00:43:48 PDT 2024


On Tue, Apr 16, 2024 at 06:32:55AM +0000, Israel Rukshin wrote:
> +void nvmf_set_hostid_and_hostnqn(char **hostid, char **hostnqn)
> +{
> +	if (!*hostid)
> +		*hostid = nvmf_hostid_from_file();
> +	if (!*hostnqn)
> +		*hostnqn = nvmf_hostnqn_from_file();

Please use a local pointer variable and do the final assign the
result argument pointer variable at the end of the function. This avoids
the dereferencing of hostid and hostnqn all the time.

Rest looks good.



More information about the Linux-nvme mailing list