Skip to content

Commit

Permalink
drm: cleanup DRM_DEBUG() parameters
Browse files Browse the repository at this point in the history
As DRM_DEBUG macro already prints out the __FUNCTION__ string (see
drivers/char/drm/drmP.h), it is not worth doing this again. At some
other places the ending "\n" was added.

airlied:- I cleaned up a few that this patch missed also

Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Márton Németh authored and Dave Airlie committed Feb 7, 2008
1 parent 4d1f788 commit 3e684ea
Show file tree
Hide file tree
Showing 28 changed files with 122 additions and 145 deletions.
6 changes: 3 additions & 3 deletions drivers/char/drm/ati_pcigart.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static void *drm_ati_alloc_pcigart_table(int order)
struct page *page;
int i;

DRM_DEBUG("%s: alloc %d order\n", __FUNCTION__, order);
DRM_DEBUG("%d order\n", order);

address = __get_free_pages(GFP_KERNEL | __GFP_COMP,
order);
Expand All @@ -54,7 +54,7 @@ static void *drm_ati_alloc_pcigart_table(int order)
for (i = 0; i < order; i++, page++)
SetPageReserved(page);

DRM_DEBUG("%s: returning 0x%08lx\n", __FUNCTION__, address);
DRM_DEBUG("returning 0x%08lx\n", address);
return (void *)address;
}

Expand All @@ -63,7 +63,7 @@ static void drm_ati_free_pcigart_table(void *address, int order)
struct page *page;
int i;
int num_pages = 1 << order;
DRM_DEBUG("%s\n", __FUNCTION__);
DRM_DEBUG("\n");

page = virt_to_page((unsigned long)address);

Expand Down
4 changes: 2 additions & 2 deletions drivers/char/drm/drm_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int drm_irq_install(struct drm_device * dev)
dev->irq_enabled = 1;
mutex_unlock(&dev->struct_mutex);

DRM_DEBUG("%s: irq=%d\n", __FUNCTION__, dev->irq);
DRM_DEBUG("irq=%d\n", dev->irq);

if (drm_core_check_feature(dev, DRIVER_IRQ_VBL)) {
init_waitqueue_head(&dev->vbl_queue);
Expand Down Expand Up @@ -164,7 +164,7 @@ int drm_irq_uninstall(struct drm_device * dev)
if (!irq_enabled)
return -EINVAL;

DRM_DEBUG("%s: irq=%d\n", __FUNCTION__, dev->irq);
DRM_DEBUG("irq=%d\n", dev->irq);

dev->driver->irq_uninstall(dev);

Expand Down
10 changes: 5 additions & 5 deletions drivers/char/drm/drm_scatter.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)
struct drm_sg_mem *entry;
unsigned long pages, i, j;

DRM_DEBUG("%s\n", __FUNCTION__);
DRM_DEBUG("\n");

if (!drm_core_check_feature(dev, DRIVER_SG))
return -EINVAL;
Expand All @@ -81,7 +81,7 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)

memset(entry, 0, sizeof(*entry));
pages = (request->size + PAGE_SIZE - 1) / PAGE_SIZE;
DRM_DEBUG("sg size=%ld pages=%ld\n", request->size, pages);
DRM_DEBUG("size=%ld pages=%ld\n", request->size, pages);

entry->pages = pages;
entry->pagelist = drm_alloc(pages * sizeof(*entry->pagelist),
Expand Down Expand Up @@ -122,8 +122,8 @@ int drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather * request)

entry->handle = ScatterHandle((unsigned long)entry->virtual);

DRM_DEBUG("sg alloc handle = %08lx\n", entry->handle);
DRM_DEBUG("sg alloc virtual = %p\n", entry->virtual);
DRM_DEBUG("handle = %08lx\n", entry->handle);
DRM_DEBUG("virtual = %p\n", entry->virtual);

for (i = (unsigned long)entry->virtual, j = 0; j < pages;
i += PAGE_SIZE, j++) {
Expand Down Expand Up @@ -210,7 +210,7 @@ int drm_sg_free(struct drm_device *dev, void *data,
if (!entry || entry->handle != request->handle)
return -EINVAL;

DRM_DEBUG("sg free virtual = %p\n", entry->virtual);
DRM_DEBUG("virtual = %p\n", entry->virtual);

drm_sg_cleanup(entry);

Expand Down
4 changes: 2 additions & 2 deletions drivers/char/drm/drm_vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static __inline__ struct page *drm_do_vm_shm_nopage(struct vm_area_struct *vma,
return NOPAGE_SIGBUS;
get_page(page);

DRM_DEBUG("shm_nopage 0x%lx\n", address);
DRM_DEBUG("0x%lx\n", address);
return page;
}

Expand Down Expand Up @@ -294,7 +294,7 @@ static __inline__ struct page *drm_do_vm_dma_nopage(struct vm_area_struct *vma,

get_page(page);

DRM_DEBUG("dma_nopage 0x%lx (page %lu)\n", address, page_nr);
DRM_DEBUG("0x%lx (page %lu)\n", address, page_nr);
return page;
}

Expand Down
22 changes: 8 additions & 14 deletions drivers/char/drm/i810_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ static void i810EmitState(struct drm_device * dev)
drm_i810_sarea_t *sarea_priv = dev_priv->sarea_priv;
unsigned int dirty = sarea_priv->dirty;

DRM_DEBUG("%s %x\n", __FUNCTION__, dirty);
DRM_DEBUG("%x\n", dirty);

if (dirty & I810_UPLOAD_BUFFERS) {
i810EmitDestVerified(dev, sarea_priv->BufferState);
Expand Down Expand Up @@ -802,8 +802,7 @@ static void i810_dma_dispatch_flip(struct drm_device * dev)
int pitch = dev_priv->pitch;
RING_LOCALS;

DRM_DEBUG("%s: page=%d pfCurrentPage=%d\n",
__FUNCTION__,
DRM_DEBUG("page=%d pfCurrentPage=%d\n",
dev_priv->current_page,
dev_priv->sarea_priv->pf_current_page);

Expand Down Expand Up @@ -848,8 +847,6 @@ static void i810_dma_quiescent(struct drm_device * dev)
drm_i810_private_t *dev_priv = dev->dev_private;
RING_LOCALS;

/* printk("%s\n", __FUNCTION__); */

i810_kernel_lost_context(dev);

BEGIN_LP_RING(4);
Expand All @@ -869,8 +866,6 @@ static int i810_flush_queue(struct drm_device * dev)
int i, ret = 0;
RING_LOCALS;

/* printk("%s\n", __FUNCTION__); */

i810_kernel_lost_context(dev);

BEGIN_LP_RING(2);
Expand Down Expand Up @@ -949,7 +944,7 @@ static int i810_dma_vertex(struct drm_device *dev, void *data,

LOCK_TEST_WITH_RETURN(dev, file_priv);

DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n",
DRM_DEBUG("idx %d used %d discard %d\n",
vertex->idx, vertex->used, vertex->discard);

if (vertex->idx < 0 || vertex->idx > dma->buf_count)
Expand Down Expand Up @@ -987,7 +982,7 @@ static int i810_clear_bufs(struct drm_device *dev, void *data,
static int i810_swap_bufs(struct drm_device *dev, void *data,
struct drm_file *file_priv)
{
DRM_DEBUG("i810_swap_bufs\n");
DRM_DEBUG("\n");

LOCK_TEST_WITH_RETURN(dev, file_priv);

Expand Down Expand Up @@ -1068,11 +1063,10 @@ static void i810_dma_dispatch_mc(struct drm_device * dev, struct drm_buf * buf,

sarea_priv->dirty = 0x7f;

DRM_DEBUG("dispatch mc addr 0x%lx, used 0x%x\n", address, used);
DRM_DEBUG("addr 0x%lx, used 0x%x\n", address, used);

dev_priv->counter++;
DRM_DEBUG("dispatch counter : %ld\n", dev_priv->counter);
DRM_DEBUG("i810_dma_dispatch_mc\n");
DRM_DEBUG("start : %lx\n", start);
DRM_DEBUG("used : %d\n", used);
DRM_DEBUG("start + used - 4 : %ld\n", start + used - 4);
Expand Down Expand Up @@ -1179,7 +1173,7 @@ static void i810_do_init_pageflip(struct drm_device * dev)
{
drm_i810_private_t *dev_priv = dev->dev_private;

DRM_DEBUG("%s\n", __FUNCTION__);
DRM_DEBUG("\n");
dev_priv->page_flipping = 1;
dev_priv->current_page = 0;
dev_priv->sarea_priv->pf_current_page = dev_priv->current_page;
Expand All @@ -1189,7 +1183,7 @@ static int i810_do_cleanup_pageflip(struct drm_device * dev)
{
drm_i810_private_t *dev_priv = dev->dev_private;

DRM_DEBUG("%s\n", __FUNCTION__);
DRM_DEBUG("\n");
if (dev_priv->current_page != 0)
i810_dma_dispatch_flip(dev);

Expand All @@ -1202,7 +1196,7 @@ static int i810_flip_bufs(struct drm_device *dev, void *data,
{
drm_i810_private_t *dev_priv = dev->dev_private;

DRM_DEBUG("%s\n", __FUNCTION__);
DRM_DEBUG("\n");

LOCK_TEST_WITH_RETURN(dev, file_priv);

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/drm/i810_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ extern int i810_max_ioctl;

#define BEGIN_LP_RING(n) do { \
if (I810_VERBOSE) \
DRM_DEBUG("BEGIN_LP_RING(%d) in %s\n", n, __FUNCTION__); \
DRM_DEBUG("BEGIN_LP_RING(%d)\n", n); \
if (dev_priv->ring.space < n*4) \
i810_wait_ring(dev, n*4); \
dev_priv->ring.space -= n*4; \
Expand Down
3 changes: 1 addition & 2 deletions drivers/char/drm/i830_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ extern int i830_driver_device_is_agp(struct drm_device * dev);

#define BEGIN_LP_RING(n) do { \
if (I830_VERBOSE) \
printk("BEGIN_LP_RING(%d) in %s\n", \
n, __FUNCTION__); \
printk("BEGIN_LP_RING(%d)\n", (n)); \
if (dev_priv->ring.space < n*4) \
i830_wait_ring(dev, n*4, __FUNCTION__); \
outcount = 0; \
Expand Down
6 changes: 3 additions & 3 deletions drivers/char/drm/i915_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ static int i915_getparam(struct drm_device *dev, void *data,
int value;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down Expand Up @@ -691,7 +691,7 @@ static int i915_setparam(struct drm_device *dev, void *data,
drm_i915_setparam_t *param = data;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down Expand Up @@ -721,7 +721,7 @@ static int i915_set_status_page(struct drm_device *dev, void *data,
drm_i915_hws_addr_t *hws = data;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down
5 changes: 2 additions & 3 deletions drivers/char/drm/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,8 @@ extern void i915_mem_release(struct drm_device * dev,

#define BEGIN_LP_RING(n) do { \
if (I915_VERBOSE) \
DRM_DEBUG("BEGIN_LP_RING(%d) in %s\n", \
(n), __FUNCTION__); \
if (dev_priv->ring.space < (n)*4) \
DRM_DEBUG("BEGIN_LP_RING(%d)\n", (n)); \
if (dev_priv->ring.space < (n)*4) \
i915_wait_ring(dev, (n)*4, __FUNCTION__); \
outcount = 0; \
outring = dev_priv->ring.tail; \
Expand Down
20 changes: 9 additions & 11 deletions drivers/char/drm/i915_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ static int i915_emit_irq(struct drm_device * dev)

i915_kernel_lost_context(dev);

DRM_DEBUG("%s\n", __FUNCTION__);
DRM_DEBUG("\n");

dev_priv->sarea_priv->last_enqueue = ++dev_priv->counter;

Expand All @@ -300,7 +300,7 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr)
drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private;
int ret = 0;

DRM_DEBUG("%s irq_nr=%d breadcrumb=%d\n", __FUNCTION__, irq_nr,
DRM_DEBUG("irq_nr=%d breadcrumb=%d\n", irq_nr,
READ_BREADCRUMB(dev_priv));

if (READ_BREADCRUMB(dev_priv) >= irq_nr)
Expand All @@ -312,8 +312,7 @@ static int i915_wait_irq(struct drm_device * dev, int irq_nr)
READ_BREADCRUMB(dev_priv) >= irq_nr);

if (ret == -EBUSY) {
DRM_ERROR("%s: EBUSY -- rec: %d emitted: %d\n",
__FUNCTION__,
DRM_ERROR("EBUSY -- rec: %d emitted: %d\n",
READ_BREADCRUMB(dev_priv), (int)dev_priv->counter);
}

Expand All @@ -329,7 +328,7 @@ static int i915_driver_vblank_do_wait(struct drm_device *dev, unsigned int *sequ
int ret = 0;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down Expand Up @@ -365,7 +364,7 @@ int i915_irq_emit(struct drm_device *dev, void *data,
LOCK_TEST_WITH_RETURN(dev, file_priv);

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand All @@ -388,7 +387,7 @@ int i915_irq_wait(struct drm_device *dev, void *data,
drm_i915_irq_wait_t *irqwait = data;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down Expand Up @@ -418,13 +417,12 @@ int i915_vblank_pipe_set(struct drm_device *dev, void *data,
drm_i915_vblank_pipe_t *pipe = data;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

if (pipe->pipe & ~(DRM_I915_VBLANK_PIPE_A|DRM_I915_VBLANK_PIPE_B)) {
DRM_ERROR("%s called with invalid pipe 0x%x\n",
__FUNCTION__, pipe->pipe);
DRM_ERROR("called with invalid pipe 0x%x\n", pipe->pipe);
return -EINVAL;
}

Expand All @@ -443,7 +441,7 @@ int i915_vblank_pipe_get(struct drm_device *dev, void *data,
u16 flag;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down
8 changes: 4 additions & 4 deletions drivers/char/drm/i915_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ int i915_mem_alloc(struct drm_device *dev, void *data,
struct mem_block *block, **heap;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down Expand Up @@ -314,7 +314,7 @@ int i915_mem_free(struct drm_device *dev, void *data,
struct mem_block *block, **heap;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand Down Expand Up @@ -342,7 +342,7 @@ int i915_mem_init_heap(struct drm_device *dev, void *data,
struct mem_block **heap;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
DRM_ERROR("called with no initialization\n");
return -EINVAL;
}

Expand All @@ -366,7 +366,7 @@ int i915_mem_destroy_heap( struct drm_device *dev, void *data,
struct mem_block **heap;

if ( !dev_priv ) {
DRM_ERROR( "%s called with no initialization\n", __FUNCTION__ );
DRM_ERROR( "called with no initialization\n" );
return -EINVAL;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/drm/mga_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ int mga_dma_flush(struct drm_device *dev, void *data,
#if MGA_DMA_DEBUG
int ret = mga_do_wait_for_idle(dev_priv);
if (ret < 0)
DRM_INFO("%s: -EBUSY\n", __FUNCTION__);
DRM_INFO("-EBUSY\n");
return ret;
#else
return mga_do_wait_for_idle(dev_priv);
Expand Down
Loading

0 comments on commit 3e684ea

Please sign in to comment.