lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 21 Jul 2014 06:06:25 -0700
From:	Joe Perches <joe@...ches.com>
To:	Lee Jones <lee.jones@...aro.org>
Cc:	Andy Whitcroft <apw@...onical.com>, linux-kernel@...r.kernel.org
Subject: Re: Checkpatch query

On Mon, 2014-07-21 at 12:39 +0100, Lee Jones wrote:
> Hi Andy, Joe,

Hi Lee.

> When running checkpatch on drivers/mfd/tps80031.c I recieve the
> following warning:
> 
> > WARNING: Possible switch case/default not preceeded by break or
> >          fallthrough comment
> > #337: FILE: drivers/mfd/tps80031.c:337:
> > +       case TPS80031_BACKUP_REG:
> > 
> > total: 0 errors, 1 warnings, 573 lines checked
> 
> ... but we use switch statement fall through all the time when
> identifying different types of registers used with Regmap.  Placing a
> fall-through comment between them all sounds very messy to me.

Yes, it can be messy, but it's found some
actual bugs/defects.

> Also, the warning only fires on 'case's which do not use '...'
> notation, which seems a little odd.

That's a checkpatch defect.  Thanks for the report.

> Anyway, I'm not sure placing a 'fall through' comment makes the code
> any cleaner or reduces possible failure rate in any way.  Is there any
> chance that this check can be removed?

You could use the --ignore= cmd-line option or add it to
a .checkpatch.conf file.

$ ./scripts/checkpatch.pl -f drivers/mfd/tps80031.c  --ignore=missing_break
WARNING: Possible unnecessary 'out of memory' message
#435: FILE: drivers/mfd/tps80031.c:435:
+	if (!tps80031) {
+		dev_err(&client->dev, "Malloc failed for tps80031\n");

total: 0 errors, 1 warnings, 573 lines checked

NOTE: Ignored message types: MISSING_BREAK

drivers/mfd/tps80031.c has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ