From: Oliver Hartkopp <socketcan@hartkopp.net>
To: linux-can@vger.kernel.org
Cc: Oliver Hartkopp <socketcan@hartkopp.net>
Subject: [PATCH v2 2/5] can: bcm: use CAN frame instead of can_frame in comments
Date: Mon, 30 May 2016 20:36:27 +0200 [thread overview]
Message-ID: <1464633390-24299-3-git-send-email-socketcan@hartkopp.net> (raw)
In-Reply-To: <1464633390-24299-1-git-send-email-socketcan@hartkopp.net>
can_frame is the name of the struct can_frame which is not meant in comments.
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
net/can/bcm.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/net/can/bcm.c b/net/can/bcm.c
index 1f4ccc3..59553de 100644
--- a/net/can/bcm.c
+++ b/net/can/bcm.c
@@ -84,7 +84,7 @@ MODULE_LICENSE("Dual BSD/GPL");
MODULE_AUTHOR("Oliver Hartkopp <oliver.hartkopp@volkswagen.de>");
MODULE_ALIAS("can-proto-2");
-/* easy access to can_frame payload */
+/* easy access to CAN frame payload */
static inline u64 GET_U64(const struct can_frame *cp)
{
return *(u64 *)cp->data;
@@ -307,13 +307,13 @@ static void bcm_send_to_user(struct bcm_op *op, struct bcm_msg_head *head,
memcpy(skb_put(skb, sizeof(*head)), head, sizeof(*head));
if (head->nframes) {
- /* can_frames starting here */
+ /* CAN frames starting here */
firstframe = (struct can_frame *)skb_tail_pointer(skb);
memcpy(skb_put(skb, datalen), frames, datalen);
/*
- * the BCM uses the can_dlc-element of the can_frame
+ * the BCM uses the can_dlc-element of the CAN frame
* structure for internal purposes. This is only
* relevant for updates that are generated by the
* BCM, where nframes is 1
@@ -494,7 +494,7 @@ static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index,
return;
}
- /* do a real check in can_frame data section */
+ /* do a real check in CAN frame data section */
if ((GET_U64(&op->frames[index]) & GET_U64(rxdata)) !=
(GET_U64(&op->frames[index]) & GET_U64(&op->last_frames[index]))) {
@@ -503,7 +503,7 @@ static void bcm_rx_cmp_to_index(struct bcm_op *op, unsigned int index,
}
if (op->flags & RX_CHECK_DLC) {
- /* do a real check in can_frame dlc */
+ /* do a real check in CAN frame dlc */
if (rxdata->can_dlc != (op->last_frames[index].can_dlc &
BCM_CAN_DLC_MASK)) {
bcm_rx_update_and_send(op, &op->last_frames[index],
@@ -556,7 +556,7 @@ static enum hrtimer_restart bcm_rx_timeout_handler(struct hrtimer *hrtimer)
/* if user wants to be informed, when cyclic CAN-Messages come back */
if ((op->flags & RX_ANNOUNCE_RESUME) && op->last_frames) {
- /* clear received can_frames to indicate 'nothing received' */
+ /* clear received CAN frames to indicate 'nothing received' */
memset(op->last_frames, 0, op->nframes * CFSIZ);
}
@@ -842,7 +842,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
if (!ifindex)
return -ENODEV;
- /* check nframes boundaries - we need at least one can_frame */
+ /* check nframes boundaries - we need at least one CAN frame */
if (msg_head->nframes < 1 || msg_head->nframes > MAX_NFRAMES)
return -EINVAL;
@@ -853,14 +853,14 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
/* update existing BCM operation */
/*
- * Do we need more space for the can_frames than currently
+ * Do we need more space for the CAN frames than currently
* allocated? -> This is a _really_ unusual use-case and
* therefore (complexity / locking) it is not supported.
*/
if (msg_head->nframes > op->nframes)
return -E2BIG;
- /* update can_frames content */
+ /* update CAN frames content */
for (i = 0; i < msg_head->nframes; i++) {
err = memcpy_from_msg((u8 *)&op->frames[i], msg, CFSIZ);
@@ -885,7 +885,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
op->can_id = msg_head->can_id;
- /* create array for can_frames and copy the data */
+ /* create array for CAN frames and copy the data */
if (msg_head->nframes > 1) {
op->frames = kmalloc(msg_head->nframes * CFSIZ,
GFP_KERNEL);
@@ -968,7 +968,7 @@ static int bcm_tx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
if (op->flags & STARTTIMER) {
hrtimer_cancel(&op->timer);
- /* spec: send can_frame when starting timer */
+ /* spec: send CAN frame when starting timer */
op->flags |= TX_ANNOUNCE;
}
@@ -1017,7 +1017,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
/* update existing BCM operation */
/*
- * Do we need more space for the can_frames than currently
+ * Do we need more space for the CAN frames than currently
* allocated? -> This is a _really_ unusual use-case and
* therefore (complexity / locking) it is not supported.
*/
@@ -1025,7 +1025,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
return -E2BIG;
if (msg_head->nframes) {
- /* update can_frames content */
+ /* update CAN frames content */
err = memcpy_from_msg((u8 *)op->frames, msg,
msg_head->nframes * CFSIZ);
if (err < 0)
@@ -1050,7 +1050,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
op->nframes = msg_head->nframes;
if (msg_head->nframes > 1) {
- /* create array for can_frames and copy the data */
+ /* create array for CAN frames and copy the data */
op->frames = kmalloc(msg_head->nframes * CFSIZ,
GFP_KERNEL);
if (!op->frames) {
@@ -1058,7 +1058,7 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
return -ENOMEM;
}
- /* create and init array for received can_frames */
+ /* create and init array for received CAN frames */
op->last_frames = kzalloc(msg_head->nframes * CFSIZ,
GFP_KERNEL);
if (!op->last_frames) {
@@ -1329,7 +1329,7 @@ static int bcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t size)
break;
case TX_SEND:
- /* we need exactly one can_frame behind the msg head */
+ /* we need exactly one CAN frame behind the msg head */
if ((msg_head.nframes != 1) || (size != CFSIZ + MHSIZ))
ret = -EINVAL;
else
--
2.8.1
next prev parent reply other threads:[~2016-05-30 18:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-30 18:36 [PATCH v2 0/5] Add support for CAN FD to broadcast manager (CAN_BCM) Oliver Hartkopp
2016-05-30 18:36 ` [PATCH v2 1/5] can: bcm: fix indention style Oliver Hartkopp
2016-05-30 18:36 ` Oliver Hartkopp [this message]
2016-05-30 18:36 ` [PATCH v2 3/5] can: bcm: unify bcm_msg_head handling and prepare function parameters Oliver Hartkopp
2016-05-30 18:36 ` [PATCH v2 4/5] can: bcm: add support for CAN FD frames Oliver Hartkopp
2016-05-30 18:36 ` [PATCH v2 5/5] can: bcm: add documentation for CAN FD support Oliver Hartkopp
2016-05-30 18:43 ` Request for testing - Re: [PATCH v2 0/5] Add support for CAN FD to broadcast manager (CAN_BCM) Oliver Hartkopp
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=1464633390-24299-3-git-send-email-socketcan@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=linux-can@vger.kernel.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 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).