All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: stable@vger.kernel.org, akpm@linux-foundation.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [ 052/153] idr: idr_for_each_entry() macro
Date: Mon, 04 Mar 2013 22:05:52 +0100	[thread overview]
Message-ID: <1607973.Qpkavuy2AM@quad> (raw)
In-Reply-To: <1362373013.3768.295.camel@deadeye.wl.decadent.org.uk>

Sure, here it is:
----------

From: Philipp Reisner <philipp.reisner@linbit.com>

commit 9749f30f1a387070e6e8351f35aeb829eacc3ab6 upstream.

Inspired by the list_for_each_entry() macro

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
---
 include/linux/idr.h |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/idr.h b/include/linux/idr.h
index 255491c..52a9da2 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -152,4 +152,15 @@ void ida_simple_remove(struct ida *ida, unsigned int id);
 
 void __init idr_init_cache(void);
 
+/**
+ * idr_for_each_entry - iterate over an idr's elements of a given type
+ * @idp:     idr handle
+ * @entry:   the type * to use as cursor
+ * @id:      id entry's key
+ */
+#define idr_for_each_entry(idp, entry, id)                             \
+       for (id = 0, entry = (typeof(entry))idr_get_next((idp), &(id)); \
+            entry != NULL;                                             \
+            ++id, entry = (typeof(entry))idr_get_next((idp), &(id)))
+
 #endif /* __IDR_H__ */


  reply	other threads:[~2013-03-04 21:06 UTC|newest]

Thread overview: 172+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04  3:37 [ 000/153] 3.2.40-stable review Ben Hutchings
2013-03-04  3:37 ` [ 001/153] sunvdc: Fix off-by-one in generic_request() Ben Hutchings
2013-03-04  3:37 ` [ 002/153] genirq: Avoid deadlock in spurious handling Ben Hutchings
2013-03-04  3:37 ` [ 003/153] KVM: s390: Handle hosts not supporting s390-virtio Ben Hutchings
2013-03-04  3:37 ` [ 004/153] workqueue: consider work function when searching for busy work items Ben Hutchings
2013-03-04  3:37 ` [ 005/153] [media] v4l: Reset subdev v4l2_dev field to NULL if registration fails Ben Hutchings
2013-03-04  3:37 ` [ 006/153] [media] omap_vout: find_vma() needs ->mmap_sem held Ben Hutchings
2013-03-04  3:37 ` [ 007/153] dca: check against empty dca_domains list before unregister provider Ben Hutchings
2013-03-04  3:37 ` [ 008/153] powerpc/eeh: Fix crash when adding a device in a slot with DDW Ben Hutchings
2013-03-08  2:51   ` Michael Neuling
2013-03-08  3:29     ` Ben Hutchings
2013-03-12  5:31       ` powerpc/eeh: Fix compile error due to missing include file Michael Neuling
2013-03-12 18:14       ` [ 008/153] powerpc/eeh: Fix crash when adding a device in a slot with DDW Thadeu Lima de Souza Cascardo
2013-03-12 23:17         ` Michael Neuling
2013-03-14  0:21           ` Ben Hutchings
2013-03-04  3:37 ` [ 009/153] ext4: return ENOMEM if sb_getblk() fails Ben Hutchings
2013-03-04  3:37 ` [ 010/153] pcmcia/vrc4171: Add missing spinlock init Ben Hutchings
2013-03-04  3:37 ` [ 011/153] [PARISC] Purge existing TLB entries in set_pte_at and ptep_set_wrprotect Ben Hutchings
2013-03-04  3:37 ` [ 012/153] ARM: PXA3xx: program the CSMSADRCFG register Ben Hutchings
2013-03-04  3:37 ` [ 013/153] USB: option: add and update Alcatel modems Ben Hutchings
2013-03-04  3:37 ` [ 014/153] quota: autoload the quota_v2 module for QFMT_VFS_V1 quota format Ben Hutchings
2013-03-04  3:37 ` [ 015/153] ext4: fix possible use-after-free with AIO Ben Hutchings
2013-03-04  3:37 ` [ 016/153] s390/kvm: Fix store status for ACRS/FPRS Ben Hutchings
2013-03-04  3:37 ` [ 017/153] staging: comedi: disallow COMEDI_DEVCONFIG on non-board minors Ben Hutchings
2013-03-04  3:37 ` [ 018/153] ALSA: usb-audio: fix Roland A-PRO support Ben Hutchings
2013-03-04  3:37 ` [ 019/153] x86-32, mm: Rip out x86_32 NUMA remapping code Ben Hutchings
2013-03-04  3:37 ` [ 020/153] ALSA: hda - Release assigned pin/cvt at error path of hdmi_pcm_open() Ben Hutchings
2013-03-04  3:37 ` [ 021/153] ext4: fix race in ext4_mb_add_n_trim() Ben Hutchings
2013-03-04  3:37 ` [ 022/153] zram: Fix deadlock bug in partial read/write Ben Hutchings
2013-03-04  3:37 ` [ 023/153] Driver core: treat unregistered bus_types as having no devices Ben Hutchings
2013-03-04  3:37 ` [ 024/153] ALSA: aloop: Fix Oops while PM resume Ben Hutchings
2013-03-04  3:37 ` [ 025/153] UBIFS: fix double free of ubifs_orphan objects Ben Hutchings
2013-03-04  3:37 ` [ 026/153] tty: set_termios/set_termiox should not return -EINTR Ben Hutchings
2013-03-04  3:37 ` [ 027/153] hrtimer: Prevent hrtimer_enqueue_reprogram race Ben Hutchings
2013-03-04  3:37 ` [ 028/153] nfsd: Fix memleak Ben Hutchings
2013-03-04  3:37 ` [ 029/153] staging: comedi: check s->async for poll(), read() and write() Ben Hutchings
2013-03-04  3:37 ` [ 030/153] ACPI: Add DMI entry for Sony VGN-FW41E_H Ben Hutchings
2013-03-04  3:37 ` [ 031/153] vgacon/vt: clear buffer attributes when we load a 512 character font (v2) Ben Hutchings
2013-03-04  3:37 ` [ 032/153] fbcon: dont lose the console font across generic->chip driver switch Ben Hutchings
2013-03-04  3:37 ` [ 033/153] drm/usb: bind driver to correct device Ben Hutchings
2013-03-04  3:37 ` [ 034/153] x86: Do not leak kernel page mapping locations Ben Hutchings
2013-03-04  3:37 ` [ 035/153] timeconst.pl: Eliminate Perl warning Ben Hutchings
2013-03-04  3:37 ` [ 036/153] fb: rework locking to fix lock ordering on takeover Ben Hutchings
2013-03-04  3:37 ` [ 037/153] fb: Yet another band-aid for fixing lockdep mess Ben Hutchings
2013-03-04  3:37 ` [ 038/153] p54usb: corrected USB ID for T-Com Sinus 154 data II Ben Hutchings
2013-03-04  3:37 ` [ 039/153] rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id Ben Hutchings
2013-03-04  3:37 ` [ 040/153] rtlwifi: rtl8192cu: Add new USB ID Ben Hutchings
2013-03-04  3:37 ` [ 041/153] USB: storage: properly handle the endian issues of idProduct Ben Hutchings
2013-03-04  3:37 ` [ 042/153] x86/apic: Use x2apic physical mode based on FADT setting Ben Hutchings
2013-03-04  3:37 ` [ 043/153] x86/apic: Work around boot failure on HP ProLiant DL980 G7 Server systems Ben Hutchings
2013-03-04  3:37 ` [ 044/153] ALSA: rme32.c irq enabling after spin_lock_irq Ben Hutchings
2013-03-04  3:37 ` [ 045/153] ALSA: ali5451: remove irq enabling in pointer callback Ben Hutchings
2013-03-04  3:37 ` [ 046/153] drivers/rtc/rtc-pl031.c: restore ST variant functionality Ben Hutchings
2013-03-04  3:37 ` [ 047/153] x86: Hyper-V: register clocksource only if its advertised Ben Hutchings
2013-03-04  3:37 ` [ 048/153] x86/mm: Check if PUD is large when validating a kernel address Ben Hutchings
2013-03-04  3:37 ` [ 049/153] Revert "drm: Add EDID_QUIRK_FORCE_REDUCED_BLANKING for ASUS VW222S" Ben Hutchings
2013-03-04  3:37 ` [ 050/153] USB: option: add Yota / Megafon M100-1 4g modem Ben Hutchings
2013-03-04  3:37 ` [ 051/153] USB: serial: fix null-pointer dereferences on disconnect Ben Hutchings
2013-03-04  3:37 ` [ 052/153] idr: idr_for_each_entry() macro Ben Hutchings
2013-03-04  4:56   ` Ben Hutchings
2013-03-04 21:05     ` Philipp Reisner [this message]
2013-03-05  5:24       ` Ben Hutchings
2013-03-04  3:38 ` [ 053/153] pps: Add pps_lookup_dev() function Ben Hutchings
2013-03-04  3:38 ` [ 054/153] pps: Use pps_lookup_dev to reduce ldisc coupling Ben Hutchings
2013-03-04  3:38 ` [ 055/153] pps: Fix a use-after free bug when unregistering a source Ben Hutchings
2013-03-04  3:38 ` [ 056/153] PCI/PM: Clean up PME state when removing a device Ben Hutchings
2013-03-04  3:38 ` [ 057/153] USB: option: add Huawei "ACM" devices using protocol = vendor Ben Hutchings
2013-03-04  3:38 ` [ 058/153] efi: Clear EFI_RUNTIME_SERVICES rather than EFI_BOOT by "noefi" boot parameter Ben Hutchings
2013-03-04  3:38 ` [ 059/153] ARM: samsung: fix assembly syntax for new gas Ben Hutchings
2013-03-04  3:38 ` [ 060/153] ARM: w90x900: fix legacy assembly syntax Ben Hutchings
2013-03-04  3:38 ` [ 061/153] USB: ehci-omap: Fix autoloading of module Ben Hutchings
2013-03-04  3:38 ` [ 062/153] USB: usb-storage: unusual_devs update for Super TOP SATA bridge Ben Hutchings
2013-03-04  3:38 ` [ 063/153] posix-cpu-timers: Fix nanosleep task_struct leak Ben Hutchings
2013-03-04  3:38 ` [ 064/153] svcrpc: make svc_age_temp_xprts enqueue under sv_lock Ben Hutchings
2013-03-04  3:38 ` [ 065/153] NFSv4.1: Dont decode skipped layoutgets Ben Hutchings
2013-03-04  3:38 ` [ 066/153] umount oops when remove blocklayoutdriver first Ben Hutchings
2013-03-04  3:38 ` [ 067/153] cgroup: fix exit() vs rmdir() race Ben Hutchings
2013-03-04  3:38 ` [ 068/153] cpuset: fix cpuset_print_task_mems_allowed() vs rename() race Ben Hutchings
2013-03-04  3:38 ` [ 069/153] ext4: fix xattr block allocation/release with bigalloc Ben Hutchings
2013-03-04  3:38 ` [ 070/153] mm: fix pageblock bitmap allocation Ben Hutchings
2013-03-04  3:38 ` [ 071/153] rtlwifi: usb: allocate URB control message setup_packet and data buffer separately Ben Hutchings
2013-03-04  3:38 ` [ 072/153] target: Fix lookup of dynamic NodeACLs during cached demo-mode operation Ben Hutchings
2013-03-04  3:38 ` [ 073/153] target: Add missing mapped_lun bounds checking during make_mappedlun setup Ben Hutchings
2013-03-04  3:38 ` [ 074/153] ftrace: Call ftrace cleanup module notifier after all other notifiers Ben Hutchings
2013-03-04  3:38 ` [ 075/153] b43: Increase number of RX DMA slots Ben Hutchings
2013-03-04  3:38 ` [ 076/153] NLM: Ensure that we resend all pending blocking locks after a reclaim Ben Hutchings
2013-03-04  3:38 ` [ 077/153] ALSA: hda - hdmi: ELD shouldnt be valid after unplug Ben Hutchings
2013-03-04  3:38 ` [ 078/153] xen-blkback: do not leak mode property Ben Hutchings
2013-03-04  3:38 ` [ 079/153] drm: dont add inferred modes for monitors that dont support them Ben Hutchings
2013-03-04  3:38 ` [ 080/153] drm/i915: disable shared panel fitter for pipe Ben Hutchings
2013-03-04  3:38 ` [ 081/153] drm/i915: add missing \n to UTS_RELEASE in the error_state Ben Hutchings
2013-03-04  3:38 ` [ 082/153] drm/i915: Set i9xx sdvo clock limits according to specifications Ben Hutchings
2013-03-04  3:38 ` [ 083/153] intel/iommu: force writebuffer-flush quirk on Gen 4 Chipsets Ben Hutchings
2013-03-04  3:38 ` [ 084/153] xen: close evtchn port if binding to irq fails Ben Hutchings
2013-03-04  3:38 ` [ 085/153] xen: Send spinlock IPI to all waiters Ben Hutchings
2013-03-04  3:38 ` [ 086/153] x86, efi: Make "noefi" really disable EFI runtime serivces Ben Hutchings
2013-03-04  3:38 ` [ 087/153] ALSA: usb: Fix Processing Unit Descriptor parsers Ben Hutchings
2013-03-04  3:38 ` [ 088/153] posix-timer: Dont call idr_find() with out-of-range ID Ben Hutchings
2013-03-04  3:38 ` [ 089/153] inotify: remove broken mask checks causing unmount to be EINVAL Ben Hutchings
2013-03-04  3:38 ` [ 090/153] fs/block_dev.c: page cache wrongly left invalidated after revalidate_disk() Ben Hutchings
2013-03-04  3:38 ` [ 091/153] ocfs2: unlock super lock if lockres refresh failed Ben Hutchings
2013-03-04  3:38 ` [ 092/153] drivers/video/backlight/adp88?0_bl.c: fix resume Ben Hutchings
2013-03-04  3:38 ` [ 093/153] ALSA: hda - hdmi: Make jacks phantom, if theyre not detectable Ben Hutchings
2013-03-04  5:13   ` Ben Hutchings
2013-03-04  7:46     ` David Henningsson
2013-03-04  7:48       ` Greg Kroah-Hartman
2013-03-04  7:55         ` David Henningsson
2013-03-04 13:57       ` Ben Hutchings
2013-03-04  3:38 ` [ 094/153] ext4: fix free clusters calculation in bigalloc filesystem Ben Hutchings
2013-03-04  3:38 ` [ 095/153] fs: Fix possible use-after-free with AIO Ben Hutchings
2013-03-04  3:38 ` [ 096/153] powerpc/kexec: Disable hard IRQ before kexec Ben Hutchings
2013-03-04  3:38 ` [ 097/153] mm: mmu_notifier: have mmu_notifiers use a global SRCU so they may safely schedule Ben Hutchings
2013-03-04  3:38 ` [ 098/153] mm: mmu_notifier: make the mmu_notifier srcu static Ben Hutchings
2013-03-04  3:38 ` [ 099/153] mmu_notifier_unregister NULL Pointer deref and multiple ->release() callouts Ben Hutchings
2013-03-04  3:38 ` [ 100/153] mm/fadvise.c: drain all pagevecs if POSIX_FADV_DONTNEED fails to discard all pages Ben Hutchings
2013-03-04  3:38 ` [ 101/153] tmpfs: fix use-after-free of mempolicy object Ben Hutchings
2013-03-04  3:38 ` [ 102/153] mmc: sdhci-esdhc-imx: fix host version read Ben Hutchings
2013-03-04  3:38 ` [ 103/153] doc, xen: Mention earlyprintk=xen in the documentation Ben Hutchings
2013-03-04  3:38 ` [ 104/153] doc, kernel-parameters: Document console=hvc<n> Ben Hutchings
2013-03-04  3:38 ` [ 105/153] ocfs2: fix possible use-after-free with AIO Ben Hutchings
2013-03-04  3:38 ` [ 106/153] x86: Make sure we can boot in the case the BDA contains pure garbage Ben Hutchings
2013-03-04  3:38 ` [ 107/153] ocfs2: fix ocfs2_init_security_and_acl() to initialize acl correctly Ben Hutchings
2013-03-04  3:38 ` [ 108/153] ocfs2: ac->ac_allow_chain_relink=0 wont disable group relink Ben Hutchings
2013-03-04  3:38 ` [ 109/153] block: fix ext_devt_idr handling Ben Hutchings
2013-03-04  3:38 ` [ 110/153] idr: fix a subtle bug in idr_get_next() Ben Hutchings
2013-03-04  3:38 ` [ 111/153] block: fix synchronization and limit check in blk_alloc_devt() Ben Hutchings
2013-03-04  3:38 ` [ 112/153] firewire: add minor number range check to fw_device_init() Ben Hutchings
2013-03-04  3:39 ` [ 113/153] idr: make idr_get_next() good for rcu_read_lock() Ben Hutchings
2013-03-04  3:39 ` [ 114/153] idr: fix top layer handling Ben Hutchings
2013-03-04 17:37   ` Luis Henriques
2013-03-04  3:39 ` [ 115/153] sysctl: fix null checking in bin_dn_node_address() Ben Hutchings
2013-03-04  3:39 ` [ 116/153] nbd: fsync and kill block device on shutdown Ben Hutchings
2013-03-04  3:39 ` [ 117/153] igb: Remove artificial restriction on RQDPC stat reading Ben Hutchings
2013-03-04  3:39 ` [ 118/153] drm/radeon/evergreen+: wait for the MC to settle after MC blackout Ben Hutchings
2013-03-04  3:39 ` [ 119/153] s390/timer: avoid overflow when programming clock comparator Ben Hutchings
2013-03-04  3:39 ` [ 120/153] unbreak automounter support on 64-bit kernel with 32-bit userspace (v2) Ben Hutchings
2013-03-04  3:39 ` [ 121/153] xen-pciback: rate limit error messages from xen_pcibk_enable_msi{,x}() Ben Hutchings
2013-03-04  3:39 ` [ 122/153] bridge: set priority of STP packets Ben Hutchings
2013-03-04  3:39 ` [ 123/153] xen-netback: correctly return errors from netbk_count_requests() Ben Hutchings
2013-03-04  3:39 ` [ 124/153] xen-netback: cancel the credit timer when taking the vif down Ben Hutchings
2013-03-04  3:39 ` [ 125/153] ipv4: fix a bug in ping_err() Ben Hutchings
2013-03-04  3:39 ` [ 126/153] ipv6: use a stronger hash for tcp Ben Hutchings
2013-03-04  3:39 ` [ 127/153] staging: comedi: ni_labpc: correct differential channel sequence for AI commands Ben Hutchings
2013-03-04  3:39 ` [ 128/153] staging: comedi: ni_labpc: set up command4 register *after* command3 Ben Hutchings
2013-03-04  3:39 ` [ 129/153] pstore: Avoid deadlock in panic and emergency-restart path Ben Hutchings
2013-03-04  3:39 ` [ 130/153] ata_piix: IDE-mode SATA patch for Intel Lynx Point DeviceIDs Ben Hutchings
2013-03-04  3:39 ` [ 131/153] ata_piix: IDE-mode SATA patch for Intel DH89xxCC DeviceIDs Ben Hutchings
2013-03-04  3:39 ` [ 132/153] ata_piix: Add Device IDs for Intel Lynx Point-LP PCH Ben Hutchings
2013-03-04  3:39 ` [ 133/153] ata_piix: IDE-mode SATA patch for Intel Avoton DeviceIDs Ben Hutchings
2013-03-04  3:39 ` [ 134/153] ata_piix: Add Device IDs for Intel Wellsburg PCH Ben Hutchings
2013-03-04  3:39 ` [ 135/153] [hid] usb hid quirks for Masterkit MA901 usb radio Ben Hutchings
2013-03-04  3:39 ` [ 136/153] [media] Avoid sysfs oops when an rc_devs raw device is absent Ben Hutchings
2013-03-04  3:39 ` [ 137/153] [media] rc: unlock on error in show_protocols() Ben Hutchings
2013-03-04  3:39 ` [ 138/153] vhost: fix length for cross region descriptor Ben Hutchings
2013-03-04  3:39 ` [ 139/153] 8250: use correct value for PORT_BRCM_TRUMANAGE Ben Hutchings
2013-03-04  3:39 ` [ 140/153] usb: Add quirk detection based on interface information Ben Hutchings
2013-03-04  3:39 ` [ 141/153] usb: Add USB_QUIRK_RESET_RESUME for all Logitech UVC webcams Ben Hutchings
2013-03-04  3:39 ` [ 142/153] speakup: lower default software speech rate Ben Hutchings
2013-03-04  3:39 ` [ 143/153] asus-laptop: Do not call HWRS on init Ben Hutchings
2013-03-04  3:39 ` [ 144/153] usermodehelper: introduce umh_complete(sub_info) Ben Hutchings
2013-03-04  3:39 ` [ 145/153] usermodehelper: implement UMH_KILLABLE Ben Hutchings
2013-03-04  3:39 ` [ 146/153] usermodehelper: ____call_usermodehelper() doesnt need do_exit() Ben Hutchings
2013-03-04  3:39 ` [ 147/153] kmod: introduce call_modprobe() helper Ben Hutchings
2013-03-04  3:39 ` [ 148/153] kmod: make __request_module() killable Ben Hutchings
2013-03-04  3:39 ` [ 149/153] exec: use -ELOOP for max recursion depth Ben Hutchings
2013-03-04  3:39 ` [ 150/153] fs: cachefiles: add support for large files in filesystem caching Ben Hutchings
2013-03-04  3:39 ` [ 151/153] ext4: rewrite punch hole to use ext4_ext_remove_space() Ben Hutchings
2013-03-04  3:39 ` [ 152/153] ext4: fix hole punch failure when depth is greater than 0 Ben Hutchings
2013-03-04  3:39 ` [ 153/153] ext4: fix kernel BUG on large-scale rm -rf commands Ben Hutchings
2013-03-04  4:29 ` [ 000/153] 3.2.40-stable review Ben Hutchings
2013-03-05 14:07 ` Satoru Takeuchi
2013-03-05 14:31   ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1607973.Qpkavuy2AM@quad \
    --to=philipp.reisner@linbit.com \
    --cc=akpm@linux-foundation.org \
    --cc=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.