linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	rt@linutronix.de, Thomas Gleixner <tglx@linutronix.de>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Linux PM <linux-pm@vger.kernel.org>
Subject: Re: [PATCH 12/21] cpufreq: Convert to hotplug state machine
Date: Wed, 07 Sep 2016 17:58:46 +0200	[thread overview]
Message-ID: <9891841.xb8KPMjjUJ@vostro.rjw.lan> (raw)
In-Reply-To: <20160907141829.wpsugjvo3mgy5b5y@linutronix.de>

On Wednesday, September 07, 2016 04:18:29 PM Sebastian Andrzej Siewior wrote:
> On 2016-09-06 23:27:46 [+0200], Rafael J. Wysocki wrote:
> > > +       ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, "cpufreq:online",
> > > +                                       cpufreq_online,
> > > +                                       cpufreq_offline);
> > > +       if (ret < 0)
> > > +               goto err_if_unreg;
> > > +       hp_online = ret;
> > 
> > hp_online is enum cpuhp_state (and we pass it to
> > cpuhp_remove_state_nocalls(() later on), but
> > cpuhp_setup_state_nocalls() returns an int (and that should be 0 if it
> > is not an error code AFAICS), so is this actually correct?
> 
> Not sure what you are pointing out here. Let me try to cover it.
> cpuhp_setup_state_nocalls() return <0 for errors. Those are are not
> assigned to hp_online. It returns 0 for success on ID was !=
> CPUHP_AP_ONLINE_DYN and >= 0 for success if ID was CPUHP_AP_ONLINE_DYN.
> In the latter case the dynamic assigned ID is returned which should be
> used if you plan to remove the callbacks.

OK, that last part wasn't clear to me.  The kerneldoc comment for
__cpuhp_setup_state() doesn't mention the possible non-zero return values
on success, which is a bit confusing IMHO.

> Assigning an unsigned int to enum is okay because enumeration constants
> itself should be an int.

But the unsigned int still may be out of range for the given enum, so I
wouldn't call it particularly clean. :-)

Anyway, please feel free to add

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

to the patch.

Thanks,
Rafael

  reply	other threads:[~2016-09-07 15:52 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 17:04 cpu hotplug: convert more drivers (batch #3) Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 01/21] arm64: FP/SIMD: Convert to hotplug state machine Sebastian Andrzej Siewior
2016-09-06 18:14   ` Will Deacon
2016-09-19 19:51   ` [tip:smp/hotplug] arm64/FP/SIMD: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 02/21] ARM: shmobile: " Sebastian Andrzej Siewior
2016-09-06 18:05   ` Geert Uytterhoeven
2016-09-07 13:58     ` Sebastian Andrzej Siewior
2016-09-19 19:52   ` [tip:smp/hotplug] ARM/shmobile: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 03/21] ARM: OMAP: wakeupgen: " Sebastian Andrzej Siewior
2016-09-13 22:24   ` Tony Lindgren
2016-09-19 19:52   ` [tip:smp/hotplug] ARM/OMAP/wakeupgen: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 04/21] ia64: mca: " Sebastian Andrzej Siewior
2016-09-19 19:53   ` [tip:smp/hotplug] ia64/mca: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 05/21] sh: SH-X3 SMP: " Sebastian Andrzej Siewior
2016-09-19 19:53   ` [tip:smp/hotplug] sh/SH-X3 " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 06/21] x86: microcode: " Sebastian Andrzej Siewior
2016-09-07 11:36   ` Borislav Petkov
2016-09-07 14:51     ` Sebastian Andrzej Siewior
2016-09-07 16:02       ` Borislav Petkov
2016-09-07 16:45     ` [PATCH 06/21 v2] " Sebastian Andrzej Siewior
2016-09-19 19:54       ` [tip:smp/hotplug] x86/microcode: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 07/21] lib: irq_poll: " Sebastian Andrzej Siewior
2016-09-19 19:54   ` [tip:smp/hotplug] lib/irq_poll: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 08/21] block: softirq: " Sebastian Andrzej Siewior
2016-09-19 19:55   ` [tip:smp/hotplug] block/softirq: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 09/21] oprofile: timer: " Sebastian Andrzej Siewior
2016-09-19 19:55   ` [tip:smp/hotplug] oprofile/timer: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 10/21] virtio scsi: " Sebastian Andrzej Siewior
2016-09-19 19:56   ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 11/21] ACPI: processor: " Sebastian Andrzej Siewior
2016-09-06 21:08   ` Rafael J. Wysocki
2016-09-07 14:01     ` Sebastian Andrzej Siewior
2016-09-07 15:59       ` Rafael J. Wysocki
2016-09-19 19:56   ` [tip:smp/hotplug] ACPI/processor: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 12/21] cpufreq: " Sebastian Andrzej Siewior
2016-09-06 21:27   ` Rafael J. Wysocki
2016-09-07 14:18     ` Sebastian Andrzej Siewior
2016-09-07 15:58       ` Rafael J. Wysocki [this message]
2016-09-19 19:56   ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-09-20 14:56     ` [PATCH] cpufreq: fix up conversion " Sebastian Andrzej Siewior
2016-09-20 15:07       ` [tip:smp/hotplug] cpufreq: Fix " tip-bot for Sebastian Andrzej Siewior
2016-09-20 16:08         ` Borislav Petkov
2016-09-20 16:17       ` [PATCH] cpufreq: fix " Rafael J. Wysocki
2016-09-06 17:04 ` [PATCH 13/21] padata: Convert " Sebastian Andrzej Siewior
2016-09-19 19:57   ` [tip:smp/hotplug] " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 14/21] fault-injection: cpu: " Sebastian Andrzej Siewior
2016-09-19 19:57   ` [tip:smp/hotplug] fault-injection/cpu: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 15/21] mips: octeon: smp: " Sebastian Andrzej Siewior
2016-09-07  8:24   ` Matt Redfearn
2016-09-07 14:27     ` Sebastian Andrzej Siewior
2016-09-08  8:34       ` Matt Redfearn
2016-09-19 15:10   ` Ralf Baechle
2016-09-19 19:58   ` [tip:smp/hotplug] mips/octeon/smp: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 16/21] mips: loongson: smp: " Sebastian Andrzej Siewior
2016-09-19 15:10   ` Ralf Baechle
2016-09-19 19:58   ` [tip:smp/hotplug] mips/loongson/smp: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 17/21] s390: mm: pfault: " Sebastian Andrzej Siewior
2016-09-19 19:59   ` [tip:smp/hotplug] s390/mm/pfault: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 18/21] x86: apic: uv: " Sebastian Andrzej Siewior
2016-09-19 19:59   ` [tip:smp/hotplug] x86/apic/uv: " tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 19/21] blk: mq: reserve hotplug ID states for block Sebastian Andrzej Siewior
2016-09-19 20:03   ` [tip:smp/hotplug] blk/mq: Reserve hotplug ID states for block multiqueue tip-bot for Sebastian Andrzej Siewior
2016-09-19 21:24   ` [tip:smp/hotplug] blk/mq: Reserve hotplug " tip-bot for Sebastian Andrzej Siewior
2016-09-21  7:45   ` tip-bot for Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 20/21] blk: mq: cpu-notif: Convert to hotplug state machine Sebastian Andrzej Siewior
2016-09-06 17:04 ` [PATCH 21/21] blk: mq: " Sebastian Andrzej Siewior

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=9891841.xb8KPMjjUJ@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=bigeasy@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=rt@linutronix.de \
    --cc=tglx@linutronix.de \
    --cc=viresh.kumar@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).