From: David van Moolenbroek Date: Fri, 30 Mar 2012 14:53:07 +0000 (+0200) Subject: Kernel/servers/drivers: resolve a few warnings X-Git-Tag: v3.2.1~626 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/man.dnssec-keyfromlabel.html?a=commitdiff_plain;h=fa805ebd1ef5cb203e17013b4c7513e1e825c9e0;p=minix.git Kernel/servers/drivers: resolve a few warnings Flagged by clang 3.1. --- diff --git a/drivers/filter/md5.c b/drivers/filter/md5.c index f2962242a..fa48864ad 100644 --- a/drivers/filter/md5.c +++ b/drivers/filter/md5.c @@ -166,7 +166,7 @@ MD5Final (digest, ctx) putu32(ctx->buf[1], digest + 4); putu32(ctx->buf[2], digest + 8); putu32(ctx->buf[3], digest + 12); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } #ifndef ASM_MD5 diff --git a/kernel/proc.c b/kernel/proc.c index 09f4dfbdb..892b8b35a 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -446,7 +446,7 @@ static int do_sync_ipc(struct proc * caller_ptr, /* who made the call */ || !(callname = ipc_call_names[call_nr])) { #if DEBUG_ENABLE_IPC_WARNINGS printf("sys_call: trap %d not allowed, caller %d, src_dst %d\n", - call_nr, proc_nr(caller_ptr), src_dst_p); + call_nr, proc_nr(caller_ptr), src_dst_e); #endif return(ETRAPDENIED); /* trap denied by mask or kernel */ } diff --git a/servers/devman/device.c b/servers/devman/device.c index 617c2fc5c..596d2c812 100644 --- a/servers/devman/device.c +++ b/servers/devman/device.c @@ -79,12 +79,13 @@ devman_device_add_event(struct devman_device* dev) int res; event = malloc(sizeof(struct devman_event)); - memset(event, 0, sizeof(event)); if (event == NULL) { panic("devman_device_remove_event: out of memory\n"); } - + + memset(event, 0, sizeof(*event)); + strcat(event->data, ADD_STRING); res = devman_generate_path(event->data, DEVMAN_STRING_LEN - 11 , dev); @@ -111,12 +112,13 @@ devman_device_remove_event(struct devman_device* dev) int res; event = malloc(sizeof(struct devman_event)); - memset(event, 0, sizeof(event)); if (event == NULL) { panic("devman_device_remove_event: out of memory\n"); } - + + memset(event, 0, sizeof(*event)); + strcat(event->data, REMOVE_STRING); res = devman_generate_path(event->data, DEVMAN_STRING_LEN-11, dev);