[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202107130230.6K1dTxjb-lkp@intel.com>
Date: Tue, 13 Jul 2021 02:29:36 +0800
From: kernel test robot <lkp@...el.com>
To: Hannes Reinecke <hare@...e.de>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [hare-scsi-devel:auth.v2 3/12] lib/base64.c:27:5: warning: no
previous prototype for 'base64_encode'
tree: https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git auth.v2
head: 9107ea4a3526c6801b38b7a2345b7372278a35ba
commit: 245c033d4a03bc806ab510cf072583c9076eb9d2 [3/12] lib/base64: RFC4648-compliant base64 encoding
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git/commit/?id=245c033d4a03bc806ab510cf072583c9076eb9d2
git remote add hare-scsi-devel https://git.kernel.org/pub/scm/linux/kernel/git/hare/scsi-devel.git
git fetch --no-tags hare-scsi-devel auth.v2
git checkout 245c033d4a03bc806ab510cf072583c9076eb9d2
# save the attached .config to linux build tree
make W=1 ARCH=um SUBARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
>> lib/base64.c:27:5: warning: no previous prototype for 'base64_encode' [-Wmissing-prototypes]
27 | int base64_encode(const u8 *src, int len, char *dst)
| ^~~~~~~~~~~~~
>> lib/base64.c:74:5: warning: no previous prototype for 'base64_decode' [-Wmissing-prototypes]
74 | int base64_decode(const char *src, int len, u8 *dst)
| ^~~~~~~~~~~~~
vim +/base64_encode +27 lib/base64.c
12
13 static const char lookup_table[65] =
14 "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15
16 /**
17 * base64_encode() - base64-encode some bytes
18 * @src: the bytes to encode
19 * @len: number of bytes to encode
20 * @dst: (output) the base64-encoded string. Not NUL-terminated.
21 *
22 * Encodes the input string using characters from the set [A-Za-z0-9+,].
23 * The encoded string is roughly 4/3 times the size of the input string.
24 *
25 * Return: length of the encoded string
26 */
> 27 int base64_encode(const u8 *src, int len, char *dst)
28 {
29 int i, bits = 0;
30 u32 ac = 0;
31 char *cp = dst;
32
33 for (i = 0; i < len; i++) {
34 ac = (ac << 8) | src[i];
35 bits += 8;
36 if (bits < 24)
37 continue;
38 do {
39 bits -= 6;
40 *cp++ = lookup_table[(ac >> bits) & 0x3f];
41 } while (bits);
42 ac = 0;
43 }
44 if (bits) {
45 int more = 0;
46
47 if (bits < 16)
48 more = 2;
49 ac = (ac << (2 + more));
50 bits += (2 + more);
51 do {
52 bits -= 6;
53 *cp++ = lookup_table[(ac >> bits) & 0x3f];
54 } while (bits);
55 *cp++ = '=';
56 if (more)
57 *cp++ = '=';
58 }
59
60 return cp - dst;
61 }
62 EXPORT_SYMBOL_GPL(base64_encode);
63
64 /**
65 * base64_decode() - base64-decode some bytes
66 * @src: the base64-encoded string to decode
67 * @len: number of bytes to decode
68 * @dst: (output) the decoded bytes.
69 *
70 * Decodes the base64-encoded bytes @src according to RFC 4648.
71 *
72 * Return: number of decoded bytes
73 */
> 74 int base64_decode(const char *src, int len, u8 *dst)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (8647 bytes)
Powered by blists - more mailing lists