lkml.org 
[lkml]   [2020]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 02/16] bus: mhi: core: Add support for registering MHI controllers
On Fri, Jan 24, 2020 at 07:24:43AM -0700, Jeffrey Hugo wrote:
> > > +/**
> > > + * struct mhi_result - Completed buffer information
> > > + * @buf_addr: Address of data buffer
> > > + * @dir: Channel direction
> > > + * @bytes_xfer: # of bytes transferred
> > > + * @transaction_status: Status of last transaction
> > > + */
> > > +struct mhi_result {
> > > + void *buf_addr;
> >
> > Why void *?
>
> Because its not possible to resolve this more clearly. The client provides
> the buffer and knows what the structure is. The bus does not. Its just an
> opaque pointer (hence void *) to the bus, and the client needs to decode it.
> This is the struct that is handed to the client to allow them to decode the
> activity (either a received buf, or a confirmation that a transmitted buf
> has been consumed).

Then shouldn't this be a "u8 *" instead as you are saying how many bytes
are here?

thanks,

greg k-h

\
 
 \ /
  Last update: 2020-01-24 18:52    [W:0.105 / U:2.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site