summaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_buildtag.c
blob: cb1aa66d7d5d9a9b07d5c099486a4844d30ef82e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// SPDX-License-Identifier: GPL-2.0-only
#include <linux/drbd_config.h>
#include <linux/module.h>

const char *drbd_buildtag(void)
{
	/* DRBD built from external sources has here a reference to the
	 * git hash of the source code.
	 */

	static char buildtag[38] = "\0uilt-in";

	if (buildtag[0] == 0) {
#ifdef MODULE
		sprintf(buildtag, "srcversion: %-24s", THIS_MODULE->srcversion);
#else
		buildtag[0] = 'b';
#endif
	}

	return buildtag;
}