diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-01-21 04:47:39 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-01-21 04:47:39 +0000 |
commit | c9cfbb27e39cf0985791ec6f55e61e196b1d079a (patch) | |
tree | c9a5d70eb7bdf1632cc0249bd616898b5fb3b081 /sys/dev | |
parent | 953638cc8846a29c02540e20dd9853c829ca9718 (diff) |
Use ARRAY_SIZE() instead of nitems() to reduce diffs with Linux.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/drm/i915/i915_gem.c | 6 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/intel_bios.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915/intel_modes.c | 10 |
3 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c index 88fefae4abf..08cd5f6b6f9 100644 --- a/sys/dev/pci/drm/i915/i915_gem.c +++ b/sys/dev/pci/drm/i915/i915_gem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i915_gem.c,v 1.62 2013/12/21 15:09:23 kettenis Exp $ */ +/* $OpenBSD: i915_gem.c,v 1.63 2014/01/21 04:47:38 kettenis Exp $ */ /* * Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org> * @@ -2155,7 +2155,7 @@ i915_gem_handle_seqno_wrap(struct drm_device *dev) */ ret = 0; for_each_ring(ring, dev_priv, i) { - for (j = 0; j < nitems(ring->sync_seqno); j++) + for (j = 0; j < ARRAY_SIZE(ring->sync_seqno); j++) ret |= ring->sync_seqno[j] != 0; } if (ret == 0) @@ -2167,7 +2167,7 @@ i915_gem_handle_seqno_wrap(struct drm_device *dev) i915_gem_retire_requests(dev); for_each_ring(ring, dev_priv, i) { - for (j = 0; j < nitems(ring->sync_seqno); j++) + for (j = 0; j < ARRAY_SIZE(ring->sync_seqno); j++) ring->sync_seqno[j] = 0; } diff --git a/sys/dev/pci/drm/i915/intel_bios.c b/sys/dev/pci/drm/i915/intel_bios.c index 3a1ffbefe35..67a5f3bfdc8 100644 --- a/sys/dev/pci/drm/i915/intel_bios.c +++ b/sys/dev/pci/drm/i915/intel_bios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_bios.c,v 1.5 2013/08/13 10:23:50 jsg Exp $ */ +/* $OpenBSD: intel_bios.c,v 1.6 2014/01/21 04:47:38 kettenis Exp $ */ /* * Copyright © 2006 Intel Corporation * @@ -188,7 +188,7 @@ get_lvds_fp_timing(const struct bdb_header *bdb, u16 data_size = ((const u16 *)data)[-1]; /* stored in header */ size_t ofs; - if (index >= nitems(ptrs->ptr)) + if (index >= ARRAY_SIZE(ptrs->ptr)) return NULL; ofs = ptrs->ptr[index].fp_timing_offset; if (ofs < data_ofs || diff --git a/sys/dev/pci/drm/i915/intel_modes.c b/sys/dev/pci/drm/i915/intel_modes.c index 48bbd1ad79e..f20155bb8a1 100644 --- a/sys/dev/pci/drm/i915/intel_modes.c +++ b/sys/dev/pci/drm/i915/intel_modes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: intel_modes.c,v 1.3 2013/08/13 10:23:51 jsg Exp $ */ +/* $OpenBSD: intel_modes.c,v 1.4 2014/01/21 04:47:38 kettenis Exp $ */ /* * Copyright (c) 2007 Dave Airlie <airlied@linux.ie> * Copyright (c) 2007, 2010 Intel Corporation @@ -91,7 +91,7 @@ intel_attach_force_audio_property(struct drm_connector *connector) prop = drm_property_create_enum(dev, 0, "audio", force_audio_names, - nitems(force_audio_names)); + ARRAY_SIZE(force_audio_names)); if (prop == NULL) return; @@ -115,9 +115,9 @@ intel_attach_broadcast_rgb_property(struct drm_connector *connector) prop = dev_priv->broadcast_rgb_property; if (prop == NULL) { prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, - "Broadcast RGB", - broadcast_rgb_names, - nitems(broadcast_rgb_names)); + "Broadcast RGB", + broadcast_rgb_names, + ARRAY_SIZE(broadcast_rgb_names)); if (prop == NULL) return; |