Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp766801lqh; Fri, 31 May 2024 16:52:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7RIkNPCjwGiGH8qRbwfyuBmT7g++sIsPvCHjbjo1FDne+8SekQgISl8zrBI4eafM0Qh6X09qPvHyV/qOUm+Mr4uulRC3gCkEK9YzX3A== X-Google-Smtp-Source: AGHT+IHBkaMD08PZK/QcLUw6X0mix8v7N9PxW897b0Ar8N1oHdBVYVTCjqJR1PfCob2mcz1nHppO X-Received: by 2002:a50:9998:0:b0:57a:2beb:acb5 with SMTP id 4fb4d7f45d1cf-57a3640e83fmr2573410a12.10.1717199538385; Fri, 31 May 2024 16:52:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717199538; cv=pass; d=google.com; s=arc-20160816; b=EJVQjw/KhlBeMvMfeAifMqPDT8fKvf/z6aCR3XxAHSQF6FMK1L2fxq9NAJgVSJk2HJ MPGmZE1qRuGrhaeneAHQd0V+QpsBYpIMJaVXdiz0kBlCDTbAv67Ect/fLZymvtFuze48 y3IQqUjwXr1QR9oMWf05SGVZNN2z0ZTw6OEPZfgevHV6N3DqZ+JybQd2EU2xV5NrJPlg sBNytR/lXbcQx9SAzktmIkVtwOtBqh0mZSuSOCPHYYwL1jdIpU8Lxy1Pg8dXbN88InBC EinSudQy4NLM4jM85I6r6vb4Q8rVzViNiYTYKLBle8aJQUFTL504d8akmO/EELvoEsMa sDhQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=Tfv/vnmuw2YufZGBKZOJtjIGxgQZexP+H8Zy3MNYB2Q=; fh=9z6sotJ7aPdIqnPi974IJy6+8ZpK4OFuKqzqAsB9108=; b=VxTuLEjg3TpSl8vpxYo2+EoWje0cEmGQhEaq+zLsLNrclaZ89Ko0SKJk3CQJHg98Zh VMGCmzlzeXfm5D6mA2vBccDm6uuBqN1XK0napHuiu8F2HrNzIBlqm0GAOcplNSpwJi9o vh0tndhAuRLfb5AeorKnGwV4CkmvpuszqUzxSgp0qIKaUTLL8OWKSHu8N0keiWrudsJx SctdLSsZcg2u7Az7Q1WAr4ZYPWLQzdmviZNyyrRS2VgKwN2CVT/tqVWtcV74dugN3a+T wD/8Dr7fDeVGb61RENkSmJ2irY710CKTau1lW9FQdqBugEGAuNrO8nl3NvPPrgj8aX63 30uA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b="W/NKUwPr"; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5058-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5058-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31ca36c3si1373274a12.489.2024.05.31.16.52.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 16:52:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-5058-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@toblux-com.20230601.gappssmtp.com header.s=20230601 header.b="W/NKUwPr"; arc=pass (i=1 dkim=pass dkdomain=toblux-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-bluetooth+bounces-5058-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-5058-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 0B3C11F27041 for ; Fri, 31 May 2024 23:52:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1135112F5B8; Fri, 31 May 2024 23:52:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b="W/NKUwPr" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C74A12E83C for ; Fri, 31 May 2024 23:52:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717199532; cv=none; b=lDB+eyvbrqFhjYUXdIxLoGXuOi90y9+2hdPMUgFBM+gmkTP6nq0e32LZc45wH8QXDxE1OXo9JUfA7/35heVTgkncGgilcGanSfkvdLSj9XHlcoRl2naY6N9KcSEgAOX39jm3irnK2zX9RUS+WjDLkRPjudMco4bhNwuuN07gyRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717199532; c=relaxed/simple; bh=ZmsfPMM9uOGyUAO76Ls6fr5SxZ5hReAihaGJqwMyKIY=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=lyh1U9yxfNoOBXcuyW63XAsxcEOgZic2FRzI9ErAPCkwUrV4p3u5hdIJtk35MvKCpHIIq7kkghS0pgeWvLS5u8v+HRmrCPyLV0Wleor4xeEtBMz3AlfMO6LFeQHopJm04KaGOavx1+p0rEXODsozwWfNmY2rVSRkHBFDE7AEwaM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com; spf=none smtp.mailfrom=toblux.com; dkim=pass (2048-bit key) header.d=toblux-com.20230601.gappssmtp.com header.i=@toblux-com.20230601.gappssmtp.com header.b=W/NKUwPr; arc=none smtp.client-ip=209.85.208.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=toblux.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=toblux.com Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2e724bc466fso28987951fa.3 for ; Fri, 31 May 2024 16:52:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toblux-com.20230601.gappssmtp.com; s=20230601; t=1717199529; x=1717804329; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Tfv/vnmuw2YufZGBKZOJtjIGxgQZexP+H8Zy3MNYB2Q=; b=W/NKUwPrj21LIGBdjBn4CeP9MbrpMRX39ByWVXTGLY5hHdoSHGexTclVwDeNYHlI0/ BX1X+U3Ow5cMDF5oRX1D0iq10jGnYtSEtymZnPsqqYoA/EZz8bhYCqhoce075WIfQTD4 v+zyvcI8qKCI8k8P9updtEb2oHCaD/Ay/iJqwtTbO22zEFO3/sj1PP2oS1BRgrUMbpkE fYlRFge2SrbAg5rPxX44dQ8m0YUSw1QkPor7ZQzE/bwoZckt0/czxTslFOKbI2KfIznI yuphxT4jKhMz8B2wKdVvqh2W/3pVH7knk2oXUmWsyXdMUAcVrShrd/hggenSo/78cPXJ 2xhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717199529; x=1717804329; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Tfv/vnmuw2YufZGBKZOJtjIGxgQZexP+H8Zy3MNYB2Q=; b=c5IdiqbVUqfz/7syoapBFnvD4TVGqhVeIjblQ2iBmo+kGMgQcRQXoDXBnYjGFOhFLm pRN5dJX4X3bKDGMDXlTu49zdpSKjNXm7bYjlbOBRT3yYmg7dtOaIVO2Ia4bzIHNdTHTp lfUtwqFvaXCpMkQCLh4ntM7VJwR9VVOUj6beb/dC6mh6Pv/NNmXsFQoPoJ69dFXhCNZU 5NCre4xFC+AWq24TUl3zdChfElpF91l4HOA1kdG0DynuywmZgmgA3RSCFyVc3t6FKfgu /VUnCY7y8tw+uc0rSscAG18JHhpPj6k5NyzDtaPSg2AStTnQMHAntPCLp3PQYcrxI6GC EH8w== X-Gm-Message-State: AOJu0YwJDiU1mSGZx4sgm6GY7kDbTEpjXqc8UH6T8gBkBcZemtz6xRjC LrZpX9PfrCfaqDxy5WGdtTTe5KEcG6G5vJjoO4ni0kCoxfBAVYy9g30t3e7gDKBeGlAECa7htiG WTBw= X-Received: by 2002:a2e:96d6:0:b0:2ea:906e:6ac7 with SMTP id 38308e7fff4ca-2ea9516109bmr27097691fa.22.1717199528652; Fri, 31 May 2024 16:52:08 -0700 (PDT) Received: from fedora.fritz.box (aftr-82-135-80-160.dynamic.mnet-online.de. [82.135.80.160]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57a31c9ea4bsm1492064a12.97.2024.05.31.16.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 16:52:08 -0700 (PDT) From: Thorsten Blum To: Marcel Holtmann , Luiz Augusto von Dentz Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Thorsten Blum Subject: [PATCH] Bluetooth: btintel_pcie: Remove unnecessary memset(0) calls Date: Sat, 1 Jun 2024 01:51:33 +0200 Message-ID: <20240531235132.664665-2-thorsten.blum@toblux.com> X-Mailer: git-send-email 2.45.1 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Remove memset(0) after dma_alloc_coherent(), which already zeroes out the memory, and fix the following two Coccinelle/coccicheck warnings reported by zalloc-simple.cocci: btintel_pcie.c:837:19-37: WARNING: dma_alloc_coherent used in /* Allocate full chunk of data buffer for DMA first and do indexing and * initialization next, so it can be freed easily */ rxq->buf_v_addr already zeroes out memory, so memset is not needed btintel_pcie.c:792:19-37: WARNING: dma_alloc_coherent used in /* Allocate full chunk of data buffer for DMA first and do indexing and * initialization next, so it can be freed easily */ txq->buf_v_addr already zeroes out memory, so memset is not needed Signed-off-by: Thorsten Blum --- drivers/bluetooth/btintel_pcie.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c index 5b6805d87fcf..237d4b27f5d8 100644 --- a/drivers/bluetooth/btintel_pcie.c +++ b/drivers/bluetooth/btintel_pcie.c @@ -797,7 +797,6 @@ static int btintel_pcie_setup_txq_bufs(struct btintel_pcie_data *data, kfree(txq->bufs); return -ENOMEM; } - memset(txq->buf_v_addr, 0, txq->count * BTINTEL_PCIE_BUFFER_SIZE); /* Setup the allocated DMA buffer to bufs. Each data_buf should * have virtual address and physical address @@ -842,7 +841,6 @@ static int btintel_pcie_setup_rxq_bufs(struct btintel_pcie_data *data, kfree(rxq->bufs); return -ENOMEM; } - memset(rxq->buf_v_addr, 0, rxq->count * BTINTEL_PCIE_BUFFER_SIZE); /* Setup the allocated DMA buffer to bufs. Each data_buf should * have virtual address and physical address -- 2.45.1