X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fs390%2Fnet%2Fnetiucv.c;h=874a19994489a208d92de22285b2781ffd6525b6;hb=db8be076cad4b843aa743ef462c75022cddd9c63;hp=f3d893cfe61d4339799bb91ab9db5fb5f9698e75;hpb=dd07a8db7283f52f347aee468007556944b5b393;p=linux-2.6 diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c index f3d893cfe6..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, }; @@ -572,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) { } @@ -1110,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);