hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/dma/ioat/dca.c
....@@ -1,19 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Intel I/OAT DMA Linux driver
34 * Copyright(c) 2007 - 2009 Intel Corporation.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * The full GNU General Public License is included in this distribution in
15
- * the file called "COPYING".
16
- *
175 */
186
197 #include <linux/kernel.h>
....@@ -51,16 +39,6 @@
5139 #define DCA2_TAG_MAP_BYTE2 0x81
5240 #define DCA2_TAG_MAP_BYTE3 0x82
5341 #define DCA2_TAG_MAP_BYTE4 0x82
54
-
55
-/* verify if tag map matches expected values */
56
-static inline int dca2_tag_map_valid(u8 *tag_map)
57
-{
58
- return ((tag_map[0] == DCA2_TAG_MAP_BYTE0) &&
59
- (tag_map[1] == DCA2_TAG_MAP_BYTE1) &&
60
- (tag_map[2] == DCA2_TAG_MAP_BYTE2) &&
61
- (tag_map[3] == DCA2_TAG_MAP_BYTE3) &&
62
- (tag_map[4] == DCA2_TAG_MAP_BYTE4));
63
-}
6442
6543 /*
6644 * "Legacy" DCA systems do not implement the DCA register set in the
....@@ -114,7 +92,7 @@
11492 int max_requesters;
11593 int requester_count;
11694 u8 tag_map[IOAT_TAG_MAP_LEN];
117
- struct ioat_dca_slot req_slots[0];
95
+ struct ioat_dca_slot req_slots[];
11896 };
11997
12098 static int ioat_dca_dev_managed(struct dca_provider *dca,
....@@ -298,8 +276,7 @@
298276 return NULL;
299277
300278 dca = alloc_dca_provider(&ioat_dca_ops,
301
- sizeof(*ioatdca)
302
- + (sizeof(struct ioat_dca_slot) * slots));
279
+ struct_size(ioatdca, req_slots, slots));
303280 if (!dca)
304281 return NULL;
305282