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]
Message-ID: <1387470731.2353.7.camel@joe-AO722>
Date:	Thu, 19 Dec 2013 08:32:11 -0800
From:	Joe Perches <joe@...ches.com>
To:	Laszlo Papp <lpapp@....org>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: Lindent formatting issues

On Thu, 2013-12-19 at 16:17 +0000, Laszlo Papp wrote:
> On Tue, Dec 17, 2013 at 8:05 PM, Joe Perches <joe@...ches.com> wrote:
[]
> > You could also use scripts/checkpatch.pl with
> > the --fix option.
> >
> > ./scripts/checkpatch.pl -f --fix <file>
> >
> > with various --types=<TYPE,...> options.
> >
> > Maybe use: https://lkml.org/lkml/2013/9/23/504
> 
> Thanks Joe. I seem to have further issues with this tool... I tried to
> run it on a file I patched, but it generated a lot of noise unrelated
> to my logical change... :(

checkpatch is really for patches.  Using -f is a
convenience ability.  You can limit what messages
checkpatch emits by using "--types=<FOO[,BAR...]>"

You can show what message classifications are being
used by adding "--show-types".

> Do you happen to know what the best way is to fix it in such cases? I
> am providing some examples below:
> 
>         if (devattr == &sensor_dev_attr_fan1_max_alarm.dev_attr
> -        || devattr == &sensor_dev_attr_fan1_min_alarm.dev_attr
> -        || devattr == &sensor_dev_attr_fan1_fault.dev_attr
> -        || devattr == &sensor_dev_attr_gpio1_alarm.dev_attr
> -        || devattr == &sensor_dev_attr_gpio2_alarm.dev_attr) {
> +           || devattr == &sensor_dev_attr_fan1_min_alarm.dev_attr
> +           || devattr == &sensor_dev_attr_fan1_fault.dev_attr
> +           || devattr == &sensor_dev_attr_gpio1_alarm.dev_attr
> +           || devattr == &sensor_dev_attr_gpio2_alarm.dev_attr) {

Well, here the general kernel style is to put
the logical && or || test at the end of the
previous line so:

	if (devattr == &sensor_dev_attr_fan1_max_alarm.dev_attr ||
	    devattr == &sensor_dev_attr_fan1_min_alarm.dev_attr ||
	    devattr == &sensor_dev_attr_fan1_fault.dev_attr ||
	    devattr == &sensor_dev_attr_gpio1_alarm.dev_attr ||
	    devattr == &sensor_dev_attr_gpio2_alarm.dev_attr) {

would likely be preferred.

> -                                   int n)
> +                                    int n)

This may be indentation alignment but I don't follow
how this is a problem.

> -       int sysfs_modes[4] = {0, 1, 2, 1};
> +       int sysfs_modes[4] = { 0, 1, 2, 1 };

Is this change from Lindent or checkpatch?

--
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