]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blame - lib/bcd.c
UBUNTU: SAUCE: Documentation: import error c_funcptr_sig_re, c_sig_re (sphinx-doc...
[mirror_ubuntu-jammy-kernel.git] / lib / bcd.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
d3de851a 2#include <linux/bcd.h>
8bc3bcc9 3#include <linux/export.h>
d3de851a 4
b53d657d 5unsigned _bcd2bin(unsigned char val)
d3de851a
DB
6{
7 return (val & 0x0f) + (val >> 4) * 10;
8}
b53d657d 9EXPORT_SYMBOL(_bcd2bin);
d3de851a 10
b53d657d 11unsigned char _bin2bcd(unsigned val)
d3de851a
DB
12{
13 return ((val / 10) << 4) + val % 10;
14}
b53d657d 15EXPORT_SYMBOL(_bin2bcd);