Fix perlcritic: replace 'return undef' with 'return'

ProhibitExplicitReturnUndef (severity 5): returning undef explicitly is
wrong because it forces scalar context on callers. 'return;' returns
undef in scalar context and an empty list in list context, which is the
correct idiom. Fixed all 7 occurrences in FreeNAS.pm.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Kevin Adams 2026-05-15 15:08:54 -04:00
parent 84cc862bed
commit 2430048a3d
1 changed files with 7 additions and 7 deletions

View File

@ -165,7 +165,7 @@ sub run_lun_command {
}
syslog("error",(caller(0))[3] . " : unknown method $method");
return undef;
return;
}
#
@ -503,7 +503,7 @@ sub freenas_iscsi_get_globalconfiguration {
return $result;
} else {
freenas_api_log_error();
return undef;
return;
}
}
@ -524,7 +524,7 @@ sub freenas_iscsi_get_extent {
return $result;
} else {
freenas_api_log_error();
return undef;
return;
}
}
@ -568,7 +568,7 @@ sub freenas_iscsi_create_extent {
return $result;
} else {
freenas_api_log_error();
return undef;
return;
}
}
@ -611,7 +611,7 @@ sub freenas_iscsi_get_target {
return $result;
} else {
freenas_api_log_error();
return undef;
return;
}
}
@ -641,7 +641,7 @@ sub freenas_iscsi_get_target_to_extent {
return $result;
} else {
freenas_api_log_error();
return undef;
return;
}
}
@ -672,7 +672,7 @@ sub freenas_iscsi_create_target_to_extent {
return $result;
} else {
freenas_api_log_error();
return undef;
return;
}
}