[v3,26/33] net/ena: cosmetic changes
Checks
Commit Message
From: Shai Brandes <shaibran@amazon.com>
This patch makes several changes to improve
the style and readability of the code.
Signed-off-by: Shai Brandes <shaibran@amazon.com>
Reviewed-by: Amit Bernstein <amitbern@amazon.com>
---
drivers/net/ena/hal/ena_com.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
Comments
On 3/6/2024 12:24 PM, shaibran@amazon.com wrote:
> From: Shai Brandes <shaibran@amazon.com>
>
> This patch makes several changes to improve
> the style and readability of the code.
>
> Signed-off-by: Shai Brandes <shaibran@amazon.com>
> Reviewed-by: Amit Bernstein <amitbern@amazon.com>
> ---
> drivers/net/ena/hal/ena_com.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ena/hal/ena_com.c b/drivers/net/ena/hal/ena_com.c
> index b98540ba63..2db21e7895 100644
> --- a/drivers/net/ena/hal/ena_com.c
> +++ b/drivers/net/ena/hal/ena_com.c
> @@ -1914,15 +1914,14 @@ int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp)
>
> /* PHC is in active state, update statistics according to req_id and error_flags */
> if ((READ_ONCE16(read_resp->req_id) != phc->req_id) ||
> - (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) {
> + (read_resp->error_flags & ENA_PHC_ERROR_FLAGS))
> /* Device didn't update req_id during blocking time or timestamp is invalid,
> * this indicates on a device error
> */
> phc->stats.phc_err++;
> - } else {
> + else
> /* Device updated req_id during blocking time with valid timestamp */
> phc->stats.phc_exp++;
> - }
> }
>
> /* Setting relative timeouts */
> @@ -2431,7 +2430,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data)
> timestamp = (u64)aenq_common->timestamp_low |
> ((u64)aenq_common->timestamp_high << 32);
>
> - ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIU64 "s]\n",
> + ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n",
>
'ENA_PRIu64' is not defined yet in this patch, so patch by patch build
fails.
Thanks Ferruh, we will fix and upload a new patchset
בתאריך 8 במרץ 2024 13:18, Ferruh Yigit <ferruh.yigit@amd.com> כתב:
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.
On 3/6/2024 12:24 PM, shaibran@amazon.com wrote:
> From: Shai Brandes <shaibran@amazon.com>
>
> This patch makes several changes to improve
> the style and readability of the code.
>
> Signed-off-by: Shai Brandes <shaibran@amazon.com>
> Reviewed-by: Amit Bernstein <amitbern@amazon.com>
> ---
> drivers/net/ena/hal/ena_com.c | 13 +++++--------
> 1 file changed, 5 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/ena/hal/ena_com.c b/drivers/net/ena/hal/ena_com.c
> index b98540ba63..2db21e7895 100644
> --- a/drivers/net/ena/hal/ena_com.c
> +++ b/drivers/net/ena/hal/ena_com.c
> @@ -1914,15 +1914,14 @@ int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp)
>
> /* PHC is in active state, update statistics according to req_id and error_flags */
> if ((READ_ONCE16(read_resp->req_id) != phc->req_id) ||
> - (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) {
> + (read_resp->error_flags & ENA_PHC_ERROR_FLAGS))
> /* Device didn't update req_id during blocking time or timestamp is invalid,
> * this indicates on a device error
> */
> phc->stats.phc_err++;
> - } else {
> + else
> /* Device updated req_id during blocking time with valid timestamp */
> phc->stats.phc_exp++;
> - }
> }
>
> /* Setting relative timeouts */
> @@ -2431,7 +2430,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data)
> timestamp = (u64)aenq_common->timestamp_low |
> ((u64)aenq_common->timestamp_high << 32);
>
> - ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIU64 "s]\n",
> + ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n",
>
'ENA_PRIu64' is not defined yet in this patch, so patch by patch build
fails.
On 3/8/2024 1:19 PM, Brandes, Shai wrote:
> Thanks Ferruh, we will fix and upload a new patchset
>
Hi Shai,
If this is the only issue I can update while merging, so please wait
before sending a new version.
> בתאריך 8 במרץ 2024 13:18, Ferruh Yigit <ferruh.yigit@amd.com> כתב:
> CAUTION: This email originated from outside of the organization. Do not
> click links or open attachments unless you can confirm the sender and
> know the content is safe.
>
>
>
> On 3/6/2024 12:24 PM, shaibran@amazon.com wrote:
>> From: Shai Brandes <shaibran@amazon.com>
>>
>> This patch makes several changes to improve
>> the style and readability of the code.
>>
>> Signed-off-by: Shai Brandes <shaibran@amazon.com>
>> Reviewed-by: Amit Bernstein <amitbern@amazon.com>
>> ---
>> drivers/net/ena/hal/ena_com.c | 13 +++++--------
>> 1 file changed, 5 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/net/ena/hal/ena_com.c b/drivers/net/ena/hal/ena_com.c
>> index b98540ba63..2db21e7895 100644
>> --- a/drivers/net/ena/hal/ena_com.c
>> +++ b/drivers/net/ena/hal/ena_com.c
>> @@ -1914,15 +1914,14 @@ int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp)
>>
>> /* PHC is in active state, update statistics according to req_id and error_flags */
>> if ((READ_ONCE16(read_resp->req_id) != phc->req_id) ||
>> - (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) {
>> + (read_resp->error_flags & ENA_PHC_ERROR_FLAGS))
>> /* Device didn't update req_id during blocking time or timestamp is invalid,
>> * this indicates on a device error
>> */
>> phc->stats.phc_err++;
>> - } else {
>> + else
>> /* Device updated req_id during blocking time with valid timestamp */
>> phc->stats.phc_exp++;
>> - }
>> }
>>
>> /* Setting relative timeouts */
>> @@ -2431,7 +2430,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data)
>> timestamp = (u64)aenq_common->timestamp_low |
>> ((u64)aenq_common->timestamp_high << 32);
>>
>> - ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIU64 "s]\n",
>> + ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n",
>>
>
> 'ENA_PRIu64' is not defined yet in this patch, so patch by patch build
> fails.
>
@@ -1914,15 +1914,14 @@ int ena_com_phc_get_timestamp(struct ena_com_dev *ena_dev, u64 *timestamp)
/* PHC is in active state, update statistics according to req_id and error_flags */
if ((READ_ONCE16(read_resp->req_id) != phc->req_id) ||
- (read_resp->error_flags & ENA_PHC_ERROR_FLAGS)) {
+ (read_resp->error_flags & ENA_PHC_ERROR_FLAGS))
/* Device didn't update req_id during blocking time or timestamp is invalid,
* this indicates on a device error
*/
phc->stats.phc_err++;
- } else {
+ else
/* Device updated req_id during blocking time with valid timestamp */
phc->stats.phc_exp++;
- }
}
/* Setting relative timeouts */
@@ -2431,7 +2430,7 @@ void ena_com_aenq_intr_handler(struct ena_com_dev *ena_dev, void *data)
timestamp = (u64)aenq_common->timestamp_low |
((u64)aenq_common->timestamp_high << 32);
- ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIU64 "s]\n",
+ ena_trc_dbg(ena_dev, "AENQ! Group[%x] Syndrome[%x] timestamp: [%" ENA_PRIu64 "s]\n",
aenq_common->group,
aenq_common->syndrome,
timestamp);
@@ -3233,16 +3232,15 @@ int ena_com_allocate_customer_metrics_buffer(struct ena_com_dev *ena_dev)
{
struct ena_customer_metrics *customer_metrics = &ena_dev->customer_metrics;
+ customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
ENA_MEM_ALLOC_COHERENT(ena_dev->dmadev,
customer_metrics->buffer_len,
customer_metrics->buffer_virt_addr,
customer_metrics->buffer_dma_addr,
customer_metrics->buffer_dma_handle);
- if (unlikely(customer_metrics->buffer_virt_addr == NULL))
+ if (unlikely(!customer_metrics->buffer_virt_addr))
return ENA_COM_NO_MEM;
- customer_metrics->buffer_len = ENA_CUSTOMER_METRICS_BUFFER_SIZE;
-
return 0;
}
@@ -3285,7 +3283,6 @@ void ena_com_delete_customer_metrics_buffer(struct ena_com_dev *ena_dev)
customer_metrics->buffer_dma_addr,
customer_metrics->buffer_dma_handle);
customer_metrics->buffer_virt_addr = NULL;
- customer_metrics->buffer_len = 0;
}
}