Re: [PATCH 2/2] staging: media: cxd2099: use kzalloc to allocate ci pointer of type struct cxd in cxd2099_attach

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

 



Hello Ezequiel,

On Sun, Aug 5, 2012 at 12:24 AM, Ezequiel Garcia <elezegarcia@xxxxxxxxx> wrote:
> Hi Devendra,
>
> On Sat, Aug 4, 2012 at 3:12 PM, Devendra Naga
> <develkernel412222@xxxxxxxxx> wrote:
>>
>>         mutex_init(&ci->lock);
>>         memcpy(&ci->cfg, cfg, sizeof(struct cxd2099_cfg));
>
> While you're still looking at this driver, perhaps you can change the memcpy
> with a plain struct assignment (if you feel like).
> It's really pointless to use a memcpy here.
>
> Something like this:
>
> -       memcpy(&ci->cfg, cfg, sizeof(struct cxd2099_cfg));
> +       ci->cfg = *cfg;
>
Correct, and also one more thing like this is

-           memcpy(&ci->en, &en_templ, sizeof(en_templ));
+          ci->en = en_templ;

Is it ok if i change ci->cfg and ci->en?
> Regards,
> Ezequiel.

Thanks,
--
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