Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 125c4c70 authored by Fengguang Wu's avatar Fengguang Wu Committed by Linus Torvalds
Browse files

idr: rename MAX_LEVEL to MAX_IDR_LEVEL



To avoid name conflicts:

  drivers/video/riva/fbdev.c:281:9: sparse: preprocessor token MAX_LEVEL redefined

While at it, also make the other names more consistent and add
parentheses.

[akpm@linux-foundation.org: repair fallout]
[sfr@canb.auug.org.au: IB/mlx4: fix for MAX_ID_MASK to MAX_IDR_MASK name change]
Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
Cc: Bernd Petrovitsch <bernd@petrovitsch.priv.at>
Cc: walter harms <wharms@bfs.de>
Cc: Glauber Costa <glommer@parallels.com>
Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b74ca3b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -982,7 +982,7 @@ int i2c_add_numbered_adapter(struct i2c_adapter *adap)

	if (adap->nr == -1) /* -1 means dynamically assign bus id */
		return i2c_add_adapter(adap);
	if (adap->nr & ~MAX_ID_MASK)
	if (adap->nr & ~MAX_IDR_MASK)
		return -EINVAL;

retry:
+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ static int cm_alloc_id(struct cm_id_private *cm_id_priv)
		ret = idr_get_new_above(&cm.local_id_table, cm_id_priv,
					next_id, &id);
		if (!ret)
			next_id = ((unsigned) id + 1) & MAX_ID_MASK;
			next_id = ((unsigned) id + 1) & MAX_IDR_MASK;
		spin_unlock_irqrestore(&cm.lock, flags);
	} while( (ret == -EAGAIN) && idr_pre_get(&cm.local_id_table, GFP_KERNEL) );

+1 −1
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ id_map_alloc(struct ib_device *ibdev, int slave_id, u32 sl_cm_id)
		ret = idr_get_new_above(&sriov->pv_id_table, ent,
					next_id, &id);
		if (!ret) {
			next_id = ((unsigned) id + 1) & MAX_ID_MASK;
			next_id = ((unsigned) id + 1) & MAX_IDR_MASK;
			ent->pv_cm_id = (u32)id;
			sl_id_map_add(ibdev, ent);
		}
+1 −1
Original line number Diff line number Diff line
@@ -306,7 +306,7 @@ int pps_register_cdev(struct pps_device *pps)
	if (err < 0)
		return err;

	pps->id &= MAX_ID_MASK;
	pps->id &= MAX_IDR_MASK;
	if (pps->id >= PPS_MAX_SOURCES) {
		pr_err("%s: too many PPS sources in the system\n",
					pps->info.name);
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ static int get_idr(struct idr *idr, struct mutex *lock, int *id)
	else if (unlikely(err))
		return err;

	*id = *id & MAX_ID_MASK;
	*id = *id & MAX_IDR_MASK;
	return 0;
}

Loading