lkml.org 
[lkml]   [2014]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCHv4,2/5] mailbox: Introduce framework for mailbox
From
On 28 March 2014 20:54, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> On Sat, Mar 29, 2014 at 3:38 AM, Markus Mayer <markus.mayer@linaro.org> wrote:
>
> .....
>
>>> +int mbox_send_message(struct mbox_chan *chan, void *mssg)
>>> +{
>>> + int t;
>>> +
>>> + if (!chan || !chan->cl)
>>> + return -EINVAL;
>>> +
>>> + t = _add_to_rbuf(chan, mssg);
>>> + if (t < 0) {
>>> + pr_err("Try increasing MBOX_TX_QUEUE_LEN\n");
>>> + return t;
>>> + }
>>> +
>>> + _msg_submit(chan);
>>> +
>>> + if (chan->txdone_method == TXDONE_BY_POLL)
>>> + poll_txdone((unsigned long)chan->con);
>>
>> Wouldn't it be cleaner to use
>> poll_txdone((unsigned long)&chan->con);
>> ?
>>
> Here's how we use it ...
>
> static void poll_txdone(unsigned long data)
> {
> struct mbox_con *con = (struct mbox_con *)data;
> .....
> }
>
> To me, unnecessarily passing a pointer to a pointer seems unclean.

You are right. I didn't look closely enough.

Regards,
-Markus


\
 
 \ /
  Last update: 2014-04-01 01:21    [W:0.083 / U:8.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site