lkml.org 
[lkml]   [2014]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/46] kernel: MOve prototype declaration to header file include/linux/perf_event.h
On Thu, Feb 27, 2014 at 07:51:50AM -0800, Josh Triplett wrote:
> On Thu, Feb 27, 2014 at 12:54:14PM +0100, Peter Zijlstra wrote:
> > On Thu, Feb 27, 2014 at 05:02:48PM +0530, Rashika Kheria wrote:
> > > Add prototype declaration of function to header file
> > > include/linux/perf_event.h because it is used by more than one file.
> > >
> > > This eliminates the following warning in kernel/events/core.c:
> > > kernel/events/core.c:3743:13: warning: no previous prototype for ‘arch_perf_update_userpage’ [-Wmissing-prototypes]
> >
> > # git grep arch_perf_update_userpage
> > arch/x86/kernel/cpu/perf_event.c:void arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now)
> > kernel/events/core.c:void __weak arch_perf_update_userpage(struct perf_event_mmap_page *userpg, u64 now)
> > kernel/events/core.c: arch_perf_update_userpage(userpg, now);
> >
> >
> > There's two definitions; one weak, and one usage site.
> >
> > What gives?
>
> There's no prototype for the function anywhere, so -Wmissing-prototypes
> rightfully complains. Adding the prototype to a header included in both
> source files ensures that the function signatures must match, and
> eliminates the warning.

Definitions don't require prior declarations. Only usage without prior
definitions require them.

I still don't see a problem.

Seems to me you're just blindly making a stupid checker happy, just
shoot it in the face.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2014-02-27 21:01    [W:0.101 / U:4.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site