LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Francois Romieu <romieu@fr.zoreil.com>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Jay Cliburn <jcliburn@gmail.com>,
	Chris Snook <chris.snook@gmail.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atheros/atlx: Simplify bit manipulations
Date: Fri, 23 Jan 2015 21:26:19 +0100	[thread overview]
Message-ID: <20150123202619.GA10084@electric-eye.fr.zoreil.com> (raw)
In-Reply-To: <1422011212-30095-1-git-send-email-linux@rasmusvillemoes.dk>

Rasmus Villemoes <linux@rasmusvillemoes.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

  reply	other threads:[~2015-01-23 20:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23 11:06 Rasmus Villemoes
2015-01-23 20:26 ` Francois Romieu [this message]
2015-01-25  7:35 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150123202619.GA10084@electric-eye.fr.zoreil.com \
    --to=romieu@fr.zoreil.com \
    --cc=chris.snook@gmail.com \
    --cc=jcliburn@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH] atheros/atlx: Simplify bit manipulations' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).