[PATCH 2/3] cifs: md5 cleanup - spaces

From: Jesper Juhl (juhl-lkml_at_dif.dk)
Date: 04/11/05

  • Next message: Matthew Garrett: "Re: [ACPI] [2.6.12-rc2][suspend] Suspending Thinkpad: drive bay light in S3 mode stays on"
    Date:	Mon, 11 Apr 2005 22:14:28 +0200 (CEST)
    To: Steven French <sfrench@us.ibm.com>
    
    

    clean up spacing, redundant blank lines etc.

    patch is also at:
            http://www.linuxtux.org/~juhl/kernel_patches/fs_cifs_md5-spaces.patch

    Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>

    --- linux-2.6.12-rc2-mm2/fs/cifs/md5.c.with_patch1 2005-04-09 10:36:44.000000000 +0200
    +++ linux-2.6.12-rc2-mm2/fs/cifs/md5.c 2005-04-09 10:40:44.000000000 +0200
    @@ -72,9 +72,8 @@ void MD5Update(struct MD5Context *ctx, u
             t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */
     
             /* Handle any leading odd-sized chunks */
    -
             if (t) {
    - unsigned char *p = (unsigned char *) ctx->in + t;
    + unsigned char *p = (unsigned char *)ctx->in + t;
     
                     t = 64 - t;
                     if (len < t) {
    @@ -83,22 +82,20 @@ void MD5Update(struct MD5Context *ctx, u
                     }
                     memmove(p, buf, t);
                     byteReverse(ctx->in, 16);
    - MD5Transform(ctx->buf, (__u32 *) ctx->in);
    + MD5Transform(ctx->buf, (__u32 *)ctx->in);
                     buf += t;
                     len -= t;
             }
             /* Process data in 64-byte chunks */
    -
             while (len >= 64) {
                     memmove(ctx->in, buf, 64);
                     byteReverse(ctx->in, 16);
    - MD5Transform(ctx->buf, (__u32 *) ctx->in);
    + MD5Transform(ctx->buf, (__u32 *)ctx->in);
                     buf += 64;
                     len -= 64;
             }
     
             /* Handle any remaining bytes of data. */
    -
             memmove(ctx->in, buf, len);
     }
     
    @@ -127,7 +124,7 @@ void MD5Final(unsigned char digest[16],
                     /* Two lots of padding: Pad the first block to 64 bytes */
                     memset(p, 0, count);
                     byteReverse(ctx->in, 16);
    - MD5Transform(ctx->buf, (__u32 *) ctx->in);
    + MD5Transform(ctx->buf, (__u32 *)ctx->in);
     
                     /* Now fill the next block with 56 bytes */
                     memset(ctx->in, 0, 56);
    @@ -138,11 +135,11 @@ void MD5Final(unsigned char digest[16],
             byteReverse(ctx->in, 14);
     
             /* Append length in bits and transform */
    - ((__u32 *) ctx->in)[14] = ctx->bits[0];
    - ((__u32 *) ctx->in)[15] = ctx->bits[1];
    + ((__u32 *)ctx->in)[14] = ctx->bits[0];
    + ((__u32 *)ctx->in)[15] = ctx->bits[1];
     
             MD5Transform(ctx->buf, (__u32 *) ctx->in);
    - byteReverse((unsigned char *) ctx->buf, 4);
    + byteReverse((unsigned char *)ctx->buf, 4);
             memmove(digest, ctx->buf, 16);
             memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
     }
    @@ -269,8 +266,8 @@ void hmac_md5_init_rfc2104(unsigned char
             }
     
             /* start out by storing key in pads */
    - memset(ctx->k_ipad, 0, sizeof (ctx->k_ipad));
    - memset(ctx->k_opad, 0, sizeof (ctx->k_opad));
    + memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad));
    + memset(ctx->k_opad, 0, sizeof(ctx->k_opad));
             memcpy(ctx->k_ipad, key, key_len);
             memcpy(ctx->k_opad, key, key_len);
     
    @@ -298,8 +295,8 @@ void hmac_md5_init_limK_to_64(const unsi
             }
     
             /* start out by storing key in pads */
    - memset(ctx->k_ipad, 0, sizeof (ctx->k_ipad));
    - memset(ctx->k_opad, 0, sizeof (ctx->k_opad));
    + memset(ctx->k_ipad, 0, sizeof(ctx->k_ipad));
    + memset(ctx->k_opad, 0, sizeof(ctx->k_opad));
             memcpy(ctx->k_ipad, key, key_len);
             memcpy(ctx->k_opad, key, key_len);
     

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Matthew Garrett: "Re: [ACPI] [2.6.12-rc2][suspend] Suspending Thinkpad: drive bay light in S3 mode stays on"

    Relevant Pages

    • [PATCH 02/05] mm simplify __alloc_pages cpuset ALLOC_* flags
      ... Thanks to the previous patch, it is equivalent to the setting ... of!ALLOC_NO_WATERMARKS, so redundant. ... goto got_pg; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [parisc-linux] Re: [PATCH 3/9] mm: parisc pte atomicity
      ... using your own tmpalias area sounds much better than getting ... I've simply not wrapped my head around the races, ... it looks like we agree that my patch is necessary and valid as is; ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: keyboard - was: Re: Linux 2.6.0-test4
      ... >> I was able to get the key unstuck by switching back and forth between ... I rebuild my kernel including your patch; ... I'll get back to you once I verify that the problem doesn't occur ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [PATCH] RPA PCI Hotplug - redundant free
      ... Please commit the ... > following patch, which removes a redundant call to a ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • [patch] removes redundant sys_delete_module()
      ... not implemented syscalls. ... This patch removes the redundant sys_delete_modulein module.c. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)