X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fs390%2Fnet%2Fnetiucv.c;h=874a19994489a208d92de22285b2781ffd6525b6;hb=db8be076cad4b843aa743ef462c75022cddd9c63;hp=d6e93f15440ea1721b243b889a9be1006da2f983;hpb=df8dc74e8a383eaf2d9b44b80a71ec6f0e52b42e;p=linux-2.6 diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index d6e93f1544..874a199944 100644 --- a/drivers/s390/net/netiucv.c +++ b/drivers/s390/net/netiucv.c @@ -97,12 +97,22 @@ MODULE_DESCRIPTION ("Linux for S/390 IUCV network driver"); DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf); -#define IUCV_DBF_TEXT_(name,level,text...) \ - do { \ - char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf); \ - sprintf(iucv_dbf_txt_buf, text); \ - debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \ - put_cpu_var(iucv_dbf_txt_buf); \ +/* Allow to sort out low debug levels early to avoid wasted sprints */ +static inline int iucv_dbf_passes(debug_info_t *dbf_grp, int level) +{ + return (level <= dbf_grp->level); +} + +#define IUCV_DBF_TEXT_(name, level, text...) \ + do { \ + if (iucv_dbf_passes(iucv_dbf_##name, level)) { \ + char* iucv_dbf_txt_buf = \ + get_cpu_var(iucv_dbf_txt_buf); \ + sprintf(iucv_dbf_txt_buf, text); \ + debug_text_event(iucv_dbf_##name, level, \ + iucv_dbf_txt_buf); \ + put_cpu_var(iucv_dbf_txt_buf); \ + } \ } while (0) #define IUCV_DBF_SPRINTF(name,level,text...) \ @@ -137,6 +147,7 @@ PRINT_##importance(header "%02x %02x %02x %02x %02x %02x %02x %02x " \ #define PRINTK_HEADER " iucv: " /* for debugging */ static struct device_driver netiucv_driver = { + .owner = THIS_MODULE, .name = "netiucv", .bus = &iucv_bus, }; @@ -198,8 +209,7 @@ struct iucv_connection { /** * Linked list of all connection structs. */ -static struct list_head iucv_connection_list = - LIST_HEAD_INIT(iucv_connection_list); +static LIST_HEAD(iucv_connection_list); static DEFINE_RWLOCK(iucv_connection_rwlock); /** @@ -573,9 +583,9 @@ static void netiucv_callback_connres(struct iucv_path *path, u8 ipuser[16]) } /** - * Dummy NOP action for all statemachines + * NOP action for statemachines */ -static void fsm_action_nop(fsm_instance *fi, int event, void *arg) +static void netiucv_action_nop(fsm_instance *fi, int event, void *arg) { } @@ -1111,7 +1121,7 @@ static const fsm_node dev_fsm[] = { { DEV_STATE_RUNNING, DEV_EVENT_STOP, dev_action_stop }, { DEV_STATE_RUNNING, DEV_EVENT_CONDOWN, dev_action_conndown }, - { DEV_STATE_RUNNING, DEV_EVENT_CONUP, fsm_action_nop }, + { DEV_STATE_RUNNING, DEV_EVENT_CONUP, netiucv_action_nop }, }; static const int DEV_FSM_LEN = sizeof(dev_fsm) / sizeof(fsm_node);