kern/177155: [patch] Fixing clang warnings at /sys/dev/safe

hiren panchasara hiren.panchasara at gmail.com
Thu Mar 21 16:58:58 UTC 2013


On Wed, Mar 20, 2013 at 1:10 PM,  <FreeBSD-gnats-submit at freebsd.org> wrote:
> Thank you very much for your problem report.
> It has the internal identification `kern/177155'.
> The individual assigned to look at your
> report is: freebsd-bugs.
>
> You can access the state of your problem report at any time
> via this link:
>
> http://www.freebsd.org/cgi/query-pr.cgi?pr=177155
>
>>Category:       kern
>>Responsible:    freebsd-bugs
>>Synopsis:       [patch] Fixing clang warnings at /sys/dev/safe
>>Arrival-Date:   Wed Mar 20 20:10:00 UTC 2013

Taking a closer look, more correct fix looks like this:

Index: sys/dev/safe/safe.c
===================================================================
--- sys/dev/safe/safe.c (revision 248555)
+++ sys/dev/safe/safe.c (working copy)
@@ -122,7 +122,7 @@
 static void safe_intr(void *);
 static void safe_callback(struct safe_softc *, struct safe_ringentry *);
 static void safe_feed(struct safe_softc *, struct safe_ringentry *);
-static void safe_mcopy(struct mbuf *, struct mbuf *, u_int);
+static void safe_mcopy(struct mbuf *, struct mbuf *, int);
 #ifndef SAFE_NO_RNG
 static void safe_rng_init(struct safe_softc *);
 static void safe_rng(void *);
@@ -1598,10 +1598,11 @@
  * Copy all data past offset from srcm to dstm.
  */
 static void
-safe_mcopy(struct mbuf *srcm, struct mbuf *dstm, u_int offset)
+safe_mcopy(struct mbuf *srcm, struct mbuf *dstm, int offset)
 {
-       u_int j, dlen, slen;
+       u_int dlen, slen;
        caddr_t dptr, sptr;
+       int j;

        /*
         * Advance src and dst to offset.

Reason being (as per my understanding):
safe_mcopy() is being called from only one place: safe_process() where
3rd arg to safe_mcopy() oplen is of type int.

Thanks,
Hiren


More information about the freebsd-bugs mailing list