* [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
@ 2015-02-05 19:24 James Smart
2015-02-06 12:20 ` Tomas Henzl
0 siblings, 1 reply; 7+ messages in thread
From: James Smart @ 2015-02-05 19:24 UTC (permalink / raw)
To: linux-scsi
---
drivers/scsi/lpfc/lpfc_ct.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 61a32cd..5091184 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -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;
}
--
1.7.11.7
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
2015-02-05 19:24 [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command James Smart
@ 2015-02-06 12:20 ` Tomas Henzl
2015-02-16 16:22 ` James Smart
0 siblings, 1 reply; 7+ messages in thread
From: Tomas Henzl @ 2015-02-06 12:20 UTC (permalink / raw)
To: james.smart, linux-scsi
On 02/05/2015 08:24 PM, James Smart wrote:
> ---
> drivers/scsi/lpfc/lpfc_ct.c | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
> index 61a32cd..5091184 100644
> --- a/drivers/scsi/lpfc/lpfc_ct.c
> +++ b/drivers/scsi/lpfc/lpfc_ct.c
> @@ -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
>
> 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;
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
2015-02-06 12:20 ` Tomas Henzl
@ 2015-02-16 16:22 ` James Smart
0 siblings, 0 replies; 7+ messages in thread
From: James Smart @ 2015-02-16 16:22 UTC (permalink / raw)
To: Tomas Henzl; +Cc: linux-scsi
agree - nice nit.
I'll add this to the list of things to merge in the next patch update.
-- james
On 2/6/2015 7:20 AM, Tomas Henzl wrote:
> On 02/05/2015 08:24 PM, James Smart wrote:
>> ---
>> drivers/scsi/lpfc/lpfc_ct.c | 23 ++++++++++++++++++++---
>> 1 file changed, 20 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
>> index 61a32cd..5091184 100644
>> --- a/drivers/scsi/lpfc/lpfc_ct.c
>> +++ b/drivers/scsi/lpfc/lpfc_ct.c
>> @@ -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
>
>>
>> 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;
>> }
>>
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
2015-04-03 21:12 James Smart
2015-04-05 12:07 ` Sebastian Herbszt
@ 2015-04-10 6:13 ` Hannes Reinecke
1 sibling, 0 replies; 7+ messages in thread
From: Hannes Reinecke @ 2015-04-10 6:13 UTC (permalink / raw)
To: james.smart, linux-scsi
On 04/03/2015 11:12 PM, James Smart wrote:
> Fix provide host name and OS name in RSNN-NN FC-GS command
>
> Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
> Signed-off-by: James Smart <james.smart@emulex.com>
> ---
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
2015-04-05 12:07 ` Sebastian Herbszt
@ 2015-04-07 19:23 ` James Smart
0 siblings, 0 replies; 7+ messages in thread
From: James Smart @ 2015-04-07 19:23 UTC (permalink / raw)
To: Sebastian Herbszt; +Cc: linux-scsi
On 4/5/2015 8:07 AM, Sebastian Herbszt wrote:
> James Smart wrote:
>> + /* 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;
>> }
> Care to disclose which bugzilla contains BZ168199?
>
>
It's meaningless as it's Emulex's bugzilla database, per our own
requirements. You will see in the v3 patches just posted I just nixed this.
-- james s
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
2015-04-03 21:12 James Smart
@ 2015-04-05 12:07 ` Sebastian Herbszt
2015-04-07 19:23 ` James Smart
2015-04-10 6:13 ` Hannes Reinecke
1 sibling, 1 reply; 7+ messages in thread
From: Sebastian Herbszt @ 2015-04-05 12:07 UTC (permalink / raw)
To: james.smart; +Cc: linux-scsi, Sebastian Herbszt
James Smart wrote:
> Fix provide host name and OS name in RSNN-NN FC-GS command
>
> Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
> Signed-off-by: James Smart <james.smart@emulex.com>
> ---
> drivers/scsi/lpfc/lpfc_ct.c | 21 +++++++++++++++++++--
> 1 file changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
> index 61a32cd..c259eb0 100644
> --- a/drivers/scsi/lpfc/lpfc_ct.c
> +++ b/drivers/scsi/lpfc/lpfc_ct.c
> @@ -1074,8 +1074,25 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
>
> 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;
> }
Care to disclose which bugzilla contains BZ168199?
Sebastian
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command
@ 2015-04-03 21:12 James Smart
2015-04-05 12:07 ` Sebastian Herbszt
2015-04-10 6:13 ` Hannes Reinecke
0 siblings, 2 replies; 7+ messages in thread
From: James Smart @ 2015-04-03 21:12 UTC (permalink / raw)
To: linux-scsi
Fix provide host name and OS name in RSNN-NN FC-GS command
Signed-off-by: Dick Kennedy <dick.kennedy@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
---
drivers/scsi/lpfc/lpfc_ct.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 61a32cd..c259eb0 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -1074,8 +1074,25 @@ lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol,
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;
}
--
1.7.11.7
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-04-10 6:13 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-05 19:24 [PATCH 10/21] lpfc: Fix provide host name and OS name in RSNN-NN FC-GS command James Smart
2015-02-06 12:20 ` Tomas Henzl
2015-02-16 16:22 ` James Smart
2015-04-03 21:12 James Smart
2015-04-05 12:07 ` Sebastian Herbszt
2015-04-07 19:23 ` James Smart
2015-04-10 6:13 ` Hannes Reinecke
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.