Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1657408

[tip:locking/core] tools/lib/lockdep: Define the ARRAY_SIZE() macro

From tip-bot for Ben Hutchings <tipbot@zytor.com>
Newsgroups linux.kernel
Subject [tip:locking/core] tools/lib/lockdep: Define the ARRAY_SIZE() macro
Date 2017-06-05 11:10 +0200
Message-ID <tOWbn-Zl-5@gated-at.bofh.it> (permalink)
References <tL0wW-8li-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Commit-ID:  108744c45fd8a51e763e976d9e5b2cc265d4a847
Gitweb:     http://git.kernel.org/tip/108744c45fd8a51e763e976d9e5b2cc265d4a847
Author:     Ben Hutchings <ben@decadent.org.uk>
AuthorDate: Thu, 25 May 2017 12:58:34 +0000
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Mon, 5 Jun 2017 09:28:04 +0200

tools/lib/lockdep: Define the ARRAY_SIZE() macro

lockdep.c now uses ARRAY_SIZE().

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: a.p.zijlstra@chello.nl
Fixes: 75dd602a5198 ("lockdep: Fix lock_chain::base size")
Link: http://lkml.kernel.org/r/20170525130005.5947-4-alexander.levin@verizon.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 tools/lib/lockdep/uinclude/linux/kernel.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/lib/lockdep/uinclude/linux/kernel.h b/tools/lib/lockdep/uinclude/linux/kernel.h
index 276c7a8..da87bd9 100644
--- a/tools/lib/lockdep/uinclude/linux/kernel.h
+++ b/tools/lib/lockdep/uinclude/linux/kernel.h
@@ -7,6 +7,8 @@
 #include <linux/hardirq.h>
 #include <linux/kern_levels.h>
 
+#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+
 #ifndef container_of
 #define container_of(ptr, type, member) ({			\
 	const typeof(((type *)0)->member) * __mptr = (ptr);	\

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/21] liblockdep fixes for v4.12 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
  [PATCH 10/21] tools: add install make target for liblockdep "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
    [tip:locking/core] tools: Add install make target for liblockdep tip-bot for Alexander Sverdlin <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 06/21] liblockdep: Fix 'set but not used' warnings "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
    [tip:locking/core] tools/lib/lockdep: Fix 'set but not used'  warnings tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 03/21] liblockdep: Define the ARRAY_SIZE() macro "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:00 +0200
    [tip:locking/core] tools/lib/lockdep: Define the ARRAY_SIZE() macro tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 11/21] tools: liblockdep: Don't mix fd-based and stream IO "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Don't mix fd-based and stream  IO tip-bot for Alexander Sverdlin <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 19/21] tools include: add IS_ERR_OR_NULL to err.h "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/include: Add IS_ERR_OR_NULL to err.h "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 09/21] MAINTAINERS: update email for Sasha Levin "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] MAINTAINERS: Update email for Sasha Levin "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 04/21] liblockdep: Enable -Wall by default "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Enable -Wall by default tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  [PATCH 12/21] tools: liblockdep: fix compilation for 4.11 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Fix compilation for 4.11 "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 21/21] tools: liblockdep: hide liblockdep output from test  results "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Hide liblockdep output from  test results "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 14/21] tools: liblockdep: Remove double-quotes from soname "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Remove double-quotes from  soname tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 17/21] tools: liblockdep: include err.h "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Include err.h "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 15/21] tools: liblockdep: Use LDFLAGS "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Use LDFLAGS tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 20/21] tools: liblockdep: add dummy current_gfp_context() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Add dummy  current_gfp_context() "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 18/21] tools: liblockdep: add empty  __is_[module,kernel]_percpu_address "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Add empty  __is_[module,kernel]_percpu_address "tip-bot for Levin, Alexander (Sasha Levin)" <tipbot@zytor.com> - 2017-06-05 11:20 +0200
  [PATCH 07/21] liblockdep: Fix 'defined but not used' warning for  init_utsname() "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-25 15:10 +0200
    [tip:locking/core] tools/lib/lockdep: Fix 'defined but not used'  warning for init_utsname() tip-bot for Ben Hutchings <tipbot@zytor.com> - 2017-06-05 11:10 +0200
  Re: [PATCH 00/21] liblockdep fixes for v4.12 Ingo Molnar <mingo@kernel.org> - 2017-05-26 09:00 +0200
    Re: [PATCH 00/21] liblockdep fixes for v4.12 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-26 13:00 +0200
      Re: [PATCH 00/21] liblockdep fixes for v4.12 Ingo Molnar <mingo@kernel.org> - 2017-05-26 13:30 +0200
        Re: [PATCH 00/21] liblockdep fixes for v4.12 "Levin, Alexander (Sasha Levin)" <alexander.levin@verizon.com> - 2017-05-26 13:50 +0200
          Re: [PATCH 00/21] liblockdep fixes for v4.12 Ingo Molnar <mingo@kernel.org> - 2017-05-28 11:20 +0200

csiph-web