[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150123202619.GA10084@electric-eye.fr.zoreil.com>
Date: Fri, 23 Jan 2015 21:26:19 +0100
From: Francois Romieu <romieu@...zoreil.com>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Jay Cliburn <jcliburn@...il.com>,
Chris Snook <chris.snook@...il.com>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] atheros/atlx: Simplify bit manipulations
Rasmus Villemoes <linux@...musvillemoes.dk> :
[...]
> diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
> index 84a09e8ddd9c..46d1b959daa8 100644
> --- a/drivers/net/ethernet/atheros/atlx/atl2.c
> +++ b/drivers/net/ethernet/atheros/atlx/atl2.c
> @@ -1278,14 +1278,10 @@ static void atl2_setup_pcicmd(struct pci_dev *pdev)
>
> pci_read_config_word(pdev, PCI_COMMAND, &cmd);
>
> - if (cmd & PCI_COMMAND_INTX_DISABLE)
> - cmd &= ~PCI_COMMAND_INTX_DISABLE;
> - if (cmd & PCI_COMMAND_IO)
> - cmd &= ~PCI_COMMAND_IO;
> - if (0 == (cmd & PCI_COMMAND_MEMORY))
> - cmd |= PCI_COMMAND_MEMORY;
> - if (0 == (cmd & PCI_COMMAND_MASTER))
> - cmd |= PCI_COMMAND_MASTER;
> + cmd &= ~PCI_COMMAND_INTX_DISABLE;
> + cmd &= ~PCI_COMMAND_IO;
> + cmd |= PCI_COMMAND_MEMORY;
> + cmd |= PCI_COMMAND_MASTER;
> pci_write_config_word(pdev, PCI_COMMAND, cmd);
Mostly open-coded pci_set_master, pci_enable_device_mem and pci_intx.
I'd suggest to ignore the PCI_COMMAND_IO bit at all then use the standard
pci helpers.
--
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists