[PATCH][2.4.23-pre3] fix three DRM43 warnings

From: Mikael Pettersson
Date: Thu Sep 04 2003 - 14:47:24 EST


[Sent to Marcelo, forgot to cc: LKML]

This patch fixes three warnings in the new XFree 4.3 DRM code:
- drm_os_linux.h has a #warning on broken list_entry usage
- radeon_drv.h has a #warning PCI posting bug
- drm_agpsupport.h generates a gcc warning on an assignment used
as a truth value

The first #warning is valid. The fix is to backport the
cleaned-up version from 2.6.

The second is bogus. The macro the #warning refers to is
a left-over from the drm-4.0 code. It's no longer used and
the fix is to simply remove it. It's also absent in 2.6.

The third simply requires an additional pair of parentheses,
like the code in 2.6 has.

gcc -D__KERNEL__ -I/tmp/linux-2.4.23-pre3/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686 -nostdinc -iwithprefix include -DKBUILD_BASENAME=radeon_drv -c -o radeon_drv.o radeon_drv.c
In file included from drmP.h:75,
from radeon_drv.c:32:
drm_os_linux.h:16:2: warning: #warning the author of this code needs to read up on list_entry
In file included from radeon_drv.c:35:
radeon_drv.h:846:2: warning: #warning PCI posting bug
In file included from radeon_drv.c:38:
drm_agpsupport.h: In function `radeon_agp_acquire':
drm_agpsupport.h:82: warning: suggest parentheses around assignment used as truth value

/Mikael

diff -ruN linux-2.4.23-pre3/drivers/char/drm/drm_agpsupport.h linux-2.4.23-pre3.drm43-fixes/drivers/char/drm/drm_agpsupport.h
--- linux-2.4.23-pre3/drivers/char/drm/drm_agpsupport.h 2003-09-04 18:54:00.000000000 +0200
+++ linux-2.4.23-pre3.drm43-fixes/drivers/char/drm/drm_agpsupport.h 2003-09-04 19:02:39.000000000 +0200
@@ -79,7 +79,7 @@
return -EBUSY;
if(!drm_agp->acquire)
return -EINVAL;
- if (retcode = drm_agp->acquire())
+ if ((retcode = drm_agp->acquire()))
return retcode;
dev->agp->acquired = 1;
return 0;
diff -ruN linux-2.4.23-pre3/drivers/char/drm/drm_os_linux.h linux-2.4.23-pre3.drm43-fixes/drivers/char/drm/drm_os_linux.h
--- linux-2.4.23-pre3/drivers/char/drm/drm_os_linux.h 2003-09-04 18:54:00.000000000 +0200
+++ linux-2.4.23-pre3.drm43-fixes/drivers/char/drm/drm_os_linux.h 2003-09-04 19:02:39.000000000 +0200
@@ -13,12 +13,10 @@
return -EFAULT


-#warning the author of this code needs to read up on list_entry
#define DRM_GETSAREA() \
do { \
- struct list_head *list; \
- list_for_each( list, &dev->maplist->head ) { \
- drm_map_list_t *entry = (drm_map_list_t *)list; \
+ drm_map_list_t *entry; \
+ list_for_each_entry( entry, &dev->maplist->head, head ) { \
if ( entry->map && \
entry->map->type == _DRM_SHM && \
(entry->map->flags & _DRM_CONTAINS_LOCK) ) { \
diff -ruN linux-2.4.23-pre3/drivers/char/drm/radeon_drv.h linux-2.4.23-pre3.drm43-fixes/drivers/char/drm/radeon_drv.h
--- linux-2.4.23-pre3/drivers/char/drm/radeon_drv.h 2003-09-04 18:54:00.000000000 +0200
+++ linux-2.4.23-pre3.drm43-fixes/drivers/char/drm/radeon_drv.h 2003-09-04 19:02:39.000000000 +0200
@@ -839,14 +839,6 @@
* Ring control
*/

-#if defined(__powerpc__)
-#define radeon_flush_write_combine() (void) GET_RING_HEAD( &dev_priv->ring )
-#else
-#define radeon_flush_write_combine() wmb()
-#warning PCI posting bug
-#endif
-
-
#define RADEON_VERBOSE 0

#define RING_LOCALS int write, _nr; unsigned int mask; u32 *ring;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/