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 B2D8FA04AD; Mon, 24 Jan 2022 18:49:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4984742872; Mon, 24 Jan 2022 18:47:52 +0100 (CET) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by mails.dpdk.org (Postfix) with ESMTP id 5BB9C4286A for ; Mon, 24 Jan 2022 18:47:49 +0100 (CET) Received: by mail-pj1-f51.google.com with SMTP id s2-20020a17090ad48200b001b501977b23so16477008pju.2 for ; Mon, 24 Jan 2022 09:47:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6kHUYjHGPzaVjF61Z0vG8E/yxaEieN8nyYlr8bY65z8=; b=J11p+KoyGOBrOhSlDxQ9WMwxPaaYDPsEofOLKsDOSfqGTcIuIf/gJ3lmxHlwA9j9e5 A4g0kb04ioOxzk+pijMvC7EAQRKp5yctEZ8iLFmTaT1CQQry/iZdTRsvbb9Y9ZRg2kbH cnpDqyZ9DP0X150BoCigtP2/sAK6z6Vd4p0iAYbo263j4sTXHnqyz4rTL+dObYRzpxVv nxB4aFThvXvdV1YeESgNvpd/ux3xFwG6W82UGKvjvnF4R9K5e/BtkyKitKiR8N3x7BM6 wycPTJTmKRmGRyjMATRAAkvFNo9kfcD3kAyUm9+bKv0IyHOY0u0pOii/1HKEgpIfIy06 uyOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6kHUYjHGPzaVjF61Z0vG8E/yxaEieN8nyYlr8bY65z8=; b=U4wMDQOF+5/H/pRiRdftRVuUNQ1D6woPsCKrlaoVAJMJkmGQwgwDqNofwl3JnF9dwA QDmlYhMwzL5AqSLyH48ap/cfp2kE0c0637CLd5naaKOD9+Gl8sg3SpdIeVbhGQzVLidG dm7RbxkHhNcvFQyOmfb7FO2wEs0jSBTFnOj+RKAVaZOVdrYw1voDnkhVpO5fH/074pEm 1rofstapIZ/U9bd93lYxINzvIPwGQgC0O1tX2kmMI0bsC5hxN8zGgHv365FmxGUA8LwW zdo0uq7b4Dh96NRcyviHvV/Yud6ZUAB7mcsp5hPxqe+8Ybo1hGMnomBFRL+8p1oOtqc6 bLMA== X-Gm-Message-State: AOAM531OWZ8HAKL0Y78DDvO8kSjhltLi8GZW1lBXimw9w0fdcUeVrbWn M9ux18SinY1W9w5sEMNsB9nTcn3BOIGbZQ== X-Google-Smtp-Source: ABdhPJxxYFmhNFmGRi/x2zYW84CxU1vrdAkTogR2VpnHy6rhxmbGuE06nM8rnH0oskJ4mg5q/zkEeg== X-Received: by 2002:a17:90a:ac0d:: with SMTP id o13mr1856442pjq.127.1643046468276; Mon, 24 Jan 2022 09:47:48 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id q7sm15835082pfs.37.2022.01.24.09.47.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Jan 2022 09:47:47 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH v2 24/83] common/dpaax: simplify kernel compat macros Date: Mon, 24 Jan 2022 09:46:20 -0800 Message-Id: <20220124174719.14417-25-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124174719.14417-1-stephen@networkplumber.org> References: <20220124000518.319850-1-stephen@networkplumber.org> <20220124174719.14417-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 The compat wrapper had unnecessary NULL check and also the emulation of kzalloc() should just use equivalent rte_zmalloc(). Signed-off-by: Stephen Hemminger --- drivers/common/dpaax/compat.h | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/common/dpaax/compat.h b/drivers/common/dpaax/compat.h index 7166f8cceb41..cbabc1588b21 100644 --- a/drivers/common/dpaax/compat.h +++ b/drivers/common/dpaax/compat.h @@ -339,16 +339,9 @@ static inline void copy_bytes(void *dest, const void *src, size_t sz) /* Allocator stuff */ #define kmalloc(sz, t) rte_malloc(NULL, sz, 0) +#define kzalloc(sz, t) rte_zmalloc(NULL, sz, 0) #define vmalloc(sz) rte_malloc(NULL, sz, 0) -#define kfree(p) { if (p) rte_free(p); } -static inline void *kzalloc(size_t sz, gfp_t __foo __rte_unused) -{ - void *ptr = rte_malloc(NULL, sz, 0); - - if (ptr) - memset(ptr, 0, sz); - return ptr; -} +#define kfree(p) rte_free(p) static inline unsigned long get_zeroed_page(gfp_t __foo __rte_unused) { -- 2.30.2