From: arvind Yadav <arvind.yadav.cs@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>, linuxppc-dev@lists.ozlabs.org
Cc: leoli@freescale.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove lots of IS_ERR_VALUE abuses.
Date: Thu, 7 Jul 2016 20:47:09 +0530 [thread overview]
Message-ID: <577E7275.4030503@gmail.com> (raw)
In-Reply-To: <5371430.pWs0YMj39t@wuerfel>
As per your concern, I have change commit message. Submit other patch.
Thanks,
Arvind Yadav
On Thursday 07 July 2016 01:40 PM, Arnd Bergmann wrote:
> On Thursday, July 7, 2016 12:47:43 AM CEST Arvind Yadav wrote:
>> Most users of IS_ERR_VALUE() in the kernel are wrong, as they
>> pass an 'int' into a function that takes an 'unsigned long'
>> argument. This happens to work because the type is sign-extended
>> on 64-bit architectures before it gets converted into an
>> unsigned type.
>>
>> However, anything that passes an 'unsigned short' or 'unsigned int'
>> argument into IS_ERR_VALUE() is guaranteed to be broken, as are
>> 8-bit integers and types that are wider than 'unsigned long'.
>>
>> Andrzej Hajda has already fixed a lot of the worst abusers that
>> were causing actual bugs, but it would be nice to prevent any
>> users that are not passing 'unsigned long' arguments.
>>
>> This patch changes all users of IS_ERR_VALUE() that I could find
>> on 32-bit ARM randconfig builds and x86 allmodconfig. For the
>> moment, this doesn't change the definition of IS_ERR_VALUE()
>> because there are probably still architecture specific users
>> elsewhere.
>>
>> Almost all the warnings I got are for files that are better off
>> using 'if (err)' or 'if (err < 0)'.
>> The only legitimate user I could find that we get a warning for
>> is the (32-bit only) freescale gigabit ethernet driver.
>>
>> I was using this definition for testing:
>>
>> #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
>> unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
>>
>> which ends up making all 16-bit or wider types work correctly with
>> the most plausible interpretation of what IS_ERR_VALUE() was supposed
>> to return according to its users, but also causes a compile-time
>> warning for any users that do not pass an 'unsigned long' argument.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> The above is my changelog text for commit 287980e49f, but it's not my patch.
>
> Your changes look fine, but reusing my description there seems wrong.
> Can you add a new description and just point to my commit instead?
>
> Arnd
>
>> drivers/net/ethernet/freescale/ucc_geth.c | 30 +++++++++++++++---------------
>> 1 file changed, 15 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
>> index 5bf1ade..c1ead2c 100644
>> --- a/drivers/net/ethernet/freescale/ucc_geth.c
>> +++ b/drivers/net/ethernet/freescale/ucc_geth.c
>> @@ -289,7 +289,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth,
>> else {
>> init_enet_offset =
>> qe_muram_alloc(thread_size, thread_alignment);
>> - if (IS_ERR_VALUE(init_enet_offset)) {
>> + if (init_enet_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory\n");
>> qe_put_snum((u8) snum);
>> @@ -2234,7 +2234,7 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth)
>> ugeth->tx_bd_ring_offset[j] =
>> qe_muram_alloc(length,
>> UCC_GETH_TX_BD_RING_ALIGNMENT);
>> - if (!IS_ERR_VALUE(ugeth->tx_bd_ring_offset[j]))
>> + if (!ugeth->tx_bd_ring_offset[j])
>> ugeth->p_tx_bd_ring[j] =
>> (u8 __iomem *) qe_muram_addr(ugeth->
>> tx_bd_ring_offset[j]);
>> @@ -2311,7 +2311,7 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth)
>> ugeth->rx_bd_ring_offset[j] =
>> qe_muram_alloc(length,
>> UCC_GETH_RX_BD_RING_ALIGNMENT);
>> - if (!IS_ERR_VALUE(ugeth->rx_bd_ring_offset[j]))
>> + if (!ugeth->rx_bd_ring_offset[j])
>> ugeth->p_rx_bd_ring[j] =
>> (u8 __iomem *) qe_muram_addr(ugeth->
>> rx_bd_ring_offset[j]);
>> @@ -2521,7 +2521,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->tx_glbl_pram_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
>> UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->tx_glbl_pram_offset)) {
>> + if (ugeth->tx_glbl_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_tx_glbl_pram\n");
>> return -ENOMEM;
>> @@ -2541,7 +2541,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> sizeof(struct ucc_geth_thread_data_tx) +
>> 32 * (numThreadsTxNumerical == 1),
>> UCC_GETH_THREAD_DATA_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->thread_dat_tx_offset)) {
>> + if (ugeth->thread_dat_tx_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_thread_data_tx\n");
>> return -ENOMEM;
>> @@ -2568,7 +2568,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(ug_info->numQueuesTx *
>> sizeof(struct ucc_geth_send_queue_qd),
>> UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->send_q_mem_reg_offset)) {
>> + if (ugeth->send_q_mem_reg_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_send_q_mem_reg\n");
>> return -ENOMEM;
>> @@ -2609,7 +2609,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->scheduler_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_scheduler),
>> UCC_GETH_SCHEDULER_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->scheduler_offset)) {
>> + if (ugeth->scheduler_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_scheduler\n");
>> return -ENOMEM;
>> @@ -2656,7 +2656,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(sizeof
>> (struct ucc_geth_tx_firmware_statistics_pram),
>> UCC_GETH_TX_STATISTICS_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->tx_fw_statistics_pram_offset)) {
>> + if (ugeth->tx_fw_statistics_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_tx_fw_statistics_pram\n");
>> return -ENOMEM;
>> @@ -2693,7 +2693,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->rx_glbl_pram_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
>> UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_glbl_pram_offset)) {
>> + if (ugeth->rx_glbl_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_glbl_pram\n");
>> return -ENOMEM;
>> @@ -2712,7 +2712,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(numThreadsRxNumerical *
>> sizeof(struct ucc_geth_thread_data_rx),
>> UCC_GETH_THREAD_DATA_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->thread_dat_rx_offset)) {
>> + if (ugeth->thread_dat_rx_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_thread_data_rx\n");
>> return -ENOMEM;
>> @@ -2733,7 +2733,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(sizeof
>> (struct ucc_geth_rx_firmware_statistics_pram),
>> UCC_GETH_RX_STATISTICS_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_fw_statistics_pram_offset)) {
>> + if (ugeth->rx_fw_statistics_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_fw_statistics_pram\n");
>> return -ENOMEM;
>> @@ -2753,7 +2753,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(ug_info->numQueuesRx *
>> sizeof(struct ucc_geth_rx_interrupt_coalescing_entry)
>> + 4, UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_irq_coalescing_tbl_offset)) {
>> + if (ugeth->rx_irq_coalescing_tbl_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_irq_coalescing_tbl\n");
>> return -ENOMEM;
>> @@ -2819,7 +2819,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> (sizeof(struct ucc_geth_rx_bd_queues_entry) +
>> sizeof(struct ucc_geth_rx_prefetched_bds)),
>> UCC_GETH_RX_BD_QUEUES_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_bd_qs_tbl_offset)) {
>> + if (ugeth->rx_bd_qs_tbl_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_bd_qs_tbl\n");
>> return -ENOMEM;
>> @@ -2905,7 +2905,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->exf_glbl_param_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_exf_global_pram),
>> UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->exf_glbl_param_offset)) {
>> + if (ugeth->exf_glbl_param_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_exf_glbl_param\n");
>> return -ENOMEM;
>> @@ -3039,7 +3039,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>>
>> /* Allocate InitEnet command parameter structure */
>> init_enet_pram_offset = qe_muram_alloc(sizeof(struct ucc_geth_init_pram), 4);
>> - if (IS_ERR_VALUE(init_enet_pram_offset)) {
>> + if (init_enet_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_init_enet_pram\n");
>> return -ENOMEM;
>>
>
WARNING: multiple messages have this Message-ID (diff)
From: arvind Yadav <arvind.yadav.cs@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>, linuxppc-dev@lists.ozlabs.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove lots of IS_ERR_VALUE abuses.
Date: Thu, 7 Jul 2016 20:47:09 +0530 [thread overview]
Message-ID: <577E7275.4030503@gmail.com> (raw)
In-Reply-To: <5371430.pWs0YMj39t@wuerfel>
As per your concern, I have change commit message. Submit other patch.
Thanks,
Arvind Yadav
On Thursday 07 July 2016 01:40 PM, Arnd Bergmann wrote:
> On Thursday, July 7, 2016 12:47:43 AM CEST Arvind Yadav wrote:
>> Most users of IS_ERR_VALUE() in the kernel are wrong, as they
>> pass an 'int' into a function that takes an 'unsigned long'
>> argument. This happens to work because the type is sign-extended
>> on 64-bit architectures before it gets converted into an
>> unsigned type.
>>
>> However, anything that passes an 'unsigned short' or 'unsigned int'
>> argument into IS_ERR_VALUE() is guaranteed to be broken, as are
>> 8-bit integers and types that are wider than 'unsigned long'.
>>
>> Andrzej Hajda has already fixed a lot of the worst abusers that
>> were causing actual bugs, but it would be nice to prevent any
>> users that are not passing 'unsigned long' arguments.
>>
>> This patch changes all users of IS_ERR_VALUE() that I could find
>> on 32-bit ARM randconfig builds and x86 allmodconfig. For the
>> moment, this doesn't change the definition of IS_ERR_VALUE()
>> because there are probably still architecture specific users
>> elsewhere.
>>
>> Almost all the warnings I got are for files that are better off
>> using 'if (err)' or 'if (err < 0)'.
>> The only legitimate user I could find that we get a warning for
>> is the (32-bit only) freescale gigabit ethernet driver.
>>
>> I was using this definition for testing:
>>
>> #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
>> unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
>>
>> which ends up making all 16-bit or wider types work correctly with
>> the most plausible interpretation of what IS_ERR_VALUE() was supposed
>> to return according to its users, but also causes a compile-time
>> warning for any users that do not pass an 'unsigned long' argument.
>>
>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> The above is my changelog text for commit 287980e49f, but it's not my patch.
>
> Your changes look fine, but reusing my description there seems wrong.
> Can you add a new description and just point to my commit instead?
>
> Arnd
>
>> drivers/net/ethernet/freescale/ucc_geth.c | 30 +++++++++++++++---------------
>> 1 file changed, 15 insertions(+), 15 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
>> index 5bf1ade..c1ead2c 100644
>> --- a/drivers/net/ethernet/freescale/ucc_geth.c
>> +++ b/drivers/net/ethernet/freescale/ucc_geth.c
>> @@ -289,7 +289,7 @@ static int fill_init_enet_entries(struct ucc_geth_private *ugeth,
>> else {
>> init_enet_offset =
>> qe_muram_alloc(thread_size, thread_alignment);
>> - if (IS_ERR_VALUE(init_enet_offset)) {
>> + if (init_enet_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory\n");
>> qe_put_snum((u8) snum);
>> @@ -2234,7 +2234,7 @@ static int ucc_geth_alloc_tx(struct ucc_geth_private *ugeth)
>> ugeth->tx_bd_ring_offset[j] =
>> qe_muram_alloc(length,
>> UCC_GETH_TX_BD_RING_ALIGNMENT);
>> - if (!IS_ERR_VALUE(ugeth->tx_bd_ring_offset[j]))
>> + if (!ugeth->tx_bd_ring_offset[j])
>> ugeth->p_tx_bd_ring[j] =
>> (u8 __iomem *) qe_muram_addr(ugeth->
>> tx_bd_ring_offset[j]);
>> @@ -2311,7 +2311,7 @@ static int ucc_geth_alloc_rx(struct ucc_geth_private *ugeth)
>> ugeth->rx_bd_ring_offset[j] =
>> qe_muram_alloc(length,
>> UCC_GETH_RX_BD_RING_ALIGNMENT);
>> - if (!IS_ERR_VALUE(ugeth->rx_bd_ring_offset[j]))
>> + if (!ugeth->rx_bd_ring_offset[j])
>> ugeth->p_rx_bd_ring[j] =
>> (u8 __iomem *) qe_muram_addr(ugeth->
>> rx_bd_ring_offset[j]);
>> @@ -2521,7 +2521,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->tx_glbl_pram_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_tx_global_pram),
>> UCC_GETH_TX_GLOBAL_PRAM_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->tx_glbl_pram_offset)) {
>> + if (ugeth->tx_glbl_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_tx_glbl_pram\n");
>> return -ENOMEM;
>> @@ -2541,7 +2541,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> sizeof(struct ucc_geth_thread_data_tx) +
>> 32 * (numThreadsTxNumerical == 1),
>> UCC_GETH_THREAD_DATA_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->thread_dat_tx_offset)) {
>> + if (ugeth->thread_dat_tx_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_thread_data_tx\n");
>> return -ENOMEM;
>> @@ -2568,7 +2568,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(ug_info->numQueuesTx *
>> sizeof(struct ucc_geth_send_queue_qd),
>> UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->send_q_mem_reg_offset)) {
>> + if (ugeth->send_q_mem_reg_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_send_q_mem_reg\n");
>> return -ENOMEM;
>> @@ -2609,7 +2609,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->scheduler_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_scheduler),
>> UCC_GETH_SCHEDULER_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->scheduler_offset)) {
>> + if (ugeth->scheduler_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_scheduler\n");
>> return -ENOMEM;
>> @@ -2656,7 +2656,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(sizeof
>> (struct ucc_geth_tx_firmware_statistics_pram),
>> UCC_GETH_TX_STATISTICS_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->tx_fw_statistics_pram_offset)) {
>> + if (ugeth->tx_fw_statistics_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_tx_fw_statistics_pram\n");
>> return -ENOMEM;
>> @@ -2693,7 +2693,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->rx_glbl_pram_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_rx_global_pram),
>> UCC_GETH_RX_GLOBAL_PRAM_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_glbl_pram_offset)) {
>> + if (ugeth->rx_glbl_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_glbl_pram\n");
>> return -ENOMEM;
>> @@ -2712,7 +2712,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(numThreadsRxNumerical *
>> sizeof(struct ucc_geth_thread_data_rx),
>> UCC_GETH_THREAD_DATA_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->thread_dat_rx_offset)) {
>> + if (ugeth->thread_dat_rx_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_thread_data_rx\n");
>> return -ENOMEM;
>> @@ -2733,7 +2733,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(sizeof
>> (struct ucc_geth_rx_firmware_statistics_pram),
>> UCC_GETH_RX_STATISTICS_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_fw_statistics_pram_offset)) {
>> + if (ugeth->rx_fw_statistics_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_fw_statistics_pram\n");
>> return -ENOMEM;
>> @@ -2753,7 +2753,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> qe_muram_alloc(ug_info->numQueuesRx *
>> sizeof(struct ucc_geth_rx_interrupt_coalescing_entry)
>> + 4, UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_irq_coalescing_tbl_offset)) {
>> + if (ugeth->rx_irq_coalescing_tbl_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_irq_coalescing_tbl\n");
>> return -ENOMEM;
>> @@ -2819,7 +2819,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> (sizeof(struct ucc_geth_rx_bd_queues_entry) +
>> sizeof(struct ucc_geth_rx_prefetched_bds)),
>> UCC_GETH_RX_BD_QUEUES_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->rx_bd_qs_tbl_offset)) {
>> + if (ugeth->rx_bd_qs_tbl_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_rx_bd_qs_tbl\n");
>> return -ENOMEM;
>> @@ -2905,7 +2905,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>> ugeth->exf_glbl_param_offset =
>> qe_muram_alloc(sizeof(struct ucc_geth_exf_global_pram),
>> UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT);
>> - if (IS_ERR_VALUE(ugeth->exf_glbl_param_offset)) {
>> + if (ugeth->exf_glbl_param_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_exf_glbl_param\n");
>> return -ENOMEM;
>> @@ -3039,7 +3039,7 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
>>
>> /* Allocate InitEnet command parameter structure */
>> init_enet_pram_offset = qe_muram_alloc(sizeof(struct ucc_geth_init_pram), 4);
>> - if (IS_ERR_VALUE(init_enet_pram_offset)) {
>> + if (init_enet_pram_offset < 0) {
>> if (netif_msg_ifup(ugeth))
>> pr_err("Can not allocate DPRAM memory for p_init_enet_pram\n");
>> return -ENOMEM;
>>
>
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
next prev parent reply other threads:[~2016-07-07 15:17 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 19:17 [PATCH] Remove lots of IS_ERR_VALUE abuses Arvind Yadav
2016-07-07 8:10 ` Arnd Bergmann
2016-07-07 15:17 ` arvind Yadav [this message]
2016-07-07 15:17 ` arvind Yadav
-- strict thread matches above, loose matches on Subject: below --
2016-07-06 19:38 Arvind Yadav
2016-05-27 21:23 [PATCH] remove " Arnd Bergmann
[not found] ` <1464384685-347275-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2016-05-27 21:46 ` Andrew Morton
2016-05-27 21:46 ` Andrew Morton
2016-05-27 21:56 ` Linus Torvalds
2016-05-27 23:24 ` Linus Torvalds
2016-05-27 23:24 ` Linus Torvalds
2016-05-27 23:24 ` Linus Torvalds
2016-05-27 22:02 ` Srinivas Kandagatla
2016-05-27 22:04 ` Al Viro
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=577E7275.4030503@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=arnd@arndb.de \
--cc=leoli@freescale.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.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.