From f6e495a2b317fd7f3693d7c9217abfe943cbb3c6 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Tue, 1 Jul 2014 14:56:20 +0200 Subject: mptfusion: simplify rounding Rounding up to a multiple of 4 should be done using the ALIGN macro. As a bonus, this also makes the generated code smaller. In GetIocFacts(), sz is assigned to a few lines below without being read in the meantime, so it is ok that it doesn't end up with the same value as facts->FWImageSize. Signed-off-by: Rasmus Villemoes Reviewed-by: Joe Lawrence Signed-off-by: Christoph Hellwig --- drivers/message/fusion/mptbase.c | 7 +------ drivers/message/fusion/mptctl.c | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index a896d948b79e..68f57d3bcca1 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -3172,12 +3172,7 @@ GetIocFacts(MPT_ADAPTER *ioc, int sleepFlag, int reason) facts->FWImageSize = le32_to_cpu(facts->FWImageSize); } - sz = facts->FWImageSize; - if ( sz & 0x01 ) - sz += 1; - if ( sz & 0x02 ) - sz += 2; - facts->FWImageSize = sz; + facts->FWImageSize = ALIGN(facts->FWImageSize, 4); if (!facts->RequestFrameSize) { /* Something is wrong! */ diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c index b0a892a2bf1b..70bb7530b22c 100644 --- a/drivers/message/fusion/mptctl.c +++ b/drivers/message/fusion/mptctl.c @@ -1741,12 +1741,7 @@ mptctl_replace_fw (unsigned long arg) /* Allocate memory for the new FW image */ - newFwSize = karg.newImageSize; - - if (newFwSize & 0x01) - newFwSize += 1; - if (newFwSize & 0x02) - newFwSize += 2; + newFwSize = ALIGN(karg.newImageSize, 4); mpt_alloc_fw_memory(ioc, newFwSize); if (ioc->cached_fw == NULL) -- cgit v1.2.3 From 5d46ad7d88a78cca36ff6472a5bdc7d1c9c22654 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sat, 16 Aug 2014 14:15:15 -0700 Subject: fusion: fix excess parameter kernel-doc warning Fix kernel-doc excess parameter warning: Warning(..//drivers/message/fusion/mptbase.c:1411): Excess function parameter 'prod_name' description in 'mpt_get_product_name' Signed-off-by: Randy Dunlap Reviewed-by: Ewan D. Milne Signed-off-by: Christoph Hellwig --- drivers/message/fusion/mptbase.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 68f57d3bcca1..187f83629f7e 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -1400,7 +1400,6 @@ mpt_verify_adapter(int iocid, MPT_ADAPTER **iocpp) * @vendor: pci vendor id * @device: pci device id * @revision: pci revision id - * @prod_name: string returned * * Returns product string displayed when driver loads, * in /proc/mpt/summary and /sysfs/class/scsi_host/host/version_product -- cgit v1.2.3 From 4089b71cc820a426d601283c92fcd4ffeb5139c2 Mon Sep 17 00:00:00 2001 From: Chris J Arges Date: Tue, 23 Sep 2014 09:22:25 -0500 Subject: mptfusion: enable no_write_same for vmware scsi disks When using a virtual SCSI disk in a VMWare VM if blkdev_issue_zeroout is used data can be improperly zeroed out using the mptfusion driver. This patch disables write_same for this driver and the vmware subsystem_vendor which ensures that manual zeroing out is used instead. Cc: stable@vger.kernel.org BugLink: http://bugs.launchpad.net/bugs/1371591 Reported-by: Bruce Lucas Tested-by: Chris J Arges Signed-off-by: Chris J Arges Reviewed-by: Martin K. Petersen Signed-off-by: Christoph Hellwig --- drivers/message/fusion/mptspi.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/message') diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 787933d43d32..613231c16194 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -1419,6 +1419,11 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) goto out_mptspi_probe; } + /* VMWare emulation doesn't properly implement WRITE_SAME + */ + if (pdev->subsystem_vendor == 0x15AD) + sh->no_write_same = 1; + spin_lock_irqsave(&ioc->FreeQlock, flags); /* Attach the SCSI Host to the IOC structure -- cgit v1.2.3