diff options
| author | Joe Lawrence <[email protected]> | 2014-06-25 21:06:28 +0000 |
|---|---|---|
| committer | Christoph Hellwig <[email protected]> | 2014-07-25 21:16:58 +0000 |
| commit | c9834c70efbaaa1461ec04289d97a842244fb294 (patch) | |
| tree | fc0f1e232f388236b602cd2bfd429db4700ef631 /drivers/message/fusion/mptbase.c | |
| parent | mptfusion: use memdup_user (diff) | |
| download | kernel-c9834c70efbaaa1461ec04289d97a842244fb294.tar.gz kernel-c9834c70efbaaa1461ec04289d97a842244fb294.zip | |
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 <[email protected]>
Acked-by: Sreekanth Reddy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Diffstat (limited to 'drivers/message/fusion/mptbase.c')
| -rw-r--r-- | drivers/message/fusion/mptbase.c | 11 |
1 files changed, 5 insertions, 6 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) * in /proc/mpt/summary and /sysfs/class/scsi_host/host<X>/version_product * **/ -static void -mpt_get_product_name(u16 vendor, u16 device, u8 revision, char *prod_name) +static const char* +mpt_get_product_name(u16 vendor, u16 device, u8 revision) { char *product_str = NULL; @@ -1635,8 +1635,7 @@ mpt_get_product_name(u16 vendor, u16 device, u8 revision, char *prod_name) } out: - if (product_str) - sprintf(prod_name, "%s", product_str); + return product_str; } /** @@ -1887,8 +1886,8 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) dinitprintk(ioc, printk(MYIOC_s_INFO_FMT "facts @ %p, pfacts[0] @ %p\n", ioc->name, &ioc->facts, &ioc->pfacts[0])); - mpt_get_product_name(pdev->vendor, pdev->device, pdev->revision, - ioc->prod_name); + ioc->prod_name = mpt_get_product_name(pdev->vendor, pdev->device, + pdev->revision); switch (pdev->device) { |
