Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

libnvdimm: Cleanup include of badblocks.h

* drivers/nvdimm/core.c doesn't use anything from badblocks.h on its own,
thus including it isn't needed. There's indeed indirect use, via funcs
in nd.h, but this one already includes badblocks.h.

* drivers/nvdimm/claim.c calls stuff from badblocks.h and therefore should
include it on its own (instead of relying any other header doing that)

* drivers/nvdimm/btt.h doesn't really need anything from badblocks.h and
can easily live with a forward declaration of struct badblocks (just
having pointers to it, but not dereferencing it anywhere)

Signed-off-by: Enrico Weigelt <info@metux.net>
Link: https://lore.kernel.org/r/20201215163531.21446-1-info@metux.net
Signed-off-by: Dan Williams <dan.j.williams@intel.com>

authored by

Enrico Weigelt and committed by
Dan Williams
5ae96d77 9a7e3d7f

+3 -2
+2 -1
drivers/nvdimm/btt.h
··· 7 7 #ifndef _LINUX_BTT_H 8 8 #define _LINUX_BTT_H 9 9 10 - #include <linux/badblocks.h> 11 10 #include <linux/types.h> 12 11 13 12 #define BTT_SIG_LEN 16 ··· 195 196 struct mutex err_lock; 196 197 int log_index[2]; 197 198 }; 199 + 200 + struct badblocks; 198 201 199 202 /** 200 203 * struct btt - handle for a BTT instance
+1
drivers/nvdimm/claim.c
··· 4 4 */ 5 5 #include <linux/device.h> 6 6 #include <linux/sizes.h> 7 + #include <linux/badblocks.h> 7 8 #include "nd-core.h" 8 9 #include "pmem.h" 9 10 #include "pfn.h"
-1
drivers/nvdimm/core.c
··· 3 3 * Copyright(c) 2013-2015 Intel Corporation. All rights reserved. 4 4 */ 5 5 #include <linux/libnvdimm.h> 6 - #include <linux/badblocks.h> 7 6 #include <linux/suspend.h> 8 7 #include <linux/export.h> 9 8 #include <linux/module.h>