Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1312343 > unrolled thread
| Started by | "João Paulo Rechi Vita" <jprvita@gmail.com> |
|---|---|
| First post | 2016-01-19 16:50 +0100 |
| Last post | 2016-01-19 21:40 +0100 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 8/8] rfkill: Factor common code "João Paulo Rechi Vita" <jprvita@gmail.com> - 2016-01-19 16:50 +0100
Re: [PATCH 8/8] rfkill: Factor common code kbuild test robot <lkp@intel.com> - 2016-01-19 19:20 +0100
Re: [PATCH 8/8] rfkill: Factor common code João Paulo Rechi Vita <jprvita@gmail.com> - 2016-01-19 21:40 +0100
| From | "João Paulo Rechi Vita" <jprvita@gmail.com> |
|---|---|
| Date | 2016-01-19 16:50 +0100 |
| Subject | [PATCH 8/8] rfkill: Factor common code |
| Message-ID | <qSGHE-1px-17@gated-at.bofh.it> |
Factor all assignments to rfkill_global_states[].cur to
rfkill_update_global_state(), and also make accesses to
rfkill_global_states[].cur go through rfkill_get_global_sw_state().
Signed-off-by: João Paulo Rechi Vita <jprvita@endlessm.com>
---
net/rfkill/core.c | 40 ++++++++++++++++++----------------------
1 file changed, 18 insertions(+), 22 deletions(-)
diff --git a/net/rfkill/core.c b/net/rfkill/core.c
index 0b9d5bf..ae3d15a 100644
--- a/net/rfkill/core.c
+++ b/net/rfkill/core.c
@@ -300,6 +300,19 @@ static void rfkill_set_block(struct rfkill *rfkill, bool blocked)
rfkill_event(rfkill);
}
+static void rfkill_update_global_state(enum rfkill_type type, bool blocked)
+{
+ int i;
+
+ if (type != RFKILL_TYPE_ALL) {
+ rfkill_global_states[type].cur = blocked;
+ return;
+ }
+
+ for (i = 0; i < NUM_RFKILL_TYPES; i++)
+ rfkill_global_states[i].cur = blocked;
+}
+
#ifdef CONFIG_RFKILL_INPUT
static atomic_t rfkill_input_disabled = ATOMIC_INIT(0);
@@ -317,15 +330,7 @@ static void __rfkill_switch_all(const enum rfkill_type type, bool blocked)
{
struct rfkill *rfkill;
- if (type == RFKILL_TYPE_ALL) {
- int i;
-
- for (i = 0; i < NUM_RFKILL_TYPES; i++)
- rfkill_global_states[i].cur = blocked;
- } else {
- rfkill_global_states[type].cur = blocked;
- }
-
+ rfkill_update_global_state(type, blocked);
list_for_each_entry(rfkill, &rfkill_list, node) {
if (rfkill->type != type && type != RFKILL_TYPE_ALL)
continue;
@@ -877,7 +882,7 @@ static void rfkill_sync_work(struct work_struct *work)
rfkill = container_of(work, struct rfkill, sync_work);
mutex_lock(&rfkill_global_mutex);
- cur = rfkill_global_states[rfkill->type].cur;
+ cur = rfkill_get_global_sw_state(rfkill->type);
rfkill_set_block(rfkill, cur);
mutex_unlock(&rfkill_global_mutex);
}
@@ -1116,15 +1121,8 @@ static ssize_t rfkill_fop_write(struct file *file, const char __user *buf,
mutex_lock(&rfkill_global_mutex);
- if (ev.op == RFKILL_OP_CHANGE_ALL) {
- if (ev.type == RFKILL_TYPE_ALL) {
- enum rfkill_type i;
- for (i = 0; i < NUM_RFKILL_TYPES; i++)
- rfkill_global_states[i].cur = ev.soft;
- } else {
- rfkill_global_states[ev.type].cur = ev.soft;
- }
- }
+ if (ev.op == RFKILL_OP_CHANGE_ALL)
+ rfkill_update_global_state(ev.type, ev.soft);
list_for_each_entry(rfkill, &rfkill_list, node) {
if (rfkill->idx != ev.idx && ev.op != RFKILL_OP_CHANGE_ALL)
@@ -1213,10 +1211,8 @@ static struct miscdevice rfkill_miscdev = {
static int __init rfkill_init(void)
{
int error;
- int i;
- for (i = 0; i < NUM_RFKILL_TYPES; i++)
- rfkill_global_states[i].cur = !rfkill_default_state;
+ rfkill_update_global_state(RFKILL_TYPE_ALL, !rfkill_default_state);
error = class_register(&rfkill_class);
if (error)
--
2.5.0
[toc] | [next] | [standalone]
| From | kbuild test robot <lkp@intel.com> |
|---|---|
| Date | 2016-01-19 19:20 +0100 |
| Message-ID | <qSJ2P-36W-29@gated-at.bofh.it> |
| In reply to | #1312343 |
[Multipart message — attachments visible in raw view] — view raw
Hi João,
[auto build test ERROR on mac80211-next/master]
[also build test ERROR on v4.4 next-20160119]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Jo-o-Paulo-Rechi-Vita/General-RFKill-improvements/20160119-234934
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: x86_64-randconfig-a0-01200034 (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
>> ERROR: "rfkill_get_global_sw_state" [net/rfkill/rfkill.ko] undefined!
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[toc] | [prev] | [next] | [standalone]
| From | João Paulo Rechi Vita <jprvita@gmail.com> |
|---|---|
| Date | 2016-01-19 21:40 +0100 |
| Message-ID | <qSLei-4ue-19@gated-at.bofh.it> |
| In reply to | #1312343 |
On 19 January 2016 at 12:39, kbuild test robot <lkp@intel.com> wrote: > Hi João, > > [auto build test ERROR on mac80211-next/master] > [also build test ERROR on v4.4 next-20160119] > [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] > > url: https://github.com/0day-ci/linux/commits/Jo-o-Paulo-Rechi-Vita/General-RFKill-improvements/20160119-234934 > base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master > config: i386-randconfig-s0-201603 (attached as .config) > reproduce: > # save the attached .config to linux build tree > make ARCH=i386 > > All errors (new ones prefixed by >>): > > net/built-in.o: In function `rfkill_sync_work': >>> core.c:(.text+0x13d849): undefined reference to `rfkill_get_global_sw_state' > I've overlooked the fact that rfkill_get_global_sw_state() is inside a #ifdef block -- I'll fix this in an updated version. -- João Paulo Rechi Vita http://about.me/jprvita
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web