Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/misc/sgi-xp: replace partid_t with a short

In preparation for supporting greater than 64 partitions replace partid_t by
short in drivers/misc/sgi-xp.

Signed-off-by: Dean Nelson <dcn@sgi.com>
Acked-by: Robin Holt <holt@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Dean Nelson and committed by
Linus Torvalds
64d032ba 65c17b80

+69 -69
+17 -17
drivers/misc/sgi-xp/xp.h
··· 264 264 * When a failure reason code is received, one can assume that the channel 265 265 * is not connected. 266 266 */ 267 - typedef void (*xpc_channel_func) (enum xp_retval reason, partid_t partid, 267 + typedef void (*xpc_channel_func) (enum xp_retval reason, short partid, 268 268 int ch_number, void *data, void *key); 269 269 270 270 /* ··· 286 286 * 287 287 * All other reason codes indicate failure. 288 288 */ 289 - typedef void (*xpc_notify_func) (enum xp_retval reason, partid_t partid, 289 + typedef void (*xpc_notify_func) (enum xp_retval reason, short partid, 290 290 int ch_number, void *key); 291 291 292 292 /* ··· 322 322 struct xpc_interface { 323 323 void (*connect) (int); 324 324 void (*disconnect) (int); 325 - enum xp_retval (*allocate) (partid_t, int, u32, void **); 326 - enum xp_retval (*send) (partid_t, int, void *); 327 - enum xp_retval (*send_notify) (partid_t, int, void *, 325 + enum xp_retval (*allocate) (short, int, u32, void **); 326 + enum xp_retval (*send) (short, int, void *); 327 + enum xp_retval (*send_notify) (short, int, void *, 328 328 xpc_notify_func, void *); 329 - void (*received) (partid_t, int, void *); 330 - enum xp_retval (*partid_to_nasids) (partid_t, void *); 329 + void (*received) (short, int, void *); 330 + enum xp_retval (*partid_to_nasids) (short, void *); 331 331 }; 332 332 333 333 extern struct xpc_interface xpc_interface; 334 334 335 335 extern void xpc_set_interface(void (*)(int), 336 336 void (*)(int), 337 - enum xp_retval (*)(partid_t, int, u32, void **), 338 - enum xp_retval (*)(partid_t, int, void *), 339 - enum xp_retval (*)(partid_t, int, void *, 337 + enum xp_retval (*)(short, int, u32, void **), 338 + enum xp_retval (*)(short, int, void *), 339 + enum xp_retval (*)(short, int, void *, 340 340 xpc_notify_func, void *), 341 - void (*)(partid_t, int, void *), 342 - enum xp_retval (*)(partid_t, void *)); 341 + void (*)(short, int, void *), 342 + enum xp_retval (*)(short, void *)); 343 343 extern void xpc_clear_interface(void); 344 344 345 345 extern enum xp_retval xpc_connect(int, xpc_channel_func, void *, u16, ··· 347 347 extern void xpc_disconnect(int); 348 348 349 349 static inline enum xp_retval 350 - xpc_allocate(partid_t partid, int ch_number, u32 flags, void **payload) 350 + xpc_allocate(short partid, int ch_number, u32 flags, void **payload) 351 351 { 352 352 return xpc_interface.allocate(partid, ch_number, flags, payload); 353 353 } 354 354 355 355 static inline enum xp_retval 356 - xpc_send(partid_t partid, int ch_number, void *payload) 356 + xpc_send(short partid, int ch_number, void *payload) 357 357 { 358 358 return xpc_interface.send(partid, ch_number, payload); 359 359 } 360 360 361 361 static inline enum xp_retval 362 - xpc_send_notify(partid_t partid, int ch_number, void *payload, 362 + xpc_send_notify(short partid, int ch_number, void *payload, 363 363 xpc_notify_func func, void *key) 364 364 { 365 365 return xpc_interface.send_notify(partid, ch_number, payload, func, key); 366 366 } 367 367 368 368 static inline void 369 - xpc_received(partid_t partid, int ch_number, void *payload) 369 + xpc_received(short partid, int ch_number, void *payload) 370 370 { 371 371 return xpc_interface.received(partid, ch_number, payload); 372 372 } 373 373 374 374 static inline enum xp_retval 375 - xpc_partid_to_nasids(partid_t partid, void *nasids) 375 + xpc_partid_to_nasids(short partid, void *nasids) 376 376 { 377 377 return xpc_interface.partid_to_nasids(partid, nasids); 378 378 }
+15 -15
drivers/misc/sgi-xp/xp_main.c
··· 51 51 struct xpc_interface xpc_interface = { 52 52 (void (*)(int))xpc_notloaded, 53 53 (void (*)(int))xpc_notloaded, 54 - (enum xp_retval(*)(partid_t, int, u32, void **))xpc_notloaded, 55 - (enum xp_retval(*)(partid_t, int, void *))xpc_notloaded, 56 - (enum xp_retval(*)(partid_t, int, void *, xpc_notify_func, void *)) 54 + (enum xp_retval(*)(short, int, u32, void **))xpc_notloaded, 55 + (enum xp_retval(*)(short, int, void *))xpc_notloaded, 56 + (enum xp_retval(*)(short, int, void *, xpc_notify_func, void *)) 57 57 xpc_notloaded, 58 - (void (*)(partid_t, int, void *))xpc_notloaded, 59 - (enum xp_retval(*)(partid_t, void *))xpc_notloaded 58 + (void (*)(short, int, void *))xpc_notloaded, 59 + (enum xp_retval(*)(short, void *))xpc_notloaded 60 60 }; 61 61 EXPORT_SYMBOL_GPL(xpc_interface); 62 62 ··· 66 66 void 67 67 xpc_set_interface(void (*connect) (int), 68 68 void (*disconnect) (int), 69 - enum xp_retval (*allocate) (partid_t, int, u32, void **), 70 - enum xp_retval (*send) (partid_t, int, void *), 71 - enum xp_retval (*send_notify) (partid_t, int, void *, 69 + enum xp_retval (*allocate) (short, int, u32, void **), 70 + enum xp_retval (*send) (short, int, void *), 71 + enum xp_retval (*send_notify) (short, int, void *, 72 72 xpc_notify_func, void *), 73 - void (*received) (partid_t, int, void *), 74 - enum xp_retval (*partid_to_nasids) (partid_t, void *)) 73 + void (*received) (short, int, void *), 74 + enum xp_retval (*partid_to_nasids) (short, void *)) 75 75 { 76 76 xpc_interface.connect = connect; 77 77 xpc_interface.disconnect = disconnect; ··· 91 91 { 92 92 xpc_interface.connect = (void (*)(int))xpc_notloaded; 93 93 xpc_interface.disconnect = (void (*)(int))xpc_notloaded; 94 - xpc_interface.allocate = (enum xp_retval(*)(partid_t, int, u32, 94 + xpc_interface.allocate = (enum xp_retval(*)(short, int, u32, 95 95 void **))xpc_notloaded; 96 - xpc_interface.send = (enum xp_retval(*)(partid_t, int, void *)) 96 + xpc_interface.send = (enum xp_retval(*)(short, int, void *)) 97 97 xpc_notloaded; 98 - xpc_interface.send_notify = (enum xp_retval(*)(partid_t, int, void *, 98 + xpc_interface.send_notify = (enum xp_retval(*)(short, int, void *, 99 99 xpc_notify_func, 100 100 void *))xpc_notloaded; 101 - xpc_interface.received = (void (*)(partid_t, int, void *)) 101 + xpc_interface.received = (void (*)(short, int, void *)) 102 102 xpc_notloaded; 103 - xpc_interface.partid_to_nasids = (enum xp_retval(*)(partid_t, void *)) 103 + xpc_interface.partid_to_nasids = (enum xp_retval(*)(short, void *)) 104 104 xpc_notloaded; 105 105 } 106 106 EXPORT_SYMBOL_GPL(xpc_clear_interface);
+10 -10
drivers/misc/sgi-xp/xpc.h
··· 172 172 (_version >= _XPC_VERSION(3, 1)) 173 173 174 174 static inline int 175 - xpc_hb_allowed(partid_t partid, struct xpc_vars *vars) 175 + xpc_hb_allowed(short partid, struct xpc_vars *vars) 176 176 { 177 177 return ((vars->heartbeating_to_mask & (1UL << partid)) != 0); 178 178 } 179 179 180 180 static inline void 181 - xpc_allow_hb(partid_t partid, struct xpc_vars *vars) 181 + xpc_allow_hb(short partid, struct xpc_vars *vars) 182 182 { 183 183 u64 old_mask, new_mask; 184 184 ··· 190 190 } 191 191 192 192 static inline void 193 - xpc_disallow_hb(partid_t partid, struct xpc_vars *vars) 193 + xpc_disallow_hb(short partid, struct xpc_vars *vars) 194 194 { 195 195 u64 old_mask, new_mask; 196 196 ··· 408 408 * messages. 409 409 */ 410 410 struct xpc_channel { 411 - partid_t partid; /* ID of remote partition connected */ 411 + short partid; /* ID of remote partition connected */ 412 412 spinlock_t lock; /* lock for updating this structure */ 413 413 u32 flags; /* general flags */ 414 414 ··· 615 615 /* interval in seconds to print 'waiting disengagement' messages */ 616 616 #define XPC_DISENGAGE_PRINTMSG_INTERVAL 10 617 617 618 - #define XPC_PARTID(_p) ((partid_t) ((_p) - &xpc_partitions[0])) 618 + #define XPC_PARTID(_p) ((short)((_p) - &xpc_partitions[0])) 619 619 620 620 /* found in xp_main.c */ 621 621 extern struct xpc_registration xpc_registrations[]; ··· 652 652 extern void xpc_check_remote_hb(void); 653 653 extern void xpc_deactivate_partition(const int, struct xpc_partition *, 654 654 enum xp_retval); 655 - extern enum xp_retval xpc_initiate_partid_to_nasids(partid_t, void *); 655 + extern enum xp_retval xpc_initiate_partid_to_nasids(short, void *); 656 656 657 657 /* found in xpc_channel.c */ 658 658 extern void xpc_initiate_connect(int); 659 659 extern void xpc_initiate_disconnect(int); 660 - extern enum xp_retval xpc_initiate_allocate(partid_t, int, u32, void **); 661 - extern enum xp_retval xpc_initiate_send(partid_t, int, void *); 662 - extern enum xp_retval xpc_initiate_send_notify(partid_t, int, void *, 660 + extern enum xp_retval xpc_initiate_allocate(short, int, u32, void **); 661 + extern enum xp_retval xpc_initiate_send(short, int, void *); 662 + extern enum xp_retval xpc_initiate_send_notify(short, int, void *, 663 663 xpc_notify_func, void *); 664 - extern void xpc_initiate_received(partid_t, int, void *); 664 + extern void xpc_initiate_received(short, int, void *); 665 665 extern enum xp_retval xpc_setup_infrastructure(struct xpc_partition *); 666 666 extern enum xp_retval xpc_pull_remote_vars_part(struct xpc_partition *); 667 667 extern void xpc_process_channel_activity(struct xpc_partition *);
+10 -10
drivers/misc/sgi-xp/xpc_channel.c
··· 53 53 * Set up the initial values for the XPartition Communication channels. 54 54 */ 55 55 static void 56 - xpc_initialize_channels(struct xpc_partition *part, partid_t partid) 56 + xpc_initialize_channels(struct xpc_partition *part, short partid) 57 57 { 58 58 int ch_number; 59 59 struct xpc_channel *ch; ··· 95 95 { 96 96 int ret, cpuid; 97 97 struct timer_list *timer; 98 - partid_t partid = XPC_PARTID(part); 98 + short partid = XPC_PARTID(part); 99 99 100 100 /* 101 101 * Zero out MOST of the entry for this partition. Only the fields ··· 290 290 (struct xpc_vars_part *)L1_CACHE_ALIGN((u64)buffer); 291 291 struct xpc_vars_part *pulled_entry; 292 292 u64 remote_entry_cacheline_pa, remote_entry_pa; 293 - partid_t partid = XPC_PARTID(part); 293 + short partid = XPC_PARTID(part); 294 294 enum xp_retval ret; 295 295 296 296 /* pull the cacheline that contains the variables we're interested in */ ··· 1375 1375 void 1376 1376 xpc_teardown_infrastructure(struct xpc_partition *part) 1377 1377 { 1378 - partid_t partid = XPC_PARTID(part); 1378 + short partid = XPC_PARTID(part); 1379 1379 1380 1380 /* 1381 1381 * We start off by making this partition inaccessible to local ··· 1428 1428 void 1429 1429 xpc_initiate_connect(int ch_number) 1430 1430 { 1431 - partid_t partid; 1431 + short partid; 1432 1432 struct xpc_partition *part; 1433 1433 struct xpc_channel *ch; 1434 1434 ··· 1484 1484 xpc_initiate_disconnect(int ch_number) 1485 1485 { 1486 1486 unsigned long irq_flags; 1487 - partid_t partid; 1487 + short partid; 1488 1488 struct xpc_partition *part; 1489 1489 struct xpc_channel *ch; 1490 1490 ··· 1728 1728 * return) in which the user-defined message is constructed. 1729 1729 */ 1730 1730 enum xp_retval 1731 - xpc_initiate_allocate(partid_t partid, int ch_number, u32 flags, void **payload) 1731 + xpc_initiate_allocate(short partid, int ch_number, u32 flags, void **payload) 1732 1732 { 1733 1733 struct xpc_partition *part = &xpc_partitions[partid]; 1734 1734 enum xp_retval ret = xpUnknownReason; ··· 1909 1909 * xpc_initiate_allocate(). 1910 1910 */ 1911 1911 enum xp_retval 1912 - xpc_initiate_send(partid_t partid, int ch_number, void *payload) 1912 + xpc_initiate_send(short partid, int ch_number, void *payload) 1913 1913 { 1914 1914 struct xpc_partition *part = &xpc_partitions[partid]; 1915 1915 struct xpc_msg *msg = XPC_MSG_ADDRESS(payload); ··· 1958 1958 * key - user-defined key to be passed to the function when it's called. 1959 1959 */ 1960 1960 enum xp_retval 1961 - xpc_initiate_send_notify(partid_t partid, int ch_number, void *payload, 1961 + xpc_initiate_send_notify(short partid, int ch_number, void *payload, 1962 1962 xpc_notify_func func, void *key) 1963 1963 { 1964 1964 struct xpc_partition *part = &xpc_partitions[partid]; ··· 2203 2203 * xpc_initiate_allocate(). 2204 2204 */ 2205 2205 void 2206 - xpc_initiate_received(partid_t partid, int ch_number, void *payload) 2206 + xpc_initiate_received(short partid, int ch_number, void *payload) 2207 2207 { 2208 2208 struct xpc_partition *part = &xpc_partitions[partid]; 2209 2209 struct xpc_channel *ch;
+8 -8
drivers/misc/sgi-xp/xpc_main.c
··· 429 429 static int 430 430 xpc_activating(void *__partid) 431 431 { 432 - partid_t partid = (u64)__partid; 432 + short partid = (u64)__partid; 433 433 struct xpc_partition *part = &xpc_partitions[partid]; 434 434 unsigned long irq_flags; 435 435 ··· 499 499 void 500 500 xpc_activate_partition(struct xpc_partition *part) 501 501 { 502 - partid_t partid = XPC_PARTID(part); 502 + short partid = XPC_PARTID(part); 503 503 unsigned long irq_flags; 504 504 struct task_struct *kthread; 505 505 ··· 541 541 irqreturn_t 542 542 xpc_notify_IRQ_handler(int irq, void *dev_id) 543 543 { 544 - partid_t partid = (partid_t) (u64)dev_id; 544 + short partid = (short)(u64)dev_id; 545 545 struct xpc_partition *part = &xpc_partitions[partid]; 546 546 547 547 DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS); ··· 643 643 static int 644 644 xpc_kthread_start(void *args) 645 645 { 646 - partid_t partid = XPC_UNPACK_ARG1(args); 646 + short partid = XPC_UNPACK_ARG1(args); 647 647 u16 ch_number = XPC_UNPACK_ARG2(args); 648 648 struct xpc_partition *part = &xpc_partitions[partid]; 649 649 struct xpc_channel *ch; ··· 809 809 xpc_disconnect_wait(int ch_number) 810 810 { 811 811 unsigned long irq_flags; 812 - partid_t partid; 812 + short partid; 813 813 struct xpc_partition *part; 814 814 struct xpc_channel *ch; 815 815 int wakeup_channel_mgr; ··· 859 859 static void 860 860 xpc_do_exit(enum xp_retval reason) 861 861 { 862 - partid_t partid; 862 + short partid; 863 863 int active_part_count, printed_waiting_msg = 0; 864 864 struct xpc_partition *part; 865 865 unsigned long printmsg_time, disengage_request_timeout = 0; ··· 1008 1008 xpc_die_disengage(void) 1009 1009 { 1010 1010 struct xpc_partition *part; 1011 - partid_t partid; 1011 + short partid; 1012 1012 unsigned long engaged; 1013 1013 long time, printmsg_time, disengage_request_timeout; 1014 1014 ··· 1124 1124 xpc_init(void) 1125 1125 { 1126 1126 int ret; 1127 - partid_t partid; 1127 + short partid; 1128 1128 struct xpc_partition *part; 1129 1129 struct task_struct *kthread; 1130 1130 size_t buf_size;
+5 -5
drivers/misc/sgi-xp/xpc_partition.c
··· 403 403 { 404 404 struct xpc_vars *remote_vars; 405 405 struct xpc_partition *part; 406 - partid_t partid; 406 + short partid; 407 407 bte_result_t bres; 408 408 409 409 remote_vars = (struct xpc_vars *)xpc_remote_copy_buffer; ··· 604 604 int reactivate = 0; 605 605 int stamp_diff; 606 606 struct timespec remote_rp_stamp = { 0, 0 }; 607 - partid_t partid; 607 + short partid; 608 608 struct xpc_partition *part; 609 609 enum xp_retval ret; 610 610 ··· 825 825 int 826 826 xpc_partition_disengaged(struct xpc_partition *part) 827 827 { 828 - partid_t partid = XPC_PARTID(part); 828 + short partid = XPC_PARTID(part); 829 829 int disengaged; 830 830 831 831 disengaged = (xpc_partition_engaged(1UL << partid) == 0); ··· 982 982 int max_regions; 983 983 int nasid; 984 984 struct xpc_rsvd_page *rp; 985 - partid_t partid; 985 + short partid; 986 986 struct xpc_partition *part; 987 987 u64 *discovered_nasids; 988 988 enum xp_retval ret; ··· 1152 1152 * remote partition's reserved page. 1153 1153 */ 1154 1154 enum xp_retval 1155 - xpc_initiate_partid_to_nasids(partid_t partid, void *nasid_mask) 1155 + xpc_initiate_partid_to_nasids(short partid, void *nasid_mask) 1156 1156 { 1157 1157 struct xpc_partition *part; 1158 1158 u64 part_nasid_pa;
+4 -4
drivers/misc/sgi-xp/xpnet.c
··· 166 166 * Packet was recevied by XPC and forwarded to us. 167 167 */ 168 168 static void 169 - xpnet_receive(partid_t partid, int channel, struct xpnet_message *msg) 169 + xpnet_receive(short partid, int channel, struct xpnet_message *msg) 170 170 { 171 171 struct sk_buff *skb; 172 172 bte_result_t bret; ··· 282 282 * state or message reception on a connection. 283 283 */ 284 284 static void 285 - xpnet_connection_activity(enum xp_retval reason, partid_t partid, int channel, 285 + xpnet_connection_activity(enum xp_retval reason, short partid, int channel, 286 286 void *data, void *key) 287 287 { 288 288 long bp; ··· 407 407 * release the skb and then release our pending message structure. 408 408 */ 409 409 static void 410 - xpnet_send_completed(enum xp_retval reason, partid_t partid, int channel, 410 + xpnet_send_completed(enum xp_retval reason, short partid, int channel, 411 411 void *__qm) 412 412 { 413 413 struct xpnet_pending_msg *queued_msg = (struct xpnet_pending_msg *)__qm; ··· 444 444 u64 start_addr, end_addr; 445 445 long dp; 446 446 u8 second_mac_octet; 447 - partid_t dest_partid; 447 + short dest_partid; 448 448 struct xpnet_dev_private *priv; 449 449 u16 embedded_bytes; 450 450