Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp22071502ybl; Mon, 6 Jan 2020 17:30:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyVk3YuxMNKerTXFQWlddbmcTvTD/l76Wfz6GTjyLRgFKzO/jGvok1gUzDa8nTbP/bk04RJ X-Received: by 2002:a05:6830:1e09:: with SMTP id s9mr102659334otr.139.1578360605928; Mon, 06 Jan 2020 17:30:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578360605; cv=none; d=google.com; s=arc-20160816; b=fsXzdGg1UclufWDJyHpMtFs/NeHT1sSmBZE6S2yJ9u+bG59WBCwXMTn2Ivfyb4H3+Q I1qoiS7IGXH0mCXXsaOg1wWLP6BDIKzS4gl59/JKMr/r8zl68oGtATpd+JLEGQ/tFE6u ipYppga1NWHkn5aE1RZEXXG0xqsqFDFloj0PnZHvPD3lTSn+/sIL/NNnwYWaiBfDYegY Yk7su9G8wWwafDrh9ipjFLfxZB53mLm1tzbt8hdZ9ujmzQBp0ShboTxJTdgRfZmGu0JM VrXJ6yo0XSm7ic6F+ZLg3FG+QJ/VW4d90/TsPt7ZB+J2UiMYlBUEI3wLkqdiSVRfe8ZR 2DBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fxwCpXshPC80zU3jurlPmcnE1obn0BTvu3Xh4TNXwso=; b=hlyi9Z6i4GBxCQWWKjZvwtKmdOKTJKHHTOf64Hu+si/60LzVELSAmfto2q3/OdaJTZ qE9RRlYyfHyC5XL69BwBI7bSUdMWvZf67vOnos401FGrOCo4/rZzgS7ezUYHmqcw359g GpN3dBqfZptQu4H9Efe4oxEmeHGA8jHVgsmk/aDoSW6xNyBbNns7vOvky6yp1ds/Vix5 r5qjhjYcGQIMJ1KaA8aeO9Ww7l4ZUCid63jcrWmViOMvE9lQAVUPSEluZ6kvqiSTCbTT 6w4j6+3KbhSX4FbJLmAlo8yDNwcPyigzvayKAVIA/2PB5KZxmDatvcKSP08HIgda89M+ ELjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UsvFKnIa; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q131si22453339oig.203.2020.01.06.17.29.54; Mon, 06 Jan 2020 17:30:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UsvFKnIa; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727417AbgAGB3n (ORCPT + 99 others); Mon, 6 Jan 2020 20:29:43 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:44861 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727363AbgAGB3n (ORCPT ); Mon, 6 Jan 2020 20:29:43 -0500 Received: by mail-ua1-f67.google.com with SMTP id c14so16676546uaq.11 for ; Mon, 06 Jan 2020 17:29:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fxwCpXshPC80zU3jurlPmcnE1obn0BTvu3Xh4TNXwso=; b=UsvFKnIa9D2YrLu0no2thCY1Wa8jrJyJpojAj4y1+W/hQfJpsV+DTSUfU6GrDETxC6 Fc5r8mcAozgaO7SFCnqTNkY09ILPnffOGTgn19WrapYctSP0hLEVziN2HTVm2swe4R45 EmDEGzEmTAwWF2+xI8YuiJHX7uXhAUqnYqjiA= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=fxwCpXshPC80zU3jurlPmcnE1obn0BTvu3Xh4TNXwso=; b=YW45Gf95RVqlzCayl2nYQXqaccB0zbFQjiczF7j9mzqoUOK69AafeoQwkFIaBPlkX7 4ejGZIzntSPPWoGvpxNXhp8izAoTaO+cC93K35Gts1qnKgLnOfRfmOUTnPoScBkO/AT4 K2gEuQ6OI/2SoSI49r1xDLrT5F0vQzOkyzliyKKIkdqRG4vtC8fENfIotrXpogAF9hN8 FUsXE6YVaYxKodUyokdFZORoyyQX9cb0jsqVnHzk/5nRXpwEpawW4sFltSIzQrd4Oxz9 3aXEcvrZEslIyRHzbqWTEUfgBo3vsvVMIUfnds5mitEEGyCE5EYcwz/9TfM6AAPW/d97 Fuqw== X-Gm-Message-State: APjAAAXYgUreMk4EHERLeJ1gyDD4OxP0YMlAywcqgBXjfyjxEZh2yXmF Tayy3s8H6hLywWrkxd2h4fLV7nu5KaI= X-Received: by 2002:ab0:94:: with SMTP id 20mr60199451uaj.71.1578360581873; Mon, 06 Jan 2020 17:29:41 -0800 (PST) Received: from alain.c.googlers.com.com (239.145.196.35.bc.googleusercontent.com. [35.196.145.239]) by smtp.gmail.com with ESMTPSA id y7sm18784079vkd.38.2020.01.06.17.29.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jan 2020 17:29:41 -0800 (PST) From: Alain Michaud To: linux-bluetooth@vger.kernel.org Cc: marcel@holtmann.org, Alain Michaud Subject: [PATCH v5 2/3] Adding a shared ARRAY_SIZE macro. Date: Tue, 7 Jan 2020 01:28:20 +0000 Message-Id: <20200107012820.158721-2-alainm@chromium.org> X-Mailer: git-send-email 2.24.1.735.g03f4e72817-goog In-Reply-To: <20200107012820.158721-1-alainm@chromium.org> References: <20200107012820.158721-1-alainm@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This will allow other implementations within src/ to use a single definition of the ARRAY_SIZE macro. --- src/shared/util.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/util.h b/src/shared/util.h index 604dc3be4..9193068d1 100644 --- a/src/shared/util.h +++ b/src/shared/util.h @@ -27,6 +27,8 @@ #include #include +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) + #if __BYTE_ORDER == __LITTLE_ENDIAN #define le16_to_cpu(val) (val) #define le32_to_cpu(val) (val) -- 2.24.1.735.g03f4e72817-goog