All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manu Abraham <manu@linuxtv.org>
To: Jiri Slaby <lnx4us@gmail.com>
Cc: Rolf Eike Beer <eike-kernel@sf-tec.de>,
	linux-kernel@vger.kernel.org, Jiri Slaby <jirislaby@gmail.com>
Subject: Re: PCI driver
Date: Mon, 10 Oct 2005 21:08:16 +0400	[thread overview]
Message-ID: <434AA000.4070403@linuxtv.org> (raw)
In-Reply-To: <3888a5cd0510100846p7f2ff70cid69a1136b9256ab6@mail.gmail.com>

Jiri Slaby wrote:

>On 10/10/05, Manu Abraham <manu@linuxtv.org> wrote:
>  
>
>>Jiri Slaby wrote:
>>    
>>
>>>Some points to the new driver:
>>>indentation isn't so good, the code is not readable well (80 chars on
>>>a line mainly).
>>>      
>>>
>>I do agree that indentation is not so good, but how would you suggest
>>the code be wrapped ?
>>    
>>
>Divide strings not "text blabalba \
>         continue"
>but with better "text blablabalasjdl"
>         "continue"
>  
>

The dprintk() macro (in mantis_common.h ) was looking very badly with 
wrap, which Andrew also commented on (about the col's) (the macro being 
the same, eventhough i was using it elsewhere) it being more than 80 
cols, but wrapping the macro made it look like hell.

>wrap line, if it is longer than 80 columns, near last comma, |, & and so on
>You seem to use some editor with tab to be less than 8 columns and
>some headers are indented bad because of it.
>  
>

My editor uses 8 columns only as a tab, Thunderbird does really handle 
things a bit different though.


>>The problem with wrapping is that readability goes down horribly, but
>>while debugging a driver, this is too painful.
>>Considering that it has a long way to go still..
>>
>>    
>>
>>>>      mantis->pdev = pdev;
>>>>
>>>>
>>>>        
>>>>
>>>If you work with this out from pci functions, you should call
>>>pci_get_dev and in exit function pci_dev_put, otherwise you don't need
>>>it at all.
>>>      
>>>
>>Well i am using it in mantis_dma.c, pci_alloc/free
>>    
>>
>And it is called only from places, where pdev is known (i.e. in
>parameter of function, e.g. mantis_pci_probe). So you don't need it to
>store in mantis, but only call mantis_dma_init(mantis, pdev). Read
>below.
>  
>
>>You mean rather than saving off the pointer, i do a pci_get_dev()
>>and later on in the exit routine, i do a pci_dev_put() .. ?
>>    
>>
>But if you really want it, call pci_get_dev() and store it into mantis
>struct. In the _device_ exit routine call the latter. But I think,
>that not to store is better, or the best is to call
>mantis_dma_init(pdev) and do pci_get_drvdata inside.
>  
>

i think will pass (pdev) it as a function argument. Looks a bit more cleaner
But what i fail to understand is , if you can pass it as an argument, 
why can't you save the pointer in the struct ?

>>>mantis_dma_init and others could be __devinit too, or not? Try to use
>>>it as much as possible.
>>>      
>>>
>>Any thoughts as to why ? I am not saying it is not needed, but i would
>>like to know what was the idea.
>>    
>>
>Kernel frees up the sections that won't be needed anymore. You put the
>function in some section by this.
>  
>
Ok,

Thanks.
Manu


  parent reply	other threads:[~2005-10-10 17:21 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-14  9:34 PCI driver Manu Abraham
2005-09-14 10:03 ` Jiri Slaby
2005-09-14 10:02   ` Manu Abraham
2005-09-14 10:29     ` Jiri Slaby
2005-09-14 11:53       ` Manu Abraham
2005-09-14 12:22         ` Jiri Slaby
2005-09-14 12:28           ` Manu Abraham
2005-09-14 12:48           ` Manu Abraham
2005-09-14 16:16             ` Jiri Slaby
2005-09-14 17:09               ` Manu Abraham
2005-09-14 19:00                 ` Jiri Slaby
2005-09-14 19:00                   ` Manu Abraham
2005-09-14 19:16                     ` Jiri Slaby
2005-09-14 19:20                       ` Manu Abraham
2005-09-14 22:27                       ` Manu Abraham
2005-09-15  6:43                         ` Rolf Eike Beer
2005-09-15  7:45                           ` Manu Abraham
2005-09-15  8:18                             ` Rolf Eike Beer
2005-09-15  8:51                               ` Manu Abraham
2005-09-15  9:48                                 ` Rolf Eike Beer
2005-09-15 14:38                                   ` Manu Abraham
2005-09-15 14:57                                     ` Rolf Eike Beer
2005-09-15 16:59                                       ` Manu Abraham
2005-09-15 18:29                                       ` Manu Abraham
2005-09-15 10:29                                 ` Ralph Metzler
2005-09-15 10:35                                   ` Manu Abraham
2005-09-15 11:42                                   ` Manu Abraham
2005-09-15 12:08                                     ` Antonino A. Daplas
2005-09-15 12:24                                       ` Rolf Eike Beer
2005-09-15 12:32                                       ` Manu Abraham
2005-09-15 12:08                                     ` Rolf Eike Beer
2005-10-10 12:02                         ` Rolf Eike Beer
2005-10-10 12:48                           ` Manu Abraham
2005-10-10 13:25                             ` Rolf Eike Beer
2005-10-10 13:16                               ` Manu Abraham
     [not found]                             ` <3888a5cd0510100719r3fddc368oa01e07e2c42b71e@mail.gmail.com>
2005-10-10 15:00                               ` Manu Abraham
     [not found]                                 ` <3888a5cd0510100846p7f2ff70cid69a1136b9256ab6@mail.gmail.com>
2005-10-10 17:08                                   ` Manu Abraham [this message]
     [not found]                                     ` <4af2d03a0510101101n54ab0b1cvae177c3c992bf9a9@mail.gmail.com>
2005-10-10 18:28                                       ` Manu Abraham
     [not found]                             ` <3888a5cd0510100725k579809a9o374930df9988bfa3@mail.gmail.com>
2005-10-10 15:02                               ` Manu Abraham
     [not found]                           ` <4af2d03a0510100528y236a1246tfc56c08a78f072d5@mail.gmail.com>
2005-10-10 12:51                             ` Manu Abraham
  -- strict thread matches above, loose matches on Subject: below --
2006-08-27 16:24 Lee Revell
2006-08-28  4:10 ` Lee Revell
2010-08-28 12:17 pci driver Srinivas Mankan

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=434AA000.4070403@linuxtv.org \
    --to=manu@linuxtv.org \
    --cc=eike-kernel@sf-tec.de \
    --cc=jirislaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lnx4us@gmail.com \
    /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 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.