#include <asm/uaccess.h>
#endif
-#include <linux/version.h>
-#ifndef KERNEL_VERSION
-#define KERNEL_VERSION(a,b,c) ((a)*65536+(b)*256+(c))
-#endif
-
#include "videocodec.h"
static int debug = 0;
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0);
MODULE_PARM_DESC(debug, "Debug level (0-4)");
#define dprintk(num, format, args...) \
if (res == 0) {
dprintk(3, "videocodec_attach '%s'\n",
codec->name);
- ptr = (struct attached_list *)
- kmalloc(sizeof(struct attached_list),
- GFP_KERNEL);
+ ptr = kzalloc(sizeof(struct attached_list), GFP_KERNEL);
if (!ptr) {
dprintk(1,
KERN_ERR
"videocodec_attach: no memory\n");
goto out_kfree;
}
- memset(ptr, 0,
- sizeof(struct attached_list));
ptr->codec = codec;
a = h->list;
"videocodec: register '%s', type: %x, flags %lx, magic %lx\n",
codec->name, codec->type, codec->flags, codec->magic);
- ptr =
- (struct codec_list *) kmalloc(sizeof(struct codec_list),
- GFP_KERNEL);
+ ptr = kzalloc(sizeof(struct codec_list), GFP_KERNEL);
if (!ptr) {
dprintk(1, KERN_ERR "videocodec_register: no memory\n");
return -ENOMEM;
}
- memset(ptr, 0, sizeof(struct codec_list));
ptr->codec = codec;
if (!h) {
dprintk(3, "videocodec_build table: %d entries, %d bytes\n", i,
size);
- if (videocodec_buf)
- kfree(videocodec_buf);
+ kfree(videocodec_buf);
videocodec_buf = (char *) kmalloc(size, GFP_KERNEL);
i = 0;
videocodec_buf = NULL;
videocodec_bufsize = 0;
- videocodec_proc_entry = create_proc_entry("videocodecs", 0, 0);
+ videocodec_proc_entry = create_proc_entry("videocodecs", 0, NULL);
if (videocodec_proc_entry) {
videocodec_proc_entry->read_proc = videocodec_info;
videocodec_proc_entry->write_proc = NULL;
videocodec_exit (void)
{
#ifdef CONFIG_PROC_FS
- remove_proc_entry("videocodecs", 0);
- if (videocodec_buf)
- kfree(videocodec_buf);
+ remove_proc_entry("videocodecs", NULL);
+ kfree(videocodec_buf);
#endif
}