diff options
author | Mauro Carvalho Chehab <devnull@localhost> | 2005-12-10 14:38:51 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <devnull@localhost> | 2005-12-10 14:38:51 +0000 |
commit | e5c26162fe321008ff90d934598fd31dd8086965 (patch) | |
tree | fcb4f0eb292835b5787eeee8c1863b9b8db71761 /linux/drivers/media/video/msp3400-driver.c | |
parent | f17d20b881ba3ed38555933302304aca3623647b (diff) | |
download | mediapointer-dvb-s2-e5c26162fe321008ff90d934598fd31dd8086965.tar.gz mediapointer-dvb-s2-e5c26162fe321008ff90d934598fd31dd8086965.tar.bz2 |
Replaces MAX()/MIN() by kernel.h max()/min() macros
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers/media/video/msp3400-driver.c')
-rw-r--r-- | linux/drivers/media/video/msp3400-driver.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/linux/drivers/media/video/msp3400-driver.c b/linux/drivers/media/video/msp3400-driver.c index ff49d022f..7a3fbf51d 100644 --- a/linux/drivers/media/video/msp3400-driver.c +++ b/linux/drivers/media/video/msp3400-driver.c @@ -176,8 +176,6 @@ struct msp3400c { int watch_stereo:1; }; -#define MIN(a,b) (((a)>(b))?(b):(a)) -#define MAX(a,b) (((a)>(b))?(a):(b)) #define HAVE_NICAM(msp) (((msp->rev2>>8) & 0xff) != 00) #define HAVE_SIMPLE(msp) ((msp->rev1 & 0xff) >= 'D'-'@') #define HAVE_SIMPLER(msp) ((msp->rev1 & 0xff) >= 'G'-'@') @@ -1177,7 +1175,7 @@ static int msp34xx_modus(struct i2c_client *client, int norm) case VIDEO_MODE_PAL: msp3400_dbg("video mode selected to PAL\n"); -#if 1 /*KEEP*/ +#if 1 /* KEEP */ /* experimental: not sure this works with all chip versions */ return 0x7003; #else @@ -1763,9 +1761,9 @@ static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) return 0; case V4L2_CID_AUDIO_BALANCE: { - int volume = MAX(msp->left, msp->right); + int volume = max(msp->left, msp->right); - ctrl->value = (32768 * MIN(msp->left, msp->right)) / + ctrl->value = (32768 * min(msp->left, msp->right)) / (volume ? volume : 1); ctrl->value = (msp->left < msp->right) ? (65535 - ctrl->value) : ctrl->value; @@ -1780,7 +1778,7 @@ static int msp_get_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) ctrl->value = msp->treble; return 0; case V4L2_CID_AUDIO_VOLUME: - ctrl->value = MAX(msp->left, msp->right); + ctrl->value = max(msp->left, msp->right); return 0; default: return -EINVAL; @@ -1803,7 +1801,7 @@ static int msp_set_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) return 0; case V4L2_CID_AUDIO_BALANCE: balance=ctrl->value; - volume = MAX(msp->left, msp->right); + volume = max(msp->left, msp->right); set_volume=1; break; case V4L2_CID_AUDIO_BASS: @@ -1815,9 +1813,9 @@ static int msp_set_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) msp3400c_settreble(client, msp->treble); return 0; case V4L2_CID_AUDIO_VOLUME: - volume = MAX(msp->left, msp->right); + volume = max(msp->left, msp->right); - balance = (32768 * MIN(msp->left, msp->right)) / + balance = (32768 * min(msp->left, msp->right)) / (volume ? volume : 1); balance = (msp->left < msp->right) ? (65535 - balance) : balance; @@ -1832,8 +1830,8 @@ static int msp_set_ctrl(struct i2c_client *client, struct v4l2_control *ctrl) } if (set_volume) { - msp->left = (MIN(65536 - balance, 32768) * volume) / 32768; - msp->right = (MIN(balance, 32768) * volume) / 32768; + msp->left = (min(65536 - balance, 32768) * volume) / 32768; + msp->right = (min(balance, 32768) * volume) / 32768; msp3400_dbg("volume=%d, balance=%d, left=%d, right=%d", volume,balance,msp->left,msp->right); @@ -1956,8 +1954,8 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) if (msp->muted) va->flags |= VIDEO_AUDIO_MUTE; - va->volume = MAX(msp->left, msp->right); - va->balance = (32768 * MIN(msp->left, msp->right)) / + va->volume = max(msp->left, msp->right); + va->balance = (32768 * min(msp->left, msp->right)) / (va->volume ? va->volume : 1); va->balance = (msp->left < msp->right) ? (65535 - va->balance) : va->balance; @@ -1976,9 +1974,9 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) msp3400_dbg("VIDIOCSAUDIO\n"); msp->muted = (va->flags & VIDEO_AUDIO_MUTE); - msp->left = (MIN(65536 - va->balance, 32768) * + msp->left = (min(65536 - va->balance, 32768) * va->volume) / 32768; - msp->right = (MIN(va->balance, 32768) * va->volume) / 32768; + msp->right = (min((int)va->balance, 32768) * va->volume) / 32768; msp->bass = va->bass; msp->treble = va->treble; msp3400_dbg("VIDIOCSAUDIO setting va->volume to %d\n", |