Commit 7fdca3a8 authored by Brian King's avatar Brian King Committed by James Bottomley

[PATCH] ipr: Sparse warnings fixes

From: Mika Kukkonen <mika@osdl.org>
The following patch fixes some sparse warnings.
Signed-off-by: default avatarBrian King <brking@us.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent c6c78f9e
...@@ -880,11 +880,13 @@ static void ipr_process_ccn(struct ipr_cmnd *ipr_cmd) ...@@ -880,11 +880,13 @@ static void ipr_process_ccn(struct ipr_cmnd *ipr_cmd)
**/ **/
static void ipr_log_vpd(struct ipr_std_inq_vpids *vpids, u8 *serial_num) static void ipr_log_vpd(struct ipr_std_inq_vpids *vpids, u8 *serial_num)
{ {
char buffer[max_t(int, sizeof(struct ipr_std_inq_vpids), char buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN
IPR_SERIAL_NUM_LEN) + 1]; + IPR_SERIAL_NUM_LEN];
memcpy(buffer, vpids, sizeof(struct ipr_std_inq_vpids)); memcpy(buffer, vpids->vendor_id, IPR_VENDOR_ID_LEN);
buffer[sizeof(struct ipr_std_inq_vpids)] = '\0'; memcpy(buffer + IPR_VENDOR_ID_LEN, vpids->product_id,
IPR_PROD_ID_LEN);
buffer[IPR_VENDOR_ID_LEN + IPR_PROD_ID_LEN] = '\0';
ipr_err("Vendor/Product ID: %s\n", buffer); ipr_err("Vendor/Product ID: %s\n", buffer);
memcpy(buffer, serial_num, IPR_SERIAL_NUM_LEN); memcpy(buffer, serial_num, IPR_SERIAL_NUM_LEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment