Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drbd: split off drbd_buildtag into separate file

To be more similar to what we do in the out-of-tree module and ease the
upstreaming process.

Signed-off-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
Reviewed-by: Joel Colledge <joel.colledge@linbit.com>
Link: https://lore.kernel.org/r/20230113123506.144082-2-christoph.boehmwalder@linbit.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Christoph Böhmwalder and committed by
Jens Axboe
887b98c7 a3df2e45

+23 -19
+1 -1
drivers/block/drbd/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 - drbd-y := drbd_bitmap.o drbd_proc.o 2 + drbd-y := drbd_buildtag.o drbd_bitmap.o drbd_proc.o 3 3 drbd-y += drbd_worker.o drbd_receiver.o drbd_req.o drbd_actlog.o 4 4 drbd-y += drbd_main.o drbd_strings.o drbd_nl.o 5 5 drbd-y += drbd_interval.o drbd_state.o
+22
drivers/block/drbd/drbd_buildtag.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + #include <linux/drbd.h> 3 + #include <linux/module.h> 4 + 5 + const char *drbd_buildtag(void) 6 + { 7 + /* DRBD built from external sources has here a reference to the 8 + * git hash of the source code. 9 + */ 10 + 11 + static char buildtag[38] = "\0uilt-in"; 12 + 13 + if (buildtag[0] == 0) { 14 + #ifdef MODULE 15 + sprintf(buildtag, "srcversion: %-24s", THIS_MODULE->srcversion); 16 + #else 17 + buildtag[0] = 'b'; 18 + #endif 19 + } 20 + 21 + return buildtag; 22 + }
-18
drivers/block/drbd/drbd_main.c
··· 3776 3776 } 3777 3777 #endif 3778 3778 3779 - const char *drbd_buildtag(void) 3780 - { 3781 - /* DRBD built from external sources has here a reference to the 3782 - git hash of the source code. */ 3783 - 3784 - static char buildtag[38] = "\0uilt-in"; 3785 - 3786 - if (buildtag[0] == 0) { 3787 - #ifdef MODULE 3788 - sprintf(buildtag, "srcversion: %-24s", THIS_MODULE->srcversion); 3789 - #else 3790 - buildtag[0] = 'b'; 3791 - #endif 3792 - } 3793 - 3794 - return buildtag; 3795 - } 3796 - 3797 3779 module_init(drbd_init) 3798 3780 module_exit(drbd_cleanup) 3799 3781