Skip to content

Commit 0102e4e

Browse files
yyankovskyijgross1
authored andcommitted
xen: Use evtchn_type_t as a type for event channels
Make event channel functions pass event channel port using evtchn_port_t type. It eliminates signed <-> unsigned conversion. Signed-off-by: Yan Yankovskyi <[email protected]> Reviewed-by: Boris Ostrovsky <[email protected]> Link: https://lore.kernel.org/r/20200323152343.GA28422@kbp1-lhp-F74019 Signed-off-by: Juergen Gross <[email protected]>
1 parent c3881eb commit 0102e4e

File tree

15 files changed

+128
-116
lines changed

15 files changed

+128
-116
lines changed

drivers/xen/events/events_2l.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,37 +53,37 @@ static void evtchn_2l_bind_to_cpu(struct irq_info *info, unsigned cpu)
5353
set_bit(info->evtchn, BM(per_cpu(cpu_evtchn_mask, cpu)));
5454
}
5555

56-
static void evtchn_2l_clear_pending(unsigned port)
56+
static void evtchn_2l_clear_pending(evtchn_port_t port)
5757
{
5858
struct shared_info *s = HYPERVISOR_shared_info;
5959
sync_clear_bit(port, BM(&s->evtchn_pending[0]));
6060
}
6161

62-
static void evtchn_2l_set_pending(unsigned port)
62+
static void evtchn_2l_set_pending(evtchn_port_t port)
6363
{
6464
struct shared_info *s = HYPERVISOR_shared_info;
6565
sync_set_bit(port, BM(&s->evtchn_pending[0]));
6666
}
6767

68-
static bool evtchn_2l_is_pending(unsigned port)
68+
static bool evtchn_2l_is_pending(evtchn_port_t port)
6969
{
7070
struct shared_info *s = HYPERVISOR_shared_info;
7171
return sync_test_bit(port, BM(&s->evtchn_pending[0]));
7272
}
7373

74-
static bool evtchn_2l_test_and_set_mask(unsigned port)
74+
static bool evtchn_2l_test_and_set_mask(evtchn_port_t port)
7575
{
7676
struct shared_info *s = HYPERVISOR_shared_info;
7777
return sync_test_and_set_bit(port, BM(&s->evtchn_mask[0]));
7878
}
7979

80-
static void evtchn_2l_mask(unsigned port)
80+
static void evtchn_2l_mask(evtchn_port_t port)
8181
{
8282
struct shared_info *s = HYPERVISOR_shared_info;
8383
sync_set_bit(port, BM(&s->evtchn_mask[0]));
8484
}
8585

86-
static void evtchn_2l_unmask(unsigned port)
86+
static void evtchn_2l_unmask(evtchn_port_t port)
8787
{
8888
struct shared_info *s = HYPERVISOR_shared_info;
8989
unsigned int cpu = get_cpu();
@@ -173,7 +173,7 @@ static void evtchn_2l_handle_events(unsigned cpu)
173173
/* Timer interrupt has highest priority. */
174174
irq = irq_from_virq(cpu, VIRQ_TIMER);
175175
if (irq != -1) {
176-
unsigned int evtchn = evtchn_from_irq(irq);
176+
evtchn_port_t evtchn = evtchn_from_irq(irq);
177177
word_idx = evtchn / BITS_PER_LONG;
178178
bit_idx = evtchn % BITS_PER_LONG;
179179
if (active_evtchns(cpu, s, word_idx) & (1ULL << bit_idx))
@@ -228,7 +228,7 @@ static void evtchn_2l_handle_events(unsigned cpu)
228228

229229
do {
230230
xen_ulong_t bits;
231-
int port;
231+
evtchn_port_t port;
232232

233233
bits = MASK_LSBS(pending_bits, bit_idx);
234234

0 commit comments

Comments
 (0)