forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/megaraid/megaraid_mm.c
....@@ -1,13 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 *
34 * Linux MegaRAID device driver
45 *
56 * Copyright (c) 2003-2004 LSI Logic Corporation.
6
- *
7
- * This program is free software; you can redistribute it and/or
8
- * modify it under the terms of the GNU General Public License
9
- * as published by the Free Software Foundation; either version
10
- * 2 of the License, or (at your option) any later version.
117 *
128 * FILE : megaraid_mm.c
139 * Version : v2.20.2.7 (Jul 16 2006)
....@@ -45,10 +41,6 @@
4541 static void mraid_mm_free_adp_resources(mraid_mmadp_t *);
4642 static void mraid_mm_teardown_dma_pools(mraid_mmadp_t *);
4743
48
-#ifdef CONFIG_COMPAT
49
-static long mraid_mm_compat_ioctl(struct file *, unsigned int, unsigned long);
50
-#endif
51
-
5244 MODULE_AUTHOR("LSI Logic Corporation");
5345 MODULE_DESCRIPTION("LSI Logic Management Module");
5446 MODULE_LICENSE("GPL");
....@@ -72,9 +64,7 @@
7264 static const struct file_operations lsi_fops = {
7365 .open = mraid_mm_open,
7466 .unlocked_ioctl = mraid_mm_unlocked_ioctl,
75
-#ifdef CONFIG_COMPAT
76
- .compat_ioctl = mraid_mm_compat_ioctl,
77
-#endif
67
+ .compat_ioctl = compat_ptr_ioctl,
7868 .owner = THIS_MODULE,
7969 .llseek = noop_llseek,
8070 };
....@@ -105,7 +95,6 @@
10595
10696 /**
10797 * mraid_mm_ioctl - module entry-point for ioctls
108
- * @inode : inode (ignored)
10998 * @filep : file operations pointer (ignored)
11099 * @cmd : ioctl command
111100 * @arg : user ioctl packet
....@@ -228,7 +217,6 @@
228217 {
229218 int err;
230219
231
- /* inconsistent: mraid_mm_compat_ioctl doesn't take the BKL */
232220 mutex_lock(&mraid_mm_mutex);
233221 err = mraid_mm_ioctl(filep, cmd, arg);
234222 mutex_unlock(&mraid_mm_mutex);
....@@ -1026,8 +1014,7 @@
10261014 kfree(adapter->kioc_list);
10271015 kfree(adapter->mbox_list);
10281016
1029
- if (adapter->pthru_dma_pool)
1030
- dma_pool_destroy(adapter->pthru_dma_pool);
1017
+ dma_pool_destroy(adapter->pthru_dma_pool);
10311018
10321019 kfree(adapter);
10331020
....@@ -1241,25 +1228,6 @@
12411228 return 0;
12421229 }
12431230
1244
-
1245
-#ifdef CONFIG_COMPAT
1246
-/**
1247
- * mraid_mm_compat_ioctl - 32bit to 64bit ioctl conversion routine
1248
- * @filep : file operations pointer (ignored)
1249
- * @cmd : ioctl command
1250
- * @arg : user ioctl packet
1251
- */
1252
-static long
1253
-mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd,
1254
- unsigned long arg)
1255
-{
1256
- int err;
1257
-
1258
- err = mraid_mm_ioctl(filep, cmd, arg);
1259
-
1260
- return err;
1261
-}
1262
-#endif
12631231
12641232 /**
12651233 * mraid_mm_exit - Module exit point