From 2430048a3d295428df7848fb49305c2aece8cbfa Mon Sep 17 00:00:00 2001 From: Kevin Adams Date: Fri, 15 May 2026 15:08:54 -0400 Subject: [PATCH] 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 --- perl5/PVE/Storage/LunCmd/FreeNAS.pm | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/perl5/PVE/Storage/LunCmd/FreeNAS.pm b/perl5/PVE/Storage/LunCmd/FreeNAS.pm index 94079e8..cabbb49 100644 --- a/perl5/PVE/Storage/LunCmd/FreeNAS.pm +++ b/perl5/PVE/Storage/LunCmd/FreeNAS.pm @@ -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; } }