Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1625298

Re: [PATCH 02/38] Annotate hardware config module parameters in arch/x86/mm/

From David Howells <dhowells@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 02/38] Annotate hardware config module parameters in arch/x86/mm/
Date 2017-04-18 14:40 +0200
Message-ID <txAAh-6aM-3@gated-at.bofh.it> (permalink)
References <twdZ7-4pP-1@gated-at.bofh.it> <tsWBr-5sA-3@gated-at.bofh.it> <tsWUO-5zn-13@gated-at.bofh.it> <twdZ7-4pP-1@gated-at.bofh.it>
Organization Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903

Show all headers | View raw


Thomas Gleixner <tglx@linutronix.de> wrote:

> > -module_param(mmio_address, ulong, 0);
> > +module_param_hw(mmio_address, ulong, iomem, 0);
> >  MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB "
> >  				"(or 8 MB if read_far is non-zero).");
> 
> The copied boilerplate above is really nonsensical here. The default
> address is 0, so the init function will emit:
> 
>      pr_err("you have to use the module argument mmio_address.\n");
>      pr_err("DO NOT LOAD THIS MODULE UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!\n");
> 
> Pretty useless when you can't supply a valid address.
> 
>        if (kernel_locked_down()) {
>        		pr_info("This is not allowed because ...");
> 		return -EPERM;
>        }
> 
> would make too much sense for the user, right?

In some drivers, this would be wrong - ipmi, for example - and we've already
been through this.  The hwparam series of patches annotates *all*
ioport/iomem/irq/dma specifiers unconditionally.  The hwparam series is the
way it is is because this has no overhead if it's not used - and also has the
potentially useful side effect of making such parameters greppable.

It may well make sense to add your above suggestion also - but in the other
patch series.

David

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 02/38] Annotate hardware config module parameters in  arch/x86/mm/ Thomas Gleixner <tglx@linutronix.de> - 2017-04-14 20:20 +0200
  Re: [PATCH 02/38] Annotate hardware config module parameters in arch/x86/mm/ David Howells <dhowells@redhat.com> - 2017-04-18 14:40 +0200

csiph-web