]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - mm/kmemleak.c
doc: fix documentation about UIO_MEM_LOGICAL using
[linux.git] / mm / kmemleak.c
index 2e435b8142e51ac9237110b451b750a6d4423fcc..9dd581d115658285cfbf77ffb5f0800ec2b89ca1 100644 (file)
@@ -1,23 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-only
 /*
  * mm/kmemleak.c
  *
  * Copyright (C) 2008 ARM Limited
  * Written by Catalin Marinas <catalin.marinas@arm.com>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *
  * For more information on the algorithm and kmemleak usage, please see
  * Documentation/dev-tools/kmemleak.rst.
  *
@@ -410,11 +397,6 @@ static void print_unreferenced(struct seq_file *seq,
  */
 static void dump_object_info(struct kmemleak_object *object)
 {
-       struct stack_trace trace;
-
-       trace.nr_entries = object->trace_len;
-       trace.entries = object->trace;
-
        pr_notice("Object 0x%08lx (size %zu):\n",
                  object->pointer, object->size);
        pr_notice("  comm \"%s\", pid %d, jiffies %lu\n",
@@ -424,7 +406,7 @@ static void dump_object_info(struct kmemleak_object *object)
        pr_notice("  flags = 0x%x\n", object->flags);
        pr_notice("  checksum = %u\n", object->checksum);
        pr_notice("  backtrace:\n");
-       print_stack_trace(&trace, 4);
+       stack_trace_print(object->trace, object->trace_len, 4);
 }
 
 /*
@@ -553,15 +535,7 @@ static struct kmemleak_object *find_and_remove_object(unsigned long ptr, int ali
  */
 static int __save_stack_trace(unsigned long *trace)
 {
-       struct stack_trace stack_trace;
-
-       stack_trace.max_entries = MAX_TRACE;
-       stack_trace.nr_entries = 0;
-       stack_trace.entries = trace;
-       stack_trace.skip = 2;
-       save_stack_trace(&stack_trace);
-
-       return stack_trace.nr_entries;
+       return stack_trace_save(trace, MAX_TRACE, 2);
 }
 
 /*
@@ -2021,13 +1995,8 @@ early_param("kmemleak", kmemleak_boot_config);
 
 static void __init print_log_trace(struct early_log *log)
 {
-       struct stack_trace trace;
-
-       trace.nr_entries = log->trace_len;
-       trace.entries = log->trace;
-
        pr_notice("Early log backtrace:\n");
-       print_stack_trace(&trace, 2);
+       stack_trace_print(log->trace, log->trace_len, 2);
 }
 
 /*