/* size = PAGE_ALIGN(size); (already done) */
mem = vmalloc_32(size);
- if (mem != 0) {
+ if (mem != NULL) {
memset(mem, 0, size);
adr = (unsigned long) mem;
while ((long) size > 0) {
int i;
PDEBUG(D_STREAM, "frame free");
- if (gspca_dev->frbuf != 0) {
+ if (gspca_dev->frbuf != NULL) {
rvfree(gspca_dev->frbuf,
gspca_dev->nframes * gspca_dev->frsz);
gspca_dev->frbuf = NULL;
gspca_dev->urb[i] = NULL;
usb_kill_urb(urb);
- if (urb->transfer_buffer != 0)
+ if (urb->transfer_buffer != NULL)
usb_buffer_free(gspca_dev->dev,
urb->transfer_buffer_length,
urb->transfer_buffer,
gspca_dev->sd_desc->close(gspca_dev);
mutex_unlock(&gspca_dev->usb_lock);
frame_free(gspca_dev);
- gspca_dev->capt_file = 0;
+ gspca_dev->capt_file = NULL;
gspca_dev->memory = GSPCA_MEMORY_NO;
}
file->private_data = NULL;
}
/* only one file may do capture */
- if ((gspca_dev->capt_file != 0 && gspca_dev->capt_file != file)
+ if ((gspca_dev->capt_file != NULL && gspca_dev->capt_file != file)
|| gspca_dev->streaming) {
ret = -EBUSY;
goto out;
if (rb->count == 0) { /* unrequest? */
frame_free(gspca_dev);
- gspca_dev->capt_file = 0;
+ gspca_dev->capt_file = NULL;
} else {
gspca_dev->memory = rb->memory;
ret = frame_alloc(gspca_dev, rb->count);
static int dev_mmap(struct file *file, struct vm_area_struct *vma)
{
struct gspca_dev *gspca_dev = file->private_data;
- struct gspca_frame *frame = 0;
+ struct gspca_frame *frame;
struct page *page;
unsigned long addr, start, size;
int i, ret;
goto out;
}
+ frame = NULL;
for (i = 0; i < gspca_dev->nframes; ++i) {
if (gspca_dev->frame[i].v4l2_buf.memory != V4L2_MEMORY_MMAP) {
PDEBUG(D_STREAM, "mmap bad memory type");
break;
}
}
- if (frame == 0) {
+ if (frame == NULL) {
PDEBUG(D_STREAM, "mmap no frame buffer found");
ret = -EINVAL;
goto out;
t16RegWrite(dev, 0x01, 0x0000, n3, 0x06);
t16RegWrite(dev, 0x01, 0x0000, n4, 0x46);
t16RegRead(dev, 0x0080, &test_byte, 1);
- t16RegWrite(dev, 0x00, 0x2c80, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x2c80, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
- t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x3880, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x338e, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x3880, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x338e, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset5, 0x04);
- t16RegWrite(dev, 0x00, 0x00a9, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x00a9, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset6, 0x22);
- t16RegWrite(dev, 0x00, 0x86bb, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x86bb, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, missing, 0x08);
- t16RegWrite(dev, 0x00, 0x2087, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x2088, NULL, 0x0);
- t16RegWrite(dev, 0x00, 0x2089, NULL, 0x0);
+ t16RegWrite(dev, 0x00, 0x2087, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x2088, NULL, 0);
+ t16RegWrite(dev, 0x00, 0x2089, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset7, 0x04);
t16RegWrite(dev, 0x01, 0x0000, nset10, 0x06);
t16RegWrite(dev, 0x01, 0x0000, nset8, 0x06);
t16RegWrite(dev, 0x01, 0x0000, nset9, 0x04);
- t16RegWrite(dev, 0x00, 0x2880, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x2880, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, nset2, 0x14);
t16RegWrite(dev, 0x01, 0x0000, nset3, 0x12);
t16RegWrite(dev, 0x01, 0x0000, nset4, 0x12);
}
if (sd->effect == 1 || sd->effect == 4)
- t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x4aa6, NULL, 0);
else
- t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0xfaa6, NULL, 0);
}
static void setwhitebalance(struct gspca_dev *gspca_dev)
reg_to_write = 0x0aa6 + 0x1000 * sd->sharpness;
- t16RegWrite(dev, 0x00, reg_to_write, NULL, 0x00);
+ t16RegWrite(dev, 0x00, reg_to_write, NULL, 0);
}
static int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val)
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[1], 0x8);
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[2], 0x8);
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
- t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
/* just in case and to keep sync with logs (for mine) */
t16RegWrite(dev, 0x01, 0x0000, tas5130a_sensor_init[3], 0x8);
- t16RegWrite(dev, 0x00, 0x3c80, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x3c80, NULL, 0);
/* just in case and to keep sync with logs (for mine) */
t16RegWrite(dev, 0x01, 0x0000, t1, 4);
t16RegWrite(dev, 0x01, 0x0000, t2, 6);
- t16RegRead(dev, 0x0012, &test_byte, 0x1);
+ t16RegRead(dev, 0x0012, &test_byte, 0x01);
t16RegWrite(dev, 0x01, 0x0000, t3, 0x10);
- t16RegWrite(dev, 0x00, 0x0013, NULL, 0x00);
+ t16RegWrite(dev, 0x00, 0x0013, NULL, 0);
t16RegWrite(dev, 0x01, 0x0000, t4, 0x4);
/* restart on each start, just in case, sometimes regs goes wrong
* when using controls from app */
{0x18, 0x20, 0x20, 0x1c, 0x16, 0x13, 0x10, 0x0e,
0x0b, 0x09, 0x07, 0x00, 0x00, 0x00, 0x00, 0x01};
static const __u8 *gamma_tb[] = {
- 0, Tgamma_1, Tgamma_2,
+ NULL, Tgamma_1, Tgamma_2,
Tgamma_3, Tgamma_4, Tgamma_5, Tgamma_6
};
static const __u8 *gradient_tb[] = {
- 0, Tgradient_1, Tgradient_2,
+ NULL, Tgradient_1, Tgradient_2,
Tgradient_3, Tgradient_4, Tgradient_5, Tgradient_6
};
#ifdef CONFIG_VIDEO_ADV_DEBUG
gc0305_50HZ, gc0305_50HZ,
gc0305_60HZ, gc0305_60HZ},
/* SENSOR_HDCS2020 3 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_HDCS2020b 4 */
{hdcs2020b_NoFliker, hdcs2020b_NoFliker,
hdcs2020b_50HZ, hdcs2020b_50HZ,
hdcs2020b_60HZ, hdcs2020b_60HZ},
/* SENSOR_HV7131B 5 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_HV7131C 6 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_ICM105A 7 */
{icm105a_NoFliker, icm105a_NoFlikerScale,
icm105a_50HZ, icm105a_50HZScale,
OV7620_50HZ, OV7620_50HZ,
OV7620_60HZ, OV7620_60HZ},
/* SENSOR_OV7630C 10 */
- {0, 0,
- 0, 0,
- 0, 0},
+ {NULL, NULL,
+ NULL, NULL,
+ NULL, NULL},
/* SENSOR_PAS106 11 */
{pas106b_NoFliker, pas106b_NoFliker,
pas106b_50HZ, pas106b_50HZ,
if (!mode)
i++; /* 640x480 */
zc3_freq = freq_tb[(int) sd->sensor][i];
- if (zc3_freq != 0) {
+ if (zc3_freq != NULL) {
usb_exchange(gspca_dev->dev, zc3_freq);
switch (sd->sensor) {
case SENSOR_GC0305: