hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/fddi/skfp/skfddi.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * File Name:
34 * skfddi.c
45 *
56 * Copyright Information:
67 * Copyright SysKonnect 1998,1999.
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
128 *
139 * The information in this file is provided "AS IS" without warranty.
1410 *
....@@ -409,10 +405,10 @@
409405 if (bp->SharedMemSize > 0) {
410406 bp->SharedMemSize += 16; // for descriptor alignment
411407
412
- bp->SharedMemAddr = dma_zalloc_coherent(&bp->pdev.dev,
413
- bp->SharedMemSize,
414
- &bp->SharedMemDMA,
415
- GFP_ATOMIC);
408
+ bp->SharedMemAddr = dma_alloc_coherent(&bp->pdev.dev,
409
+ bp->SharedMemSize,
410
+ &bp->SharedMemDMA,
411
+ GFP_ATOMIC);
416412 if (!bp->SharedMemAddr) {
417413 printk("could not allocate mem for ");
418414 printk("hardware module: %ld byte\n",
....@@ -1524,22 +1520,8 @@
15241520 #ifdef DUMPPACKETS
15251521 void dump_data(unsigned char *Data, int length)
15261522 {
1527
- int i, j;
1528
- unsigned char s[255], sh[10];
1529
- if (length > 64) {
1530
- length = 64;
1531
- }
15321523 printk(KERN_INFO "---Packet start---\n");
1533
- for (i = 0, j = 0; i < length / 8; i++, j += 8)
1534
- printk(KERN_INFO "%02x %02x %02x %02x %02x %02x %02x %02x\n",
1535
- Data[j + 0], Data[j + 1], Data[j + 2], Data[j + 3],
1536
- Data[j + 4], Data[j + 5], Data[j + 6], Data[j + 7]);
1537
- strcpy(s, "");
1538
- for (i = 0; i < length % 8; i++) {
1539
- sprintf(sh, "%02x ", Data[j + i]);
1540
- strcat(s, sh);
1541
- }
1542
- printk(KERN_INFO "%s\n", s);
1524
+ print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, Data, min_t(size_t, length, 64), false);
15431525 printk(KERN_INFO "------------------\n");
15441526 } // dump_data
15451527 #else