All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] my first janitorial
@ 2007-03-31 13:39 Pedram M
  2007-03-31 13:55 ` Arnaldo Carvalho de Melo
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Pedram M @ 2007-03-31 13:39 UTC (permalink / raw)
  To: kernel-janitors

for: drivers/char/istallion.c


@@ -4590,7 +4590,7 @@
        printk("stli_findpcibrds()\n");
 #endif

-       while ((dev = pci_find_device(PCI_VENDOR_ID_STALLION,
+       while ((dev = pci_get_device(PCI_VENDOR_ID_STALLION,
            PCI_DEVICE_ID_ECRA, dev))) {
                if ((rc = stli_initpcibrd(BRD_ECPPCI, dev)))
                        return(rc);


Thanks,
Pedram
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] my first janitorial
  2007-03-31 13:39 [KJ] my first janitorial Pedram M
@ 2007-03-31 13:55 ` Arnaldo Carvalho de Melo
  2007-03-31 13:59 ` Cong WANG
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Arnaldo Carvalho de Melo @ 2007-03-31 13:55 UTC (permalink / raw)
  To: kernel-janitors

On 3/31/07, Pedram M <pmessri@gmail.com> wrote:
> for: drivers/char/istallion.c
>
>
> @@ -4590,7 +4590,7 @@
>         printk("stli_findpcibrds()\n");
>  #endif
>
> -       while ((dev = pci_find_device(PCI_VENDOR_ID_STALLION,
> +       while ((dev = pci_get_device(PCI_VENDOR_ID_STALLION,
>             PCI_DEVICE_ID_ECRA, dev))) {
>                 if ((rc = stli_initpcibrd(BRD_ECPPCI, dev)))
>                         return(rc);

Congratulations for your first patch! But please add a changeset
comment stating the reason for the patch, followed by your
Signed-off-by: line, all the details are available at the
Documentation/SubmittingPatches file in the kernel sources.

Regards,

- Arnaldo
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] my first janitorial
  2007-03-31 13:39 [KJ] my first janitorial Pedram M
  2007-03-31 13:55 ` Arnaldo Carvalho de Melo
@ 2007-03-31 13:59 ` Cong WANG
  2007-03-31 14:32 ` Greg KH
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Cong WANG @ 2007-03-31 13:59 UTC (permalink / raw)
  To: kernel-janitors

2007/3/31, Pedram M <pmessri@gmail.com>:
> for: drivers/char/istallion.c
>
>
> @@ -4590,7 +4590,7 @@
>         printk("stli_findpcibrds()\n");
>  #endif
>
> -       while ((dev = pci_find_device(PCI_VENDOR_ID_STALLION,
> +       while ((dev = pci_get_device(PCI_VENDOR_ID_STALLION,
>             PCI_DEVICE_ID_ECRA, dev))) {
>                 if ((rc = stli_initpcibrd(BRD_ECPPCI, dev)))
>                         return(rc);
>
>
> Thanks,
> Pedram

Please do read Documentation/SubmittingPatches first before you submit a patch.


-- 
So Dark The Con Of Man.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] my first janitorial
  2007-03-31 13:39 [KJ] my first janitorial Pedram M
  2007-03-31 13:55 ` Arnaldo Carvalho de Melo
  2007-03-31 13:59 ` Cong WANG
@ 2007-03-31 14:32 ` Greg KH
  2007-04-01  5:24   ` Pedram M
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2007-03-31 14:32 UTC (permalink / raw)
  To: kernel-janitors

On Sat, Mar 31, 2007 at 06:39:01AM -0700, Pedram M wrote:
> for: drivers/char/istallion.c
> 
> 
> @@ -4590,7 +4590,7 @@
>         printk("stli_findpcibrds()\n");
>  #endif
> 
> -       while ((dev = pci_find_device(PCI_VENDOR_ID_STALLION,
> +       while ((dev = pci_get_device(PCI_VENDOR_ID_STALLION,

I think this leaks the reference count on the pci device.  Where do you
decrement it?

Please read the documentation for the pci_get_device() function, it is
not a simple search-and-replace fix for this task.

thanks,

greg k-h
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] my first janitorial
  2007-03-31 13:39 [KJ] my first janitorial Pedram M
@ 2007-04-01  5:24   ` Pedram M
  2007-03-31 13:59 ` Cong WANG
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Pedram M @ 2007-04-01  5:24 UTC (permalink / raw)
  To: kernel-janitors; +Cc: linux-kernel

How about this one? Am I doing it right now?
If not, please try to explain more to me what I am
doing wrong.

@@ -4760,7 +4760,7 @@
 	for (i = 0; i < NR_CARDS; i++) {
 		/* look for a Cyclades card by vendor and device id */
 		while ((device_id = cy_pci_dev_id[dev_index]) != 0) {
-			if ((pdev = pci_find_device(PCI_VENDOR_ID_CYCLADES,
+			if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES,
 						   device_id, pdev)) = NULL) {
 				dev_index++;	/* try next device id */
 			} else {
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: my first janitorial
@ 2007-04-01  5:24   ` Pedram M
  0 siblings, 0 replies; 18+ messages in thread
From: Pedram M @ 2007-04-01  5:24 UTC (permalink / raw)
  To: kernel-janitors; +Cc: linux-kernel

How about this one? Am I doing it right now?
If not, please try to explain more to me what I am
doing wrong.

@@ -4760,7 +4760,7 @@
 	for (i = 0; i < NR_CARDS; i++) {
 		/* look for a Cyclades card by vendor and device id */
 		while ((device_id = cy_pci_dev_id[dev_index]) != 0) {
-			if ((pdev = pci_find_device(PCI_VENDOR_ID_CYCLADES,
+			if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES,
 						   device_id, pdev)) == NULL) {
 				dev_index++;	/* try next device id */
 			} else {

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

* Re: [KJ] my first janitorial
  2007-04-01  5:24   ` Pedram M
@ 2007-04-01  6:16     ` Jaco Kroon
  -1 siblings, 0 replies; 18+ messages in thread
From: Jaco Kroon @ 2007-04-01  6:16 UTC (permalink / raw)
  To: Pedram M; +Cc: kernel-janitors, linux-kernel

Pedram M wrote:
> How about this one? Am I doing it right now?
> If not, please try to explain more to me what I am
> doing wrong.

You need a changelog entry (or explanation of what you're doing). You 
need a signed-off-by line and your patch needs to apply to the root of 
the kernel tree with -p1, something like:

-------------
Replace deprecated pci_find_device call with pci_get_device.

Signed-Off-By: Pedram M <pmessri@gmail.com>

--- linux-2.6.20.3.orig/path/to/file.c     2006-06-24 09:41:08.000000000 
+0200
+++ linux-2.6.20.3/path/to/file.c       2006-07-15 21:01:57.000000000 +0200
@@ -4760,7 +4760,7 @@
  	for (i = 0; i < NR_CARDS; i++) {
  		/* look for a Cyclades card by vendor and device id */
  		while ((device_id = cy_pci_dev_id[dev_index]) != 0) {
-			if ((pdev = pci_find_device(PCI_VENDOR_ID_CYCLADES,
+			if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES,
  						   device_id, pdev)) = NULL) {
  				dev_index++;	/* try next device id */
  			} else {
-------------

And your subject needs to please include the string "[PATCH]", something 
like:  [PATCH] path/to/file.c: pci_find_device cleanup

However, as pointed out, the code itself is incorrect, for every 
pci_get_device there also needs to be a call to pci_put_device in order 
to maintain reference counts.

Your client does not seem to be clobbering the patch itself and 
maintains tabs and line wrapping (unlike my client).

Jaco
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] my first janitorial
@ 2007-04-01  6:16     ` Jaco Kroon
  0 siblings, 0 replies; 18+ messages in thread
From: Jaco Kroon @ 2007-04-01  6:16 UTC (permalink / raw)
  To: Pedram M; +Cc: kernel-janitors, linux-kernel

Pedram M wrote:
> How about this one? Am I doing it right now?
> If not, please try to explain more to me what I am
> doing wrong.

You need a changelog entry (or explanation of what you're doing). You 
need a signed-off-by line and your patch needs to apply to the root of 
the kernel tree with -p1, something like:

-------------
Replace deprecated pci_find_device call with pci_get_device.

Signed-Off-By: Pedram M <pmessri@gmail.com>

--- linux-2.6.20.3.orig/path/to/file.c     2006-06-24 09:41:08.000000000 
+0200
+++ linux-2.6.20.3/path/to/file.c       2006-07-15 21:01:57.000000000 +0200
@@ -4760,7 +4760,7 @@
  	for (i = 0; i < NR_CARDS; i++) {
  		/* look for a Cyclades card by vendor and device id */
  		while ((device_id = cy_pci_dev_id[dev_index]) != 0) {
-			if ((pdev = pci_find_device(PCI_VENDOR_ID_CYCLADES,
+			if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES,
  						   device_id, pdev)) == NULL) {
  				dev_index++;	/* try next device id */
  			} else {
-------------

And your subject needs to please include the string "[PATCH]", something 
like:  [PATCH] path/to/file.c: pci_find_device cleanup

However, as pointed out, the code itself is incorrect, for every 
pci_get_device there also needs to be a call to pci_put_device in order 
to maintain reference counts.

Your client does not seem to be clobbering the patch itself and 
maintains tabs and line wrapping (unlike my client).

Jaco

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

* Re: [KJ] my first janitorial
  2007-04-01  5:24   ` Pedram M
@ 2007-04-01  6:17     ` Willy Tarreau
  -1 siblings, 0 replies; 18+ messages in thread
From: Willy Tarreau @ 2007-04-01  6:17 UTC (permalink / raw)
  To: Pedram M; +Cc: kernel-janitors, linux-kernel

Hi,

On Sat, Mar 31, 2007 at 10:24:12PM -0700, Pedram M wrote:
> How about this one? Am I doing it right now?
> If not, please try to explain more to me what I am
> doing wrong.

You have made several mistakes :
  - you must select an appropriate subject for your mail. Nobody cares
    that it is your first mail, what they care about is the problem you
    are trying to fix and what it applies to. Preferably start your
    subject with [PATCH] so that people can quickly notice it without
    having to open it first.

  - you did not send a description of your patch. It is important to
    have a full description, it can be from 1 line to 1 page depending
    on the complexity of the issue. It is important to explain why you
    think you are right so that people can argue if they don't agree.
    Please also try to be as factual as possible, because your message
    will become the commit message. It means that sentences such as
    "I think that ..." are not the best we can write.

  - you must sign your patch. For this, add a "Signed-Off-By:" footer.
    Take a look at other patches for this.

   - your patch was cut and cannot apply to anything. A proper patch starts
     with line beginning with "---" line, followed by a line with "+++",
     both indicating the file your patch is supposed to apply to. Make your
     patch with one level directory for the kernel so that it can apply with
     "patch -p1". For instance:

        $ diff -u linux-2.6.20/Makefile linux-2.6.20-mine/Makefile

     Another solution is to use '.' as the directory, in order to add one
     directory level for "patch -p1" to be happy :

        $ diff -u ./Makefile.orig ./Makefile

Hoping this helps,
Willy


> @@ -4760,7 +4760,7 @@
> 	for (i = 0; i < NR_CARDS; i++) {
> 		/* look for a Cyclades card by vendor and device id */
> 		while ((device_id = cy_pci_dev_id[dev_index]) != 0) {
> -			if ((pdev = pci_find_device(PCI_VENDOR_ID_CYCLADES,
> +			if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES,
> 						   device_id, pdev)) = 
> 						   NULL) {
> 				dev_index++;	/* try next device id */
> 			} else {
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: my first janitorial
@ 2007-04-01  6:17     ` Willy Tarreau
  0 siblings, 0 replies; 18+ messages in thread
From: Willy Tarreau @ 2007-04-01  6:17 UTC (permalink / raw)
  To: Pedram M; +Cc: kernel-janitors, linux-kernel

Hi,

On Sat, Mar 31, 2007 at 10:24:12PM -0700, Pedram M wrote:
> How about this one? Am I doing it right now?
> If not, please try to explain more to me what I am
> doing wrong.

You have made several mistakes :
  - you must select an appropriate subject for your mail. Nobody cares
    that it is your first mail, what they care about is the problem you
    are trying to fix and what it applies to. Preferably start your
    subject with [PATCH] so that people can quickly notice it without
    having to open it first.

  - you did not send a description of your patch. It is important to
    have a full description, it can be from 1 line to 1 page depending
    on the complexity of the issue. It is important to explain why you
    think you are right so that people can argue if they don't agree.
    Please also try to be as factual as possible, because your message
    will become the commit message. It means that sentences such as
    "I think that ..." are not the best we can write.

  - you must sign your patch. For this, add a "Signed-Off-By:" footer.
    Take a look at other patches for this.

   - your patch was cut and cannot apply to anything. A proper patch starts
     with line beginning with "---" line, followed by a line with "+++",
     both indicating the file your patch is supposed to apply to. Make your
     patch with one level directory for the kernel so that it can apply with
     "patch -p1". For instance:

        $ diff -u linux-2.6.20/Makefile linux-2.6.20-mine/Makefile

     Another solution is to use '.' as the directory, in order to add one
     directory level for "patch -p1" to be happy :

        $ diff -u ./Makefile.orig ./Makefile

Hoping this helps,
Willy


> @@ -4760,7 +4760,7 @@
> 	for (i = 0; i < NR_CARDS; i++) {
> 		/* look for a Cyclades card by vendor and device id */
> 		while ((device_id = cy_pci_dev_id[dev_index]) != 0) {
> -			if ((pdev = pci_find_device(PCI_VENDOR_ID_CYCLADES,
> +			if ((pdev = pci_get_device(PCI_VENDOR_ID_CYCLADES,
> 						   device_id, pdev)) == 
> 						   NULL) {
> 				dev_index++;	/* try next device id */
> 			} else {
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [KJ] my first janitorial
  2007-04-01  5:24   ` Pedram M
@ 2007-04-01 16:00     ` Alan Cox
  -1 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2007-04-01 15:14 UTC (permalink / raw)
  To: Pedram M; +Cc: kernel-janitors, linux-kernel

On Sat, 31 Mar 2007 22:24:12 -0700
"Pedram M" <pmessri@gmail.com> wrote:

> How about this one? Am I doing it right now?
> If not, please try to explain more to me what I am
> doing wrong.

You need to hold a reference to the PCI device for the entire duration it
is used. I think you actually also need something like this to get the whole
thing using pci references and pci_get_* properly

Alan

--- drivers/char/cyclades.c~	2007-04-01 15:52:16.000000000 +0100
+++ drivers/char/cyclades.c	2007-04-01 15:52:16.000000000 +0100
@@ -4803,7 +4782,7 @@
                 cy_card[j].bus_index = 1;
                 cy_card[j].first_line = cy_next_channel;
                 cy_card[j].num_chips = cy_pci_nchan/4;
-		cy_card[j].pdev = pdev;
+		cy_card[j].pdev = pci_dev_get(pdev);
 	
                 /* enable interrupts in the PCI interface */
 		plx_ver = cy_readb(cy_pci_addr2 + CyPLX_VER) & 0x0f;
@@ -4901,7 +4880,7 @@
 			Ze_addr0[ZeIndex] = cy_pci_addr0;
 			Ze_addr2[ZeIndex] = cy_pci_addr2;
 			Ze_irq[ZeIndex] = cy_pci_irq;
-			Ze_pdev[ZeIndex] = pdev;
+			Ze_pdev[ZeIndex] = pci_dev_get(pdev);
 			ZeIndex++;
 		    }
 		    i--;
@@ -4986,7 +4965,7 @@
                 cy_card[j].bus_index = 1;
                 cy_card[j].first_line = cy_next_channel;
                 cy_card[j].num_chips = -1;
-		cy_card[j].pdev = pdev;
+		cy_card[j].pdev = pci_dev_get(pdev);
 
                 /* print message */
 #ifdef CONFIG_CYZ_INTR
@@ -5007,6 +4986,10 @@
                 cy_next_channel += cy_pci_nchan;
 	    }
         }
+        
+        if (pdev)
+		pci_dev_put(pdev);
+        
 
         for (; ZeIndex != 0 && i < NR_CARDS; i++) {
 	    cy_pci_phys0 = Ze_phys0[0];
@@ -5485,11 +5468,12 @@
 	    )
 		free_irq(cy_card[i].irq, &cy_card[i]);
 #ifdef CONFIG_PCI
-		if (cy_card[i].pdev)
+		if (cy_card[i].pdev) {
 			pci_release_regions(cy_card[i].pdev);
+			pci_dev_put(pdev);
+		}
 #endif
         }
     }
 } /* cy_cleanup_module */
 
 module_init(cy_init);
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: my first janitorial
@ 2007-04-01 16:00     ` Alan Cox
  0 siblings, 0 replies; 18+ messages in thread
From: Alan Cox @ 2007-04-01 16:00 UTC (permalink / raw)
  To: Pedram M; +Cc: kernel-janitors, linux-kernel

On Sat, 31 Mar 2007 22:24:12 -0700
"Pedram M" <pmessri@gmail.com> wrote:

> How about this one? Am I doing it right now?
> If not, please try to explain more to me what I am
> doing wrong.

You need to hold a reference to the PCI device for the entire duration it
is used. I think you actually also need something like this to get the whole
thing using pci references and pci_get_* properly

Alan

--- drivers/char/cyclades.c~	2007-04-01 15:52:16.000000000 +0100
+++ drivers/char/cyclades.c	2007-04-01 15:52:16.000000000 +0100
@@ -4803,7 +4782,7 @@
                 cy_card[j].bus_index = 1;
                 cy_card[j].first_line = cy_next_channel;
                 cy_card[j].num_chips = cy_pci_nchan/4;
-		cy_card[j].pdev = pdev;
+		cy_card[j].pdev = pci_dev_get(pdev);
 	
                 /* enable interrupts in the PCI interface */
 		plx_ver = cy_readb(cy_pci_addr2 + CyPLX_VER) & 0x0f;
@@ -4901,7 +4880,7 @@
 			Ze_addr0[ZeIndex] = cy_pci_addr0;
 			Ze_addr2[ZeIndex] = cy_pci_addr2;
 			Ze_irq[ZeIndex] = cy_pci_irq;
-			Ze_pdev[ZeIndex] = pdev;
+			Ze_pdev[ZeIndex] = pci_dev_get(pdev);
 			ZeIndex++;
 		    }
 		    i--;
@@ -4986,7 +4965,7 @@
                 cy_card[j].bus_index = 1;
                 cy_card[j].first_line = cy_next_channel;
                 cy_card[j].num_chips = -1;
-		cy_card[j].pdev = pdev;
+		cy_card[j].pdev = pci_dev_get(pdev);
 
                 /* print message */
 #ifdef CONFIG_CYZ_INTR
@@ -5007,6 +4986,10 @@
                 cy_next_channel += cy_pci_nchan;
 	    }
         }
+        
+        if (pdev)
+		pci_dev_put(pdev);
+        
 
         for (; ZeIndex != 0 && i < NR_CARDS; i++) {
 	    cy_pci_phys0 = Ze_phys0[0];
@@ -5485,11 +5468,12 @@
 	    )
 		free_irq(cy_card[i].irq, &cy_card[i]);
 #ifdef CONFIG_PCI
-		if (cy_card[i].pdev)
+		if (cy_card[i].pdev) {
 			pci_release_regions(cy_card[i].pdev);
+			pci_dev_put(pdev);
+		}
 #endif
         }
     }
 } /* cy_cleanup_module */
 
 module_init(cy_init);

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

* Re: [KJ] my first janitorial
  2007-04-01 16:00     ` Alan Cox
@ 2007-04-01 18:28       ` Jiri Slaby
  -1 siblings, 0 replies; 18+ messages in thread
From: Jiri Slaby @ 2007-04-01 18:28 UTC (permalink / raw)
  To: Alan Cox; +Cc: Pedram M, kernel-janitors, linux-kernel

Alan Cox napsal(a):
> On Sat, 31 Mar 2007 22:24:12 -0700
> "Pedram M" <pmessri@gmail.com> wrote:
> 
>> How about this one? Am I doing it right now?
>> If not, please try to explain more to me what I am
>> doing wrong.
> 
> You need to hold a reference to the PCI device for the entire duration it
> is used. I think you actually also need something like this to get the whole
> thing using pci references and pci_get_* properly
> 
> Alan
> 
> --- drivers/char/cyclades.c~	2007-04-01 15:52:16.000000000 +0100
> +++ drivers/char/cyclades.c	2007-04-01 15:52:16.000000000 +0100
> @@ -4803,7 +4782,7 @@
>                  cy_card[j].bus_index = 1;
>                  cy_card[j].first_line = cy_next_channel;
>                  cy_card[j].num_chips = cy_pci_nchan/4;
> -		cy_card[j].pdev = pdev;
> +		cy_card[j].pdev = pci_dev_get(pdev);

No, please let this code be, I have a bunch of patches to have pci_probing
for this driver, the remaining part for first set of patches is testing.

thanks,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
 B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

Hnus <hnus@fi.muni.cz> is an alias for /dev/null
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: my first janitorial
@ 2007-04-01 18:28       ` Jiri Slaby
  0 siblings, 0 replies; 18+ messages in thread
From: Jiri Slaby @ 2007-04-01 18:28 UTC (permalink / raw)
  To: Alan Cox; +Cc: Pedram M, kernel-janitors, linux-kernel

Alan Cox napsal(a):
> On Sat, 31 Mar 2007 22:24:12 -0700
> "Pedram M" <pmessri@gmail.com> wrote:
> 
>> How about this one? Am I doing it right now?
>> If not, please try to explain more to me what I am
>> doing wrong.
> 
> You need to hold a reference to the PCI device for the entire duration it
> is used. I think you actually also need something like this to get the whole
> thing using pci references and pci_get_* properly
> 
> Alan
> 
> --- drivers/char/cyclades.c~	2007-04-01 15:52:16.000000000 +0100
> +++ drivers/char/cyclades.c	2007-04-01 15:52:16.000000000 +0100
> @@ -4803,7 +4782,7 @@
>                  cy_card[j].bus_index = 1;
>                  cy_card[j].first_line = cy_next_channel;
>                  cy_card[j].num_chips = cy_pci_nchan/4;
> -		cy_card[j].pdev = pdev;
> +		cy_card[j].pdev = pci_dev_get(pdev);

No, please let this code be, I have a bunch of patches to have pci_probing
for this driver, the remaining part for first set of patches is testing.

thanks,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
 B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

Hnus <hnus@fi.muni.cz> is an alias for /dev/null

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

* Re: [KJ] my first janitorial
  2007-04-01  6:17     ` Willy Tarreau
@ 2007-04-01 19:04       ` Jan Engelhardt
  -1 siblings, 0 replies; 18+ messages in thread
From: Jan Engelhardt @ 2007-04-01 19:04 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: Pedram M, kernel-janitors, linux-kernel


On Apr 1 2007 08:17, Willy Tarreau wrote:
>
>   - your patch was cut and cannot apply to anything. A proper patch starts
>     with line beginning with "---" line, followed by a line with "+++",
>     both indicating the file your patch is supposed to apply to. Make your
>     patch with one level directory for the kernel so that it can apply with
>     "patch -p1". For instance:
>
>        $ diff -u linux-2.6.20/Makefile linux-2.6.20-mine/Makefile
>
>     Another solution is to use '.' as the directory, in order to add one
>     directory level for "patch -p1" to be happy :
>
>        $ diff -u ./Makefile.orig ./Makefile

Suggesting quilt.



Jan
-- 
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: my first janitorial
@ 2007-04-01 19:04       ` Jan Engelhardt
  0 siblings, 0 replies; 18+ messages in thread
From: Jan Engelhardt @ 2007-04-01 19:04 UTC (permalink / raw)
  To: Willy Tarreau; +Cc: Pedram M, kernel-janitors, linux-kernel


On Apr 1 2007 08:17, Willy Tarreau wrote:
>
>   - your patch was cut and cannot apply to anything. A proper patch starts
>     with line beginning with "---" line, followed by a line with "+++",
>     both indicating the file your patch is supposed to apply to. Make your
>     patch with one level directory for the kernel so that it can apply with
>     "patch -p1". For instance:
>
>        $ diff -u linux-2.6.20/Makefile linux-2.6.20-mine/Makefile
>
>     Another solution is to use '.' as the directory, in order to add one
>     directory level for "patch -p1" to be happy :
>
>        $ diff -u ./Makefile.orig ./Makefile

Suggesting quilt.



Jan
-- 

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

* Re: [KJ] my first janitorial
  2007-03-31 13:39 [KJ] my first janitorial Pedram M
                   ` (3 preceding siblings ...)
  2007-04-01  5:24   ` Pedram M
@ 2007-04-02  3:39 ` surya.prabhakar
  2007-04-02  3:40 ` Greg KH
  5 siblings, 0 replies; 18+ messages in thread
From: surya.prabhakar @ 2007-04-02  3:39 UTC (permalink / raw)
  To: kernel-janitors


[-- Attachment #1.1: Type: text/plain, Size: 1130 bytes --]

Greg,
   In my earlier mails I did send patches for cleanup related to almost
all instances of pci_find_device cleanup ( archives can be checked ) .
Unfortunately the driver maintainer never responded. And people are
doing the same thing again.
thanks.


On Sat, 2007-03-31 at 07:32 -0700, Greg KH wrote:
> On Sat, Mar 31, 2007 at 06:39:01AM -0700, Pedram M wrote:
> > for: drivers/char/istallion.c
> > 
> > 
> > @@ -4590,7 +4590,7 @@
> >         printk("stli_findpcibrds()\n");
> >  #endif
> > 
> > -       while ((dev = pci_find_device(PCI_VENDOR_ID_STALLION,
> > +       while ((dev = pci_get_device(PCI_VENDOR_ID_STALLION,
> 
> I think this leaks the reference count on the pci device.  Where do you
> decrement it?
> 
> Please read the documentation for the pci_get_device() function, it is
> not a simple search-and-replace fix for this task.
> 
> thanks,
> 
> greg k-h
> _______________________________________________
> Kernel-janitors mailing list
> Kernel-janitors@lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors
-- 
surya.
02/04/2007

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3185 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

* Re: [KJ] my first janitorial
  2007-03-31 13:39 [KJ] my first janitorial Pedram M
                   ` (4 preceding siblings ...)
  2007-04-02  3:39 ` [KJ] " surya.prabhakar
@ 2007-04-02  3:40 ` Greg KH
  5 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2007-04-02  3:40 UTC (permalink / raw)
  To: kernel-janitors

On Mon, Apr 02, 2007 at 08:57:21AM +0530, surya.prabhakar@wipro.com wrote:
> Greg,
>    In my earlier mails I did send patches for cleanup related to almost
> all instances of pci_find_device cleanup ( archives can be checked ) .
> Unfortunately the driver maintainer never responded. And people are
> doing the same thing again.

Then push them to the kernel-janitor maintainer (who is that these days)
and get them into the main kernel tree.  Persistance is the key here.

The fact that the driver maintainer/author did not respond is not
supprising, as the reason these drivers need fixing is that no one seems
to be maintaining them anymore :)

thanks,

greg k-h
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors

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

end of thread, other threads:[~2007-04-02  3:40 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-31 13:39 [KJ] my first janitorial Pedram M
2007-03-31 13:55 ` Arnaldo Carvalho de Melo
2007-03-31 13:59 ` Cong WANG
2007-03-31 14:32 ` Greg KH
2007-04-01  5:24 ` Pedram M
2007-04-01  5:24   ` Pedram M
2007-04-01  6:16   ` [KJ] " Jaco Kroon
2007-04-01  6:16     ` Jaco Kroon
2007-04-01  6:17   ` Willy Tarreau
2007-04-01  6:17     ` Willy Tarreau
2007-04-01 19:04     ` [KJ] " Jan Engelhardt
2007-04-01 19:04       ` Jan Engelhardt
2007-04-01 15:14   ` [KJ] " Alan Cox
2007-04-01 16:00     ` Alan Cox
2007-04-01 18:28     ` [KJ] " Jiri Slaby
2007-04-01 18:28       ` Jiri Slaby
2007-04-02  3:39 ` [KJ] " surya.prabhakar
2007-04-02  3:40 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.