On 3/14/19 10:34 PM, Philippe Mathieu-Daudé wrote: >> +static int qpa_validate_per_direction_opts (Audiodev *dev, >> AudiodevPaPerDirectionOptions *pdo) > > If this function is expected to return a boolean value, please use the > 'bool' C type and true/false. > >> +{ >> + if (!pdo->has_buffer_length) { >> + pdo->has_buffer_length = true; >> + pdo->buffer_length = dev->timer_period * 4; > > buffer_length set: return true. > >> + } > > else, also return true? > > Why return a value then? > >> + return 1; >> +}
You're right, in the current state it makes no sense. I did it because I also want to add the possibility that validation fails. For example, a buffer length of 0 is invalid, but the case is not handled at the moment. Since I was not sure how exactly to do the validation (wanted Kraxel to answer first), that case is missing atm.