diff options
author | Joe Lawrence <joe.lawrence@stratus.com> | 2014-06-25 17:06:28 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-25 17:16:58 -0400 |
commit | c9834c70efbaaa1461ec04289d97a842244fb294 (patch) | |
tree | fc0f1e232f388236b602cd2bfd429db4700ef631 /drivers | |
parent | 3e67c459d0ac945ac09639d85de299e65317aefe (diff) |
mptfusion: make adapter prod_name[] a pointer
The struct _MPT_ADAPTER doesn't need a full copy of the product string,
so prod_name can point to the string literal storage that the driver
already provides.
Avoids the following smatch warning:
drivers/message/fusion/mptbase.c:2858 MptDisplayIocCapabilities()
warn: this array is probably non-NULL. 'ioc->prod_name'
Signed-off-by: Joe Lawrence <joe.lawrence@stratus.com>
Acked-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/message/fusion/mptbase.c | 11 | ||||
-rw-r--r-- | drivers/message/fusion/mptbase.h | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index ea30033a477c..9d4c7825a5f2 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1408,8 +1408,8 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp) | |||
1408 | * in /proc/mpt/summary and /sysfs/class/scsi_host/host<X>/version_product | 1408 | * in /proc/mpt/summary and /sysfs/class/scsi_host/host<X>/version_product |
1409 | * | 1409 | * |
1410 | **/ | 1410 | **/ |
1411 | static void | 1411 | static const char* |
1412 | mpt_get_product_name(u16 vendor, u16 device, u8 revision, char *prod_name) | 1412 | mpt_get_product_name(u16 vendor, u16 device, u8 revision) |
1413 | { | 1413 | { |
1414 | char *product_str = NULL; | 1414 | char *product_str = NULL; |
1415 | 1415 | ||
@@ -1635,8 +1635,7 @@ mpt_get_product_name(u16 vendor, u16 device, u8 revision, char *prod_name) | |||
1635 | } | 1635 | } |
1636 | 1636 | ||
1637 | out: | 1637 | out: |
1638 | if (product_str) | 1638 | return product_str; |
1639 | sprintf(prod_name, "%s", product_str); | ||
1640 | } | 1639 | } |
1641 | 1640 | ||
1642 | /** | 1641 | /** |
@@ -1887,8 +1886,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1887 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n", | 1886 | dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n", |
1888 | ioc->name, &ioc->facts, &ioc->pfacts[0])); | 1887 | ioc->name, &ioc->facts, &ioc->pfacts[0])); |
1889 | 1888 | ||
1890 | mpt_get_product_name(pdev->vendor, pdev->device, pdev->revision, | 1889 | ioc->prod_name = mpt_get_product_name(pdev->vendor, pdev->device, |
1891 | ioc->prod_name); | 1890 | pdev->revision); |
1892 | 1891 | ||
1893 | switch (pdev->device) | 1892 | switch (pdev->device) |
1894 | { | 1893 | { |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index f37ea6fdc6ae..8f14090b8b71 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -605,7 +605,7 @@ typedef struct _MPT_ADAPTER | |||
605 | int id; /* Unique adapter id N {0,1,2,...} */ | 605 | int id; /* Unique adapter id N {0,1,2,...} */ |
606 | int pci_irq; /* This irq */ | 606 | int pci_irq; /* This irq */ |
607 | char name[MPT_NAME_LENGTH]; /* "iocN" */ | 607 | char name[MPT_NAME_LENGTH]; /* "iocN" */ |
608 | char prod_name[MPT_NAME_LENGTH]; /* "LSIFC9x9" */ | 608 | const char *prod_name; /* "LSIFC9x9" */ |
609 | #ifdef CONFIG_FUSION_LOGGING | 609 | #ifdef CONFIG_FUSION_LOGGING |
610 | /* used in mpt_display_event_info */ | 610 | /* used in mpt_display_event_info */ |
611 | char evStr[EVENT_DESCR_STR_SZ]; | 611 | char evStr[EVENT_DESCR_STR_SZ]; |