Re: [PATCH] Fixed coding style problems.

From: Dan Carpenter
Date: Fri Jun 08 2018 - 18:12:28 EST


The subject should be:

[PATCH] staging: comedi: shorten a long line

or something. You need the subsystem prefix. Try not to be vague.


On Fri, Jun 08, 2018 at 08:52:37PM +0200, Chris Opperman wrote:
> This patch fixes a coding style problem in drivers/staging/comedi/drivers.c
> and is submitted for task 10 of the eudyptula challenge.
> Signed-off-by: Chris Opperman <eklikeroomys@xxxxxxxxx>

You need a blank line before the Signed-off-by line.

Best not to mention eudyptula. The patch should be a readability
improvement which justifies itsefl.

> ---
> drivers/staging/comedi/drivers.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
> index 9d73347..90ee974 100644
> --- a/drivers/staging/comedi/drivers.c
> +++ b/drivers/staging/comedi/drivers.c
> @@ -475,7 +475,8 @@ unsigned int comedi_nsamples_left(struct comedi_subdevice *s,
> struct comedi_cmd *cmd = &async->cmd;
>
> if (cmd->stop_src == TRIG_COUNT) {
> - unsigned int scans_left = __comedi_nscans_left(s, cmd->stop_arg);
> + unsigned int scans_left =
> + __comedi_nscans_left(s, cmd->stop_arg);

This isn't really a readability improvement. Checkpatch.pl is not the
king of the world. It's only useful so far as it improves readability.

We would still have accepted the patch probably but the format wasn't
right because of the subject line.

> unsigned int scan_pos =
> comedi_bytes_to_samples(s, async->scan_progress);
> unsigned long long samples_left = 0;

regards,
dan carpenter