Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2284968pxb; Fri, 25 Mar 2022 14:38:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLdZTqJ2N74CcvWP9dP0tvSFR79QcI8UadUVO0cNXVAK1wxEKqYZHzzglExvjNEbZ1bgLz X-Received: by 2002:a05:6a00:194b:b0:4fb:4ac:de57 with SMTP id s11-20020a056a00194b00b004fb04acde57mr7016925pfk.17.1648244323640; Fri, 25 Mar 2022 14:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648244323; cv=none; d=google.com; s=arc-20160816; b=kb41OOELAbvsdsWEKLwPqTRh/yuD3khL75yiFgNLIUZ2omtTL9mTEm3yDx0tcjYQTm Rbs/hx6gHhhOgY1SUAv6LysdLywGmTjD4TMH6ZzBZ5/yUHXLtbig7fvnsIJrSHvj2Hro terK1W5EWNm628MO6fB9cP2qw1qeINBi2nEEZnqHhD09aguZj7Ibatjuay817LgobWMx aF2xclMVnmZ+XhusFUhGg7M/eOYnyS0aKvcw/ZG77WA1vcT5wFDy0j5tA5ZDjkqZQMLd dUvriIYjd7kJBNS7RSpSt0d+FcggMeqtEHkFnl+5iVzVEM/xu6y8M8ed3qJczEIoPb61 UnbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/WtNl/o5Pmcjf/ZiCwFNzmbnFHHYcHXG9vVzdZA7COQ=; b=HgH5nurzjWnR9w8KBfZadPd87rlQt9pNIaNAsVoTkTPFREirfH//oWqTKzobSo0Pjk UCGGO9m9CfVdZEUiWs8xraev9dZ018SkBp9iH1pF7e4104TgtETMHp7kkBsiC+DKoCKf X72Aw05+PousrS+MMQVmounKtBcbVz3Db8WxxZp+OqS07N8DglhfL5hh9kSxYYIBlw8r GfpX2J2jILL7R5wokalDW1GHLUyIMFhnoyvE+jnD9tjNMUuscIyLzdZrIwXlhVXsybw8 NdEHJlCqu/K+jnhdwYqz4xgohWtalFIs8hUTHq2+/4x0BDyD5/Nj2x8O5qpClsgyO97R j9wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=bNgPiYZZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id x8-20020a170902ec8800b00153b2d16462si3700236plg.106.2022.03.25.14.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 14:38:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=bNgPiYZZ; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAC95EBADE; Fri, 25 Mar 2022 14:10:50 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233309AbiCYVMV (ORCPT + 70 others); Fri, 25 Mar 2022 17:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233257AbiCYVMR (ORCPT ); Fri, 25 Mar 2022 17:12:17 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD7CF1FE54C for ; Fri, 25 Mar 2022 14:10:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/WtNl/o5Pmcjf/ZiCwFNzmbnFHHYcHXG9vVzdZA7COQ=; b=bNgPiYZZgOCGTr5wRh7JAwpsnw vOCmNufBjt4N4fuYVPRSDXIhjRDvmm9jI/IT5d6V7Ef/zvY+wqa4WKtAxVug9EkEItbaY9RO3gFmE nsBP6Sfl8U5l+O0djbhd2Vd2fDMDaIvhaGifg1WYrBLqn9l/+ulIm7aqu6GN8qr1LWCQ=; Received: from p200300daa70ef200dc11dea3d730df97.dip0.t-ipconnect.de ([2003:da:a70e:f200:dc11:dea3:d730:df97] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1nXrCh-0001fW-ST for linux-wireless@vger.kernel.org; Fri, 25 Mar 2022 22:10:39 +0100 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 4/8] mt76: dma: use kzalloc instead of devm_kzalloc for txwi Date: Fri, 25 Mar 2022 22:10:27 +0100 Message-Id: <20220325211031.24171-4-nbd@nbd.name> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220325211031.24171-1-nbd@nbd.name> References: <20220325211031.24171-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org dma unmap is already needed for cleanup anyway, so we don't need the extra tracking and can save a bit of memory here Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/dma.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/dma.c b/drivers/net/wireless/mediatek/mt76/dma.c index 02daeefb0761..09dc37bbf112 100644 --- a/drivers/net/wireless/mediatek/mt76/dma.c +++ b/drivers/net/wireless/mediatek/mt76/dma.c @@ -16,7 +16,7 @@ mt76_alloc_txwi(struct mt76_dev *dev) int size; size = L1_CACHE_ALIGN(dev->drv->txwi_size + sizeof(*t)); - txwi = devm_kzalloc(dev->dev, size, GFP_ATOMIC); + txwi = kzalloc(size, GFP_ATOMIC); if (!txwi) return NULL; @@ -73,9 +73,11 @@ mt76_free_pending_txwi(struct mt76_dev *dev) struct mt76_txwi_cache *t; local_bh_disable(); - while ((t = __mt76_get_txwi(dev)) != NULL) + while ((t = __mt76_get_txwi(dev)) != NULL) { dma_unmap_single(dev->dev, t->dma_addr, dev->drv->txwi_size, DMA_TO_DEVICE); + kfree(mt76_get_txwi_ptr(dev, t)); + } local_bh_enable(); } -- 2.35.1