* [PATCH] xen-pciback: Add name prefix to global 'permissive' variable
@ 2015-04-12 23:26 Ben Hutchings
2015-04-15 14:17 ` Konrad Rzeszutek Wilk
2015-04-29 16:35 ` David Vrabel
0 siblings, 2 replies; 3+ messages in thread
From: Ben Hutchings @ 2015-04-12 23:26 UTC (permalink / raw)
To: xen-devel; +Cc: Jan Beulich
[-- Attachment #1.1: Type: text/plain, Size: 2822 bytes --]
The variable for the 'permissive' module parameter used to be static
but was recently changed to be extern. This puts it in the kernel
global namespace if the driver is built-in, so its name should begin
with a prefix identifying the driver.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Fixes: af6fc858a35b ("xen-pciback: limit guest control of command register")
---
drivers/xen/xen-pciback/conf_space.c | 6 +++---
drivers/xen/xen-pciback/conf_space.h | 2 +-
| 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c
index 75fe3d4..9c23420 100644
--- a/drivers/xen/xen-pciback/conf_space.c
+++ b/drivers/xen/xen-pciback/conf_space.c
@@ -16,8 +16,8 @@
#include "conf_space.h"
#include "conf_space_quirks.h"
-bool permissive;
-module_param(permissive, bool, 0644);
+bool xen_pcibk_permissive;
+module_param_named(permissive, xen_pcibk_permissive, bool, 0644);
/* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word,
* xen_pcibk_write_config_word, and xen_pcibk_write_config_byte are created. */
@@ -262,7 +262,7 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
* This means that some fields may still be read-only because
* they have entries in the config_field list that intercept
* the write and do nothing. */
- if (dev_data->permissive || permissive) {
+ if (dev_data->permissive || xen_pcibk_permissive) {
switch (size) {
case 1:
err = pci_write_config_byte(dev, offset,
diff --git a/drivers/xen/xen-pciback/conf_space.h b/drivers/xen/xen-pciback/conf_space.h
index 2e1d73d..62461a8 100644
--- a/drivers/xen/xen-pciback/conf_space.h
+++ b/drivers/xen/xen-pciback/conf_space.h
@@ -64,7 +64,7 @@ struct config_field_entry {
void *data;
};
-extern bool permissive;
+extern bool xen_pcibk_permissive;
#define OFFSET(cfg_entry) ((cfg_entry)->base_offset+(cfg_entry)->field->offset)
--git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
index 2d73693..f8baf46 100644
--- a/drivers/xen/xen-pciback/conf_space_header.c
+++ b/drivers/xen/xen-pciback/conf_space_header.c
@@ -105,7 +105,7 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
cmd->val = value;
- if (!permissive && (!dev_data || !dev_data->permissive))
+ if (!xen_pcibk_permissive && (!dev_data || !dev_data->permissive))
return 0;
/* Only allow the guest to control certain bits. */
--
Ben Hutchings
Everything should be made as simple as possible, but not simpler.
- Albert Einstein
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] xen-pciback: Add name prefix to global 'permissive' variable
2015-04-12 23:26 [PATCH] xen-pciback: Add name prefix to global 'permissive' variable Ben Hutchings
@ 2015-04-15 14:17 ` Konrad Rzeszutek Wilk
2015-04-29 16:35 ` David Vrabel
1 sibling, 0 replies; 3+ messages in thread
From: Konrad Rzeszutek Wilk @ 2015-04-15 14:17 UTC (permalink / raw)
To: Ben Hutchings, david.vrabel; +Cc: xen-devel, Jan Beulich
On Mon, Apr 13, 2015 at 12:26:35AM +0100, Ben Hutchings wrote:
> The variable for the 'permissive' module parameter used to be static
> but was recently changed to be extern. This puts it in the kernel
> global namespace if the driver is built-in, so its name should begin
> with a prefix identifying the driver.
It looks OK to me. David you OK pulling this in?
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> Fixes: af6fc858a35b ("xen-pciback: limit guest control of command register")
> ---
> drivers/xen/xen-pciback/conf_space.c | 6 +++---
> drivers/xen/xen-pciback/conf_space.h | 2 +-
> drivers/xen/xen-pciback/conf_space_header.c | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/xen/xen-pciback/conf_space.c b/drivers/xen/xen-pciback/conf_space.c
> index 75fe3d4..9c23420 100644
> --- a/drivers/xen/xen-pciback/conf_space.c
> +++ b/drivers/xen/xen-pciback/conf_space.c
> @@ -16,8 +16,8 @@
> #include "conf_space.h"
> #include "conf_space_quirks.h"
>
> -bool permissive;
> -module_param(permissive, bool, 0644);
> +bool xen_pcibk_permissive;
> +module_param_named(permissive, xen_pcibk_permissive, bool, 0644);
>
> /* This is where xen_pcibk_read_config_byte, xen_pcibk_read_config_word,
> * xen_pcibk_write_config_word, and xen_pcibk_write_config_byte are created. */
> @@ -262,7 +262,7 @@ int xen_pcibk_config_write(struct pci_dev *dev, int offset, int size, u32 value)
> * This means that some fields may still be read-only because
> * they have entries in the config_field list that intercept
> * the write and do nothing. */
> - if (dev_data->permissive || permissive) {
> + if (dev_data->permissive || xen_pcibk_permissive) {
> switch (size) {
> case 1:
> err = pci_write_config_byte(dev, offset,
> diff --git a/drivers/xen/xen-pciback/conf_space.h b/drivers/xen/xen-pciback/conf_space.h
> index 2e1d73d..62461a8 100644
> --- a/drivers/xen/xen-pciback/conf_space.h
> +++ b/drivers/xen/xen-pciback/conf_space.h
> @@ -64,7 +64,7 @@ struct config_field_entry {
> void *data;
> };
>
> -extern bool permissive;
> +extern bool xen_pcibk_permissive;
>
> #define OFFSET(cfg_entry) ((cfg_entry)->base_offset+(cfg_entry)->field->offset)
>
> diff --git a/drivers/xen/xen-pciback/conf_space_header.c b/drivers/xen/xen-pciback/conf_space_header.c
> index 2d73693..f8baf46 100644
> --- a/drivers/xen/xen-pciback/conf_space_header.c
> +++ b/drivers/xen/xen-pciback/conf_space_header.c
> @@ -105,7 +105,7 @@ static int command_write(struct pci_dev *dev, int offset, u16 value, void *data)
>
> cmd->val = value;
>
> - if (!permissive && (!dev_data || !dev_data->permissive))
> + if (!xen_pcibk_permissive && (!dev_data || !dev_data->permissive))
> return 0;
>
> /* Only allow the guest to control certain bits. */
>
> --
> Ben Hutchings
> Everything should be made as simple as possible, but not simpler.
> - Albert Einstein
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] xen-pciback: Add name prefix to global 'permissive' variable
2015-04-12 23:26 [PATCH] xen-pciback: Add name prefix to global 'permissive' variable Ben Hutchings
2015-04-15 14:17 ` Konrad Rzeszutek Wilk
@ 2015-04-29 16:35 ` David Vrabel
1 sibling, 0 replies; 3+ messages in thread
From: David Vrabel @ 2015-04-29 16:35 UTC (permalink / raw)
To: Ben Hutchings, xen-devel; +Cc: Jan Beulich
On 13/04/15 00:26, Ben Hutchings wrote:
> The variable for the 'permissive' module parameter used to be static
> but was recently changed to be extern. This puts it in the kernel
> global namespace if the driver is built-in, so its name should begin
> with a prefix identifying the driver.
Applied to for-linus-4.1b, thanks.
David
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-04-29 16:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 23:26 [PATCH] xen-pciback: Add name prefix to global 'permissive' variable Ben Hutchings
2015-04-15 14:17 ` Konrad Rzeszutek Wilk
2015-04-29 16:35 ` David Vrabel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.