All of lore.kernel.org
 help / color / mirror / Atom feed
From: huangdaode@hisilicon.com (huangdaode)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next v3] net: Fix Hisilicon Network Subsystem Support Compilation
Date: Sun, 27 Sep 2015 15:19:09 +0800	[thread overview]
Message-ID: <5607986D.7050700@hisilicon.com> (raw)
In-Reply-To: <20150925.214256.1901015223799070196.davem@davemloft.net>

On 2015/9/26 12:42, David Miller wrote:
> From: huangdaode <huangdaode@hisilicon.com>
> Date: Fri, 25 Sep 2015 16:29:50 +0800
>
>> @@ -191,9 +191,12 @@ static void hns_rcb_ring_init(struct ring_pair_cb *ring_pair, int ring_type)
>>   	if (ring_type == RX_RING) {
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_L_REG,
>>   			       (u32)dma);
>> +#ifdef CONFIG_64BIT
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG,
>>   			       (u32)(dma >> 32));
>> -
>> +#else
>> +		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG, 0);
>> +#endif
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BD_LEN_REG,
>>   			       bd_size_type);
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BD_NUM_REG,
> CONFIG_64BIT doesn't tell you if _DMA_ addresses are 64-bit or not.
>
> Furthermore there is a portable way to shift a 32-bit value down
> 32-bits whilst avoiding warnings.
>
> 	(x >> 31) >> 1
>
> So you should definitely use that instead of the CONFIG_64BIT test.
>
> .

agreed.

WARNING: multiple messages have this Message-ID (diff)
From: huangdaode <huangdaode@hisilicon.com>
To: David Miller <davem@davemloft.net>
Cc: robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	catalin.marinas@arm.com, will.deacon@arm.com,
	liguozhu@hisilicon.com, Yisen.Zhuang@huawei.com,
	paul.gortmaker@windriver.com, dingtianhong@huawei.com,
	zhangfei.gao@linaro.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
	linuxarm@huawei.com, salil.mehta@huawei.com,
	kenneth-lee-2012@foxmail.com, xuwei5@hisilicon.com,
	lisheng011@huawei.com
Subject: Re: [PATCH net-next v3] net: Fix Hisilicon Network Subsystem Support Compilation
Date: Sun, 27 Sep 2015 15:19:09 +0800	[thread overview]
Message-ID: <5607986D.7050700@hisilicon.com> (raw)
In-Reply-To: <20150925.214256.1901015223799070196.davem@davemloft.net>

On 2015/9/26 12:42, David Miller wrote:
> From: huangdaode <huangdaode@hisilicon.com>
> Date: Fri, 25 Sep 2015 16:29:50 +0800
>
>> @@ -191,9 +191,12 @@ static void hns_rcb_ring_init(struct ring_pair_cb *ring_pair, int ring_type)
>>   	if (ring_type == RX_RING) {
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_L_REG,
>>   			       (u32)dma);
>> +#ifdef CONFIG_64BIT
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG,
>>   			       (u32)(dma >> 32));
>> -
>> +#else
>> +		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG, 0);
>> +#endif
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BD_LEN_REG,
>>   			       bd_size_type);
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BD_NUM_REG,
> CONFIG_64BIT doesn't tell you if _DMA_ addresses are 64-bit or not.
>
> Furthermore there is a portable way to shift a 32-bit value down
> 32-bits whilst avoiding warnings.
>
> 	(x >> 31) >> 1
>
> So you should definitely use that instead of the CONFIG_64BIT test.
>
> .

agreed.

WARNING: multiple messages have this Message-ID (diff)
From: huangdaode <huangdaode@hisilicon.com>
To: David Miller <davem@davemloft.net>
Cc: <robh+dt@kernel.org>, <pawel.moll@arm.com>,
	<mark.rutland@arm.com>, <ijc+devicetree@hellion.org.uk>,
	<galak@codeaurora.org>, <catalin.marinas@arm.com>,
	<will.deacon@arm.com>, <liguozhu@hisilicon.com>,
	<Yisen.Zhuang@huawei.com>, <paul.gortmaker@windriver.com>,
	<dingtianhong@huawei.com>, <zhangfei.gao@linaro.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <netdev@vger.kernel.org>,
	<linuxarm@huawei.com>, <salil.mehta@huawei.com>,
	<kenneth-lee-2012@foxmail.com>, <xuwei5@hisilicon.com>,
	<lisheng011@huawei.com>
Subject: Re: [PATCH net-next v3] net: Fix Hisilicon Network Subsystem Support Compilation
Date: Sun, 27 Sep 2015 15:19:09 +0800	[thread overview]
Message-ID: <5607986D.7050700@hisilicon.com> (raw)
In-Reply-To: <20150925.214256.1901015223799070196.davem@davemloft.net>

On 2015/9/26 12:42, David Miller wrote:
> From: huangdaode <huangdaode@hisilicon.com>
> Date: Fri, 25 Sep 2015 16:29:50 +0800
>
>> @@ -191,9 +191,12 @@ static void hns_rcb_ring_init(struct ring_pair_cb *ring_pair, int ring_type)
>>   	if (ring_type == RX_RING) {
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_L_REG,
>>   			       (u32)dma);
>> +#ifdef CONFIG_64BIT
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG,
>>   			       (u32)(dma >> 32));
>> -
>> +#else
>> +		dsaf_write_dev(q, RCB_RING_RX_RING_BASEADDR_H_REG, 0);
>> +#endif
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BD_LEN_REG,
>>   			       bd_size_type);
>>   		dsaf_write_dev(q, RCB_RING_RX_RING_BD_NUM_REG,
> CONFIG_64BIT doesn't tell you if _DMA_ addresses are 64-bit or not.
>
> Furthermore there is a portable way to shift a 32-bit value down
> 32-bits whilst avoiding warnings.
>
> 	(x >> 31) >> 1
>
> So you should definitely use that instead of the CONFIG_64BIT test.
>
> .

agreed.




  reply	other threads:[~2015-09-27  7:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25  8:29 [PATCH net-next v3] net: Fix Hisilicon Network Subsystem Support Compilation huangdaode
2015-09-25  8:29 ` huangdaode
2015-09-25  8:29 ` huangdaode
2015-09-26  4:42 ` David Miller
2015-09-26  4:42   ` David Miller
2015-09-26  4:42   ` David Miller
2015-09-27  7:19   ` huangdaode [this message]
2015-09-27  7:19     ` huangdaode
2015-09-27  7:19     ` huangdaode

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=5607986D.7050700@hisilicon.com \
    --to=huangdaode@hisilicon.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.