mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Why lock_kernel() in drivers/pci/proc.c (2.6.0-test9)??
@ 2003-11-19  2:29 Peter Chubb
  2003-11-19  2:51 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Chubb @ 2003-11-19  2:29 UTC (permalink / raw)
  To: linux-kernel, akpm


Hi,
	What is the BKL protecting in
drivers/pci/proc.c:proc_bus_pci_lseek() ?

It looks useless to me, as file->f_pos is changed outside the lock
anyway, and all the other variables inside the locked region are
effectively constants for the purpose of this code.

So unless something subtle's going on, I suggest this:



--- linux-2.6.0-test9/drivers/pci/proc.c 2003-11-19 13:28:10.000000000 +1100
+++ new/drivers/pci/proc.c	2003-11-19 13:28:00.000000000 +1100
@@ -25,7 +25,6 @@
 {
 	loff_t new = -1;
 
-	lock_kernel();
 	switch (whence) {
 	case 0:
 		new = off;
@@ -37,7 +36,7 @@
 		new = PCI_CFG_SPACE_SIZE + off;
 		break;
 	}
-	unlock_kernel();
+
 	if (new < 0 || new > PCI_CFG_SPACE_SIZE)
 		return -EINVAL;
	return (file->f_pos = new);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-19  2:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-19  2:29 Why lock_kernel() in drivers/pci/proc.c (2.6.0-test9)?? Peter Chubb
2003-11-19  2:51 ` Andrew Morton

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®