Commit graph

5 commits

Author SHA1 Message Date
Arnd Bergmann
77409c4cdc scsi: myrs: avoid stack overflow warning
Putting a 1024 byte data structure on the stack is generally a bad idea.
On 32-bit systems, it also triggers a compile-time warning when building
with -Og:

drivers/scsi/myrs.c: In function 'myrs_get_ctlr_info':
drivers/scsi/myrs.c:212:1: error: the frame size of 1028 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

We only really need three members of the structure, so just read them
manually here instead of copying the entire structure.

Fixes: 7726618639 ("scsi: myrs: Add Mylex RAID controller (SCSI interface)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-11-05 22:35:01 -05:00
Dan Carpenter
a0db8a7516 scsi: myrs: Fix the processor absent message in processor_show()
If both processors are absent then it's supposed to print that, but
instead we print that just the second processor is absent.

Fixes: 7726618639 ("scsi: myrs: Add Mylex RAID controller (SCSI interface)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-19 18:31:37 -04:00
Dan Carpenter
9a231caa77 scsi: myrs: Fix a logical vs bitwise bug
The || was supposed to be |.  The original code just sets ->result to 1.

Fixes: 7726618639 ("scsi: myrs: Add Mylex RAID controller (SCSI interface)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-19 18:30:28 -04:00
James Bottomley
d592dd6400 scsi: myrs: fix build failure on 32 bit
For 32 bit versions we have to be careful about divisions of 64 bit
quantities so use do_div() instead of a direct division.  This fixes a
warning about _uldivmod being undefined in certain configurations

Fixes: 7726618639 ("scsi: myrs: Add Mylex RAID controller")
Reported-by: kbuild test robot <lkp@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-19 18:26:58 -04:00
Hannes Reinecke
7726618639 scsi: myrs: Add Mylex RAID controller (SCSI interface)
This patch adds support for the Mylex DAC960 RAID controller,
supporting the newer, SCSI-based interface.  The driver is a
re-implementation of the original DAC960 driver.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2018-10-17 21:07:54 -04:00