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

drivers: staging: dgap: move DG_NAME and DG_PART from "Makefile" to "dgap_driver.h"

Normally, the macros from command line are system specific macros (e.g
__linux, __KERNEL__ ...), and module own macros are usually defined in
their header files.

DG_NAME and DG_PART are driver 'dgap' owned macros which are used by
multiple files within driver, and need be defined in the driver main
header file.

So move DG_NAME and DG_PART to "dgap_driver.h", it not only can make
code clearer, but also can avoid compiling failure when EXTRA_CFLAGS
appended to make command line (e.g. "EXTRA_CFLAGS=-W").

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chen Gang and committed by
Greg Kroah-Hartman
6319c61a b74c7461

+3 -2
-2
drivers/staging/dgap/Makefile
··· 1 - EXTRA_CFLAGS += -DDG_NAME=\"dgap-1.3-16\" -DDG_PART=\"40002347_C\" 2 - 3 1 obj-$(CONFIG_DGAP) += dgap.o 4 2 5 3
+3
drivers/staging/dgap/dgap_driver.h
··· 53 53 * DPR((fmt, args, ...)); Only prints if DGAP_TRACER is defined at 54 54 * compile time and dgap_debug!=0 55 55 */ 56 + #define DG_NAME "dgap-1.3-16" 57 + #define DG_PART "40002347_C" 58 + 56 59 #define PROCSTR "dgap" /* /proc entries */ 57 60 #define DEVSTR "/dev/dg/dgap" /* /dev entries */ 58 61 #define DRVSTR "dgap" /* Driver name string