From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A46DBA0527; Wed, 15 Jul 2020 15:32:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 784361BEB2; Wed, 15 Jul 2020 15:32:28 +0200 (CEST) Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by dpdk.org (Postfix) with ESMTP id 66F871BEB1 for ; Wed, 15 Jul 2020 15:32:27 +0200 (CEST) Received: by mail-ed1-f67.google.com with SMTP id dm19so1590573edb.13 for ; Wed, 15 Jul 2020 06:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=MFY9FcK2TGu14w5F3Na1lGk4t/oh/JiJ1NM04sdRUK8=; b=io8WElgVyDsY105ycHrFqPwGxPEqi8C7XrRBKTFxNnOC46BD2j62naOzR5pMhaPXhH bGmGG2i43Q9r1sjYzTn1pfr1OZxkT6gN3ApeskaxxNoGl4zjm+HZW2h7QOSNr5yPnR3P 7fDDnIE/SoIfsuWZyao/VuGDJwUXP8l8XzEpkF91HcJ+umg4dcDuC7RwUPqiHJssjxd7 4bCQMcS/YSGvx7mqUOLQ6R2k8pMvPXu9uz3Y8z7YDQc9jSr5yFpaWDAFpfgyXa2TIKpG mFoToP9UXjI43tZbRpOwJrv3vIENywEb9K6is9GrVdRhzqqeR6k06c7A4+a1VNlDOvZu 6LGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MFY9FcK2TGu14w5F3Na1lGk4t/oh/JiJ1NM04sdRUK8=; b=gp5mlZTfJLd/+fHhxAPgaoDOB0U+lxH4oAyr7KNM/LMt8sBcXDAYyHVJdLz9NGrbj7 Pe6bSI+IZziUTyy+ic4AGa2PVaqpENV8ACRXbIoxSUYxyjavD5aZtzPmdoO4pqrsLVcQ OT9nrUkTNyAk9uq05UyR8uYoGpJAxf673owLBtJMSCxdkR66sEKSjrdtiFI+p4+rlOPN 4L8DZWaZT3QIBHrqluEgsa1O5ZIE+FSUeI6ipYGqKLtWmqafd7HlN4NBzPqoxQuPBBDj F54VUXQ4QvZm7a+mWoJfINpCKOGrsWJJhOJBlUMx1Sv1aPr93J/gZD6iFYAKPc1J9OxV Bx7w== X-Gm-Message-State: AOAM530L/WWDZG255NC46iubqIlFJ4i6m9tSaLFPMceQ0/a9VVbPvJcp oFGPz75+PDOUtmlWsl2nJ8IaVw== X-Google-Smtp-Source: ABdhPJyRYBNz4tBU+fGvgseRrXfJ1i6CACiPh+n8EWV1gIiZrKzz2EeEtvw7XovVqv2ihUC/FZfgoA== X-Received: by 2002:a50:fd12:: with SMTP id i18mr9822375eds.371.1594819947092; Wed, 15 Jul 2020 06:32:27 -0700 (PDT) Received: from localhost.localdomain ([39.40.65.183]) by smtp.gmail.com with ESMTPSA id cd11sm2082895ejb.57.2020.07.15.06.32.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 06:32:26 -0700 (PDT) From: Sarosh Arif To: anatoly.burakov@intel.com Cc: dev@dpdk.org, Sarosh Arif Date: Wed, 15 Jul 2020 18:31:36 +0500 Message-Id: <20200715133136.31986-1-sarosh.arif@emumba.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] lib/librte_eal/common/rte_malloc: remove redundant check for size and alignment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since mallock_socket() always calls malloc_heap_alloc() and this check is present inside malloc_heap_alloc() so there is no need to place it in mallock_socket(). Signed-off-by: Sarosh Arif --- lib/librte_eal/common/rte_malloc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/librte_eal/common/rte_malloc.c b/lib/librte_eal/common/rte_malloc.c index 9d39e58c0..51256117b 100644 --- a/lib/librte_eal/common/rte_malloc.c +++ b/lib/librte_eal/common/rte_malloc.c @@ -61,10 +61,6 @@ malloc_socket(const char *type, size_t size, unsigned int align, { void *ptr; - /* return NULL if size is 0 or alignment is not power-of-2 */ - if (size == 0 || (align && !rte_is_power_of_2(align))) - return NULL; - /* if there are no hugepages and if we are not allocating from an * external heap, use memory from any socket available. checking for * socket being external may return -1 in case of invalid socket, but -- 2.17.1