forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/drivers/net/ethernet/cavium/liquidio/octeon_console.c
....@@ -15,7 +15,7 @@
1515 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
1616 * NONINFRINGEMENT. See the GNU General Public License for more details.
1717 ***********************************************************************/
18
-/**
18
+/*
1919 * @file octeon_console.c
2020 */
2121 #include <linux/moduleparam.h>
....@@ -127,11 +127,11 @@
127127 u32 pad;
128128 /* must be 64 bit aligned here... */
129129 /* Array of addresses of octeon_pci_console structures */
130
- u64 console_addr_array[0];
130
+ u64 console_addr_array[];
131131 /* Implicit storage for console_addr_array */
132132 };
133133
134
-/**
134
+/*
135135 * This function is the implementation of the get macros defined
136136 * for individual structure members. The argument are generated
137137 * by the macros inorder to read only the needed memory.
....@@ -160,7 +160,7 @@
160160 }
161161 }
162162
163
-/**
163
+/*
164164 * This function retrieves the string name of a named block. It is
165165 * more complicated than a simple memcpy() since the named block
166166 * descriptor may not be directly accessible.
....@@ -182,7 +182,7 @@
182182
183183 /* See header file for descriptions of functions */
184184
185
-/**
185
+/*
186186 * Check the version information on the bootmem descriptor
187187 *
188188 * @param exact_match
....@@ -205,11 +205,11 @@
205205 major_version = (u32)__cvmx_bootmem_desc_get(
206206 oct, oct->bootmem_desc_addr,
207207 offsetof(struct cvmx_bootmem_desc, major_version),
208
- FIELD_SIZEOF(struct cvmx_bootmem_desc, major_version));
208
+ sizeof_field(struct cvmx_bootmem_desc, major_version));
209209 minor_version = (u32)__cvmx_bootmem_desc_get(
210210 oct, oct->bootmem_desc_addr,
211211 offsetof(struct cvmx_bootmem_desc, minor_version),
212
- FIELD_SIZEOF(struct cvmx_bootmem_desc, minor_version));
212
+ sizeof_field(struct cvmx_bootmem_desc, minor_version));
213213
214214 dev_dbg(&oct->pci_dev->dev, "%s: major_version=%d\n", __func__,
215215 major_version);
....@@ -237,13 +237,13 @@
237237 oct, named_addr,
238238 offsetof(struct cvmx_bootmem_named_block_desc,
239239 base_addr),
240
- FIELD_SIZEOF(
240
+ sizeof_field(
241241 struct cvmx_bootmem_named_block_desc,
242242 base_addr));
243243 desc->size = __cvmx_bootmem_desc_get(oct, named_addr,
244244 offsetof(struct cvmx_bootmem_named_block_desc,
245245 size),
246
- FIELD_SIZEOF(
246
+ sizeof_field(
247247 struct cvmx_bootmem_named_block_desc,
248248 size));
249249
....@@ -268,20 +268,20 @@
268268 oct, oct->bootmem_desc_addr,
269269 offsetof(struct cvmx_bootmem_desc,
270270 named_block_array_addr),
271
- FIELD_SIZEOF(struct cvmx_bootmem_desc,
271
+ sizeof_field(struct cvmx_bootmem_desc,
272272 named_block_array_addr));
273273 u32 num_blocks = (u32)__cvmx_bootmem_desc_get(
274274 oct, oct->bootmem_desc_addr,
275275 offsetof(struct cvmx_bootmem_desc,
276276 nb_num_blocks),
277
- FIELD_SIZEOF(struct cvmx_bootmem_desc,
277
+ sizeof_field(struct cvmx_bootmem_desc,
278278 nb_num_blocks));
279279
280280 u32 name_length = (u32)__cvmx_bootmem_desc_get(
281281 oct, oct->bootmem_desc_addr,
282282 offsetof(struct cvmx_bootmem_desc,
283283 named_block_name_len),
284
- FIELD_SIZEOF(struct cvmx_bootmem_desc,
284
+ sizeof_field(struct cvmx_bootmem_desc,
285285 named_block_name_len));
286286
287287 u64 named_addr = named_block_array_addr;
....@@ -292,7 +292,7 @@
292292 offsetof(
293293 struct cvmx_bootmem_named_block_desc,
294294 size),
295
- FIELD_SIZEOF(
295
+ sizeof_field(
296296 struct cvmx_bootmem_named_block_desc,
297297 size));
298298
....@@ -323,7 +323,7 @@
323323 return result;
324324 }
325325
326
-/**
326
+/*
327327 * Find a named block on the remote Octeon
328328 *
329329 * @param name Name of block to find
....@@ -707,7 +707,7 @@
707707 return ret;
708708 }
709709
710
-/**
710
+/*
711711 * Removes all consoles
712712 *
713713 * @param oct octeon device
....@@ -840,17 +840,11 @@
840840 return -EINVAL;
841841 }
842842
843
- if (strncmp(LIQUIDIO_PACKAGE, h->version, strlen(LIQUIDIO_PACKAGE))) {
844
- dev_err(&oct->pci_dev->dev, "Unmatched firmware package type. Expected %s, got %s.\n",
845
- LIQUIDIO_PACKAGE, h->version);
846
- return -EINVAL;
847
- }
848
-
849
- if (memcmp(LIQUIDIO_BASE_VERSION, h->version + strlen(LIQUIDIO_PACKAGE),
843
+ if (memcmp(LIQUIDIO_BASE_VERSION, h->version,
850844 strlen(LIQUIDIO_BASE_VERSION))) {
851845 dev_err(&oct->pci_dev->dev, "Unmatched firmware version. Expected %s.x, got %s.\n",
852846 LIQUIDIO_BASE_VERSION,
853
- h->version + strlen(LIQUIDIO_PACKAGE));
847
+ h->version);
854848 return -EINVAL;
855849 }
856850