[PATCH] ansify ppp-deflate.c

2012-12-17 Thread Michael W. Bombardieri
Hi,

I am submitting a patch to convert ppp-deflate.c to ANSI.
No binary change on amd64.
Does this look OK to go in?

- Michael


Index: ppp-deflate.c
===
RCS file: /cvs/src/sys/net/ppp-deflate.c,v
retrieving revision 1.9
diff -u -r1.9 ppp-deflate.c
--- ppp-deflate.c   7 Jul 2011 02:57:25 -   1.9
+++ ppp-deflate.c   18 Dec 2012 01:42:41 -
@@ -125,9 +125,7 @@
  * Space allocation and freeing routines for use by zlib routines.
  */
 void *
-zcalloc(notused, items, size)
-void *notused;
-u_int items, size;
+zcalloc(void *notused, u_int items, u_int size)
 {
 void *ptr;
 
@@ -136,9 +134,7 @@
 }
 
 void
-zcfree(notused, ptr)
-void *notused;
-void *ptr;
+zcfree(void *notused, void *ptr)
 {
 free(ptr, M_DEVBUF);
 }
@@ -147,9 +143,7 @@
  * Allocate space for a compressor.
  */
 static void *
-z_comp_alloc(options, opt_len)
-u_char *options;
-int opt_len;
+z_comp_alloc(u_char *options, int opt_len)
 {
 struct deflate_state *state;
 int w_size;
@@ -183,8 +177,7 @@
 }
 
 static void
-z_comp_free(arg)
-void *arg;
+z_comp_free(void *arg)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 
@@ -193,10 +186,8 @@
 }
 
 static int
-z_comp_init(arg, options, opt_len, unit, hdrlen, debug)
-void *arg;
-u_char *options;
-int opt_len, unit, hdrlen, debug;
+z_comp_init(void *arg, u_char *options, int opt_len, int unit,
+int hdrlen, int debug)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 
@@ -219,8 +210,7 @@
 }
 
 static void
-z_comp_reset(arg)
-void *arg;
+z_comp_reset(void *arg)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 
@@ -229,11 +219,8 @@
 }
 
 int
-z_compress(arg, mret, mp, orig_len, maxolen)
-void *arg;
-struct mbuf **mret;/* compressed packet (out) */
-struct mbuf *mp;   /* uncompressed packet (in) */
-int orig_len, maxolen;
+z_compress(void *arg, struct mbuf **mret, struct mbuf *mp,
+int orig_len, int maxolen)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 u_char *rptr, *wptr;
@@ -357,9 +344,7 @@
 }
 
 static void
-z_comp_stats(arg, stats)
-void *arg;
-struct compstat *stats;
+z_comp_stats(void *arg, struct compstat *stats)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 u_int out;
@@ -379,9 +364,7 @@
  * Allocate space for a decompressor.
  */
 static void *
-z_decomp_alloc(options, opt_len)
-u_char *options;
-int opt_len;
+z_decomp_alloc(u_char *options, int opt_len)
 {
 struct deflate_state *state;
 int w_size;
@@ -414,8 +397,7 @@
 }
 
 static void
-z_decomp_free(arg)
-void *arg;
+z_decomp_free(void *arg)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 
@@ -424,10 +406,8 @@
 }
 
 static int
-z_decomp_init(arg, options, opt_len, unit, hdrlen, mru, debug)
-void *arg;
-u_char *options;
-int opt_len, unit, hdrlen, mru, debug;
+z_decomp_init(void *arg, u_char *options, int opt_len, int unit,
+int hdrlen, int mru, int debug)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 
@@ -451,8 +431,7 @@
 }
 
 static void
-z_decomp_reset(arg)
-void *arg;
+z_decomp_reset(void *arg)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 
@@ -477,9 +456,7 @@
  * compression, even though they are detected by inspecting the input.
  */
 int
-z_decompress(arg, mi, mop)
-void *arg;
-struct mbuf *mi, **mop;
+z_decompress(void *arg, struct mbuf *mi, struct mbuf **mop)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 struct mbuf *mo, *mo_head;
@@ -625,9 +602,7 @@
  * Incompressible data has arrived - add it to the history.
  */
 static void
-z_incomp(arg, mi)
-void *arg;
-struct mbuf *mi;
+z_incomp(void *arg, struct mbuf *mi)
 {
 struct deflate_state *state = (struct deflate_state *) arg;
 u_char *rptr;



Re: savecore on swap-less amd64 box

2012-12-17 Thread Mark Kettenis
> Date: Mon, 17 Dec 2012 15:10:01 +0200
> From: Alexey Suslikov 
> 
> On Mon, Dec 17, 2012 at 2:44 PM, Mark Kettenis  
> wrote:
> >> Date: Mon, 17 Dec 2012 14:14:40 +0200
> >> From: Alexey Suslikov 
> >>
> >> Hello tech@.
> >>
> >> On swap-less amd64 box using 20121213 amd64 snap, I have noticed a 
> >> difference
> >> in how savecore behaves on SP and MP kernels.
> >>
> >> During boot, I see
> >>
> >> OpenBSD 5.2-current (GENERIC) #6: Wed Dec 12 23:16:44 MST 2012
> >> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
> >>
> >> savecore: /dev/sd0b: Device not configured
> >>
> >> OpenBSD 5.2-current (GENERIC.MP) #5: Wed Dec 12 23:22:46 MST 2012
> >> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> >>
> >> savecore: can't find device 0/127
> >>
> >> $ cat /etc/fstab
> >> 93e3a680795f1b55.a / ffs rw,softdep 1 1
> >>
> >> Is it normal or I have missed something?
> >
> > reboot that GENERIC.MP kernel once more
> 
> yep. that fixed the "problem".
> 
> just curious, what was it and why?

Printing the proper device names relies on /var/run/dev.db being up to
date.  This database is generated by dev_mkdb, which is run after swap
gets enabled.  The database is tied to a specific kernel.  So when you
change your kernel the database doesn't match the kernel and you get
the "can't find device" message.



Re: savecore on swap-less amd64 box

2012-12-17 Thread Alexey Suslikov
On Mon, Dec 17, 2012 at 2:44 PM, Mark Kettenis  wrote:
>> Date: Mon, 17 Dec 2012 14:14:40 +0200
>> From: Alexey Suslikov 
>>
>> Hello tech@.
>>
>> On swap-less amd64 box using 20121213 amd64 snap, I have noticed a difference
>> in how savecore behaves on SP and MP kernels.
>>
>> During boot, I see
>>
>> OpenBSD 5.2-current (GENERIC) #6: Wed Dec 12 23:16:44 MST 2012
>> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
>>
>> savecore: /dev/sd0b: Device not configured
>>
>> OpenBSD 5.2-current (GENERIC.MP) #5: Wed Dec 12 23:22:46 MST 2012
>> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
>>
>> savecore: can't find device 0/127
>>
>> $ cat /etc/fstab
>> 93e3a680795f1b55.a / ffs rw,softdep 1 1
>>
>> Is it normal or I have missed something?
>
> reboot that GENERIC.MP kernel once more

yep. that fixed the "problem".

just curious, what was it and why?

Cheers,
Alexey



Re: savecore on swap-less amd64 box

2012-12-17 Thread Mark Kettenis
> Date: Mon, 17 Dec 2012 14:14:40 +0200
> From: Alexey Suslikov 
> 
> Hello tech@.
> 
> On swap-less amd64 box using 20121213 amd64 snap, I have noticed a difference
> in how savecore behaves on SP and MP kernels.
> 
> During boot, I see
> 
> OpenBSD 5.2-current (GENERIC) #6: Wed Dec 12 23:16:44 MST 2012
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
> 
> savecore: /dev/sd0b: Device not configured
> 
> OpenBSD 5.2-current (GENERIC.MP) #5: Wed Dec 12 23:22:46 MST 2012
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> 
> savecore: can't find device 0/127
> 
> $ cat /etc/fstab
> 93e3a680795f1b55.a / ffs rw,softdep 1 1
> 
> Is it normal or I have missed something?

reboot that GENERIC.MP kernel once more