Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1339736

Re: [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in dma desc

From Murali Karicheri <m-karicheri2@ti.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in dma desc
Date 2016-02-22 18:10 +0100
Message-ID <r529I-AD-21@gated-at.bofh.it> (permalink)
References <r3Xvt-qi-9@gated-at.bofh.it> <r40jG-2yF-31@gated-at.bofh.it> <r41IK-3Oe-9@gated-at.bofh.it> <r41IK-3Oe-7@gated-at.bofh.it>
Organization Texas Instruments

Show all headers | View raw


On 02/19/2016 05:25 PM, Arnd Bergmann wrote:
> On Friday 19 February 2016 17:21:57 Murali Karicheri wrote:
>>>>              get_pkt_info(&dma_buf, &tmp, &dma_desc, ndesc);
>>>> -            get_sw_data((u32 *)&buf_ptr, &buf_len, ndesc);
>>>> +            /* warning!!!! We are retrieving the virtual ptr in the sw_data
>>>> +             * field as a 32bit value. Will not work on 64bit machines
>>>> +             */
>>>> +            buf_ptr = (void *)GET_SW_DATA0(ndesc);
>>>> +            buf_len = (int)GET_SW_DATA1(desc);
>>>
>>> I would have abstracted the retrieval of a pointer again,
>>> and added the comment in the helper function once, it doesn't
>>> really need to be duplicated everywhere.
>>>
>> Arnd,
>>
>> I thought about it to add it to the API. API currently set buffer
>> and ptr. It would be an issue only if store/retrieve ptr in/from the sw_data.
>> So for the comment to be really useful to someone who is changing the code,
>> doesn't it make sense to add it at the point of invocation as done in this
>> patch? No?
>>
> 
> Up to you, it was just an idea and you have my Ack either way.
> 
> 	Arnd
> 
Ok. Thanks

-- 
Murali Karicheri
Linux Kernel, Keystone

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] net: ti: netcp: restore get/set_pad_info() functionality Murali Karicheri <m-karicheri2@ti.com> - 2016-02-19 19:00 +0100
  [PATCH v2 2/3] soc: ti: knav_dma: rename pad in struct knav_dma_desc to sw_data Murali Karicheri <m-karicheri2@ti.com> - 2016-02-19 19:00 +0100
    Re: [PATCH v2 2/3] soc: ti: knav_dma: rename pad in struct knav_dma_desc to sw_data Arnd Bergmann <arnd@arndb.de> - 2016-02-19 22:00 +0100
  [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in dma desc Murali Karicheri <m-karicheri2@ti.com> - 2016-02-19 19:00 +0100
    Re: [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in dma desc Arnd Bergmann <arnd@arndb.de> - 2016-02-19 22:00 +0100
      Re: [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in dma desc Arnd Bergmann <arnd@arndb.de> - 2016-02-19 23:30 +0100
        Re: [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in  dma desc Murali Karicheri <m-karicheri2@ti.com> - 2016-02-22 18:10 +0100
      Re: [PATCH v2 3/3] net: netcp: rework the code for get/set sw_data in  dma desc Murali Karicheri <m-karicheri2@ti.com> - 2016-02-19 23:30 +0100
  Re: [PATCH v2 0/3] net: ti: netcp: restore get/set_pad_info()  functionality David Miller <davem@davemloft.net> - 2016-02-22 04:10 +0100

csiph-web