From 29e3c970f4ddc3f756dde2f46fcbda3456b0f200 Mon Sep 17 00:00:00 2001 From: "John L. Hammond" Date: Mon, 11 Feb 2013 12:23:33 -0600 Subject: [PATCH] LU-2675 cleanup: make bitfield (un)signedness explicit Fix this common sparse warning (dubious one-bit signed bitfield) in case ones-complement machines come back or something. Signed-off-by: John L. Hammond Change-Id: I24ea468efedd8a1269ea92022d13e802f4838ba1 Reviewed-on: http://review.whamcloud.com/5166 Tested-by: Hudson Reviewed-by: Bob Glossman Reviewed-by: Sebastien Buisson Tested-by: Maloo Reviewed-by: Andreas Dilger --- lnet/klnds/o2iblnd/o2iblnd.h | 6 +++--- lnet/klnds/socklnd/socklnd.h | 9 +++++---- lnet/selftest/conrpc.h | 8 ++++---- lnet/selftest/selftest.h | 8 ++++---- lustre/fld/fld_internal.h | 2 +- lustre/fld/lproc_fld.c | 2 +- lustre/include/dt_object.h | 4 ++-- lustre/include/lclient.h | 2 +- lustre/include/md_object.h | 1 - lustre/include/obd.h | 2 +- lustre/lod/lod_internal.h | 2 +- lustre/lov/lov_cl_internal.h | 2 +- lustre/mdd/mdd_device.c | 2 +- lustre/mdt/mdt_internal.h | 22 +++++++++++----------- lustre/mgs/mgs_internal.h | 2 +- lustre/osp/osp_internal.h | 4 ++-- 16 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lnet/klnds/o2iblnd/o2iblnd.h b/lnet/klnds/o2iblnd/o2iblnd.h index 47b9cfa..2c8f637 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.h +++ b/lnet/klnds/o2iblnd/o2iblnd.h @@ -606,9 +606,9 @@ typedef struct kib_conn int ibc_outstanding_credits; /* # credits to return */ int ibc_reserved_credits;/* # ACK/DONE msg credits */ int ibc_comms_error; /* set on comms error */ - int ibc_nrx:16; /* receive buffers owned */ - int ibc_scheduled:1; /* scheduled for attention */ - int ibc_ready:1; /* CQ callback fired */ + unsigned int ibc_nrx:16; /* receive buffers owned */ + unsigned int ibc_scheduled:1; /* scheduled for attention */ + unsigned int ibc_ready:1; /* CQ callback fired */ /* time of last send */ unsigned long ibc_last_send; /** link chain for kiblnd_check_conns only */ diff --git a/lnet/klnds/socklnd/socklnd.h b/lnet/klnds/socklnd/socklnd.h index 982a8d3..abdf25a 100644 --- a/lnet/klnds/socklnd/socklnd.h +++ b/lnet/klnds/socklnd/socklnd.h @@ -296,10 +296,11 @@ typedef struct ksock_conn __u32 ksnc_myipaddr; /* my IP */ __u32 ksnc_ipaddr; /* peer's IP */ int ksnc_port; /* peer's port */ - int ksnc_type:3; /* type of connection, should be signed value */ - int ksnc_closing:1; /* being shut down */ - int ksnc_flip:1; /* flip or not, only for V2.x */ - int ksnc_zc_capable:1; /* enable to ZC */ + signed int ksnc_type:3; /* type of connection, + * should be signed value */ + unsigned int ksnc_closing:1; /* being shut down */ + unsigned int ksnc_flip:1; /* flip or not, only for V2.x */ + unsigned int ksnc_zc_capable:1; /* enable to ZC */ struct ksock_proto *ksnc_proto; /* protocol for the connection */ /* reader */ diff --git a/lnet/selftest/conrpc.h b/lnet/selftest/conrpc.h index 27ac86b..981b249 100644 --- a/lnet/selftest/conrpc.h +++ b/lnet/selftest/conrpc.h @@ -70,11 +70,11 @@ typedef struct lstcon_rpc { struct lstcon_node *crp_node; /* destination node */ struct lstcon_rpc_trans *crp_trans; /* conrpc transaction */ - int crp_posted:1; /* rpc is posted */ - int crp_finished:1; /* rpc is finished */ - int crp_unpacked:1; /* reply is unpacked */ + unsigned int crp_posted:1; /* rpc is posted */ + unsigned int crp_finished:1; /* rpc is finished */ + unsigned int crp_unpacked:1; /* reply is unpacked */ /** RPC is embedded in other structure and can't free it */ - int crp_embedded:1; + unsigned int crp_embedded:1; int crp_status; /* console rpc errors */ cfs_time_t crp_stamp; /* replied time stamp */ } lstcon_rpc_t; diff --git a/lnet/selftest/selftest.h b/lnet/selftest/selftest.h index 3540b44..2b7f250 100644 --- a/lnet/selftest/selftest.h +++ b/lnet/selftest/selftest.h @@ -378,15 +378,15 @@ typedef struct sfw_test_instance { sfw_batch_t *tsi_batch; /* batch */ sfw_test_client_ops_t *tsi_ops; /* test client operations */ - /* public parameter for all test units */ - int tsi_is_client:1; /* is test client */ - int tsi_stoptsu_onerr:1; /* stop tsu on error */ + /* public parameter for all test units */ + unsigned int tsi_is_client:1; /* is test client */ + unsigned int tsi_stoptsu_onerr:1; /* stop tsu on error */ int tsi_concur; /* concurrency */ int tsi_loop; /* loop count */ /* status of test instance */ spinlock_t tsi_lock; /* serialize */ - int tsi_stopping:1; /* test is stopping */ + unsigned int tsi_stopping:1; /* test is stopping */ cfs_atomic_t tsi_nactive; /* # of active test unit */ cfs_list_t tsi_units; /* test units */ cfs_list_t tsi_free_rpcs; /* free rpcs */ diff --git a/lustre/fld/fld_internal.h b/lustre/fld/fld_internal.h index db6dad6..fbb050a 100644 --- a/lustre/fld/fld_internal.h +++ b/lustre/fld/fld_internal.h @@ -112,7 +112,7 @@ struct fld_cache { /** * Cache name used for debug and messages. */ char fci_name[80]; - int fci_no_shrink:1; + unsigned int fci_no_shrink:1; }; enum fld_op { diff --git a/lustre/fld/lproc_fld.c b/lustre/fld/lproc_fld.c index 52d517f..c68f3c4 100644 --- a/lustre/fld/lproc_fld.c +++ b/lustre/fld/lproc_fld.c @@ -158,7 +158,7 @@ struct fld_seq_param { struct lu_env fsp_env; struct dt_it *fsp_it; struct lu_server_fld *fsp_fld; - int fsp_stop:1; + unsigned int fsp_stop:1; }; static void *fldb_seq_start(struct seq_file *p, loff_t *pos) diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 4207f1c..fdd45bd 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -752,10 +752,10 @@ struct thandle { __s32 th_result; /** whether we need sync commit */ - int th_sync:1; + unsigned int th_sync:1; /* local transation, no need to inform other layers */ - int th_local:1; + unsigned int th_local:1; /* In DNE, one transaction can be disassemblied into * updates on several different MDTs, and these updates diff --git a/lustre/include/lclient.h b/lustre/include/lclient.h index 4a2631b..93169c7 100644 --- a/lustre/include/lclient.h +++ b/lustre/include/lclient.h @@ -214,7 +214,7 @@ struct ccc_object { * * \see ll_dirty_page_discard_warn. */ - int cob_discard_page_warned:1; + unsigned int cob_discard_page_warned:1; }; /** diff --git a/lustre/include/md_object.h b/lustre/include/md_object.h index d1554ea..80722a5 100644 --- a/lustre/include/md_object.h +++ b/lustre/include/md_object.h @@ -174,7 +174,6 @@ struct md_attr { struct lustre_capa *ma_capa; struct md_som_data *ma_som; int ma_lmm_size; - int ma_big_lmm_used:1; int ma_lmv_size; int ma_acl_size; int ma_cookie_size; diff --git a/lustre/include/obd.h b/lustre/include/obd.h index 404fc4b..723d68b 100644 --- a/lustre/include/obd.h +++ b/lustre/include/obd.h @@ -837,7 +837,7 @@ struct obd_trans_info { struct llog_cookie *oti_logcookies; int oti_numcookies; /** synchronous write is needed */ - long oti_sync_write:1; + unsigned long oti_sync_write:1; /* initial thread handling transaction */ struct ptlrpc_thread * oti_thread; diff --git a/lustre/lod/lod_internal.h b/lustre/lod/lod_internal.h index a83479d..dcf7d6e 100644 --- a/lustre/lod/lod_internal.h +++ b/lustre/lod/lod_internal.h @@ -157,7 +157,7 @@ struct lod_object { int ldo_stripes_allocated; /* default striping for directory represented by this object * is cached in stripenr/stripe_size */ - int ldo_striping_cached:1, + unsigned int ldo_striping_cached:1, ldo_def_striping_set:1; __u32 ldo_def_stripe_size; __u16 ldo_def_stripenr; diff --git a/lustre/lov/lov_cl_internal.h b/lustre/lov/lov_cl_internal.h index d0bb9ae..5c43cbb 100644 --- a/lustre/lov/lov_cl_internal.h +++ b/lustre/lov/lov_cl_internal.h @@ -303,7 +303,7 @@ struct lov_lock { * Set when sub-lock was canceled, while top-lock was being * used, or unused. */ - int lls_cancel_race:1; + unsigned int lls_cancel_race:1; /** * An array of sub-locks * diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index 007b999..639b688 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -1503,7 +1503,7 @@ struct mdd_changelog_user_data { __u32 mcud_id; __u32 mcud_minid; /**< user id with lowest rec reference */ __u32 mcud_usercount; - int mcud_found:1; + unsigned int mcud_found:1; }; #define MCUD_UNREGISTER -1LL diff --git a/lustre/mdt/mdt_internal.h b/lustre/mdt/mdt_internal.h index 3473c94..2b65a37 100644 --- a/lustre/mdt/mdt_internal.h +++ b/lustre/mdt/mdt_internal.h @@ -119,17 +119,17 @@ struct mdt_device { struct obd_export *mdt_bottom_exp; /** target device */ struct lu_target mdt_lut; - /* - * Options bit-fields. - */ - struct { - signed int mo_user_xattr :1, - mo_acl :1, - mo_compat_resname:1, - mo_mds_capa :1, - mo_oss_capa :1, - mo_cos :1; - } mdt_opts; + /* + * Options bit-fields. + */ + struct { + unsigned int mo_user_xattr:1, + mo_acl:1, + mo_compat_resname:1, + mo_mds_capa:1, + mo_oss_capa:1, + mo_cos:1; + } mdt_opts; /* mdt state flags */ unsigned long mdt_state; /* lock to protect IOepoch */ diff --git a/lustre/mgs/mgs_internal.h b/lustre/mgs/mgs_internal.h index 00aae38..df1217c 100644 --- a/lustre/mgs/mgs_internal.h +++ b/lustre/mgs/mgs_internal.h @@ -148,7 +148,7 @@ struct fs_db { struct completion fsdb_notify_comp; cfs_time_t fsdb_notify_start; cfs_atomic_t fsdb_notify_phase; - volatile int fsdb_notify_async:1, + volatile unsigned int fsdb_notify_async:1, fsdb_notify_stop:1; /* statistic data */ unsigned int fsdb_notify_total; diff --git a/lustre/osp/osp_internal.h b/lustre/osp/osp_internal.h index ed3057f..c32356b 100644 --- a/lustre/osp/osp_internal.h +++ b/lustre/osp/osp_internal.h @@ -97,7 +97,7 @@ struct osp_device { int opd_got_disconnected; int opd_imp_connected; int opd_imp_active; - int opd_imp_seen_connected:1, + unsigned int opd_imp_seen_connected:1, opd_connect_mdt:1; /* whether local recovery is completed: @@ -186,7 +186,7 @@ extern cfs_mem_cache_t *osp_object_kmem; struct osp_object { struct lu_object_header opo_header; struct dt_object opo_obj; - int opo_reserved:1, + unsigned int opo_reserved:1, opo_new:1, opo_empty:1; -- 1.8.3.1