From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D784910E0 for ; Mon, 13 Jan 2025 00:13:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736727226; cv=none; b=JHf13ISCNADhLfpDAhT7TRBKZuHjk4qzm7B0hlBIu/Y90R2KM1NRI2ZFEdCtsyi2fOZBEKTvoM//LbnnpHUqr8J13nvtvTCsM9i+HTAfnTThX7hAtWBTfvif/bBiIDcSWA29V4gIWk4xDXPTmGKeFXMJcaaekgZhD+ho4/YfQUo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736727226; c=relaxed/simple; bh=ZlFBYo5h7LGJ1/l/QHz7H3DE/AcrJCuOo/lpN9ULRkM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BxAaRDscU0/NBLJeEuIM+H43aIi+w9ZFT6xSkWhXSZ0/aVJdIzc8XdrZi+/PGQtvA/KnXyLFvBuY797tieoEHIMXexDekbOSiATB0g9G4IqR7bx1k42t4NGlhLJaP6yntFrxRr4yo797V5bLvg76DtblDbr9xzpxLHeY8DYMsKs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=VOPv9KKZ; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="VOPv9KKZ" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1736727213; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dO2Yboz2F3pGEQEYNYbFyosxQ8UlBjN9Z7A4NSykAgU=; b=VOPv9KKZ6cM1Z9qOR2ARV2EPzX7KTc9FGCTBJ+aXjk6BoUprF6pERE/qfbGZGKtBP80Dr3 6gMRAKaMVGMyT7NP8i2/dk8OAN7kR3A/0pPIjoMpxmzCvwlYGnYCVExncePKJ4jVaIQErz FsutSBcB/jHRgLp785kBZVsDqJDceUc= From: Thorsten Blum To: Herve Codina , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: Thorsten Blum , linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: codecs: Use ARRAY_SIZE() to calculate PEB2466_TLV_SIZE Date: Mon, 13 Jan 2025 01:10:01 +0100 Message-ID: <20250113001001.400669-2-thorsten.blum@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT Use the ARRAY_SIZE() macro to calculate PEB2466_TLV_SIZE and improve the code's readability. Signed-off-by: Thorsten Blum --- sound/soc/codecs/peb2466.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sound/soc/codecs/peb2466.c b/sound/soc/codecs/peb2466.c index bb9ca6354ae1..a989cfe058f0 100644 --- a/sound/soc/codecs/peb2466.c +++ b/sound/soc/codecs/peb2466.c @@ -26,8 +26,7 @@ struct peb2466_lookup { unsigned int count; }; -#define PEB2466_TLV_SIZE (sizeof((unsigned int []){TLV_DB_SCALE_ITEM(0, 0, 0)}) / \ - sizeof(unsigned int)) +#define PEB2466_TLV_SIZE ARRAY_SIZE(((unsigned int[]){TLV_DB_SCALE_ITEM(0, 0, 0)})) struct peb2466_lkup_ctrl { int reg; -- 2.47.1