* [PATCH] PCI: Fix comparison to bool warning in pci.c
@ 2020-09-25 22:45 Krzysztof Wilczyński
2020-09-25 22:53 ` Krzysztof Wilczyński
2020-09-28 22:18 ` Bjorn Helgaas
0 siblings, 2 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2020-09-25 22:45 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci
Take care about Coccinelle warnings:
drivers/pci/pci.c:6008:6-12: WARNING: Comparison to bool
drivers/pci/pci.c:6024:7-13: WARNING: Comparison to bool
No change to functionality intended.
Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
drivers/pci/pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index e39c5499770f..487e7214743d 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -6005,7 +6005,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
if (flags & PCI_VGA_STATE_CHANGE_DECODES) {
pci_read_config_word(dev, PCI_COMMAND, &cmd);
- if (decode == true)
+ if (decode)
cmd |= command_bits;
else
cmd &= ~command_bits;
@@ -6021,7 +6021,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
if (bridge) {
pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
&cmd);
- if (decode == true)
+ if (decode)
cmd |= PCI_BRIDGE_CTL_VGA;
else
cmd &= ~PCI_BRIDGE_CTL_VGA;
--
2.28.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: Fix comparison to bool warning in pci.c
2020-09-25 22:45 [PATCH] PCI: Fix comparison to bool warning in pci.c Krzysztof Wilczyński
@ 2020-09-25 22:53 ` Krzysztof Wilczyński
2020-09-28 22:18 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Wilczyński @ 2020-09-25 22:53 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci
Hello Bjorn,
This is a trivial patch and I remember you wanted to rename the "decode"
variable to something more meaningful, so I had a look at the
following:
http://lkml.iu.edu/hypermail/linux/kernel/0908.1/00875.html
http://lkml.iu.edu/hypermail/linux/kernel/0507.1/1942.html
I also had a look at the "IEEE Std 1275-1994, Standard for Boot
(Initialization Configuration) Firmware, Revision 2.1", but I am still
unsure to what would be a better name for this variable.
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] PCI: Fix comparison to bool warning in pci.c
2020-09-25 22:45 [PATCH] PCI: Fix comparison to bool warning in pci.c Krzysztof Wilczyński
2020-09-25 22:53 ` Krzysztof Wilczyński
@ 2020-09-28 22:18 ` Bjorn Helgaas
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2020-09-28 22:18 UTC (permalink / raw)
To: Krzysztof Wilczyński; +Cc: Bjorn Helgaas, linux-pci
On Fri, Sep 25, 2020 at 10:45:55PM +0000, Krzysztof Wilczyński wrote:
> Take care about Coccinelle warnings:
>
> drivers/pci/pci.c:6008:6-12: WARNING: Comparison to bool
> drivers/pci/pci.c:6024:7-13: WARNING: Comparison to bool
>
> No change to functionality intended.
>
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
Applied to pci/misc for v5.10, thanks!
I can't remember why I thought about renaming "decode".
> ---
> drivers/pci/pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index e39c5499770f..487e7214743d 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -6005,7 +6005,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
>
> if (flags & PCI_VGA_STATE_CHANGE_DECODES) {
> pci_read_config_word(dev, PCI_COMMAND, &cmd);
> - if (decode == true)
> + if (decode)
> cmd |= command_bits;
> else
> cmd &= ~command_bits;
> @@ -6021,7 +6021,7 @@ int pci_set_vga_state(struct pci_dev *dev, bool decode,
> if (bridge) {
> pci_read_config_word(bridge, PCI_BRIDGE_CONTROL,
> &cmd);
> - if (decode == true)
> + if (decode)
> cmd |= PCI_BRIDGE_CTL_VGA;
> else
> cmd &= ~PCI_BRIDGE_CTL_VGA;
> --
> 2.28.0
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-28 23:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-25 22:45 [PATCH] PCI: Fix comparison to bool warning in pci.c Krzysztof Wilczyński
2020-09-25 22:53 ` Krzysztof Wilczyński
2020-09-28 22:18 ` Bjorn Helgaas
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.