Re: [PATCH] drivers/cpufreq: delete non-required instances of include <linux/init.h>

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

 



On 14-01-09 10:17 AM, Viresh Kumar wrote:
> On Thu, Jan 9, 2014 at 8:40 PM, Paul Gortmaker
> <paul.gortmaker@xxxxxxxxxxxxx> wrote:
>> None of these files are actually using any __init type directives
>> and hence don't need to include <linux/init.h>.  Most are just a
>> left over from __devinit and __cpuinit removal, or simply due to
>> code getting copied from one driver to the next.
> 
> Are you sure? Its not only about devinit or cpuinit but module_init()
> and others as well. And they are pretty much used by most of them.

Yes I am sure.  I start with this:

-------------
#!/bin/bash

if [ "$1" = "" ]; then
        echo must supply path name
        exit 1
fi

for i in `git grep -l linux/init.h $1` ; do
        grep -q '__ref\|__init\|__cpuinit\|__meminit\|__MEMINIT\|__CPUINIT\|__INIT\|__REF\|__HEAD' $i
        if [ $? != 0 ] ; then
                echo $i
                sed -i '/linux\/init.h/d' $i
        fi
done
--------------

which as you can see whitelists any real users, and then I
follow up with build testing to double check.  I will note that
in this particular case, I couldn't find an ARM defconfig that
actually enabled any CONFIG_ARM_S3C24xx options though.

Paul.

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




[Index of Archives]     [Linux Kernel Devel]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Forum]     [Linux SCSI]

  Powered by Linux