On Mon, Feb 9, 2009 at 12:25 AM, Roel Kluin <[email protected]> wrote:
> With a postfix decrement count will reach -1 rather than 0,
> subsequent tests fail.

Thomas can you sign off on this?

Dave.
>
> Signed-off-by: Roel Kluin <[email protected]>
> ---
> diff --git a/drivers/gpu/drm/via/via_dma.c b/drivers/gpu/drm/via/via_dma.c
> index 7a339db..600315c 100644
> --- a/drivers/gpu/drm/via/via_dma.c
> +++ b/drivers/gpu/drm/via/via_dma.c
> @@ -481,9 +481,9 @@ static int via_wait_idle(drm_via_private_t * dev_priv)
>  {
>        int count = 10000000;
>
> -       while (!(VIA_READ(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && count--);
> +       while (!(VIA_READ(VIA_REG_STATUS) & VIA_VR_QUEUE_BUSY) && --count);
>
> -       while (count-- && (VIA_READ(VIA_REG_STATUS) &
> +       while (--count && (VIA_READ(VIA_REG_STATUS) &
>                           (VIA_CMD_RGTR_BUSY | VIA_2D_ENG_BUSY |
>                            VIA_3D_ENG_BUSY))) ;
>        return count;
> @@ -705,7 +705,7 @@ static int via_cmdbuf_size(struct drm_device *dev, void 
> *data, struct drm_file *
>        switch (d_siz->func) {
>        case VIA_CMDBUF_SPACE:
>                while (((tmp_size = via_cmdbuf_space(dev_priv)) < d_siz->size)
> -                      && count--) {
> +                      && --count) {
>                        if (!d_siz->wait) {
>                                break;
>                        }
> @@ -717,7 +717,7 @@ static int via_cmdbuf_size(struct drm_device *dev, void 
> *data, struct drm_file *
>                break;
>        case VIA_CMDBUF_LAG:
>                while (((tmp_size = via_cmdbuf_lag(dev_priv)) > d_siz->size)
> -                      && count--) {
> +                      && --count) {
>                        if (!d_siz->wait) {
>                                break;
>                        }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to