From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C85FE43C5B; Wed, 6 Mar 2024 13:28:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A66742EBA; Wed, 6 Mar 2024 13:25:59 +0100 (CET) Received: from smtp-fw-52004.amazon.com (smtp-fw-52004.amazon.com [52.119.213.154]) by mails.dpdk.org (Postfix) with ESMTP id E057942E41 for ; Wed, 6 Mar 2024 13:25:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1709727958; x=1741263958; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=dlm6VTopozRTtgsRxyisTZw4RPfugWax+gsYpfrByuM=; b=BRjhSgHTxa2vSQlc1A+BouawZQdr0nk+InErkYu41sR7XGIIx/1JVyNW rA4oZMZ35lQayCruusFsIzS4xUiWspiiujWqebBQ8yFRe0ZGnAnFAgOmi 3c/8H8V5I6X7aqquTDapoot0HC6+nDPbrVfNRITHEZaELrQhwD1VfeJ7B g=; X-IronPort-AV: E=Sophos;i="6.06,208,1705363200"; d="scan'208";a="189623397" Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.43.8.2]) by smtp-border-fw-52004.iad7.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 12:25:58 +0000 Received: from EX19MTAEUC001.ant.amazon.com [10.0.10.100:13917] by smtpin.naws.eu-west-1.prod.farcaster.email.amazon.dev [10.0.11.111:2525] with esmtp (Farcaster) id 0aad8b78-4fa2-4a45-8cc3-b00bb44f939d; Wed, 6 Mar 2024 12:25:56 +0000 (UTC) X-Farcaster-Flow-ID: 0aad8b78-4fa2-4a45-8cc3-b00bb44f939d Received: from EX19D007EUA001.ant.amazon.com (10.252.50.133) by EX19MTAEUC001.ant.amazon.com (10.252.51.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Wed, 6 Mar 2024 12:25:44 +0000 Received: from EX19MTAUWA001.ant.amazon.com (10.250.64.204) by EX19D007EUA001.ant.amazon.com (10.252.50.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Wed, 6 Mar 2024 12:25:43 +0000 Received: from HFA15-CG15235BS.amazon.com (10.1.213.21) by mail-relay.amazon.com (10.250.64.204) with Microsoft SMTP Server id 15.2.1258.28 via Frontend Transport; Wed, 6 Mar 2024 12:25:42 +0000 From: To: CC: , Shai Brandes Subject: [PATCH v3 26/33] net/ena: cosmetic changes Date: Wed, 6 Mar 2024 14:24:38 +0200 Message-ID: <20240306122445.4350-27-shaibran@amazon.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240306122445.4350-1-shaibran@amazon.com> References: <20240306122445.4350-1-shaibran@amazon.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Shai Brandes This patch makes several changes to improve the style and readability of the code. Signed-off-by: Shai Brandes Reviewed-by: Amit Bernstein --- 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", 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; } } -- 2.17.1