Hi everyone,

I compiled the ion driver with W=1 where I encountered the two following
warnings and I had a couple of questions about solving them.


1.

drivers/staging/android/ion/ion.c: In function ‘ion_dma_buf_begin_cpu_access’:
drivers/staging/android/ion/ion.c:316:8: warning: variable ‘vaddr’ set but not 
used [-Wunused-but-set-variable]

which concerns the following function:

static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
                                        enum dma_data_direction direction)
{
        struct ion_buffer *buffer = dmabuf->priv;
        void *vaddr;
        struct ion_dma_buf_attachment *a;

        /*
         * TODO: Move this elsewhere because we don't always need a vaddr
         */
        if (buffer->heap->ops->map_kernel) {
                mutex_lock(&buffer->lock);
                vaddr = ion_buffer_kmap_get(buffer);
                mutex_unlock(&buffer->lock);
        }

        mutex_lock(&buffer->lock);
        list_for_each_entry(a, &buffer->attachments, list) {
                dma_sync_sg_for_cpu(a->dev, a->table->sgl, a->table->nents,
                                    direction);
        }
        mutex_unlock(&buffer->lock);

        return 0;
}

Can vaddr be removed and just have ion_buffer_kmap_get remain, since it is 
never used again in the function?


2.

drivers/staging/android/ion/ion_carveout_heap.c:106:18: warning: no previous 
prototype for ‘ion_carveout_heap_create’ [-Wmissing-prototypes]
drivers/staging/android/ion/ion_chunk_heap.c:111:18: warning: no previous 
prototype for ‘ion_chunk_heap_create’ [-Wmissing-prototypes]

It appears neither of these functions are used since commit 2f87f50b2340
("staging: android: ion: Rework heap registration/enumeration"). Ultimately,
removing the whole file fixes this warning; is there still a need to rework
them or can they be removed?


If any part of this email was formatted incorrectly or could be done better,
please let me know!

Thank you,
Nathan Chancellor
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to