netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
  • * [PATCH 25/31] ethernet: use parity8 in sun/niu.c
           [not found] <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com>
           [not found] ` <1458788612-4367-1-git-send-email-zhaoxiu.zeng-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
    @ 2016-03-27  7:36 ` zhaoxiu.zeng
      2016-03-28 14:33   ` Michal Nazarewicz
      2016-03-27  7:50 ` [PATCH 31/31] ethernet: broadcom: use parity8 in tg3.c zhaoxiu.zeng
      2 siblings, 1 reply; 4+ messages in thread
    From: zhaoxiu.zeng @ 2016-03-27  7:36 UTC (permalink / raw)
      To: Jiri Pirko, Andrew Morton, Michal Nazarewicz, David S. Miller,
    	Vlastimil Babka, Joonsoo Kim
      Cc: linux-kernel, netdev
    
    From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
    
    Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
    ---
     drivers/net/ethernet/sun/niu.c | 10 ++--------
     1 file changed, 2 insertions(+), 8 deletions(-)
    
    diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
    index 9cc4564..8c344ef 100644
    --- a/drivers/net/ethernet/sun/niu.c
    +++ b/drivers/net/ethernet/sun/niu.c
    @@ -2742,18 +2742,12 @@ static int niu_set_alt_mac_rdc_table(struct niu *np, int idx,
     
     static u64 vlan_entry_set_parity(u64 reg_val)
     {
    -	u64 port01_mask;
    -	u64 port23_mask;
    -
    -	port01_mask = 0x00ff;
    -	port23_mask = 0xff00;
    -
    -	if (hweight64(reg_val & port01_mask) & 1)
    +	if (parity8(reg_val))
     		reg_val |= ENET_VLAN_TBL_PARITY0;
     	else
     		reg_val &= ~ENET_VLAN_TBL_PARITY0;
     
    -	if (hweight64(reg_val & port23_mask) & 1)
    +	if (parity8((unsigned int)reg_val >> 8))
     		reg_val |= ENET_VLAN_TBL_PARITY1;
     	else
     		reg_val &= ~ENET_VLAN_TBL_PARITY1;
    -- 
    2.5.5
    
    ^ permalink raw reply related	[flat|nested] 4+ messages in thread
  • * [PATCH 31/31] ethernet: broadcom: use parity8 in tg3.c
           [not found] <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com>
           [not found] ` <1458788612-4367-1-git-send-email-zhaoxiu.zeng-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
      2016-03-27  7:36 ` [PATCH 25/31] ethernet: use parity8 in sun/niu.c zhaoxiu.zeng
    @ 2016-03-27  7:50 ` zhaoxiu.zeng
      2 siblings, 0 replies; 4+ messages in thread
    From: zhaoxiu.zeng @ 2016-03-27  7:50 UTC (permalink / raw)
      To: Siva Reddy Kallam, Prashant Sreedharan, Michael Chan; +Cc: linux-kernel, netdev
    
    From: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
    
    Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
    ---
     drivers/net/ethernet/broadcom/tg3.c | 6 +-----
     1 file changed, 1 insertion(+), 5 deletions(-)
    
    diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
    index 3010080..802a429 100644
    --- a/drivers/net/ethernet/broadcom/tg3.c
    +++ b/drivers/net/ethernet/broadcom/tg3.c
    @@ -12939,11 +12939,7 @@ static int tg3_test_nvram(struct tg3 *tp)
     
     		err = -EIO;
     		for (i = 0; i < NVRAM_SELFBOOT_DATA_SIZE; i++) {
    -			u8 hw8 = hweight8(data[i]);
    -
    -			if ((hw8 & 0x1) && parity[i])
    -				goto out;
    -			else if (!(hw8 & 0x1) && !parity[i])
    +			if (parity8(data[i]) == !!parity[i])
     				goto out;
     		}
     		err = 0;
    -- 
    2.5.5
    
    ^ permalink raw reply related	[flat|nested] 4+ messages in thread

  • end of thread, other threads:[~2016-03-28 14:33 UTC | newest]
    
    Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
    -- links below jump to the message on this page --
         [not found] <1458788612-4367-1-git-send-email-zhaoxiu.zeng@gmail.com>
         [not found] ` <1458788612-4367-1-git-send-email-zhaoxiu.zeng-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
    2016-03-27  6:51   ` [PATCH 12/31] sunrpc: auth_gss: use parity8 zhaoxiu.zeng
    2016-03-27  7:36 ` [PATCH 25/31] ethernet: use parity8 in sun/niu.c zhaoxiu.zeng
    2016-03-28 14:33   ` Michal Nazarewicz
    2016-03-27  7:50 ` [PATCH 31/31] ethernet: broadcom: use parity8 in tg3.c zhaoxiu.zeng
    

    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).