All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Sebastian Herbszt <herbszt@gmx.de>, linux-scsi@vger.kernel.org
Cc: James Smart <James.Smart@Emulex.Com>
Subject: Re: [PATCH] lpfc: fix model description
Date: Thu, 23 Apr 2015 09:36:46 +0200	[thread overview]
Message-ID: <5538A10E.10904@sandisk.com> (raw)
In-Reply-To: <20150422231618.00005ec8@localhost>

On 04/22/15 23:16, Sebastian Herbszt wrote:
> Remove trailing space from model description.
>
> Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
>
> diff -up 4.0/drivers/scsi/lpfc.orig/lpfc_init.c 4.0/drivers/scsi/lpfc/lpfc_init.c
> --- 4.0/drivers/scsi/lpfc.orig/lpfc_init.c	2015-04-15 06:18:24.673045138 +0200
> +++ 4.0/drivers/scsi/lpfc/lpfc_init.c	2015-04-22 21:03:39.203230409 +0200
> @@ -2253,7 +2253,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba
>   				phba->Port);
>   		else if (max_speed == 0)
>   			snprintf(descp, 255,
> -				"Emulex %s %s %s ",
> +				"Emulex %s %s %s",
>   				m.name, m.bus, m.function);
>   		else
>   			snprintf(descp, 255,

Hello Sebastian,

Since you are touching that code, please include the following 
additional changes in your patch or in a separate patch:
* Change the type of the third argument of lpfc_get_hba_model_desc()
   from uint8_t * into char * since that pointer is used to store a
   '\0'-terminated ASCII string.
* Add a size argument to lpfc_get_hba_model_desc() such that the callers
   of this function can specify what the size is of the array descp
   points at (sizeof(phba->ModelDesc) ?).
* Switch from snprintf() to scnprintf() because the latter function
   guarantees '\0'-termination if the output has to be truncated.

Thanks,

Bart.


  reply	other threads:[~2015-04-23  7:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 21:16 [PATCH] lpfc: fix model description Sebastian Herbszt
2015-04-23  7:36 ` Bart Van Assche [this message]
2015-04-26 22:32   ` Sebastian Herbszt
2015-04-27  6:02     ` Bart Van Assche
2015-05-27 21:40 ` Sebastian Herbszt
2015-05-28 20:28   ` James Smart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5538A10E.10904@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=James.Smart@Emulex.Com \
    --cc=herbszt@gmx.de \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.