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] [day] [month] [year] [list]
Date:	Fri, 25 Feb 2011 17:01:43 -0800
From:	Joe Perches <joe@...ches.com>
To:	Peter Tyser <ptyser@...-inc.com>
Cc:	linux-kernel@...r.kernel.org, Alek Du <alek.du@...el.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Eric Miao <eric.y.miao@...il.com>,
	Uwe Kleine-K?nig <u.kleine-koenig@...gutronix.de>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Grant Likely <grant.likely@...retlab.ca>,
	Vincent Palatin <vpalatin@...omium.org>
Subject: Re: [PATCH v4 4/4] gpio: Add support for Intel
 ICHx/3100/Series[56] GPIO

On Fri, 2011-02-25 at 15:26 -0600, Peter Tyser wrote:
> This driver works on many Intel chipsets, including the ICH6, ICH7,
> ICH8, ICH9, ICH10, 3100, Series 5/3400 (Ibex Peak), Series 6/C200
> (Cougar Point).

Hi Peter.

just trivia...

> diff --git a/drivers/gpio/ichx_gpio.c b/drivers/gpio/ichx_gpio.c
[]
> @@ -0,0 +1,551 @@
> +/*
> + * Intel ICH6-10, Series 5 and 6 GPIO driver
[]
> + */
> +

You could use

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

before any #include

so that the uses of
	printk(KERN_<level> "%s: foo...\n", DRV_NAME, bar...);
can be
	pr_<level>("foo...\n", bar...);

> +#include <linux/module.h>
> +#include <linux/pci.h>
> +#include <linux/gpio.h>
> +#include <linux/platform_device.h>

[]

> +static int modparam_gpiobase = -1 /* dynamic */;

Pretty unusual commenting style and too easy to lose sight
of the terminating semicolon.

It's more usually written as:

static int modparam_gpiobase = -1;	/* dynamic */

> +static int __devinit ichx_gpio_init(struct pci_dev *pdev,
> +				const struct pci_device_id *ent,
> +				struct platform_device *dev)
> +{
[]
> +	if (!ichx_priv.gpio_base) {
> +		printk(KERN_ERR "%s: GPIO BAR not enumerated\n", DRV_NAME);

print->pr_<level> like:
		pr_err("GPIO BAR not enumerated\n");

> +	if (ichx_priv.desc->gpe0_sts_ofs) {
> +		pci_read_config_dword(pdev, PCI_ICHX_ACPI_BAR,
> +				      (u32 *)&ichx_priv.pm_base);
> +		ichx_priv.pm_base &= PCI_BASE_ADDRESS_IO_MASK;
> +		if (!ichx_priv.pm_base)
> +			printk(KERN_WARNING "%s: ACPI BAR not enumerated, "
> +			       "GPI 0 - 15 unusable\n", DRV_NAME);

			pr_warn("ACPI BAR not enumerated, GPI 0 - 15 unusable\n");

and so forth for all the printks.

One other typo:

> +static int ich6_gpio_request(struct gpio_chip *chip, unsigned nr)
> +{
> +	/*
> +	 * Fixups for bits 16 and 17 are necessary on the Intel ICH6/3100
> +	 * brdige as they are controlled by USE register bits 0 and 1.  See
> 

	bridge


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