aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_qdio.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-10-01 06:42:16 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-10-03 13:11:52 -0400
commit44cc76f2d154aa24340354b4711a0fe7f8f08adc (patch)
tree0b32bb89450b12262b4bf78fc4cd297e8db0b77b /drivers/s390/scsi/zfcp_qdio.c
parentff3b24fa5370a7ca618f212284d9b36fcedb9c0e (diff)
[SCSI] zfcp: remove unused references, declarations and flags
- Remove unused references and declarations, including one instance of the FC ls_adisc struct that has been defined twice. - Also remove the flags COMMON_OPENING, COMMON_CLOSING, ADAPTER_REGISTERED and XPORT_OK that are only set and cleared, but not checked anywhere. - Remove the zfcp specific atomic_test_mask makro. Simply use atomic_read directly instead. - Remove the zfcp internal sg helper functions and switch the places where it is still used to call sg_virt directly. - With the update of the QDIO code, the QDIO data structures no longer use the volatile type qualifier. Now we can also remove the volatile qualifiers from the zfcp code. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_qdio.c')
-rw-r--r--drivers/s390/scsi/zfcp_qdio.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/drivers/s390/scsi/zfcp_qdio.c b/drivers/s390/scsi/zfcp_qdio.c
index 9c5b84980901..0dfaa176af7f 100644
--- a/drivers/s390/scsi/zfcp_qdio.c
+++ b/drivers/s390/scsi/zfcp_qdio.c
@@ -28,7 +28,7 @@ static int zfcp_qdio_buffers_enqueue(struct qdio_buffer **sbal)
28 return 0; 28 return 0;
29} 29}
30 30
31static volatile struct qdio_buffer_element * 31static struct qdio_buffer_element *
32zfcp_qdio_sbale(struct zfcp_qdio_queue *q, int sbal_idx, int sbale_idx) 32zfcp_qdio_sbale(struct zfcp_qdio_queue *q, int sbal_idx, int sbale_idx)
33{ 33{
34 return &q->sbal[sbal_idx]->element[sbale_idx]; 34 return &q->sbal[sbal_idx]->element[sbale_idx];
@@ -145,7 +145,7 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err,
145{ 145{
146 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm; 146 struct zfcp_adapter *adapter = (struct zfcp_adapter *) parm;
147 struct zfcp_qdio_queue *queue = &adapter->resp_q; 147 struct zfcp_qdio_queue *queue = &adapter->resp_q;
148 volatile struct qdio_buffer_element *sbale; 148 struct qdio_buffer_element *sbale;
149 int sbal_idx, sbale_idx, sbal_no; 149 int sbal_idx, sbale_idx, sbal_no;
150 150
151 if (unlikely(qdio_err)) { 151 if (unlikely(qdio_err)) {
@@ -190,8 +190,7 @@ static void zfcp_qdio_int_resp(struct ccw_device *cdev, unsigned int qdio_err,
190 * @fsf_req: pointer to struct fsf_req 190 * @fsf_req: pointer to struct fsf_req
191 * Returns: pointer to qdio_buffer_element (SBALE) structure 191 * Returns: pointer to qdio_buffer_element (SBALE) structure
192 */ 192 */
193volatile struct qdio_buffer_element * 193struct qdio_buffer_element *zfcp_qdio_sbale_req(struct zfcp_fsf_req *req)
194zfcp_qdio_sbale_req(struct zfcp_fsf_req *req)
195{ 194{
196 return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, 0); 195 return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, 0);
197} 196}
@@ -201,8 +200,7 @@ zfcp_qdio_sbale_req(struct zfcp_fsf_req *req)
201 * @fsf_req: pointer to struct fsf_req 200 * @fsf_req: pointer to struct fsf_req
202 * Returns: pointer to qdio_buffer_element (SBALE) structure 201 * Returns: pointer to qdio_buffer_element (SBALE) structure
203 */ 202 */
204volatile struct qdio_buffer_element * 203struct qdio_buffer_element *zfcp_qdio_sbale_curr(struct zfcp_fsf_req *req)
205zfcp_qdio_sbale_curr(struct zfcp_fsf_req *req)
206{ 204{
207 return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last, 205 return zfcp_qdio_sbale(&req->adapter->req_q, req->sbal_last,
208 req->sbale_curr); 206 req->sbale_curr);
@@ -216,10 +214,10 @@ static void zfcp_qdio_sbal_limit(struct zfcp_fsf_req *fsf_req, int max_sbals)
216 % QDIO_MAX_BUFFERS_PER_Q; 214 % QDIO_MAX_BUFFERS_PER_Q;
217} 215}
218 216
219static volatile struct qdio_buffer_element * 217static struct qdio_buffer_element *
220zfcp_qdio_sbal_chain(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) 218zfcp_qdio_sbal_chain(struct zfcp_fsf_req *fsf_req, unsigned long sbtype)
221{ 219{
222 volatile struct qdio_buffer_element *sbale; 220 struct qdio_buffer_element *sbale;
223 221
224 /* set last entry flag in current SBALE of current SBAL */ 222 /* set last entry flag in current SBALE of current SBAL */
225 sbale = zfcp_qdio_sbale_curr(fsf_req); 223 sbale = zfcp_qdio_sbale_curr(fsf_req);
@@ -250,7 +248,7 @@ zfcp_qdio_sbal_chain(struct zfcp_fsf_req *fsf_req, unsigned long sbtype)
250 return sbale; 248 return sbale;
251} 249}
252 250
253static volatile struct qdio_buffer_element * 251static struct qdio_buffer_element *
254zfcp_qdio_sbale_next(struct zfcp_fsf_req *fsf_req, unsigned long sbtype) 252zfcp_qdio_sbale_next(struct zfcp_fsf_req *fsf_req, unsigned long sbtype)
255{ 253{
256 if (fsf_req->sbale_curr == ZFCP_LAST_SBALE_PER_SBAL) 254 if (fsf_req->sbale_curr == ZFCP_LAST_SBALE_PER_SBAL)
@@ -273,7 +271,7 @@ static int zfcp_qdio_fill_sbals(struct zfcp_fsf_req *fsf_req,
273 unsigned int sbtype, void *start_addr, 271 unsigned int sbtype, void *start_addr,
274 unsigned int total_length) 272 unsigned int total_length)
275{ 273{
276 volatile struct qdio_buffer_element *sbale; 274 struct qdio_buffer_element *sbale;
277 unsigned long remaining, length; 275 unsigned long remaining, length;
278 void *addr; 276 void *addr;
279 277
@@ -308,7 +306,7 @@ static int zfcp_qdio_fill_sbals(struct zfcp_fsf_req *fsf_req,
308int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype, 306int zfcp_qdio_sbals_from_sg(struct zfcp_fsf_req *fsf_req, unsigned long sbtype,
309 struct scatterlist *sg, int max_sbals) 307 struct scatterlist *sg, int max_sbals)
310{ 308{
311 volatile struct qdio_buffer_element *sbale; 309 struct qdio_buffer_element *sbale;
312 int retval, bytes = 0; 310 int retval, bytes = 0;
313 311
314 /* figure out last allowed SBAL */ 312 /* figure out last allowed SBAL */
@@ -345,7 +343,7 @@ int zfcp_qdio_send(struct zfcp_fsf_req *fsf_req)
345 int first = fsf_req->sbal_first; 343 int first = fsf_req->sbal_first;
346 int count = fsf_req->sbal_number; 344 int count = fsf_req->sbal_number;
347 int retval, pci, pci_batch; 345 int retval, pci, pci_batch;
348 volatile struct qdio_buffer_element *sbale; 346 struct qdio_buffer_element *sbale;
349 347
350 /* acknowledgements for transferred buffers */ 348 /* acknowledgements for transferred buffers */
351 pci_batch = req_q->pci_batch + count; 349 pci_batch = req_q->pci_batch + count;
@@ -419,7 +417,7 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter)
419 struct zfcp_qdio_queue *req_q; 417 struct zfcp_qdio_queue *req_q;
420 int first, count; 418 int first, count;
421 419
422 if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) 420 if (!(atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP))
423 return; 421 return;
424 422
425 /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ 423 /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */
@@ -451,10 +449,10 @@ void zfcp_qdio_close(struct zfcp_adapter *adapter)
451 */ 449 */
452int zfcp_qdio_open(struct zfcp_adapter *adapter) 450int zfcp_qdio_open(struct zfcp_adapter *adapter)
453{ 451{
454 volatile struct qdio_buffer_element *sbale; 452 struct qdio_buffer_element *sbale;
455 int cc; 453 int cc;
456 454
457 if (atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) 455 if (atomic_read(&adapter->status) & ZFCP_STATUS_ADAPTER_QDIOUP)
458 return -EIO; 456 return -EIO;
459 457
460 if (qdio_establish(&adapter->qdio_init_data)) 458 if (qdio_establish(&adapter->qdio_init_data))