Skip to contentSkip to conversation

acpi: remove unnecassary check of acpi_ac_dir_param in

PATCH In review tom hisch 6 participants 9 messages Jul 7, 2006 – Jul 11, 2006

Subsystems (2)
lore
Share & tools
lore

tom hisch

author
#0 lore raw

PATCH 1/1 acpi: remove unnecassary check of acpi_ac_dir_param in

thank you for all your tips!

2nd try:
this patch is against 2.6.18-rc1

it removes an unnecassary check of acpi_ac_dir_param.

it compiles clean on x86 with the applied patch but I do not have a smart battery to test it.

tabs don't work in the gmail compose mail window so i have attached the patch. any ideas how to send patches with gmail ??
now everything ok ?

drivers/acpi/cm_sbs.c renamed from drivers/acpi/cm_sbs.c.orig +4 -4
@@ -69,10 +69,10 @@ void acpi_unlock_ac_dir(struct proc_dir_
 	down(&cm_sbs_sem);
 	if (acpi_ac_dir_param) {
 		lock_ac_dir_cnt--;
-	}
-	if (lock_ac_dir_cnt == 0 && acpi_ac_dir_param && acpi_ac_dir) {
-		remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
-		acpi_ac_dir = 0;
+		if (lock_ac_dir_cnt == 0 && acpi_ac_dir) {
+			remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
+			acpi_ac_dir = 0;
+		}
 	}
 	up(&cm_sbs_sem);
 }

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

Quoted 5 lines · On Fri, 7 Jul 2006 19:44:50 +0200 tom hisch wrote:

thank you for all your tips!

2nd try:
this patch is against 2.6.18-rc1

Quoted 7 lines

it removes an unnecassary check of acpi_ac_dir_param.

it compiles clean on x86 with the applied patch but I do not have a smart battery to test it.

tabs don't work in the gmail compose mail window so i have attached the patch. any ideas how to send patches with gmail ??

I've never seen info on how to do that other than by using attachments.

Quoted 1 line

now everything ok ?

We'll see if the KJ maintainer comments on it.

---
~Randy
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

In reply to tom hisch

On 07/07/06, Randy.Dunlap <[email protected]> wrote:> On Fri, 7 Jul 2006 19:44:50 +0200 tom hisch wrote:> > tabs don't work in the gmail compose mail window so i have attached the> > patch. any ideas how to send patches with gmail ??>> I've never seen info on how to do that other than by using> attachments. The following way works:
1. Open the patch with gedit or kedit.2. Mark all text and copy with Ctrl+C.3. Inside the gmail compose edit field paste with Ctrl+V.
BR Håkon Løvdal
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#3 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

In reply to tom hisch
Quoted 1 line · tom hisch

it removes an unnecassary check of acpi_ac_dir_param.

No. it doesn't. ;-) Every single user of acpi_unlock_ac_dir() passes to it, guess what? Right, value returned from acpi_lock_ac_dir() which is valid pointer by that time.

Ditto for battery stuff screenful below.

Quoted 7 lines
drivers/acpi/cm_sbs.c renamed from drivers/acpi/cm_sbs.c.orig +0 -1
@@ -69,10 +69,10 @@ void acpi_unlock_ac_dir(struct proc_dir_
 	down(&cm_sbs_sem);
 	if (acpi_ac_dir_param) {
 		lock_ac_dir_cnt--;
-	}

drivers/acpi/cm_sbs.c void acpi_unlock_ac_dir(struct proc_dir_ · line 78

Quoted 10 lines
drivers/acpi/cm_sbs.c renamed from drivers/acpi/cm_sbs.c.orig +4 -3
-	if (lock_ac_dir_cnt = 0 && acpi_ac_dir_param && acpi_ac_dir) {
-		remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
-		acpi_ac_dir = 0;
+		if (lock_ac_dir_cnt = 0 && acpi_ac_dir) {
+			remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
+			acpi_ac_dir = 0;
+		}
 	}
 	up(&cm_sbs_sem);
 }

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#4 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

In reply to tom hisch
Quoted 18 lines · Alexey Dobriyan
Quoted 1 line · tom hisch

it removes an unnecassary check of acpi_ac_dir_param.

No. it doesn't. ;-) Every single user of acpi_unlock_ac_dir() passes to it, guess what? Right, value returned from acpi_lock_ac_dir() which is valid pointer by that time.

Ditto for battery stuff screenful below.

Quoted 9 lines
drivers/acpi/cm_sbs.c renamed from drivers/acpi/cm_sbs.c.orig +0 -3
@@ -69,10 +69,10 @@ void acpi_unlock_ac_dir(struct proc_dir_
 	down(&cm_sbs_sem);
 	if (acpi_ac_dir_param) {
 		lock_ac_dir_cnt--;
-	}
-	if (lock_ac_dir_cnt = 0 && acpi_ac_dir_param && acpi_ac_dir) {
-		remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
Quoted 8 lines

drivers/acpi/cm_sbs.c void acpi_unlock_ac_dir(struct proc_dir_ · line 78

Quoted 8 lines
drivers/acpi/cm_sbs.c renamed from drivers/acpi/cm_sbs.c.orig +4 -1
-		acpi_ac_dir = 0;
+		if (lock_ac_dir_cnt = 0 && acpi_ac_dir) {
+			remove_proc_entry(ACPI_AC_CLASS, acpi_root_dir);
+			acpi_ac_dir = 0;
+		}
 	}
 	up(&cm_sbs_sem);
 }

Whoa, I've found a leak.

drivers/acpi/sbs.c +3 -0
@@ -1736,6 +1736,7 @@ static int __init acpi_sbs_init(void)
 	if (!acpi_battery_dir) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
 				  "acpi_lock_battery_dir() failed\n"));
+		acpi_unlock_ac_dir(acpi_ac_dir);
 		return -ENODEV;
 	}
 
@@ -1743,6 +1744,8 @@ static int __init acpi_sbs_init(void)
 	if (result < 0) {
 		ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
 				  "acpi_bus_register_driver() failed\n"));
+		acpi_unlock_battery_dir(acpi_battery_dir);
+		acpi_unlock_ac_dir(acpi_ac_dir);
 		return -ENODEV;
 	}
 

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

author
#5 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

In reply to tom hisch
Quoted 10 lines · Håkon Løvdal
Quoted 2 lines · Randy.Dunlap
Quoted 1 line · On Fri, 7 Jul 2006 19:44:50 +0200 tom hisch wrote:

tabs don't work in the gmail compose mail window so i have attached

the

Quoted 4 lines
Quoted 1 line

patch. any ideas how to send patches with gmail ??

I've never seen info on how to do that other than by using attachments.

Quoted 8 lines

The following way works:

1. Open the patch with gedit or kedit.
2. Mark all text and copy with Ctrl+C.
3. Inside the gmail compose edit field paste with Ctrl+V.

BR Håkon Løvdal

but all tabs are then converted to whitespaces and I get such a message while applying the patch:

Hunk #1 FAILED at 1736.
Hunk #2 FAILED at 1744.

tom hisch

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#6 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

In reply to tom hisch
Quoted 3 lines · tom hisch

tabs don't work in the gmail compose mail window so i have attached the patch. any ideas how to send patches with gmail ??

Gmail supports POP, so you can set up your gmail account to use POP and use your favourite mail client instead.

Darren J.
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

#7 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

In reply to tom hisch
Quoted 3 lines · tom hisch

tabs don't work in the gmail compose mail window so i have attached the patch. any ideas how to send patches with gmail ??

I personally use pine or kmail for that and just send via gmails servers. See https://mail.google.com/support/bin/answer.py?answer287&topic55

Signature · 7 lines
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
author
#8 lore raw

Re: [KJ] [Patch] acpi: remove unnecassary check of

In reply to tom hisch
Quoted 7 lines · Alexey Dobriyan
Quoted 1 line · tom hisch

it removes an unnecassary check of acpi_ac_dir_param.

No. it doesn't. ;-) Every single user of acpi_unlock_ac_dir() passes to it, guess what? Right, value returned from acpi_lock_ac_dir() which is valid pointer by that time.

sorry but I don't understand what can happen between the two checks ??

tom

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors