Skip to contentSkip to conversation

arcmsr: Fix bug of updating adapter firmware through ioctl(ARCHTTP) interface

PATCH In review 黃清隆 4 participants 6 messages Aug 26, 2013 – Sep 3, 2013 SCSI

lore
Share & tools
lore
maintainer
#1 lore raw
Quoted 5 lines · 黃清隆

From: Ching <[email protected]>

Fix bug of updating adapter firmware through ioctl(ARCHTTP) interface.

---

This one has a set of nasty checkpatch errors:

WARNING: please, no spaces at the start of a line
#31: FILE: drivers/scsi/arcmsr/arcmsr.h:801:
+ struct QBUFFER __iomem *);$

ERROR: space prohibited after that open parenthesis '(' #283: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2141:
+ if ( iop_len > 0 ) {

ERROR: space prohibited before that close parenthesis ')' #283: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2141:
+ if ( iop_len > 0 ) {

ERROR: space prohibited after that open parenthesis '(' #286: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2144:
+ if( buf1 == NULL)

ERROR: space required before the open parenthesis '(' #286: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2144:
+ if( buf1 == NULL)

ERROR: return is not a function, parentheses are not required #287: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2145:
+ return (0);

ERROR: space required before the open parenthesis '(' #293: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2151:
+ if(data_len)

ERROR: space prohibited after that open parenthesis '(' #307: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2165:
+ kfree( (uint8_t *)buf2);

ERROR: return is not a function, parentheses are not required #310: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2168:
+ return (1);

WARNING: please, no spaces at the start of a line #315: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2173:
+ struct QBUFFER __iomem *prbuffer) {$

WARNING: braces {} are not necessary for single statement blocks #321: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2179:
+ if (acb->adapter_type & (ACB_ADAPTER_TYPE_C |
ACB_ADAPTER_TYPE_D)) {
+ return(arcmsr_Read_iop_rqbuffer_in_DWORD(acb,
prbuffer));
+ }

ERROR: return is not a function, parentheses are not required #322: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2180:
+ return(arcmsr_Read_iop_rqbuffer_in_DWORD(acb,
prbuffer));

ERROR: return is not a function, parentheses are not required #335: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2193:
+ return (1);

ERROR: need consistent spacing around '-' (ctx:WxV) #394: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2205:
+ buf_empty_len = (acb->rqbuf_lastindex - acb->rqbuf_firstindex
-1) &

                                                                      ^

ERROR: need consistent spacing around '-' (ctx:WxV) #395: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2206:

+               (ARCMSR_MAX_QBUFFER -1);
                                    ^

ERROR: trailing whitespace
#424: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2224:
+^I$

ERROR: space prohibited after that open parenthesis '(' #428: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2228:
+ if( buf1 == NULL)

ERROR: space required before the open parenthesis '(' #428: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2228:
+ if( buf1 == NULL)

ERROR: space prohibited after that open parenthesis '(' #557: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2252:
+ kfree( buf1);

ERROR: spaces required around that '=' (ctx:VxV) #568: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2263:

+       int32_t allxfer_len=0;
                           ^

ERROR: trailing whitespace
#569: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2264:
+^I$

ERROR: trailing whitespace
#578: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2273:
+^I^Iwhile ((acb->wqbuf_firstindex != acb->wqbuf_lastindex) $

ERROR: spaces required around that '=' (ctx:VxV) #759: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2700:

+               for (i=0; i < 15; i++) {
                      ^

WARNING: line over 80 characters
#766: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2707:
+ } else if (acb->rqbuf_firstindex !=
acb->rqbuf_lastindex) {

ERROR: trailing whitespace
#770: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2711:
+^I^I^I} else $

WARNING: line over 80 characters
#779: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2766:
+ acb->rqbuf_firstindex %=
ARCMSR_MAX_QBUFFER;

WARNING: line over 80 characters
#787: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2819:
+ memcpy(pcmdmessagefld->messagedatabuffer, ver_addr,
allxfer_len);

ERROR: space required before the open parenthesis '(' #837: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:2824:
+ if(arcmsr_Read_iop_rqbuffer_data(acb, prbuffer)
== 0)

ERROR: spaces required around that '=' (ctx:VxV) #1071: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:4279:

+               for (i=0; i < 200; i++) {
                      ^

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(10);
WARNING: line over 80 characters
#1074: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:4282:
+ if (outbound_doorbell &
ARCMSR_HBCMU_IOP2DRV_DATA_WRITE_OK) {

ERROR: spaces required around that '=' (ctx:VxV) #1094: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:4301:

+               for (i=0; i < 200; i++) {
                      ^

WARNING: msleep < 20ms can sleep for up to 20ms; see Documentation/timers/timers-howto.txt
+ msleep(10);
WARNING: line over 80 characters
#1097: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:4304:
+ if (outbound_doorbell &
ARCMSR_ARC1214_IOP2DRV_DATA_WRITE_OK) {

WARNING: quoted string split across lines #1121: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:4750:
+ sprintf(buf, "Areca %s Host Adapter RAID Controller%s\narcmsr "
+ "version %s\n",type, raid6 ? "( RAID6 capable)" : "",

ERROR: space required after that ',' (ctx:VxV) #1121: FILE: drivers/scsi/arcmsr/arcmsr_hba.c:4750:
+ "version %s\n",type, raid6 ? "( RAID6 capable)" : "",

                              ^

total: 25 errors, 11 warnings, 1061 lines checked

Please fix these and resend.

Thanks,

James

#2 lore raw

PATCH 1/2 scsi: fix warning with unused variable

drivers/scsi/scsi_error.c:246:16: warning: unused variable 'flags' [-Wunused-variable]

---
 drivers/scsi/scsi_error.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/scsi/scsi_error.c +0 -1
index f16d1a6..83e591b 100644
@@ -243,7 +243,6 @@ static void scsi_report_sense(struct scsi_device *sdev,
 			      struct scsi_sense_hdr *sshdr)
 {
 	enum scsi_device_event evt_type = SDEV_EVT_MAXBITS;	/* i.e. none */
-	unsigned long flags;
 
 	if (sshdr->sense_key == UNIT_ATTENTION) {
 		if (sshdr->asc == 0x3f && sshdr->ascq == 0x03) {
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 2/2 scsi: replace the deprecated flush_work_sync

In reply to James Bottomley

flush_work_sync is replaced by flush_work with commit 4382973(workqueue: deprecate flush[_delayed]_work_sync()).

---
 drivers/scsi/arcmsr/arcmsr_hba.c |    4 ++--
 drivers/scsi/ufs/ufshcd.c        |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/scsi/arcmsr/arcmsr_hba.c +2 -2
index aac6378..e1ea1ca 100644
@@ -1599,7 +1599,7 @@ arcmsr_remove(struct pci_dev *pdev)
 	int poll_count = 0, i;
 	arcmsr_free_sysfs_attr(acb);
 	scsi_remove_host(host);
-	flush_work_sync(&acb->arcmsr_do_message_isr_bh);
+	flush_work(&acb->arcmsr_do_message_isr_bh);
 	del_timer_sync(&acb->eternal_timer);
 	arcmsr_disable_outbound_ints(acb);
 	arcmsr_stop_adapter_bgrb(acb);
@@ -1661,7 +1661,7 @@ arcmsr_shutdown(struct pci_dev *pdev)
 		pci_disable_msix(pdev);
 	} else
 		free_irq(pdev->irq, acb);
-	flush_work_sync(&acb->arcmsr_do_message_isr_bh);
+	flush_work(&acb->arcmsr_do_message_isr_bh);
 	arcmsr_stop_adapter_bgrb(acb);
 	arcmsr_flush_adapter_cache(acb);
 }
drivers/scsi/ufs/ufshcd.c +1 -1
index a0f5ac2..1b99c0a 100644
@@ -2737,7 +2737,7 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd)
 			break;
 		spin_unlock_irqrestore(hba->host->host_lock, flags);
 		dev_dbg(hba->dev, "%s: reset in progress\n", __func__);
-		flush_work_sync(&hba->eh_work);
+		flush_work(&hba->eh_work);
 	} while (1);
 
 	hba->ufshcd_state = UFSHCD_STATE_RESET;
Signature · 1 line
1.7.0.4
#4 lore raw

PATCH 1/1 scsi: ufs: replace the deprecated flush_work_sync

In reply to James Bottomley

flush_work_sync is replaced by flush_work with commit 4382973(workqueue: deprecate flush[_delayed]_work_sync()).

---
 drivers/scsi/ufs/ufshcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/ufs/ufshcd.c +1 -1
index a0f5ac2..1b99c0a 100644
@@ -2737,7 +2737,7 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd)
 			break;
 		spin_unlock_irqrestore(hba->host->host_lock, flags);
 		dev_dbg(hba->dev, "%s: reset in progress\n", __func__);
-		flush_work_sync(&hba->eh_work);
+		flush_work(&hba->eh_work);
 	} while (1);
 
 	hba->ufshcd_state = UFSHCD_STATE_RESET;
Signature · 1 line
1.7.0.4
Acked-by on v1 1/1
#5 lore raw

Re: [PATCH] scsi: ufs: replace the deprecated flush_work_sync

Quoted 22 lines · Seungwon Jeon

flush_work_sync is replaced by flush_work with commit 4382973(workqueue: deprecate flush[_delayed]_work_sync()).

---
 drivers/scsi/ufs/ufshcd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/scsi/ufs/ufshcd.c +1 -2
index a0f5ac2..1b99c0a 100644
@@ -2737,7 +2737,7 @@ static int ufshcd_eh_host_reset_handler(struct scsi_cmnd *cmd)
                        break;
                spin_unlock_irqrestore(hba->host->host_lock, flags);
                dev_dbg(hba->dev, "%s: reset in progress\n", __func__);
-               flush_work_sync(&hba->eh_work);
+               flush_work(&hba->eh_work);
        } while (1);
 
        hba->ufshcd_state = UFSHCD_STATE_RESET;
--
Quoted 3 lines

1.7.0.4

Signature · 1 line
~Santosh