hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/fs/ecryptfs/debug.c
....@@ -1,24 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /**
23 * eCryptfs: Linux filesystem encryption layer
34 * Functions only useful for debugging.
45 *
56 * Copyright (C) 2006 International Business Machines Corp.
67 * Author(s): Michael A. Halcrow <mahalcro@us.ibm.com>
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License as
10
- * published by the Free Software Foundation; either version 2 of the
11
- * License, or (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful, but
14
- * WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
- * General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21
- * 02111-1307, USA.
228 */
239
2410 #include "ecryptfs_kernel.h"
....@@ -97,25 +83,9 @@
9783 */
9884 void ecryptfs_dump_hex(char *data, int bytes)
9985 {
100
- int i = 0;
101
- int add_newline = 1;
102
-
10386 if (ecryptfs_verbosity < 1)
10487 return;
105
- if (bytes != 0) {
106
- printk(KERN_DEBUG "0x%.2x.", (unsigned char)data[i]);
107
- i++;
108
- }
109
- while (i < bytes) {
110
- printk("0x%.2x.", (unsigned char)data[i]);
111
- i++;
112
- if (i % 16 == 0) {
113
- printk("\n");
114
- add_newline = 0;
115
- } else
116
- add_newline = 1;
117
- }
118
- if (add_newline)
119
- printk("\n");
120
-}
12188
89
+ print_hex_dump(KERN_DEBUG, "ecryptfs: ", DUMP_PREFIX_OFFSET, 16, 1,
90
+ data, bytes, false);
91
+}