lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
Subsystems (2)
PATCH 10/21 lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
--- drivers/scsi/lpfc/lpfc_ct.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)
drivers/scsi/lpfc/lpfc_ct.c +20 -3
@@ -1070,12 +1070,29 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, size_t size) {char fwrev[FW_REV_STR_SIZE ]; -int n; +int n =0 ;lpfc_decode_firmware_rev (vport->phba, fwrev,0 ); - n =snprintf (symbol, size,"Emulex %s FV%s DV%s" , - vport->phba->ModelName, fwrev, lpfc_release_version); + n =snprintf (symbol, size,"Emulex %s" , vport->phba->ModelName); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," FV%s" , fwrev); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," DV%s" , lpfc_release_version); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," HN:%s" ,init_utsname ()->nodename); + +/* Note :- OS name is "Linux" as per requirement BZ168199. */ +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," OS:%s" ,init_utsname ()->sysname); +return n; }
Signature · 4 lines
1.7.11.7 Signed-off-by: James Smart <[email protected]> Signed-off-by: Dick Kennedy <[email protected]>
Quoted 9 lines · James Smart
--- drivers/scsi/lpfc/lpfc_ct.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)drivers/scsi/lpfc/lpfc_ct.c +0
-0
drivers/scsi/lpfc/lpfc_ct.c lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, · line 1073
Quoted 5 lines
drivers/scsi/lpfc/lpfc_ct.c +1
-1@@ -1070,12 +1070,29 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, size_t size) {char fwrev[FW_REV_STR_SIZE ]; -int n; +int n =0 ;
No need for this^ initialisation , as 'n' is directly set two lines later
Quoted 27 lines
drivers/scsi/lpfc/lpfc_ct.c +19
-2lpfc_decode_firmware_rev (vport->phba, fwrev,0 ); - n =snprintf (symbol, size,"Emulex %s FV%s DV%s" , - vport->phba->ModelName, fwrev, lpfc_release_version); + n =snprintf (symbol, size,"Emulex %s" , vport->phba->ModelName); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," FV%s" , fwrev); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," DV%s" , lpfc_release_version); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," HN:%s" ,init_utsname ()->nodename); + +/* Note :- OS name is "Linux" as per requirement BZ168199. */ +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," OS:%s" ,init_utsname ()->sysname); +return n; }
agree - nice nit.
I'll add this to the list of things to merge in the next patch update.
-- james
Quoted 46 lines · Tomas Henzl
Quoted 9 lines · James Smart
--- drivers/scsi/lpfc/lpfc_ct.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-)drivers/scsi/lpfc/lpfc_ct.c +0
-0drivers/scsi/lpfc/lpfc_ct.c lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, · line 1073
Quoted 5 lines
drivers/scsi/lpfc/lpfc_ct.c +1
-1@@ -1070,12 +1070,29 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, size_t size) {char fwrev[FW_REV_STR_SIZE ]; -int n; +int n =0 ;No need for this^ initialisation , as 'n' is directly set two lines later
Quoted 27 lines
drivers/scsi/lpfc/lpfc_ct.c +19
-2lpfc_decode_firmware_rev (vport->phba, fwrev,0 ); - n =snprintf (symbol, size,"Emulex %s FV%s DV%s" , - vport->phba->ModelName, fwrev, lpfc_release_version); + n =snprintf (symbol, size,"Emulex %s" , vport->phba->ModelName); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," FV%s" , fwrev); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," DV%s" , lpfc_release_version); + +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," HN:%s" ,init_utsname ()->nodename); + +/* Note :- OS name is "Linux" as per requirement BZ168199. */ +if (size < n) +return n; + n +=snprintf (symbol + n, size - n," OS:%s" ,init_utsname ()->sysname); +return n; }