.. | .. |
---|
15 | 15 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or |
---|
16 | 16 | * NONINFRINGEMENT. See the GNU General Public License for more details. |
---|
17 | 17 | ***********************************************************************/ |
---|
18 | | -/** |
---|
| 18 | +/* |
---|
19 | 19 | * @file octeon_console.c |
---|
20 | 20 | */ |
---|
21 | 21 | #include <linux/moduleparam.h> |
---|
.. | .. |
---|
127 | 127 | u32 pad; |
---|
128 | 128 | /* must be 64 bit aligned here... */ |
---|
129 | 129 | /* Array of addresses of octeon_pci_console structures */ |
---|
130 | | - u64 console_addr_array[0]; |
---|
| 130 | + u64 console_addr_array[]; |
---|
131 | 131 | /* Implicit storage for console_addr_array */ |
---|
132 | 132 | }; |
---|
133 | 133 | |
---|
134 | | -/** |
---|
| 134 | +/* |
---|
135 | 135 | * This function is the implementation of the get macros defined |
---|
136 | 136 | * for individual structure members. The argument are generated |
---|
137 | 137 | * by the macros inorder to read only the needed memory. |
---|
.. | .. |
---|
160 | 160 | } |
---|
161 | 161 | } |
---|
162 | 162 | |
---|
163 | | -/** |
---|
| 163 | +/* |
---|
164 | 164 | * This function retrieves the string name of a named block. It is |
---|
165 | 165 | * more complicated than a simple memcpy() since the named block |
---|
166 | 166 | * descriptor may not be directly accessible. |
---|
.. | .. |
---|
182 | 182 | |
---|
183 | 183 | /* See header file for descriptions of functions */ |
---|
184 | 184 | |
---|
185 | | -/** |
---|
| 185 | +/* |
---|
186 | 186 | * Check the version information on the bootmem descriptor |
---|
187 | 187 | * |
---|
188 | 188 | * @param exact_match |
---|
.. | .. |
---|
205 | 205 | major_version = (u32)__cvmx_bootmem_desc_get( |
---|
206 | 206 | oct, oct->bootmem_desc_addr, |
---|
207 | 207 | 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)); |
---|
209 | 209 | minor_version = (u32)__cvmx_bootmem_desc_get( |
---|
210 | 210 | oct, oct->bootmem_desc_addr, |
---|
211 | 211 | 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)); |
---|
213 | 213 | |
---|
214 | 214 | dev_dbg(&oct->pci_dev->dev, "%s: major_version=%d\n", __func__, |
---|
215 | 215 | major_version); |
---|
.. | .. |
---|
237 | 237 | oct, named_addr, |
---|
238 | 238 | offsetof(struct cvmx_bootmem_named_block_desc, |
---|
239 | 239 | base_addr), |
---|
240 | | - FIELD_SIZEOF( |
---|
| 240 | + sizeof_field( |
---|
241 | 241 | struct cvmx_bootmem_named_block_desc, |
---|
242 | 242 | base_addr)); |
---|
243 | 243 | desc->size = __cvmx_bootmem_desc_get(oct, named_addr, |
---|
244 | 244 | offsetof(struct cvmx_bootmem_named_block_desc, |
---|
245 | 245 | size), |
---|
246 | | - FIELD_SIZEOF( |
---|
| 246 | + sizeof_field( |
---|
247 | 247 | struct cvmx_bootmem_named_block_desc, |
---|
248 | 248 | size)); |
---|
249 | 249 | |
---|
.. | .. |
---|
268 | 268 | oct, oct->bootmem_desc_addr, |
---|
269 | 269 | offsetof(struct cvmx_bootmem_desc, |
---|
270 | 270 | named_block_array_addr), |
---|
271 | | - FIELD_SIZEOF(struct cvmx_bootmem_desc, |
---|
| 271 | + sizeof_field(struct cvmx_bootmem_desc, |
---|
272 | 272 | named_block_array_addr)); |
---|
273 | 273 | u32 num_blocks = (u32)__cvmx_bootmem_desc_get( |
---|
274 | 274 | oct, oct->bootmem_desc_addr, |
---|
275 | 275 | offsetof(struct cvmx_bootmem_desc, |
---|
276 | 276 | nb_num_blocks), |
---|
277 | | - FIELD_SIZEOF(struct cvmx_bootmem_desc, |
---|
| 277 | + sizeof_field(struct cvmx_bootmem_desc, |
---|
278 | 278 | nb_num_blocks)); |
---|
279 | 279 | |
---|
280 | 280 | u32 name_length = (u32)__cvmx_bootmem_desc_get( |
---|
281 | 281 | oct, oct->bootmem_desc_addr, |
---|
282 | 282 | offsetof(struct cvmx_bootmem_desc, |
---|
283 | 283 | named_block_name_len), |
---|
284 | | - FIELD_SIZEOF(struct cvmx_bootmem_desc, |
---|
| 284 | + sizeof_field(struct cvmx_bootmem_desc, |
---|
285 | 285 | named_block_name_len)); |
---|
286 | 286 | |
---|
287 | 287 | u64 named_addr = named_block_array_addr; |
---|
.. | .. |
---|
292 | 292 | offsetof( |
---|
293 | 293 | struct cvmx_bootmem_named_block_desc, |
---|
294 | 294 | size), |
---|
295 | | - FIELD_SIZEOF( |
---|
| 295 | + sizeof_field( |
---|
296 | 296 | struct cvmx_bootmem_named_block_desc, |
---|
297 | 297 | size)); |
---|
298 | 298 | |
---|
.. | .. |
---|
323 | 323 | return result; |
---|
324 | 324 | } |
---|
325 | 325 | |
---|
326 | | -/** |
---|
| 326 | +/* |
---|
327 | 327 | * Find a named block on the remote Octeon |
---|
328 | 328 | * |
---|
329 | 329 | * @param name Name of block to find |
---|
.. | .. |
---|
707 | 707 | return ret; |
---|
708 | 708 | } |
---|
709 | 709 | |
---|
710 | | -/** |
---|
| 710 | +/* |
---|
711 | 711 | * Removes all consoles |
---|
712 | 712 | * |
---|
713 | 713 | * @param oct octeon device |
---|
.. | .. |
---|
840 | 840 | return -EINVAL; |
---|
841 | 841 | } |
---|
842 | 842 | |
---|
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, |
---|
850 | 844 | strlen(LIQUIDIO_BASE_VERSION))) { |
---|
851 | 845 | dev_err(&oct->pci_dev->dev, "Unmatched firmware version. Expected %s.x, got %s.\n", |
---|
852 | 846 | LIQUIDIO_BASE_VERSION, |
---|
853 | | - h->version + strlen(LIQUIDIO_PACKAGE)); |
---|
| 847 | + h->version); |
---|
854 | 848 | return -EINVAL; |
---|
855 | 849 | } |
---|
856 | 850 | |
---|