aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/idset.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/idset.c')
-rw-r--r--drivers/s390/cio/idset.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/s390/cio/idset.c b/drivers/s390/cio/idset.c
index cf8f24a4b5eb..4d10981c7cc1 100644
--- a/drivers/s390/cio/idset.c
+++ b/drivers/s390/cio/idset.c
@@ -78,7 +78,7 @@ static inline int idset_get_first(struct idset *set, int *ssid, int *id)
78 78
79struct idset *idset_sch_new(void) 79struct idset *idset_sch_new(void)
80{ 80{
81 return idset_new(__MAX_SSID + 1, __MAX_SUBCHANNEL + 1); 81 return idset_new(max_ssid + 1, __MAX_SUBCHANNEL + 1);
82} 82}
83 83
84void idset_sch_add(struct idset *set, struct subchannel_id schid) 84void idset_sch_add(struct idset *set, struct subchannel_id schid)
@@ -110,3 +110,23 @@ int idset_sch_get_first(struct idset *set, struct subchannel_id *schid)
110 } 110 }
111 return rc; 111 return rc;
112} 112}
113
114int idset_is_empty(struct idset *set)
115{
116 int bitnum;
117
118 bitnum = find_first_bit(set->bitmap, set->num_ssid * set->num_id);
119 if (bitnum >= set->num_ssid * set->num_id)
120 return 1;
121 return 0;
122}
123
124void idset_add_set(struct idset *to, struct idset *from)
125{
126 unsigned long i, len;
127
128 len = min(__BITOPS_WORDS(to->num_ssid * to->num_id),
129 __BITOPS_WORDS(from->num_ssid * from->num_id));
130 for (i = 0; i < len ; i++)
131 to->bitmap[i] |= from->bitmap[i];
132}