Re: [PATCH 1/3] msi vector targeting abstractions

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

 



> > +static inline int msi_arch_init(void)
> > +{
> > +	extern struct msi_ops msi_apic_ops;
> > +	msi_register(&msi_apic_ops);
> > +	return 0;
> > +}
> 
> Don't have an extern in a function, it belongs in a .h file somewhere
> that describes it and everyone can see it.  Otherwise this gets stale
> and messy over time.

In this case, I have a public .h (asm-xxx/msi.h) which needs a data structure
decleared down in a driver-private file (drivers/pci/msi-apic.c).  Do you have
a suggestion for where I should put the msi_apic_ops declaration?  It should
be somewhere such that future msi ops (e.g. sn_msi_ops from patch3) would
be treated consistently.

linux/pci.h seems like one possiblity near where the ops struct is declared,
but that doesn't really seem right, because we'ld want to treat sn_msi_ops
(and future msi ops) the same way.

Maybe just move the extern out of the function and up further in the
asm-xxx/msi.h file?

> 
> > +/*
> > + * Generic callouts used on most archs/platforms.  Override with
> > + * msi_register_callouts()
> > + */
> 
> Care to use kerneldoc here and define exactly what is needed for these
> function pointers?  And you are still calling them "callouts" here :)
> 
> > +struct msi_ops msi_apic_ops = {
> > +	.setup = msi_setup_apic,
> > +	.teardown = msi_teardown_apic,
> > +#ifdef CONFIG_SMP
> > +	.target = msi_target_apic,
> > +#endif
> 
> Why the #ifdef?  Just drop it, it makes the code cleaner.
> 
> Care to redo this?

ok.  Will submit a new version once we have the placement of the msi_apic_ops
declaration sorted out.

Mark
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux