hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/scsi/aacraid/dpcsup.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Adaptec AAC series RAID controller driver
34 * (c) Copyright 2001 Red Hat Inc.
....@@ -9,26 +10,10 @@
910 * 2010-2015 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
1011 * 2016-2017 Microsemi Corp. (aacraid@microsemi.com)
1112 *
12
- * This program is free software; you can redistribute it and/or modify
13
- * it under the terms of the GNU General Public License as published by
14
- * the Free Software Foundation; either version 2, or (at your option)
15
- * any later version.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
22
- * You should have received a copy of the GNU General Public License
23
- * along with this program; see the file COPYING. If not, write to
24
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25
- *
2613 * Module Name:
2714 * dpcsup.c
2815 *
2916 * Abstract: All DPC processing routines for the cyclone board occur here.
30
- *
31
- *
3217 */
3318
3419 #include <linux/kernel.h>
....@@ -38,7 +23,6 @@
3823 #include <linux/slab.h>
3924 #include <linux/completion.h>
4025 #include <linux/blkdev.h>
41
-#include <linux/semaphore.h>
4226
4327 #include "aacraid.h"
4428
....@@ -115,10 +99,11 @@
11599 }
116100 if (hwfib->header.XferState & cpu_to_le32(NoResponseExpected | Async))
117101 {
118
- if (hwfib->header.XferState & cpu_to_le32(NoResponseExpected))
102
+ if (hwfib->header.XferState & cpu_to_le32(NoResponseExpected)) {
119103 FIB_COUNTER_INCREMENT(aac_config.NoResponseRecved);
120
- else
104
+ } else {
121105 FIB_COUNTER_INCREMENT(aac_config.AsyncRecved);
106
+ }
122107 /*
123108 * NOTE: we cannot touch the fib after this
124109 * call, because it may have been deallocated.
....@@ -129,7 +114,7 @@
129114 spin_lock_irqsave(&fib->event_lock, flagv);
130115 if (!fib->done) {
131116 fib->done = 1;
132
- up(&fib->event_wait);
117
+ complete(&fib->event_wait);
133118 }
134119 spin_unlock_irqrestore(&fib->event_lock, flagv);
135120
....@@ -245,7 +230,6 @@
245230 struct fib *fibctx;
246231 struct aac_dev *dev;
247232 struct aac_aifcmd *cmd;
248
- int status;
249233
250234 fibctx = (struct fib *)context;
251235 BUG_ON(fibptr == NULL);
....@@ -265,7 +249,7 @@
265249 cmd = (struct aac_aifcmd *) fib_data(fibctx);
266250 cmd->command = cpu_to_le32(AifReqEvent);
267251
268
- status = aac_fib_send(AifRequest,
252
+ aac_fib_send(AifRequest,
269253 fibctx,
270254 sizeof(struct hw_fib)-sizeof(struct aac_fibhdr),
271255 FsaNormal,
....@@ -274,7 +258,7 @@
274258 }
275259
276260
277
-/**
261
+/*
278262 * aac_intr_normal - Handle command replies
279263 * @dev: Device
280264 * @index: completion reference
....@@ -376,16 +360,16 @@
376360 start_callback = 1;
377361 } else {
378362 unsigned long flagv;
379
- int complete = 0;
363
+ int completed = 0;
380364
381365 dprintk((KERN_INFO "event_wait up\n"));
382366 spin_lock_irqsave(&fib->event_lock, flagv);
383367 if (fib->done == 2) {
384368 fib->done = 1;
385
- complete = 1;
369
+ completed = 1;
386370 } else {
387371 fib->done = 1;
388
- up(&fib->event_wait);
372
+ complete(&fib->event_wait);
389373 }
390374 spin_unlock_irqrestore(&fib->event_lock, flagv);
391375
....@@ -395,7 +379,7 @@
395379 mflags);
396380
397381 FIB_COUNTER_INCREMENT(aac_config.NativeRecved);
398
- if (complete)
382
+ if (completed)
399383 aac_fib_complete(fib);
400384 }
401385 } else {
....@@ -419,25 +403,26 @@
419403 if (hwfib->header.XferState &
420404 cpu_to_le32(NoResponseExpected | Async)) {
421405 if (hwfib->header.XferState & cpu_to_le32(
422
- NoResponseExpected))
406
+ NoResponseExpected)) {
423407 FIB_COUNTER_INCREMENT(
424408 aac_config.NoResponseRecved);
425
- else
409
+ } else {
426410 FIB_COUNTER_INCREMENT(
427411 aac_config.AsyncRecved);
412
+ }
428413 start_callback = 1;
429414 } else {
430415 unsigned long flagv;
431
- int complete = 0;
416
+ int completed = 0;
432417
433418 dprintk((KERN_INFO "event_wait up\n"));
434419 spin_lock_irqsave(&fib->event_lock, flagv);
435420 if (fib->done == 2) {
436421 fib->done = 1;
437
- complete = 1;
422
+ completed = 1;
438423 } else {
439424 fib->done = 1;
440
- up(&fib->event_wait);
425
+ complete(&fib->event_wait);
441426 }
442427 spin_unlock_irqrestore(&fib->event_lock, flagv);
443428
....@@ -447,7 +432,7 @@
447432 mflags);
448433
449434 FIB_COUNTER_INCREMENT(aac_config.NormalRecved);
450
- if (complete)
435
+ if (completed)
451436 aac_fib_complete(fib);
452437 }
453438 }