Re: [PATCH v4] staging: comedi: Improved readability of function comedi_nsamples_left.
From: Dan Carpenter
Date: Wed Jun 13 2018 - 05:30:38 EST
Sooooooooo close...
On Tue, Jun 12, 2018 at 11:09:44PM +0200, Chris Opperman wrote:
> Changes since v3:
> a) Reverted u64 to unsigned long long and u32 to unsigned int.
> b) Added patch versioning.
> c) Changed type of scans_left to unsigned long long to avoid cast.
> d) Clarified and updated changelog.
>
> >8-----------------------------------------------------------------------8<
This part here needs to go ...
>
> Improve readability of comedi_nsamples_left:
> a) Reduce nesting by using more return statements.
> b) Declare variables scans_left and samples_left at start of function.
> c) Change type of scans_Left to unsigned long long to avoid cast.
^
>
> Signed-off-by: Chris Opperman <eklikeroomys@xxxxxxxxx>
> ---
... down here, under the --- cut off line.
> drivers/staging/comedi/drivers.c | 26 +++++++++++++-------------
> 1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
regards,
dan carpenter