mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Hannes Reinecke <hare@suse.de>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [hare-scsi-devel:auth.v2 3/12] lib/base64.c:27:5: warning: no previous prototype for 'base64_encode'
Date: Tue, 13 Jul 2021 02:29:36 +0800	[thread overview]
Message-ID: <202107130230.6K1dTxjb-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3340 bytes --]

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@intel.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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 8647 bytes --]

                 reply	other threads:[~2021-07-12 18:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107130230.6K1dTxjb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=hare@suse.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®