mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: "Li, Aubrey" <aubrey.li@linux.intel.com>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	mingo@redhat.com, tglx@linutronix.de,
	linux-kernel@vger.kernel.org,
	"alan@linux.intel.com" <alan@linux.intel.com>
Subject: Re: [PATCH] x86: new Intel Atom SoC power management controller driver
Date: Thu, 06 Mar 2014 16:41:11 -0800	[thread overview]
Message-ID: <1394152871.16156.32.camel@joe-AO722> (raw)
In-Reply-To: <53191222.2000904@linux.intel.com>

On Fri, 2014-03-07 at 08:26 +0800, Li, Aubrey wrote:

> my patch is word wrapped while I was not aware, hope this one work.

trivial notes:

> diff --git a/arch/x86/include/asm/pmc_atom.h b/arch/x86/include/asm/pmc_atom.h
[]
> +#define	BIT_LPSS1_F0_DMA	(1 << 0)
> +#define	BIT_LPSS1_F1_PWM1	(1 << 1)

These could use BIT(foo)

#define	BIT_LPSS1_F0_DMA	BIT(0)
#define	BIT_LPSS1_F1_PWM1	BIT(1)

etc..

> +#define	BIT_SMB			(1 << 0)
> +#define	BIT_USH_SS_PHY		(1 << 1)
> +#define	BIT_OTG_SS_PHY		(1 << 2)
> +#define	BIT_DFX			(1 << 3)

here too.

> diff --git a/arch/x86/kernel/pmc_atom.c b/arch/x86/kernel/pmc_atom.c
[]
> @@ -0,0 +1,301 @@
> +/*
> + * Intel Atom SOC Power Management Controller Driver
[]
> + */

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

> +static void pmc_power_off(void)
> +{
[]
> +	printk(KERN_INFO, "PMC: Preparing to enter system sleep state S5\n");

	pr_info("Preparing to enter system sleep state S5\n");

> +		if (func_dis_index & dev_map[dev_index].bit_mask) {
> +			seq_printf(s, "Dev: %-32s\tState: %s [%s]\n",
> +				dev_map[dev_index].name, "Disabled",
> +				(d3_sts_index & dev_map[dev_index].bit_mask) ?
> +				"D3":"D0");
> +		} else {
> +			seq_printf(s, "Dev: %-32s\tState: %s [%s]\n",
> +				dev_map[dev_index].name, "Enabled ",
> +				(d3_sts_index & dev_map[dev_index].bit_mask) ?
> +				"D3":"D0");
> +		}

Maybe better with a single seq_printf

		seq_printf(s, "Dev: %-32s\tState: %s [%s]\n",
			   dev_map[dev_index].name,
			   dev_map[dev_index].bit_mask & func_dis_index ?
			   "Disabled" : " Enabled ",
			   dev_map[dev_index].bit_mask & d3_sts_index ?
			   "D3" : "D0");

> +static int pmc_probe(struct pci_dev *pdev,
> +			  const struct pci_device_id *unused)
> +{

> +	pmc = devm_kzalloc(&pdev->dev, sizeof(struct pmc_dev), GFP_KERNEL);
> +	if (!pmc) {
> +		dev_err(&pdev->dev, "error: could not allocate memory\n");

Unnecessary OOM message, kzalloc will dump_stack()



  reply	other threads:[~2014-03-07  0:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-06  3:31 Li, Aubrey
2014-03-06  3:49 ` H. Peter Anvin
2014-03-06  5:21   ` Li, Aubrey
2014-03-06  5:28     ` H. Peter Anvin
2014-03-06  5:33       ` Li, Aubrey
2014-03-06  5:52         ` H. Peter Anvin
2014-03-06  5:58           ` Li, Aubrey
2014-03-06 16:30             ` H. Peter Anvin
2014-03-07  0:26               ` Li, Aubrey
2014-03-07  0:41                 ` Joe Perches [this message]
2014-03-07  2:08                   ` Li, Aubrey
2014-03-07  2:21                     ` Joe Perches
2014-03-07  3:04                       ` Li, Aubrey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394152871.16156.32.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=alan@linux.intel.com \
    --cc=aubrey.li@linux.intel.com \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®