On Wednesday 23 of April 2014 14:12:59 Oliver Neukum wrote: > On Tue, 2014-04-22 at 15:59 +0200, Michal Malý wrote: > > +/* Some devices might have a limit on how many uncombinable effects > > + * can be played at once */ > > +static int mlnx_upload_conditional(struct mlnx_device *mlnxdev, > > + const struct ff_effect *effect) > > +{ > > + struct mlnx_effect_command ecmd = { > > + .cmd = MLNX_UPLOAD_UNCOMB, > > + .u.uncomb.id = effect->id, > > + .u.uncomb.effect = effect > > + }; > > + return mlnxdev->control_effect(mlnxdev->dev, mlnxdev->private, > > &ecmd); > > +} > > + > > This mean you are building the structure on the stack > > 1. Are you sure nobody retains a reference? Yes. The command is a one-shot thing so it makes no sense to hold a persistent reference to it. Should the HW-specific driver need to keep any data from the command - if the uses a workqueue to submit data to the device for instance - it should keep its own copy of the data. The idea is to keep MLNX and HW- specific driver as separated as possible to prevent any race conditions. > 2. That is needlessly inefficient Are you suggesting I drop the 'consts' and keep the memory preallocated? Thanks for the feedback, Michal -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html