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 37BBCA04A6; Mon, 24 Jan 2022 01:07:37 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E002C42816; Mon, 24 Jan 2022 01:05:49 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id A3EE242827 for ; Mon, 24 Jan 2022 01:05:46 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id q63so9997004pja.1 for ; Sun, 23 Jan 2022 16:05:46 -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=BO3AqzVVc3DmnAjMeswbBoiBeYsZpyffC4GKJ+J74uWDRtpPmf7ZzfjmzG8+8/yZ/j bGfXmMsQpCWpIdMB/G1aR3XcnbT2y5O0Qw8k47G7OoLQzjIML99+Gw5f1Cg8DiLpXc43 FsF73VqCPspDs51XhaTgya1ixcU8r5uR7yxrgjxGQniVpMRcrDnoRP3cixaVJjJEq3+C CCfrYguF0NQoretV4DsaVG10LztKxjd0tTMSlWW/afUrWMalPGI+Hj1fNpWbr+gwlRTD bixctduIiSZNKWdQZHFpT2dd6pOm6I38KeeiDBmIQJuO2Ce03ixze+HbMfp1XUIDR9PJ AF8w== 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=VsVXBnGDIt0ufF+VsAm/s1hMjP6OJqBmbu9Hob+eD+ZokpVb/LbVYZLJI4G2h61Mve QLBBn9QrADg/PLjL8/I9Va0imyJfBBDhQ5/bYnu7ErqsnwFvbE/xEzybNh+KN6aWBABF Y1MyQNtGa1H8NKzyRW1hpDRuZ8fXT9dv88rWg89Jy3ktxXPny2hofuUHE/rvXKhXuYPu 5h5M6FiBEJQXmpCcijYegOq0qWJaf7hV5X4v//dywQmnTHH7H8HJLAiHKraofkvxDAdd SttauWXH2tobAPhfAzXM9QW7XiEKkhvpMsPF5oN8oUDZ2V7A6B6NnCqWnJszYEPAfQAJ VopA== X-Gm-Message-State: AOAM533jIPua5ba3Bji2+kfh09YMjEtmV5Xrcs2upGWXmPUcksWY9xXd 85vO76ZIZTfdOkaftpcDZy5mZoYX1MkVLw== X-Google-Smtp-Source: ABdhPJzLSqeA7bXOyS8kwFgwbT0vCwVuifIc+i/NIdnw4QBhAar/7ZcaO8Yp2YBgFZD1bQPSlhtzUQ== X-Received: by 2002:a17:90a:e17:: with SMTP id v23mr10785191pje.130.1642982745694; Sun, 23 Jan 2022 16:05:45 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id ck21sm10935350pjb.51.2022.01.23.16.05.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 23 Jan 2022 16:05:45 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH 23/82] common/dpaax: simplify kernel compat macros Date: Sun, 23 Jan 2022 16:04:19 -0800 Message-Id: <20220124000518.319850-24-stephen@networkplumber.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220124000518.319850-1-stephen@networkplumber.org> References: <20220124000518.319850-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