Skip to contentSkip to conversation

Initial lib for sharing common code between ccid-3/ccid-4

PATCH In review Leandro 4 participants 5 messages Nov 1, 2007 – Nov 8, 2007

lore
Share & tools
lore

Leandro

author
#0 lore raw

PATCH 7/25 Initial lib for sharing common code between ccid-3/ccid-4

[CCID-3/4 lib] Initial lib for sharing common code between ccid-3/ccid-4

The lib is called tfrc_ccids.o

Index: leandro.new/net/dccp/ccids/lib/Makefile =================================--- leandro.new.orig/net/dccp/ccids/lib/Makefile +++ leandro.new/net/dccp/ccids/lib/Makefile
@@ -1,4 +1,5 @@
obj-$(CONFIG_IP_DCCP_TFRC_LIB) += dccp_tfrc_lib.o

dccp_tfrc_lib-y := tfrc_module.o tfrc_equation.o \
- packet_history.o loss_interval.o
+ packet_history.o loss_interval.o \
+ tfrc_ccids.o
Index: leandro.new/net/dccp/ccids/lib/tfrc_ccids.c =================================--- /dev/null +++ leandro.new/net/dccp/ccids/lib/tfrc_ccids.c @@ -0,0 +1,14 @@
+/*
+ * net/dccp/ccids/lib/tfrc_ccids.c
+ *

+ *  Copyright (c) 2007 Leandro Melo de Sales <[email protected]>
+ *  Copyright (c) 2005 Ian McDonald <[email protected]>
+ *  Copyright (c) 2005 Arnaldo Carvalho de Melo <[email protected]>
+ *  Copyright (c) 2003 Nils-Erik Mattsson, Joacim Haggmark, Magnus Erixzon
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.

+ */
+#include "tfrc_ccids.h"
Index: leandro.new/net/dccp/ccids/lib/tfrc_ccids.h =================================--- /dev/null +++ leandro.new/net/dccp/ccids/lib/tfrc_ccids.h @@ -0,0 +1,24 @@
+/*
+ * net/dccp/ccids/lib/tfrc_ccids.h
+ *

+ *  Copyright (c) 2007 Leandro Melo de Sales <[email protected]>
+ *  Copyright (c) 2005 Ian McDonald <[email protected]>
+ *  Copyright (c) 2005 Arnaldo Carvalho de Melo <[email protected]>
+ *  Copyright (c) 2003 Nils-Erik Mattsson, Joacim Haggmark, Magnus Erixzon
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.

+ */
+#ifndef _TFRC_CCIDS_H_
+#define _TFRC_CCIDS_H_
+
+#include <linux/ktime.h>
+#include <linux/list.h>
+#include <linux/types.h>
+#include <linux/tfrc.h>
+#include <asm/unaligned.h>
+#include "tfrc.h"
+
+#endif /* _TFRC_CCIDS_H_ */

#1 lore raw

Re: [PATCH 7/25] Initial lib for sharing common code between

Quoted 8 lines · Leandro

[CCID-3/4 lib] Initial lib for sharing common code between ccid-3/ccid-4

The lib is called tfrc_ccids.o

Index: leandro.new/net/dccp/ccids/lib/Makefile =================================> --- leandro.new.orig/net/dccp/ccids/lib/Makefile +++ leandro.new/net/dccp/ccids/lib/Makefile

Review line 5

Quoted 6 lines
(quoted diff) +2 -1
@@ -1,4 +1,5 @@
 obj-$(CONFIG_IP_DCCP_TFRC_LIB) += dccp_tfrc_lib.o
 
 dccp_tfrc_lib-y := tfrc_module.o    tfrc_equation.o \
-                   packet_history.o loss_interval.o
+                   packet_history.o loss_interval.o \
+		   tfrc_ccids.o

Whitespace police hits! I don't remember Documentation/CodingStyle mentioning anything about whitespaces in Makefiles. Nevertheless, packet_history.o is indented here with spaces, tfrc_ccids.o with tabulators, I think we should stick to just one kind of whitespace.

Quoted 3 lines
(quoted diff) +2 -1
-                   packet_history.o loss_interval.o
+                   packet_history.o loss_interval.o \
+                   tfrc_ccids.o
#2 lore raw

PATCH 7/25 Initial lib for sharing common code between ccid-3/ccid-4

In reply to Leandro

Just forward a private e-mail with Tommi about his comments.

2007/11/1, Tommi Saviranta <[email protected]>:

Quoted 11 lines · Leandro
Quoted 10 lines

[CCID-3/4 lib] Initial lib for sharing common code between ccid-3/ccid-4

The lib is called tfrc_ccids.o

Index: leandro.new/net/dccp/ccids/lib/Makefile =================================> > --- leandro.new.orig/net/dccp/ccids/lib/Makefile +++ leandro.new/net/dccp/ccids/lib/Makefile

(quoted diff) +0 -0
@@ -1,4 +1,5 @@
 obj-$(CONFIG_IP_DCCP_TFRC_LIB) += dccp_tfrc_lib.o
 
Quoted 15 lines

Review line 5

Quoted 4 lines
(quoted diff) +2 -1
 dccp_tfrc_lib-y := tfrc_module.o    tfrc_equation.o \
-                   packet_history.o loss_interval.o
+                   packet_history.o loss_interval.o \
+                tfrc_ccids.o

Whitespace police hits! I don't remember Documentation/CodingStyle mentioning anything about whitespaces in Makefiles. Nevertheless, packet_history.o is indented here with spaces, tfrc_ccids.o with tabulators, I think we should stick to just one kind of whitespace.

Quoted 3 lines
(quoted diff) +2 -1
-                   packet_history.o loss_interval.o
+                   packet_history.o loss_interval.o \
+                   tfrc_ccids.o

From Documentation/CodingStyle:

"Tabs are 8 characters, and thus indentations are also 8 characters. There are heretic movements that try to make indentations 4 (or even 2!) characters deep, and that is akin to trying to define the value of PI to be 3."

(...)

"In short, 8-char indents make things easier to read, and have the added benefit of warning you when you're nesting your functions too deep. Heed that warning."

So, the kind that we are looking for it to use tabs (8 chars). Since tfrc_ccids.o I used tabs, I think that it is ok.

Leandro.

#4 lore raw
In reply to Leandro

Quoting Tommi:

| On Wed, Oct 31, 2007 at 21:30:24 -0300, Leandro wrote:
| > [CCID-3/4 lib] Initial lib for sharing common code between ccid-3/ccid-4
| > 
| > The lib is called tfrc_ccids.o
| 
| > Index: leandro.new/net/dccp/ccids/lib/Makefile
| > =================================| > --- leandro.new.orig/net/dccp/ccids/lib/Makefile
| > +++ leandro.new/net/dccp/ccids/lib/Makefile
| > @@ -1,4 +1,5 @@
| >  obj-$(CONFIG_IP_DCCP_TFRC_LIB) += dccp_tfrc_lib.o
| >  
| >  dccp_tfrc_lib-y := tfrc_module.o    tfrc_equation.o \
| > -                   packet_history.o loss_interval.o
| > +                   packet_history.o loss_interval.o \
| > +		   tfrc_ccids.o
| 
| Whitespace police hits! I don't remember Documentation/CodingStyle
| mentioning anything about whitespaces in Makefiles. Nevertheless,
| packet_history.o is indented here with spaces, tfrc_ccids.o with
| tabulators, I think we should stick to just one kind of whitespace.
| 
| > -                   packet_history.o loss_interval.o
| > +                   packet_history.o loss_interval.o \
| > +                   tfrc_ccids.o
| 

Leandro is right, tabs are ok in this place (it is a line continuation). I just found that in the online version the patch looks as suggested above (I run my whitespace scripts routinely over patch sets, and have done this here as well).