Re: [PATCH] em28xx: fix compiler warnings

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

 



On Tue, Aug 5, 2014 at 8:18 AM, Hans Verkuil <hverkuil@xxxxxxxxx> wrote:
> On 08/05/2014 03:57 PM, Shuah Khan wrote:
> I'm not sure what you mean. It *was* a local variable, that was the problem.
> There are two option: one is to add it to the main struct, then other is to
> allocate and free it inside the function. In general I dislike that since it
> adds aan extra check (did we really get the memory?) and you have to make sure
> you will free the memory. And that's besides the overhead of having to allocate
> memory. Originally I named tmp_i2c_client 'probe_i2c_client', but then I saw
> that the ir code needs it as well. If the ir code is fixed so it has its own
> i2c client, then the name can revert to probe_i2c_client.
>

Right. Adding it to the main structure is better than alloc and free the memory.
Would i2c_client_buf or i2c_client_data sound better than tmp_i2c_client?

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




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux