All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] RT-Socket-CAN driver for EMS CPC PCI card
Date: Fri, 24 Aug 2007 21:29:31 +0200	[thread overview]
Message-ID: <46CF319B.1030602@domain.hid> (raw)
In-Reply-To: <46CF2970.6070804@domain.hid>

Jan Kiszka wrote:
> Wolfgang Grandegger wrote:
>> Hello,
>>
>> the following patch changes:
>>
>> 2007-08-22  Wolfgang Grandegger  <wg@domain.hid>
>>
>>     * ksrc/drivers/can/sja1000: Add the RT-Socket-CAN SJA1000 driver
>>     rtcan_ems_pci.c for the EMS CPC PCI card from EMS Dr. Thomas
>>     Wuensche (http://www.ems-wuensche.de).
>>
>> I would like to apply it to Xenomai's trunk and v2.3.x branch.
>>
> 
> I few quick comments from my side:
> 
>  - Could you submit new code already Lindent'ified? This keeps the
>    effort bounded to convert the rest one day.

I was already thinking about it.

>> Index: ksrc/drivers/can/sja1000/rtcan_ems_pci.c
>> ===================================================================
>> --- ksrc/drivers/can/sja1000/rtcan_ems_pci.c	(revision 0)
>> +++ ksrc/drivers/can/sja1000/rtcan_ems_pci.c	(revision 0)
> ...
>> +#define EMS_PCI_SINGLE 0 /* this is a single channel device */
> 
> This define is unused - is this intended?

Well, there are more. I'm going to remove them.

>> +static int rtcan_ems_pci_add_chan(struct pci_dev *pdev, int channel,
>> +				   struct rtcan_device **master_dev)
>> +{
>> +    struct rtcan_device *dev;
>> +    struct rtcan_sja1000 *chip;
>> +    struct rtcan_ems_pci *board;
>> +    unsigned long addr;
>> +    int ret, init_step = 1;
> 
> ret!=0 always means error here? In that case I find "err" a more telling
> variable name ("if (err) ..." -- personal flavour).

Agreed.

>> +    /* Register and setup interrupt handling */
>> +#ifdef CONFIG_XENO_OPT_SHIRQ_LEVEL
>> +    chip->irq_flags = RTDM_IRQTYPE_SHARED;
>> +#else
>> +    chip->irq_flags = 0;
>> +#endif
> 
> That #ifdef is redundant, just use RTDM_IRQTYPE_SHARED unconditionally.

OK.

>> +#ifdef CONFIG_XENO_OPT_SHIRQ_LEVEL
>> +    if ((ret = rtcan_ems_pci_add_chan(pdev, EMS_PCI_MASTER,
>> +				      &master_dev)))
>> +	    goto failure_cleanup;
>> +    if ((ret = rtcan_ems_pci_add_chan(pdev, EMS_PCI_SLAVE,
>> +				      &master_dev)))
>> +	    goto failure_cleanup;
>> +#else
>> +    printk("Shared interrupts not enabled, using single channel!\n");
>> +    if ((ret = rtcan_ems_pci_add_chan(pdev, EMS_PCI_MASTER,
>> +				      &master_dev)))
>> +	    goto failure_cleanup;
>> +#endif
> 
> The master registration should be moved out off the #ifdef - it's identical.

Yes, right.

> Besides this, I have no concerns merging it, also into 2.3. Thanks for
> your effort!

OK, thanks for reviewing the code.

Wolfgang.



      reply	other threads:[~2007-08-24 19:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-22 10:58 [Xenomai-core] [PATCH] RT-Socket-CAN driver for EMS CPC PCI card Wolfgang Grandegger
2007-08-24 18:54 ` Jan Kiszka
2007-08-24 19:29   ` Wolfgang Grandegger [this message]

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=46CF319B.1030602@domain.hid \
    --to=wg@domain.hid \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.