* [PATCH] scsi update
@ 2016-01-20 19:41 Don Brace
2016-01-20 19:41 ` [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string Don Brace
0 siblings, 1 reply; 6+ messages in thread
From: Don Brace @ 2016-01-20 19:41 UTC (permalink / raw)
To: JBottomley, Viswas.G, scott.teel, Kevin.Barnett, scott.benesh,
Mahesh.Rajashekhara, hch, Justin.Lindley, elliott
Cc: linux-scsi
This patch is based on Linus tree
The change is:
- export sanitize_inquiry_string
---
Don Brace (1):
scsi: export function scsi_scan.c:sanitize_inquiry_string
drivers/scsi/scsi_scan.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
--
Signature
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string
2016-01-20 19:41 [PATCH] scsi update Don Brace
@ 2016-01-20 19:41 ` Don Brace
2016-01-20 22:52 ` Matthew R. Ochs
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Don Brace @ 2016-01-20 19:41 UTC (permalink / raw)
To: JBottomley, Viswas.G, scott.teel, Kevin.Barnett, scott.benesh,
Mahesh.Rajashekhara, hch, Justin.Lindley, elliott
Cc: linux-scsi
The hpsa driver uses this function to cleanup inquiry
data. Our new pqi driver will also use this
function. This function was copied into both drivers.
This patch exports sanitize_inquiry_string so the hpsa
and the pqi drivers can use this function directly.
Hannes recommended the change in review:
https://www.marc.info/?l=linux-scsi&m=144619249003064&w=2
that using the existing function in scsi_scan would be
preferrable.
Suggested-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
Reviewed-by: Scott Teel <scott.teel@pmcs.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Don Brace <don.brace@pmcs.com>
---
drivers/scsi/scsi_scan.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 6a82066..1f02e84 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -518,7 +518,8 @@ void scsi_target_reap(struct scsi_target *starget)
}
/**
- * sanitize_inquiry_string - remove non-graphical chars from an INQUIRY result string
+ * scsi_sanitize_inquiry_string - remove non-graphical chars from an
+ * INQUIRY result string
* @s: INQUIRY result string to sanitize
* @len: length of the string
*
@@ -531,7 +532,7 @@ void scsi_target_reap(struct scsi_target *starget)
* string terminator, so all the following characters are set to
* spaces.
**/
-static void sanitize_inquiry_string(unsigned char *s, int len)
+void scsi_sanitize_inquiry_string(unsigned char *s, int len)
{
int terminated = 0;
@@ -542,6 +543,7 @@ static void sanitize_inquiry_string(unsigned char *s, int len)
*s = ' ';
}
}
+EXPORT_SYMBOL(scsi_sanitize_inquiry_string);
/**
* scsi_probe_lun - probe a single LUN using a SCSI INQUIRY
@@ -627,9 +629,9 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
}
if (result == 0) {
- sanitize_inquiry_string(&inq_result[8], 8);
- sanitize_inquiry_string(&inq_result[16], 16);
- sanitize_inquiry_string(&inq_result[32], 4);
+ scsi_sanitize_inquiry_string(&inq_result[8], 8);
+ scsi_sanitize_inquiry_string(&inq_result[16], 16);
+ scsi_sanitize_inquiry_string(&inq_result[32], 4);
response_len = inq_result[4] + 5;
if (response_len > 255)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string
2016-01-20 19:41 ` [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string Don Brace
@ 2016-01-20 22:52 ` Matthew R. Ochs
2016-01-21 6:35 ` Johannes Thumshirn
2016-01-22 21:17 ` Don Brace
2 siblings, 0 replies; 6+ messages in thread
From: Matthew R. Ochs @ 2016-01-20 22:52 UTC (permalink / raw)
To: Don Brace
Cc: JBottomley, Viswas.G, scott.teel, Kevin.Barnett, scott.benesh,
Mahesh.Rajashekhara, hch, Justin.Lindley, elliott, linux-scsi
> On Jan 20, 2016, at 1:41 PM, Don Brace <don.brace@pmcs.com> wrote:
>
> The hpsa driver uses this function to cleanup inquiry
> data. Our new pqi driver will also use this
> function. This function was copied into both drivers.
>
> This patch exports sanitize_inquiry_string so the hpsa
> and the pqi drivers can use this function directly.
>
> Hannes recommended the change in review:
> https://www.marc.info/?l=linux-scsi&m=144619249003064&w=2
> that using the existing function in scsi_scan would be
> preferrable.
I also made this suggestion when reviewing the same patch:
https://www.marc.info/?l=linux-scsi&m=144613827316617&w=2
Reviewed-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
>
> Suggested-by: Hannes Reinecke <hare@suse.de>
> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
> Reviewed-by: Scott Teel <scott.teel@pmcs.com>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Signed-off-by: Don Brace <don.brace@pmcs.com>
> ---
> drivers/scsi/scsi_scan.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 6a82066..1f02e84 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -518,7 +518,8 @@ void scsi_target_reap(struct scsi_target *starget)
> }
>
> /**
> - * sanitize_inquiry_string - remove non-graphical chars from an INQUIRY result string
> + * scsi_sanitize_inquiry_string - remove non-graphical chars from an
> + * INQUIRY result string
> * @s: INQUIRY result string to sanitize
> * @len: length of the string
> *
> @@ -531,7 +532,7 @@ void scsi_target_reap(struct scsi_target *starget)
> * string terminator, so all the following characters are set to
> * spaces.
> **/
> -static void sanitize_inquiry_string(unsigned char *s, int len)
> +void scsi_sanitize_inquiry_string(unsigned char *s, int len)
> {
> int terminated = 0;
>
> @@ -542,6 +543,7 @@ static void sanitize_inquiry_string(unsigned char *s, int len)
> *s = ' ';
> }
> }
> +EXPORT_SYMBOL(scsi_sanitize_inquiry_string);
>
> /**
> * scsi_probe_lun - probe a single LUN using a SCSI INQUIRY
> @@ -627,9 +629,9 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
> }
>
> if (result == 0) {
> - sanitize_inquiry_string(&inq_result[8], 8);
> - sanitize_inquiry_string(&inq_result[16], 16);
> - sanitize_inquiry_string(&inq_result[32], 4);
> + scsi_sanitize_inquiry_string(&inq_result[8], 8);
> + scsi_sanitize_inquiry_string(&inq_result[16], 16);
> + scsi_sanitize_inquiry_string(&inq_result[32], 4);
>
> response_len = inq_result[4] + 5;
> if (response_len > 255)
>
> --
> 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] 6+ messages in thread
* Re: [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string
2016-01-20 19:41 ` [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string Don Brace
2016-01-20 22:52 ` Matthew R. Ochs
@ 2016-01-21 6:35 ` Johannes Thumshirn
2016-01-22 21:17 ` Don Brace
2 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2016-01-21 6:35 UTC (permalink / raw)
To: Don Brace
Cc: JBottomley, Viswas.G, scott.teel, Kevin.Barnett, scott.benesh,
Mahesh.Rajashekhara, hch, Justin.Lindley, elliott, linux-scsi
On Wed, Jan 20, 2016 at 01:41:41PM -0600, Don Brace wrote:
> The hpsa driver uses this function to cleanup inquiry
> data. Our new pqi driver will also use this
> function. This function was copied into both drivers.
>
> This patch exports sanitize_inquiry_string so the hpsa
> and the pqi drivers can use this function directly.
>
> Hannes recommended the change in review:
> https://www.marc.info/?l=linux-scsi&m=144619249003064&w=2
> that using the existing function in scsi_scan would be
> preferrable.
>
> Suggested-by: Hannes Reinecke <hare@suse.de>
> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
> Reviewed-by: Scott Teel <scott.teel@pmcs.com>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Signed-off-by: Don Brace <don.brace@pmcs.com>
> ---
> drivers/scsi/scsi_scan.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 6a82066..1f02e84 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -518,7 +518,8 @@ void scsi_target_reap(struct scsi_target *starget)
> }
>
> /**
> - * sanitize_inquiry_string - remove non-graphical chars from an INQUIRY result string
> + * scsi_sanitize_inquiry_string - remove non-graphical chars from an
> + * INQUIRY result string
> * @s: INQUIRY result string to sanitize
> * @len: length of the string
> *
> @@ -531,7 +532,7 @@ void scsi_target_reap(struct scsi_target *starget)
> * string terminator, so all the following characters are set to
> * spaces.
> **/
> -static void sanitize_inquiry_string(unsigned char *s, int len)
> +void scsi_sanitize_inquiry_string(unsigned char *s, int len)
> {
> int terminated = 0;
>
> @@ -542,6 +543,7 @@ static void sanitize_inquiry_string(unsigned char *s, int len)
> *s = ' ';
> }
> }
> +EXPORT_SYMBOL(scsi_sanitize_inquiry_string);
>
> /**
> * scsi_probe_lun - probe a single LUN using a SCSI INQUIRY
> @@ -627,9 +629,9 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
> }
>
> if (result == 0) {
> - sanitize_inquiry_string(&inq_result[8], 8);
> - sanitize_inquiry_string(&inq_result[16], 16);
> - sanitize_inquiry_string(&inq_result[32], 4);
> + scsi_sanitize_inquiry_string(&inq_result[8], 8);
> + scsi_sanitize_inquiry_string(&inq_result[16], 16);
> + scsi_sanitize_inquiry_string(&inq_result[32], 4);
>
> response_len = inq_result[4] + 5;
> if (response_len > 255)
>
> --
> 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
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
--
Johannes Thumshirn Storage
jthumshirn@suse.de +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
--
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] 6+ messages in thread
* Re: [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string
2016-01-20 19:41 ` [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string Don Brace
2016-01-20 22:52 ` Matthew R. Ochs
2016-01-21 6:35 ` Johannes Thumshirn
@ 2016-01-22 21:17 ` Don Brace
2016-01-27 2:06 ` Martin K. Petersen
2 siblings, 1 reply; 6+ messages in thread
From: Don Brace @ 2016-01-22 21:17 UTC (permalink / raw)
To: JBottomley, Viswas.G, scott.teel, Kevin.Barnett, scott.benesh,
Mahesh.Rajashekhara, hch, Justin.Lindley, elliott
Cc: linux-scsi
On 01/20/2016 01:41 PM, Don Brace wrote:
> The hpsa driver uses this function to cleanup inquiry
> data. Our new pqi driver will also use this
> function. This function was copied into both drivers.
>
> This patch exports sanitize_inquiry_string so the hpsa
> and the pqi drivers can use this function directly.
>
> Hannes recommended the change in review:
> https://www.marc.info/?l=linux-scsi&m=144619249003064&w=2
> that using the existing function in scsi_scan would be
> preferrable.
>
> Suggested-by: Hannes Reinecke <hare@suse.de>
> Reviewed-by: Kevin Barnett <kevin.barnett@pmcs.com>
> Reviewed-by: Justin Lindley <justin.lindley@pmcs.com>
> Reviewed-by: Scott Teel <scott.teel@pmcs.com>
> Reviewed-by: Hannes Reinecke <hare@suse.de>
> Signed-off-by: Don Brace <don.brace@pmcs.com>
> ---
> drivers/scsi/scsi_scan.c | 12 +++++++-----
> 1 file changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index 6a82066..1f02e84 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -518,7 +518,8 @@ void scsi_target_reap(struct scsi_target *starget)
It was pointed out to me by Kevin Barnett that I should also add a prototype
in scsi.h.
Any thoughts for a V1 with this addition?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string
2016-01-22 21:17 ` Don Brace
@ 2016-01-27 2:06 ` Martin K. Petersen
0 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2016-01-27 2:06 UTC (permalink / raw)
To: Don Brace
Cc: JBottomley, Viswas.G, scott.teel, Kevin.Barnett, scott.benesh,
Mahesh.Rajashekhara, hch, Justin.Lindley, elliott, linux-scsi
>>>>> "Don" == Don Brace <brace77070@gmail.com> writes:
Don> It was pointed out to me by Kevin Barnett that I should also add a
Don> prototype in scsi.h.
Yes, please.
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-01-27 2:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-20 19:41 [PATCH] scsi update Don Brace
2016-01-20 19:41 ` [PATCH] scsi: export function scsi_scan.c:sanitize_inquiry_string Don Brace
2016-01-20 22:52 ` Matthew R. Ochs
2016-01-21 6:35 ` Johannes Thumshirn
2016-01-22 21:17 ` Don Brace
2016-01-27 2:06 ` Martin K. Petersen
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.