mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 13:11:27 +00:00
kbuild: Enable additional compiler warnings
Add additional compiler flags to improve code compliance.
This commit is contained in:
30
fcst/Kbuild
30
fcst/Kbuild
@@ -1,10 +1,26 @@
|
|||||||
KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers
|
KBUILD_EXTRA_SYMBOLS = $(src)/../scst/src/Module.symvers
|
||||||
ccflags-y += -I$(src)/../scst/include $(shell if [ -e include/scsi ]; then header_dir=.; else header_dir=$$(sed -n 's/^include[[:blank:]]\+\(.*\)\/Makefile$$/\1/p;s/^MAKEARGS := -C \([^ ]*\) .*/\1/p' Makefile); fi; if false; then echo "header_dir=$${header_dir}" >&2; fi; grep -qw fc_fill_fc_hdr "$${header_dir}/include/scsi/fc_encode.h" 2>/dev/null && echo -DFC_FILL_FC_HDR_IN_SCSI_FC_ENCODE_H)
|
|
||||||
|
ccflags-y := -I$(src)/../scst/include $(shell if [ -e include/scsi ]; then header_dir=.; else header_dir=$$(sed -n 's/^include[[:blank:]]\+\(.*\)\/Makefile$$/\1/p;s/^MAKEARGS := -C \([^ ]*\) .*/\1/p' Makefile); fi; if false; then echo "header_dir=$${header_dir}" >&2; fi; grep -qw fc_fill_fc_hdr "$${header_dir}/include/scsi/fc_encode.h" 2>/dev/null && echo -DFC_FILL_FC_HDR_IN_SCSI_FC_ENCODE_H)
|
||||||
|
|
||||||
|
ccflags-y += -Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
obj-$(CONFIG_FCST) += fcst.o
|
obj-$(CONFIG_FCST) += fcst.o
|
||||||
|
|
||||||
fcst-objs := \
|
fcst-objs := ft_cmd.o \
|
||||||
ft_cmd.o \
|
ft_io.o \
|
||||||
ft_io.o \
|
ft_scst.o \
|
||||||
ft_scst.o \
|
ft_sess.o
|
||||||
ft_sess.o
|
|
||||||
|
|||||||
@@ -16,7 +16,24 @@
|
|||||||
|
|
||||||
KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers
|
KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers
|
||||||
|
|
||||||
ccflags-y += -I$(src)/../include -I$(src)/../../scst/include
|
ccflags-y := -I$(src)/../include \
|
||||||
|
-I$(src)/../../scst/include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
ccflags-y += $(CONFTEST_CFLAGS)
|
ccflags-y += $(CONFTEST_CFLAGS)
|
||||||
#ccflags-y += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
|
#ccflags-y += -DCONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
|
||||||
|
|
||||||
@@ -24,4 +41,3 @@ obj-m += iscsi-scst.o
|
|||||||
iscsi-scst-objs := iscsi.o nthread.o config.o digest.o \
|
iscsi-scst-objs := iscsi.o nthread.o config.o digest.o \
|
||||||
conn.o session.o target.o event.o param.o \
|
conn.o session.o target.o event.o param.o \
|
||||||
iscsit_transport.o
|
iscsit_transport.o
|
||||||
|
|
||||||
|
|||||||
@@ -269,7 +269,7 @@ restart:
|
|||||||
}
|
}
|
||||||
|
|
||||||
res = kobject_init_and_add(&conn->conn_kobj, &iscsi_conn_ktype,
|
res = kobject_init_and_add(&conn->conn_kobj, &iscsi_conn_ktype,
|
||||||
scst_sysfs_get_sess_kobj(session->scst_sess), addr);
|
scst_sysfs_get_sess_kobj(session->scst_sess), "%s", addr);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Unable create sysfs entries for conn %s",
|
PRINT_ERROR("Unable create sysfs entries for conn %s",
|
||||||
addr);
|
addr);
|
||||||
|
|||||||
@@ -15,16 +15,30 @@
|
|||||||
# GNU General Public License for more details.
|
# GNU General Public License for more details.
|
||||||
|
|
||||||
LINUXINCLUDE := $(ISER_CFLAGS) $(LINUXINCLUDE)
|
LINUXINCLUDE := $(ISER_CFLAGS) $(LINUXINCLUDE)
|
||||||
KBUILD_EXTRA_SYMBOLS+=$(src)/../../../scst/src/Module.symvers
|
KBUILD_EXTRA_SYMBOLS += $(src)/../../../scst/src/Module.symvers
|
||||||
KBUILD_EXTRA_SYMBOLS+= \
|
KBUILD_EXTRA_SYMBOLS += \
|
||||||
$(src)/../../kernel/Module.symvers \
|
$(src)/../../kernel/Module.symvers \
|
||||||
$(shell for d in /usr/src/ofa_kernel/default/Module.symvers; do \
|
$(shell for d in /usr/src/ofa_kernel/default/Module.symvers; do \
|
||||||
[ -e $$d ] || continue; echo $$d; break; done)
|
[ -e $$d ] || continue; echo $$d; break; done)
|
||||||
|
|
||||||
ccflags-y += -I$(src)/../../../scst/include
|
ccflags-y := -I$(src)/../../../scst/include \
|
||||||
ccflags-y += -I$(src)/../../include
|
-I$(src)/../../include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
obj-m += isert-scst.o
|
obj-m += isert-scst.o
|
||||||
isert-scst-objs := isert.o isert_login.o \
|
isert-scst-objs := isert.o isert_login.o \
|
||||||
iser_datamover.o iser_rdma.o iser_buf.o iser_pdu.o iser_global.o
|
iser_datamover.o iser_rdma.o iser_buf.o iser_pdu.o iser_global.o
|
||||||
|
|
||||||
|
|||||||
@@ -901,7 +901,6 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
|||||||
struct ib_mr *mr;
|
struct ib_mr *mr;
|
||||||
#endif
|
#endif
|
||||||
struct ib_cq *cq;
|
struct ib_cq *cq;
|
||||||
char wq_name[64];
|
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
@@ -975,9 +974,9 @@ static struct isert_device *isert_device_create(struct ib_device *ib_dev)
|
|||||||
cq_desc->idx = i;
|
cq_desc->idx = i;
|
||||||
INIT_WORK(&cq_desc->cq_comp_work, isert_cq_comp_work_cb);
|
INIT_WORK(&cq_desc->cq_comp_work, isert_cq_comp_work_cb);
|
||||||
|
|
||||||
snprintf(wq_name, sizeof(wq_name), "isert_cq_%p", cq_desc);
|
cq_desc->cq_workqueue = alloc_workqueue("isert_cq_%p",
|
||||||
cq_desc->cq_workqueue = alloc_workqueue(wq_name,
|
WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1,
|
||||||
WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM, 1);
|
cq_desc);
|
||||||
if (unlikely(!cq_desc->cq_workqueue)) {
|
if (unlikely(!cq_desc->cq_workqueue)) {
|
||||||
PRINT_ERROR("Failed to alloc iser cq work queue for dev:%s",
|
PRINT_ERROR("Failed to alloc iser cq work queue for dev:%s",
|
||||||
ib_dev->name);
|
ib_dev->name);
|
||||||
|
|||||||
@@ -1,4 +1,19 @@
|
|||||||
ccflags-y := -I$(src)/../scst/include -I$(src)/include
|
ccflags-y := -I$(src)/../scst/include \
|
||||||
|
-I$(src)/include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),)
|
ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),)
|
||||||
ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET)
|
ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET)
|
||||||
|
|||||||
@@ -1,6 +1,23 @@
|
|||||||
KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \
|
KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \
|
||||||
$(src)/../Module.symvers
|
$(src)/../Module.symvers
|
||||||
ccflags-y += -I$(src)/../../scst/include -I$(src)/..
|
ccflags-y := -I$(src)/../../scst/include \
|
||||||
|
-I$(src)/.. \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD
|
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD
|
||||||
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR
|
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,19 @@
|
|||||||
ccflags-y := -I$(src)/../scst/include
|
ccflags-y := -I$(src)/../scst/include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),)
|
ifneq ($(CONFIG_SCSI_QLA2XXX_TARGET),)
|
||||||
ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET)
|
ccflags-y += -DCONFIG_SCSI_QLA2XXX_TARGET=$(CONFIG_SCSI_QLA2XXX_TARGET)
|
||||||
|
|||||||
@@ -1,6 +1,23 @@
|
|||||||
KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \
|
KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \
|
||||||
$(src)/../Module.symvers
|
$(src)/../Module.symvers
|
||||||
ccflags-y += -I$(src)/../../scst/include -I$(src)/..
|
ccflags-y := -I$(src)/../../scst/include \
|
||||||
|
-I$(src)/.. \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD
|
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_WORK_IN_THREAD
|
||||||
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR
|
#ccflags-y += -DCONFIG_QLA_TGT_DEBUG_SRR
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,19 @@
|
|||||||
ccflags-y := -I$(src)/../include
|
ccflags-y := -I$(src)/../include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
ccflags-y += $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) \
|
ccflags-y += $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) \
|
||||||
$(shell [ -n "${REVISION}" ] && echo -DSCST_REVISION=${REVISION})
|
$(shell [ -n "${REVISION}" ] && echo -DSCST_REVISION=${REVISION})
|
||||||
@@ -20,17 +35,18 @@ ccflags-y += $(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM
|
|||||||
|
|
||||||
obj-m := scst.o
|
obj-m := scst.o
|
||||||
|
|
||||||
scst-y += scst_copy_mgr.o
|
scst-y += scst_copy_mgr.o \
|
||||||
scst-y += scst_debug.o
|
scst_debug.o \
|
||||||
scst-y += scst_dlm.o
|
scst_dlm.o \
|
||||||
scst-y += scst_event.o
|
scst_event.o \
|
||||||
scst-y += scst_lib.o
|
scst_lib.o \
|
||||||
scst-y += scst_local_cmd.o
|
scst_local_cmd.o \
|
||||||
scst-y += scst_main.o
|
scst_main.o \
|
||||||
scst-y += scst_mem.o
|
scst_mem.o \
|
||||||
scst-y += scst_no_dlm.o
|
scst_no_dlm.o \
|
||||||
scst-y += scst_pres.o
|
scst_pres.o \
|
||||||
scst-y += scst_sysfs.o
|
scst_sysfs.o \
|
||||||
scst-y += scst_targ.o
|
scst_targ.o \
|
||||||
scst-y += scst_tg.o
|
scst_tg.o
|
||||||
obj-$(CONFIG_SCST) += scst.o dev_handlers/
|
|
||||||
|
obj-$(CONFIG_SCST) += scst.o dev_handlers/
|
||||||
|
|||||||
@@ -1,5 +1,22 @@
|
|||||||
KBUILD_EXTRA_SYMBOLS=$(src)/../Module.symvers
|
KBUILD_EXTRA_SYMBOLS = $(src)/../Module.symvers
|
||||||
ccflags-y += -I$(src)/../../include
|
|
||||||
|
ccflags-y := -I$(src)/../../include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
#ccflags-y += -DCONFIG_DEBUG_EXT_COPY_REMAP
|
#ccflags-y += -DCONFIG_DEBUG_EXT_COPY_REMAP
|
||||||
|
|
||||||
obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \
|
obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \
|
||||||
|
|||||||
@@ -2080,8 +2080,8 @@ static int scst_sgv_sysfs_create(struct sgv_pool *pool)
|
|||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
res = kobject_init_and_add(&pool->sgv_kobj, &sgv_pool_ktype,
|
res = kobject_init_and_add(&pool->sgv_kobj, &sgv_pool_ktype, scst_sgv_kobj, "%s",
|
||||||
scst_sgv_kobj, pool->name);
|
pool->name);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add sgv pool %s to sysfs", pool->name);
|
PRINT_ERROR("Can't add sgv pool %s to sysfs", pool->name);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -2147,7 +2147,7 @@ int scst_add_sgv_kobj(struct kobject *parent, const char *name)
|
|||||||
scst_sgv_kobj = kzalloc(sizeof(*scst_sgv_kobj), GFP_KERNEL);
|
scst_sgv_kobj = kzalloc(sizeof(*scst_sgv_kobj), GFP_KERNEL);
|
||||||
if (!scst_sgv_kobj)
|
if (!scst_sgv_kobj)
|
||||||
goto out;
|
goto out;
|
||||||
res = kobject_init_and_add(scst_sgv_kobj, &sgv_ktype, parent, name);
|
res = kobject_init_and_add(scst_sgv_kobj, &sgv_ktype, parent, "%s", name);
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
goto out_free;
|
goto out_free;
|
||||||
out:
|
out:
|
||||||
|
|||||||
@@ -1083,8 +1083,8 @@ int scst_tgtt_sysfs_create(struct scst_tgt_template *tgtt)
|
|||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
res = kobject_init_and_add(&tgtt->tgtt_kobj, &tgtt_ktype,
|
res = kobject_init_and_add(&tgtt->tgtt_kobj, &tgtt_ktype, scst_targets_kobj, "%s",
|
||||||
scst_targets_kobj, tgtt->name);
|
tgtt->name);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add tgtt %s to sysfs", tgtt->name);
|
PRINT_ERROR("Can't add tgtt %s to sysfs", tgtt->name);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -3019,8 +3019,8 @@ int scst_tgt_sysfs_create(struct scst_tgt *tgt)
|
|||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
res = kobject_init_and_add(&tgt->tgt_kobj, &tgt_ktype,
|
res = kobject_init_and_add(&tgt->tgt_kobj, &tgt_ktype, &tgt->tgtt->tgtt_kobj, "%s",
|
||||||
&tgt->tgtt->tgtt_kobj, tgt->tgt_name);
|
tgt->tgt_name);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add tgt %s to sysfs", tgt->tgt_name);
|
PRINT_ERROR("Can't add tgt %s to sysfs", tgt->tgt_name);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -3983,8 +3983,8 @@ int scst_dev_sysfs_create(struct scst_device *dev)
|
|||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
res = kobject_init_and_add(&dev->dev_kobj, &scst_dev_ktype,
|
res = kobject_init_and_add(&dev->dev_kobj, &scst_dev_ktype, scst_devices_kobj, "%s",
|
||||||
scst_devices_kobj, dev->virt_name);
|
dev->virt_name);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add device %s to sysfs", dev->virt_name);
|
PRINT_ERROR("Can't add device %s to sysfs", dev->virt_name);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -4370,8 +4370,8 @@ int scst_tgt_dev_sysfs_create(struct scst_tgt_dev *tgt_dev)
|
|||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
res = kobject_init_and_add(&tgt_dev->tgt_dev_kobj, &scst_tgt_dev_ktype,
|
res = kobject_init_and_add(&tgt_dev->tgt_dev_kobj, &scst_tgt_dev_ktype,
|
||||||
&tgt_dev->sess->sess_kobj, "lun%lld",
|
&tgt_dev->sess->sess_kobj, "lun%lld",
|
||||||
(unsigned long long)tgt_dev->lun);
|
(unsigned long long)tgt_dev->lun);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add tgt_dev %lld to sysfs",
|
PRINT_ERROR("Can't add tgt_dev %lld to sysfs",
|
||||||
(unsigned long long)tgt_dev->lun);
|
(unsigned long long)tgt_dev->lun);
|
||||||
@@ -5049,8 +5049,8 @@ int scst_sess_sysfs_create(struct scst_session *sess)
|
|||||||
name = sess->sess_name;
|
name = sess->sess_name;
|
||||||
TRACE_DBG("Adding session %s to sysfs", name);
|
TRACE_DBG("Adding session %s to sysfs", name);
|
||||||
|
|
||||||
res = kobject_init_and_add(&sess->sess_kobj, &scst_session_ktype,
|
res = kobject_init_and_add(&sess->sess_kobj, &scst_session_ktype, sess->tgt->tgt_sess_kobj,
|
||||||
sess->tgt->tgt_sess_kobj, name);
|
"%s", name);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add session %s to sysfs", name);
|
PRINT_ERROR("Can't add session %s to sysfs", name);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -5229,8 +5229,8 @@ int scst_acg_dev_sysfs_create(struct scst_acg_dev *acg_dev,
|
|||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
res = kobject_init_and_add(&acg_dev->acg_dev_kobj, &acg_dev_ktype,
|
res = kobject_init_and_add(&acg_dev->acg_dev_kobj, &acg_dev_ktype, parent, "%llu",
|
||||||
parent, "%llu", acg_dev->lun);
|
acg_dev->lun);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add acg_dev %p to sysfs", acg_dev);
|
PRINT_ERROR("Can't add acg_dev %p to sysfs", acg_dev);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -5647,8 +5647,8 @@ int scst_acg_sysfs_create(struct scst_tgt *tgt,
|
|||||||
|
|
||||||
TRACE_ENTRY();
|
TRACE_ENTRY();
|
||||||
|
|
||||||
res = kobject_init_and_add(&acg->acg_kobj, &acg_ktype,
|
res = kobject_init_and_add(&acg->acg_kobj, &acg_ktype, tgt->tgt_ini_grp_kobj, "%s",
|
||||||
tgt->tgt_ini_grp_kobj, acg->acg_name);
|
acg->acg_name);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add acg '%s' to sysfs", acg->acg_name);
|
PRINT_ERROR("Can't add acg '%s' to sysfs", acg->acg_name);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -6257,8 +6257,7 @@ int scst_devt_sysfs_create(struct scst_dev_type *devt)
|
|||||||
else
|
else
|
||||||
parent = scst_handlers_kobj;
|
parent = scst_handlers_kobj;
|
||||||
|
|
||||||
res = kobject_init_and_add(&devt->devt_kobj, &scst_devt_ktype,
|
res = kobject_init_and_add(&devt->devt_kobj, &scst_devt_ktype, parent, "%s", devt->name);
|
||||||
parent, devt->name);
|
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
PRINT_ERROR("Can't add devt %s to sysfs", devt->name);
|
PRINT_ERROR("Can't add devt %s to sysfs", devt->name);
|
||||||
goto out;
|
goto out;
|
||||||
@@ -8025,8 +8024,8 @@ int __init scst_sysfs_init(void)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = kobject_init_and_add(&scst_sysfs_root_kobj,
|
res = kobject_init_and_add(&scst_sysfs_root_kobj, &scst_sysfs_root_ktype, kernel_kobj,
|
||||||
&scst_sysfs_root_ktype, kernel_kobj, "%s", "scst_tgt");
|
"%s", "scst_tgt");
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
goto sysfs_root_add_error;
|
goto sysfs_root_add_error;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,20 @@
|
|||||||
KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers
|
KBUILD_EXTRA_SYMBOLS=$(src)/../scst/src/Module.symvers
|
||||||
ccflags-y += -I$(src)/../scst/include
|
|
||||||
|
|
||||||
obj-m := scst_local.o
|
ccflags-y := -I$(src)/../scst/include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
|
obj-m := scst_local.o
|
||||||
|
|||||||
@@ -1,8 +1,23 @@
|
|||||||
LINUXINCLUDE := $(CONFTEST_CFLAGS) $(LINUXINCLUDE)
|
LINUXINCLUDE := $(CONFTEST_CFLAGS) $(LINUXINCLUDE)
|
||||||
KBUILD_EXTRA_SYMBOLS=$(src)/../../scst/src/Module.symvers \
|
KBUILD_EXTRA_SYMBOLS = $(src)/../../scst/src/Module.symvers \
|
||||||
$(shell for d in /usr/src/ofa_kernel/default/Module.symvers; do\
|
$(shell for d in /usr/src/ofa_kernel/default/Module.symvers; do\
|
||||||
[ -e $$d ] || continue; echo $$d; break; done)
|
[ -e $$d ] || continue; echo $$d; break; done)
|
||||||
|
|
||||||
ccflags-y += -I$(src)/../../scst/include
|
ccflags-y += -I$(src)/../../scst/include \
|
||||||
|
-Wall \
|
||||||
|
-Wextra \
|
||||||
|
-Wno-type-limits \
|
||||||
|
-Wno-missing-field-initializers \
|
||||||
|
-Wno-unused-parameter \
|
||||||
|
-Wformat \
|
||||||
|
-O2 \
|
||||||
|
-Werror=format-security \
|
||||||
|
-Werror=implicit-function-declaration \
|
||||||
|
-pipe \
|
||||||
|
-g \
|
||||||
|
-grecord-gcc-switches \
|
||||||
|
-fstack-clash-protection \
|
||||||
|
-fstack-protector-strong \
|
||||||
|
-Wstrict-prototypes
|
||||||
|
|
||||||
obj-m += ib_srpt.o
|
obj-m += ib_srpt.o
|
||||||
|
|||||||
Reference in New Issue
Block a user