qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 1/2] pl330: Initial version


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH v5 1/2] pl330: Initial version
Date: Mon, 29 Oct 2012 08:32:56 +0000

On 29 October 2012 06:35, Peter Crosthwaite
<address@hidden> wrote:
> Device model for Primecell PL330 dma controller.

A general question -- this is a DMA controller so should it be using
the DMAContext APIs now? Avi?

> +static void pl330_queue_init(PL330Queue *s, int size, int channum)
> +{
> +    s->queue = (PL330QueueEntry *)g_new0(PL330QueueEntry, size);
> +    s->chan_num = channum;
> +    s->lo_seqn = (uint8_t *)g_malloc0(channum);
> +    s->hi_seqn = (uint8_t *)g_malloc0(channum);

You don't need to cast the return value from g_new0 or g_malloc0.

> +
> +    default:
> +        hw_error("pl330: bad read offset " TARGET_FMT_plx "\n", offset);

This hw_error() (and probably most of the others in this file)
should be replaced by qemu_log_mask() with either LOG_GUEST_ERROR
or LOG_UNIMP as appropriate.

> +    s->manager.parent = s;
> +    s->manager.tag = s->num_chnls;
> +    s->manager.is_manager = 1;

This is a bool, so 'true'.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]