Skip to content

Commit

Permalink
[media] radio-aimslab.c: Fix gcc 4.5+ bug
Browse files Browse the repository at this point in the history
gcc 4.5+ doesn't properly evaluate some inlined expressions.
A previous patch were proposed by Andrew Morton using noinline.
However, the entire inlined function is bogus, so let's just
remove it and be happy.

Reported-by: Andrew Morton <akpm@linux-foundation.org>
Cc: stable@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Mauro Carvalho Chehab committed Jan 6, 2011
1 parent a7862aa commit e3c9221
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions drivers/media/radio/radio-aimslab.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/module.h> /* Modules */
#include <linux/init.h> /* Initdata */
#include <linux/ioport.h> /* request_region */
#include <linux/delay.h> /* udelay */
#include <linux/videodev2.h> /* kernel radio structs */
#include <linux/version.h> /* for KERNEL_VERSION MACRO */
#include <linux/io.h> /* outb, outb_p */
Expand Down Expand Up @@ -71,27 +70,17 @@ static struct rtrack rtrack_card;

/* local things */

static void sleep_delay(long n)
{
/* Sleep nicely for 'n' uS */
int d = n / msecs_to_jiffies(1000);
if (!d)
udelay(n);
else
msleep(jiffies_to_msecs(d));
}

static void rt_decvol(struct rtrack *rt)
{
outb(0x58, rt->io); /* volume down + sigstr + on */
sleep_delay(100000);
msleep(100);
outb(0xd8, rt->io); /* volume steady + sigstr + on */
}

static void rt_incvol(struct rtrack *rt)
{
outb(0x98, rt->io); /* volume up + sigstr + on */
sleep_delay(100000);
msleep(100);
outb(0xd8, rt->io); /* volume steady + sigstr + on */
}

Expand Down Expand Up @@ -120,7 +109,7 @@ static int rt_setvol(struct rtrack *rt, int vol)

if (vol == 0) { /* volume = 0 means mute the card */
outb(0x48, rt->io); /* volume down but still "on" */
sleep_delay(2000000); /* make sure it's totally down */
msleep(2000); /* make sure it's totally down */
outb(0xd0, rt->io); /* volume steady, off */
rt->curvol = 0; /* track the volume state! */
mutex_unlock(&rt->lock);
Expand Down Expand Up @@ -155,7 +144,7 @@ static void send_0_byte(struct rtrack *rt)
outb_p(128+64+16+8+ 1, rt->io); /* on + wr-enable + data low */
outb_p(128+64+16+8+2+1, rt->io); /* clock */
}
sleep_delay(1000);
msleep(1);
}

static void send_1_byte(struct rtrack *rt)
Expand All @@ -169,7 +158,7 @@ static void send_1_byte(struct rtrack *rt)
outb_p(128+64+16+8+4+2+1, rt->io); /* clock */
}

sleep_delay(1000);
msleep(1);
}

static int rt_setfreq(struct rtrack *rt, unsigned long freq)
Expand Down Expand Up @@ -420,7 +409,7 @@ static int __init rtrack_init(void)

/* this ensures that the volume is all the way down */
outb(0x48, rt->io); /* volume down but still "on" */
sleep_delay(2000000); /* make sure it's totally down */
msleep(2000); /* make sure it's totally down */
outb(0xc0, rt->io); /* steady volume, mute card */

if (video_register_device(&rt->vdev, VFL_TYPE_RADIO, radio_nr) < 0) {
Expand Down

0 comments on commit e3c9221

Please sign in to comment.