| .. | .. |
|---|
| 575 | 575 | #define downx(x, v) ((v) & -(x)) |
|---|
| 576 | 576 | #define modx(x, v) ((v) & ((x) - 1)) |
|---|
| 577 | 577 | |
|---|
| 578 | +/* |
|---|
| 579 | + * FIXME: Use C variants of the code marked with #ifdef __mc68000__ |
|---|
| 580 | + * in the driver. It shouldn't negatively affect the performance and |
|---|
| 581 | + * is required for APUS support (once it is re-added to the kernel). |
|---|
| 582 | + * Needs to be tested on the hardware though.. |
|---|
| 583 | + */ |
|---|
| 578 | 584 | /* if x1 is not a constant, this macro won't make real sense :-) */ |
|---|
| 579 | 585 | #ifdef __mc68000__ |
|---|
| 580 | 586 | #define DIVUL(x1, x2) ({int res; asm("divul %1,%2,%3": "=d" (res): \ |
|---|
| .. | .. |
|---|
| 1855 | 1861 | var->yspot = par->crsr.spot_y; |
|---|
| 1856 | 1862 | if (size > var->height * var->width) |
|---|
| 1857 | 1863 | return -ENAMETOOLONG; |
|---|
| 1858 | | - if (!access_ok(VERIFY_WRITE, data, size)) |
|---|
| 1859 | | - return -EFAULT; |
|---|
| 1860 | 1864 | delta = 1 << par->crsr.fmode; |
|---|
| 1861 | 1865 | lspr = lofsprite + (delta << 1); |
|---|
| 1862 | 1866 | if (par->bplcon0 & BPC0_LACE) |
|---|
| .. | .. |
|---|
| 1886 | 1890 | | ((datawords >> 15) & 1)); |
|---|
| 1887 | 1891 | datawords <<= 1; |
|---|
| 1888 | 1892 | #endif |
|---|
| 1893 | + /* FIXME: check the return value + test the change */ |
|---|
| 1889 | 1894 | put_user(color, data++); |
|---|
| 1890 | 1895 | } |
|---|
| 1891 | 1896 | if (bits > 0) { |
|---|
| .. | .. |
|---|
| 1935 | 1940 | return -EINVAL; |
|---|
| 1936 | 1941 | if (!var->height) |
|---|
| 1937 | 1942 | return -EINVAL; |
|---|
| 1938 | | - if (!access_ok(VERIFY_READ, data, var->width * var->height)) |
|---|
| 1939 | | - return -EFAULT; |
|---|
| 1940 | 1943 | delta = 1 << fmode; |
|---|
| 1941 | 1944 | lofsprite = shfsprite = (u_short *)spritememory; |
|---|
| 1942 | 1945 | lspr = lofsprite + (delta << 1); |
|---|
| .. | .. |
|---|
| 1956 | 1959 | bits = 16; words = delta; datawords = 0; |
|---|
| 1957 | 1960 | for (width = (short)var->width - 1; width >= 0; width--) { |
|---|
| 1958 | 1961 | unsigned long tdata = 0; |
|---|
| 1962 | + /* FIXME: check the return value + test the change */ |
|---|
| 1959 | 1963 | get_user(tdata, data); |
|---|
| 1960 | 1964 | data++; |
|---|
| 1961 | 1965 | #ifdef __mc68000__ |
|---|
| .. | .. |
|---|
| 3493 | 3497 | } |
|---|
| 3494 | 3498 | |
|---|
| 3495 | 3499 | |
|---|
| 3496 | | -static struct fb_ops amifb_ops = { |
|---|
| 3500 | +static const struct fb_ops amifb_ops = { |
|---|
| 3497 | 3501 | .owner = THIS_MODULE, |
|---|
| 3498 | 3502 | .fb_check_var = amifb_check_var, |
|---|
| 3499 | 3503 | .fb_set_par = amifb_set_par, |
|---|
| .. | .. |
|---|
| 3554 | 3558 | custom.dmacon = DMAF_ALL | DMAF_MASTER; |
|---|
| 3555 | 3559 | |
|---|
| 3556 | 3560 | info = framebuffer_alloc(sizeof(struct amifb_par), &pdev->dev); |
|---|
| 3557 | | - if (!info) { |
|---|
| 3558 | | - dev_err(&pdev->dev, "framebuffer_alloc failed\n"); |
|---|
| 3561 | + if (!info) |
|---|
| 3559 | 3562 | return -ENOMEM; |
|---|
| 3560 | | - } |
|---|
| 3561 | 3563 | |
|---|
| 3562 | 3564 | strcpy(info->fix.id, "Amiga "); |
|---|
| 3563 | 3565 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
|---|