Re: [PATCH 1/9] SQUASHME: pmem: Remove unused #include headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2014-09-09 at 18:40 +0300, Boaz Harrosh wrote:
> From: Boaz Harrosh <boaz@xxxxxxxxxxxxx>
> 
> Removed:
> -#include <linux/bio.h>
> -#include <linux/fs.h>
> 
> These two are included in linux/blkdev.h
> 
> -#include <linux/highmem.h>
I think this was present in the BRD code for flush_dcache_page(), but we
should probably be direct and include <asm/cacheflush.h> instead.

> -#include <linux/major.h>
Yep, not needed.

> -#include <linux/uaccess.h>
Yep, not needed.

> These 3 are not used anymore

I was under the impression that the philosophy regarding includes was that you
should directly include header files for the things that you use, and not rely
on headers that include other headers?  That way a change to a header file
where you remove an unneeded #include doesn't cascade into a bunch of changes
in .c files for now undefined symbols?

If this isn't the case, I think we can actually pare things down to just these
three include files:

#include <linux/blkdev.h>
#include <linux/hdreg.h>
#include <linux/module.h>


Here are the other include files that you left:
>  #include <linux/init.h>
Included from include/linux/printk.h:5:0,
	 from include/linux/kernel.h:13,
	 from include/linux/sched.h:17,
	 from include/linux/blkdev.h:4

>  #include <linux/moduleparam.h>
Included by <linux/module.h>

>  #include <linux/slab.h>
Included from include/linux/genhd.h:15:0,
	 from include/linux/blkdev.h:9


If we *should* directly include the header files for anything that we use, we
can probably pare it down to this:

#include <asm/cacheflush.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/fs.h>
#include <linux/hdreg.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>


> Signed-off-by: Boaz Harrosh <boaz@xxxxxxxxxxxxx>
> ---
>  drivers/block/pmem.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/block/pmem.c b/drivers/block/pmem.c
> index d63bc96..8b0b9b0 100644
> --- a/drivers/block/pmem.c
> +++ b/drivers/block/pmem.c
> @@ -16,17 +16,12 @@
>   * Copyright (C) 2007 Novell Inc.
>   */
>  
> -#include <linux/bio.h>
>  #include <linux/blkdev.h>
> -#include <linux/fs.h>
>  #include <linux/hdreg.h>
> -#include <linux/highmem.h>
>  #include <linux/init.h>
> -#include <linux/major.h>
>  #include <linux/module.h>
>  #include <linux/moduleparam.h>
>  #include <linux/slab.h>
> -#include <linux/uaccess.h>
>  
>  #define SECTOR_SHIFT		9
>  #define PAGE_SECTORS_SHIFT	(PAGE_SHIFT - SECTOR_SHIFT)


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux