netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kurt Van Dijck <kurt.van.dijck@eia.be>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: netdev@vger.kernel.org, socketcan-core@lists.berlios.de
Subject: Re: [PATCH net-next-2.6 v2 1/2] can: add driver for Softing card
Date: Thu, 6 Jan 2011 16:05:26 +0100	[thread overview]
Message-ID: <20110106150525.GB324@e-circ.dyndns.org> (raw)
In-Reply-To: <4D24DB2C.9040104@grandegger.com>

Wolfgang,

On Wed, Jan 05, 2011 at 09:57:16PM +0100, Wolfgang Grandegger wrote:
> 
> here comes my review... First some general remarks. As Mark already
> pointed out, there are still some coding style issues:
Oops, I tried to eliminate those.
> 
> - Please use the following style for multi line comments:
shame on me. I should have done them all after Mark pointed me to it.
> 
> - Please avoid alignment of expressions and structure members.
I see:
diff --git a/include/linux/can.h b/include/linux/can.h
index d183333..6b1e5a6 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -56,18 +56,18 @@ typedef __u32 can_err_mask_t;
  */
 struct can_frame {
 	canid_t can_id;  /* 32 bit CAN_ID + EFF/RTR/ERR flags */
-	__u8    can_dlc; /* data length code: 0 .. 8 */
-	__u8    data[8] __attribute__((aligned(8)));
+	__u8 can_dlc; /* data length code: 0 .. 8 */
+	__u8 data[8] __attribute__((aligned(8)));
 };
 
 /* particular protocols of the protocol family PF_CAN */
-#define CAN_RAW		1 /* RAW sockets */
-#define CAN_BCM		2 /* Broadcast Manager */
-#define CAN_TP16	3 /* VAG Transport Protocol v1.6 */
-#define CAN_TP20	4 /* VAG Transport Protocol v2.0 */
-#define CAN_MCNET	5 /* Bosch MCNet */
-#define CAN_ISOTP	6 /* ISO 15765-2 Transport Protocol */
-#define CAN_NPROTO	7
+#define CAN_RAW 1 /* RAW sockets */
+#define CAN_BCM 2 /* Broadcast Manager */
+#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
+#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
+#define CAN_MCNET 5 /* Bosch MCNet */
+#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
+#define CAN_NPROTO 7
 
 #define SOL_CAN_BASE 100
 
@@ -79,7 +79,7 @@ struct can_frame {
  */
 struct sockaddr_can {
 	sa_family_t can_family;
-	int         can_ifindex;
+	int can_ifindex;
 	union {
 		/* transport protocol class address information (e.g. ISOTP) */
 		struct { canid_t rx_id, tx_id; } tp;

I applied a search pattern on this, since I seem incapable of finding
alignment problems in my own code :-).
I assume alignment is ok for definitions, but not within functions?
I consulted the Documentation/Coding-style, but I did not find
the exact answer.
> 
> More comments inline...
More to process for me too ...

Kurt

  reply	other threads:[~2011-01-06 15:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 15:05 [PATCH net-next-2.6 v2 0/2] can: add driver for Softing card Kurt Van Dijck
     [not found] ` <20110104150513.GA321-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-04 15:07   ` [PATCH net-next-2.6 v2 1/2] " Kurt Van Dijck
     [not found]     ` <20110104150759.GB321-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-05 20:57       ` Wolfgang Grandegger
2011-01-06 15:05         ` Kurt Van Dijck [this message]
     [not found]           ` <20110106150525.GB324-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-06 16:27             ` Wolfgang Grandegger
     [not found]               ` <4D25ED70.7000303-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-07 12:29                 ` Kurt Van Dijck
     [not found]         ` <4D24DB2C.9040104-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-10 13:31           ` Kurt Van Dijck
     [not found]             ` <20110110133112.GA324-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-10 13:40               ` Wolfram Sang
     [not found]                 ` <20110110134006.GC31011-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2011-01-10 13:44                   ` Kurt Van Dijck
2011-01-10 14:05             ` Wolfgang Grandegger
     [not found]               ` <4D2B1245.9060303-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-10 14:07                 ` Wolfgang Grandegger
2011-01-10 14:40                 ` Kurt Van Dijck
2011-01-04 15:09 ` [PATCH net-next-2.6 v2 2/2] " Kurt Van Dijck
     [not found]   ` <20110104150923.GC321-MxZ6Iy/zr/UdbCeoMzGj59i2O/JbrIOy@public.gmane.org>
2011-01-05 21:02     ` Wolfgang Grandegger
     [not found]       ` <4D24DC58.7090009-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2011-01-06  6:26         ` Kurt Van Dijck

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=20110106150525.GB324@e-circ.dyndns.org \
    --to=kurt.van.dijck@eia.be \
    --cc=netdev@vger.kernel.org \
    --cc=socketcan-core@lists.berlios.de \
    --cc=wg@grandegger.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 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).