Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3fc0dae8 authored by Tomas Winkler's avatar Tomas Winkler Committed by Greg Kroah-Hartman
Browse files

staging/easycap: repace #if defined with simpler #ifdef



for sake of readability replace #if defined with #ifdef
and #if (!defined with #ifndef

Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent f2b3c685
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -90,22 +90,22 @@
#include <sound/control.h>
#endif /* !CONFIG_EASYCAP_OSS */
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
#include <media/v4l2-dev.h>
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
#include <media/v4l2-device.h>
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
#include <linux/videodev2.h>
#include <linux/soundcard.h>
#if defined(EASYCAP_NEEDS_USBVIDEO_H)
#ifdef EASYCAP_NEEDS_USBVIDEO_H
#include <config/video/usbvideo.h>
#endif /*EASYCAP_NEEDS_USBVIDEO_H*/

#if (!defined(PAGE_SIZE))
#ifndef PAGE_SIZE
#error "PAGE_SIZE not defined"
#endif
#endif /* PAGE_SIZE */

/*---------------------------------------------------------------------------*/
/*  VENDOR, PRODUCT:  Syntek Semiconductor Co., Ltd
@@ -309,9 +309,9 @@ struct easycap {
	int minor;

/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
	struct video_device video_device;
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
	struct v4l2_device v4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
@@ -322,7 +322,7 @@ struct easycap {
	unsigned int audio_buffer_page_many;

#define UPSAMPLE
#if defined(UPSAMPLE)
#ifdef UPSAMPLE
	__s16 oldaudio;
#endif /*UPSAMPLE*/

+4 −4
Original line number Diff line number Diff line
@@ -1387,7 +1387,7 @@ case VIDIOC_G_CTRL: {
	break;
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#if defined(VIDIOC_S_CTRL_OLD)
#ifdef VIDIOC_S_CTRL_OLD
case VIDIOC_S_CTRL_OLD: {
	JOM(8, "VIDIOC_S_CTRL_OLD required at least for xawtv\n");
}
@@ -2156,7 +2156,7 @@ case VIDIOC_QBUF: {
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
case VIDIOC_DQBUF:
	{
#if defined(AUDIOTIME)
#ifdef AUDIOTIME
	struct signed_div_result sdr;
	long long int above, below, dnbydt, fudge, sll;
	unsigned long long int ull;
@@ -2269,7 +2269,7 @@ case VIDIOC_DQBUF:
	do_gettimeofday(&timeval);
	timeval2 = timeval;

#if defined(AUDIOTIME)
#ifdef AUDIOTIME
	if (!peasycap->timeval0.tv_sec) {
		timeval8 = timeval;
		timeval1 = timeval;
@@ -2389,7 +2389,7 @@ case VIDIOC_STREAMOFF: {
/*---------------------------------------------------------------------------*/
	JOM(8, "calling wake_up on wq_video and wq_audio\n");
	wake_up_interruptible(&(peasycap->wq_video));
#if defined(EASYCAP_NEEDS_ALSA)
#ifdef EASYCAP_NEEDS_ALSA
	if (NULL != peasycap->psubstream)
		snd_pcm_period_elapsed(peasycap->psubstream);
#else
+3 −3
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ static const struct saa7113config{
	int set;
} saa7113configPAL[256] = {
		{0x01, 0x08},
#if defined(ANTIALIAS)
#ifdef ANTIALIAS
		{0x02, 0xC0},
#else
		{0x02, 0x80},
@@ -191,7 +191,7 @@ static const struct saa7113config{
/*--------------------------------------------------------------------------*/
static const struct saa7113config saa7113configNTSC[256] = {
		{0x01, 0x08},
#if defined(ANTIALIAS)
#ifdef ANTIALIAS
		{0x02, 0xC0},
#else
		{0x02, 0x80},
@@ -929,7 +929,7 @@ rc0 = usb_control_msg(pusb_device, usb_sndctrlpipe(pusb_device, 0),
		(__u16)0,
		(int)500);

#if defined(NOREADBACK)
#ifdef NOREADBACK
#
#else
rc1 = usb_control_msg(pusb_device, usb_rcvctrlpipe(pusb_device, 0),
+25 −28
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ return -1;
/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
static int easycap_open(struct inode *inode, struct file *file)
{
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
struct usb_interface *pusb_interface;
#else
struct video_device *pvideo_device;
@@ -146,7 +146,7 @@ SAY("==========OPEN=========\n");

peasycap = NULL;
/*---------------------------------------------------------------------------*/
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
if (NULL == inode) {
	SAY("ERROR: inode is NULL.\n");
	return -EFAULT;
@@ -728,7 +728,7 @@ return 0;
/*--------------------------------------------------------------------------*/
static int easycap_release(struct inode *inode, struct file *file)
{
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
struct easycap *peasycap;

JOT(4, "\n");
@@ -756,7 +756,7 @@ JOM(4, "ending successfully\n");

return 0;
}
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
static int easycap_open_noinode(struct file *file)
{
	return easycap_open(NULL, file);
@@ -1375,7 +1375,7 @@ if (peasycap->field_read == peasycap->field_fill) {
							peasycap->field_read);
	return 0;
}
#if defined(EASYCAP_TESTCARD)
#ifdef EASYCAP_TESTCARD
easycap_testcard(peasycap, peasycap->field_read);
#else
if (0 <= input && INPUT_MANY > input) {
@@ -3128,8 +3128,8 @@ static const struct usb_class_driver easycap_class = {
	.minor_base = USB_SKEL_MINOR_BASE,
};
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#if defined(EASYCAP_NEEDS_V4L2_FOPS)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_FOPS
static const struct v4l2_file_operations v4l2_fops = {
	.owner		= THIS_MODULE,
	.open		= easycap_open_noinode,
@@ -3180,8 +3180,8 @@ __u16 mask;
__s32 value;
struct easycap_format *peasycap_format;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
@@ -3303,10 +3303,10 @@ if (0 == bInterfaceNumber) {
	}
	SAM("allocated 0x%08lX=peasycap\n", (unsigned long int) peasycap);
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
	SAM("where     0x%08lX=&peasycap->video_device\n",
				(unsigned long int) &peasycap->video_device);
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
	SAM("and       0x%08lX=&peasycap->v4l2_device\n",
				(unsigned long int) &peasycap->v4l2_device);
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
@@ -3559,11 +3559,11 @@ if (0 == bInterfaceNumber) {
							bInterfaceNumber);
		return -ENODEV;
	}
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
#
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/
/*
 *  SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
@@ -4128,7 +4128,7 @@ case 0: {
 *  BEWARE.
*/
/*---------------------------------------------------------------------------*/
#if defined(PREFER_NTSC)
#ifdef PREFER_NTSC
	peasycap->ntsc = true;
	JOM(8, "defaulting initially to NTSC\n");
#else
@@ -4145,7 +4145,7 @@ case 0: {
 *  THE VIDEO DEVICE CAN BE REGISTERED NOW, AS IT IS READY.
 */
/*--------------------------------------------------------------------------*/
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
	if (0 != (usb_register_dev(pusb_interface, &easycap_class))) {
		err("Not able to get a minor for this device");
		usb_set_intfdata(pusb_interface, NULL);
@@ -4158,7 +4158,7 @@ case 0: {
	}
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
	if (0 != (v4l2_device_register(&(pusb_interface->dev),
						&(peasycap->v4l2_device)))) {
		SAM("v4l2_device_register() failed\n");
@@ -4181,7 +4181,7 @@ case 0: {
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/

	strcpy(&peasycap->video_device.name[0], "easycapdc60");
#if defined(EASYCAP_NEEDS_V4L2_FOPS)
#ifdef EASYCAP_NEEDS_V4L2_FOPS
	peasycap->video_device.fops = &v4l2_fops;
#else
	peasycap->video_device.fops = &easycap_fops;
@@ -4214,7 +4214,7 @@ case 0: {
 */
/*--------------------------------------------------------------------------*/
case 1: {
#if defined(EASYCAP_SILENT)
#ifdef EASYCAP_SILENT
	return -ENOENT;
#endif /*EASYCAP_SILENT*/
	if (!peasycap) {
@@ -4233,7 +4233,7 @@ case 1: {
}
/*--------------------------------------------------------------------------*/
case 2: {
#if defined(EASYCAP_SILENT)
#ifdef EASYCAP_SILENT
	return -ENOENT;
#endif /*EASYCAP_SILENT*/
	if (!peasycap) {
@@ -4566,8 +4566,8 @@ struct list_head *plist_head;
struct data_urb *pdata_urb;
int minor, m, kd;
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#if defined(EASYCAP_IS_VIDEODEV_CLIENT)
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
struct v4l2_device *pv4l2_device;
#endif /*EASYCAP_NEEDS_V4L2_DEVICE_H*/
#endif /*EASYCAP_IS_VIDEODEV_CLIENT*/
@@ -4602,11 +4602,8 @@ if (NULL == peasycap) {
	return;
}
/*---------------------------------------------------------------------------*/
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
#
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_IS_VIDEODEV_CLIENT
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
/*---------------------------------------------------------------------------*/
/*
 *  SOME VERSIONS OF THE videodev MODULE OVERWRITE THE DATA WHICH HAS
@@ -4715,7 +4712,7 @@ case 0: {
	} else
		SAY("ERROR: %i=kd is bad: cannot lock dongle\n", kd);
/*---------------------------------------------------------------------------*/
#if (!defined(EASYCAP_IS_VIDEODEV_CLIENT))
#ifndef EASYCAP_IS_VIDEODEV_CLIENT
	if (NULL == peasycap) {
		SAM("ERROR: peasycap has become NULL\n");
	} else {
@@ -4726,7 +4723,7 @@ case 0: {
	}
/*vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
#else
#if defined(EASYCAP_NEEDS_V4L2_DEVICE_H)
#ifdef EASYCAP_NEEDS_V4L2_DEVICE_H
	if (!peasycap->v4l2_device.name[0]) {
		SAM("ERROR: peasycap->v4l2_device.name is empty\n");
		if (0 <= kd && DONGLE_MANY > kd)
+4 −4
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ int isfragment;
__u8 *p1, *p2;
__s16 s16;
int i, j, more, much, rc;
#if defined(UPSAMPLE)
#ifdef UPSAMPLE
int k;
__s16 oldaudio, newaudio, delta;
#endif /*UPSAMPLE*/
@@ -131,7 +131,7 @@ if (purb->status) {
 */
/*---------------------------------------------------------------------------*/

#if defined(UPSAMPLE)
#ifdef UPSAMPLE
oldaudio = peasycap->oldaudio;
#endif /*UPSAMPLE*/

@@ -185,7 +185,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
					p1 += much;
					more -= much;
				} else {
#if defined(UPSAMPLE)
#ifdef UPSAMPLE
					if (much % 16)
						JOM(8, "MISTAKE? much"
						" is not divisible by 16\n");
@@ -271,7 +271,7 @@ for (i = 0; i < purb->number_of_packets; i++) {
				purb->iso_frame_desc[i].status);
	}

#if defined(UPSAMPLE)
#ifdef UPSAMPLE
peasycap->oldaudio = oldaudio;
#endif /*UPSAMPLE*/

Loading