[-next] audit: remove duplicated include from audit.c
diff mbox series

Message ID 20181209062502.16308-1-yuehaibing@huawei.com
State Accepted
Commit d406db524c32ca35bd85cada28a547fff3115715
Headers show
Series
  • [-next] audit: remove duplicated include from audit.c
Related show

Commit Message

YueHaibing Dec. 9, 2018, 6:25 a.m. UTC
Remove duplicated include.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 kernel/audit.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Paul Moore Dec. 13, 2018, 11:42 p.m. UTC | #1
On Sun, Dec 9, 2018 at 1:25 AM YueHaibing <yuehaibing@huawei.com> wrote:
> Remove duplicated include.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  kernel/audit.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/kernel/audit.c b/kernel/audit.c
> index a0a4544..632d360 100644
> --- a/kernel/audit.c
> +++ b/kernel/audit.c
> @@ -60,7 +60,6 @@
>  #include <linux/mutex.h>
>  #include <linux/gfp.h>
>  #include <linux/pid.h>
> -#include <linux/slab.h>

As discussed previously, I don't want to remove header files whose
declarations are used in the source file.  While it may be true that
slab.h is included in one of the previously included header files, I
like leaving it as an explicit include to help document the dependency
and protect us from changes in the other header files.

--
paul moore
www.paul-moore.com
YueHaibing Dec. 14, 2018, 1:33 a.m. UTC | #2
On 2018/12/14 7:42, Paul Moore wrote:
> On Sun, Dec 9, 2018 at 1:25 AM YueHaibing <yuehaibing@huawei.com> wrote:
>> Remove duplicated include.
>>
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>  kernel/audit.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/kernel/audit.c b/kernel/audit.c
>> index a0a4544..632d360 100644
>> --- a/kernel/audit.c
>> +++ b/kernel/audit.c
>> @@ -60,7 +60,6 @@
>>  #include <linux/mutex.h>
>>  #include <linux/gfp.h>
>>  #include <linux/pid.h>
>> -#include <linux/slab.h>
> 
> As discussed previously, I don't want to remove header files whose
> declarations are used in the source file.  While it may be true that
> slab.h is included in one of the previously included header files, I
> like leaving it as an explicit include to help document the dependency
> and protect us from changes in the other header files.

The slab.h is included twice in audit.c , It like this:

#include <linux/file.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/atomic.h>
#include <linux/mm.h>
#include <linux/export.h>
#include <linux/slab.h>		//the first
#include <linux/err.h>
#include <linux/kthread.h>
#include <linux/kernel.h>
#include <linux/syscalls.h>
#include <linux/spinlock.h>
#include <linux/rcupdate.h>
#include <linux/mutex.h>
#include <linux/gfp.h>
#include <linux/pid.h>
#include <linux/slab.h>    //duplicated


> 
> --
> paul moore
> www.paul-moore.com
> 
>
Paul Moore Dec. 14, 2018, 5:14 p.m. UTC | #3
On Thu, Dec 13, 2018 at 8:33 PM YueHaibing <yuehaibing@huawei.com> wrote:
> On 2018/12/14 7:42, Paul Moore wrote:
> > On Sun, Dec 9, 2018 at 1:25 AM YueHaibing <yuehaibing@huawei.com> wrote:
> >> Remove duplicated include.
> >>
> >> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> >> ---
> >>  kernel/audit.c | 1 -
> >>  1 file changed, 1 deletion(-)
> >>
> >> diff --git a/kernel/audit.c b/kernel/audit.c
> >> index a0a4544..632d360 100644
> >> --- a/kernel/audit.c
> >> +++ b/kernel/audit.c
> >> @@ -60,7 +60,6 @@
> >>  #include <linux/mutex.h>
> >>  #include <linux/gfp.h>
> >>  #include <linux/pid.h>
> >> -#include <linux/slab.h>
> >
> > As discussed previously, I don't want to remove header files whose
> > declarations are used in the source file.  While it may be true that
> > slab.h is included in one of the previously included header files, I
> > like leaving it as an explicit include to help document the dependency
> > and protect us from changes in the other header files.
>
> The slab.h is included twice in audit.c , It like this:

Yes, you're right - my apologies.  I mistakenly thought this was a
patch similar to the ones you sent earlier and were rejected; I should
have looked closer at this patch.

Normally I wouldn't merge non-critical stuff at this stage of the
development window, but since this is such a trivial patch, and easily
verified, I'm going to go ahead and merge this into audit/next.

Thank you.

Patch
diff mbox series

diff --git a/kernel/audit.c b/kernel/audit.c
index a0a4544..632d360 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -60,7 +60,6 @@ 
 #include <linux/mutex.h>
 #include <linux/gfp.h>
 #include <linux/pid.h>
-#include <linux/slab.h>
 
 #include <linux/audit.h>