On Tue, Aug 08, 2017 at 10:35:15AM +0200, Hannes Reinecke wrote:
> From: Jeff Mahoney <je...@suse.com>
> 
> Add a warning message if an unsupported device is found and the
> hpsa_allow_any parameter is not set.
> Also make the hpsa_allow_any parameter writeable once the hpsa
> driver is loaded.

This looks ok, but maybe we should also plan for just setting the
flag by defauly sooner or later?

> +static struct kernel_param_ops hpsa_allow_any_ops = {

const?

> +
> +     if (hpsa_allow_any && !newval) {
> +             if (hpsa_claimed_unsupported) {
> +                     pr_info("hpsa: can't disable hpsa_allow_any parameter. 
> Devices already in use.\n");
> +                     return -EPERM;
> +             } else
> +                     hpsa_allow_any = false;
> +     } else if (!hpsa_allow_any && newval) {
> +             pr_info("hpsa: allowing unsupported devices. If devices are 
> claimed, this will result in an unsupported environment.\n");
> +             hpsa_allow_any = true;
> +     }
> +     return 0;

Do we really need this to start with?  It's normal that module
parameters only affect newly probed devices when changed at runtime,
so I think we could just stick to the simple module parameter with
permissions that allow runtime changes.

Reply via email to