From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Stephane Grosjean <s.grosjean@peak-system.com>,
linux-can@vger.kernel.org
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Subject: Re: [PATCH v4] can/peak_usb: add support for PEAK new CANFD USB adapters
Date: Tue, 13 Jan 2015 14:29:25 +0100 [thread overview]
Message-ID: <54B51DB5.2030707@pengutronix.de> (raw)
In-Reply-To: <54B51B2C.3080404@peak-system.com>
[-- Attachment #1: Type: text/plain, Size: 3832 bytes --]
On 01/13/2015 02:18 PM, Stephane Grosjean wrote:
> Hi Marc,
>
> Le 07/01/2015 18:03, Marc Kleine-Budde a écrit :
>> On 01/06/2015 11:00 AM, Stephane Grosjean wrote:
>> @@ -750,9 +795,10 @@ static int peak_usb_create_dev(struct
>> peak_usb_adapter *peak_usb_adapter,
>> dev->can.clock = peak_usb_adapter->clock;
>> dev->can.bittiming_const = &peak_usb_adapter->bittiming_const;
>> dev->can.do_set_bittiming = peak_usb_set_bittiming;
>> + dev->can.data_bittiming_const =
>> &peak_usb_adapter->data_bittiming_const;
>> + dev->can.do_set_data_bittiming = peak_usb_set_data_bittiming;
>> dev->can.do_set_mode = peak_usb_set_mode;
>> - dev->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES |
>> - CAN_CTRLMODE_LISTENONLY;
>> + dev->can.ctrlmode_supported = peak_usb_adapter->ctrlmode_supported;
>> All ctrlmode_supported can go into a seperate patch.
>
> I'll try but can you please explain why?
Because it's a separate feature. Making the review easier.
[...]
>> What about the following hunks (but not the .ctrlmode_supported) ? They
>> can go into a seperate patch which comes first?
>
> So. You want me to do a serie of patches, right?
> - a first patch that would change the existing files
> - another one that would add the ctrl_mode_supported chanegs
> - another one that would add the new files
It's not about existing and new files. A patch should handle a single
topic and be easy to review. If something can be separated it should.
For example, adding the ctrl_mode_supported for the existing adapters
would be such a feature. Making the functions in pcan_usb_pro.c non
static, moving the #defines and adding the function declarations to
pcan_usb_pro.h is another preparation patch, so that the final patch,
that adds the new adapter is smaller and thus easier to review.
>>> diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
>>> b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
>>> index 4cfa3b8..a764045 100644
>>> --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
>>> +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
>>> @@ -27,14 +27,6 @@
>>> MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro adapter");
>>> -/* PCAN-USB Pro Endpoints */
>>> -#define PCAN_USBPRO_EP_CMDOUT 1
>>> -#define PCAN_USBPRO_EP_CMDIN (PCAN_USBPRO_EP_CMDOUT |
>>> USB_DIR_IN)
>>> -#define PCAN_USBPRO_EP_MSGOUT_0 2
>>> -#define PCAN_USBPRO_EP_MSGIN (PCAN_USBPRO_EP_MSGOUT_0 |
>>> USB_DIR_IN)
>>> -#define PCAN_USBPRO_EP_MSGOUT_1 3
>>> -#define PCAN_USBPRO_EP_UNUSED (PCAN_USBPRO_EP_MSGOUT_1 |
>>> USB_DIR_IN)
>>> -
>>> #define PCAN_USBPRO_CHANNEL_COUNT 2
>>> /* PCAN-USB Pro adapter internal clock (MHz) */
>>> @@ -322,8 +314,8 @@ static int pcan_usb_pro_wait_rsp(struct
>>> peak_usb_device *dev,
>>> return (i >= PCAN_USBPRO_RSP_SUBMIT_MAX) ? -ERANGE : err;
>>> }
>
>>> +extern int pcan_usb_pro_probe(struct usb_interface *intf);
>>> +extern int pcan_usb_pro_send_req(struct peak_usb_device *dev, int
>>> req_id,
>>> + int req_value, void *req_addr,
>>> + int req_size);
>>> +extern void pcan_usb_pro_restart_complete(struct urb *urb);
>> IIRC we're killing the "extern" in function definitions in the kernel.
>
> Ok. So I remove all "extern" keywords even from existing files, right?
Up to you, this probably would be another patch. However, please don't
add new "extern"s :)
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-01-13 13:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-06 10:00 [PATCH v4] can/peak_usb: add support for PEAK new CANFD USB adapters Stephane Grosjean
2015-01-07 17:03 ` Marc Kleine-Budde
2015-01-07 17:37 ` Oliver Hartkopp
2015-01-07 18:37 ` iproute2 fd-non-iso PoC - was " Oliver Hartkopp
2015-01-08 9:04 ` Marc Kleine-Budde
2015-01-08 9:09 ` Marc Kleine-Budde
2015-01-13 13:18 ` Stephane Grosjean
2015-01-13 13:29 ` Marc Kleine-Budde [this message]
2015-01-13 13:32 ` Marc Kleine-Budde
2015-01-14 10:50 ` Stephane Grosjean
2015-01-14 10:51 ` Marc Kleine-Budde
2015-01-14 10:56 ` Stephane Grosjean
2015-01-14 11:07 ` Marc Kleine-Budde
2015-01-14 18:55 ` Oliver Hartkopp
2015-01-14 20:57 ` Marc Kleine-Budde
2015-01-15 15:49 ` Marc Kleine-Budde
2015-01-14 12:05 ` Fwd: " Stephane Grosjean
2015-01-14 13:00 ` Andri Yngvason
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=54B51DB5.2030707@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=linux-can@vger.kernel.org \
--cc=s.grosjean@peak-system.com \
--cc=socketcan@hartkopp.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).