Re: [PATCH BlueZ 2/5] AVRCP: rename avrcp_header to avc_header

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

 



Hi Szymon,

On Mon, Sep 12, 2011 at 4:37 PM, Szymon Janc <szymon.janc@xxxxxxxxx> wrote:
>> Hi Luiz
>
>> >        sk = g_io_channel_unix_get_fd(control->io);
>> > @@ -1451,19 +1451,19 @@ static struct pdu_handler {
>> >  /* handle vendordep pdu inside an avctp packet */
>> >  static int handle_vendordep_pdu(struct control *control,
>> >                                        struct avctp_header *avctp,
>> > -                                       struct avrcp_header *avrcp,
>> > +                                       struct avc_header *avc,
>> >                                        int operand_count)
>> >  {
>> >        struct pdu_handler *handler;
>> > -       struct avrcp_spec_avc_pdu *pdu = (void *) avrcp + AVRCP_HEADER_LENGTH;
>> > +       struct avrcp_spec_avc_pdu *pdu = (void *) avc + AVC_HEADER_LENGTH;
>>
>> We might want to change this to:
>>
>> struct avrcp_spec_avc_pdu *pdu = (avrcp_spec_avc_pdu *)(avc +
>> AVC_HEADER_LENGTH);
>
> I don't think this is correct, that would result in jumping
> 5 * (sizeof (struct avc_header)) bytes..

I fail to see how the multiplication got into you equation, but anyway
I would prefer using something like this (void *)
&avc[AVC_HEADER_LENGTH], but that should be a different patch.

>> This way we kill some warnings on ARM: arithmetic with void pointer
>
> This should happen only if compiling with -Wpointer-arith or -pedantic.

I don't think we use those.

-- 
Luiz Augusto von Dentz
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux