The patch below fixes the following recently introduced checkpatch complaints:
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 23 Mar 2009 19:32:32 +0000 (19:32 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Mon, 23 Mar 2009 19:32:32 +0000 (19:32 +0000)
* use tabs not spaces

and the following recently introduced sparse warnings:

* drivers/scst/scst_lib.c:437:6: warning: symbol 'scst_queue_report_luns_changed_UA' was not declared. Should it be static?
* drivers/scst/scst_lib.c:3909:21: warning: symbol 'tm_dbg_tgt_dev' was not declared. Should it be static?
* drivers/scst/iscsi-scst/session.c:170:9: warning: cast to non-scalar
* drivers/scst/iscsi-scst/session.c:180:24: warning: cast to non-scalar
The patch below has been verified by reviewing it carefully and by verifying the output of the following command: scripts/run-regression-tests -k 2.6.28.8

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@712 d57e44dd-8a1f-0410-8b47-8ef2f437770f

iscsi-scst/kernel/session.c
scst/src/dev_handlers/scst_disk.c
scst/src/scst_lib.c

index e914695..39fba5f 100644 (file)
@@ -167,7 +167,7 @@ int session_add(struct iscsi_target *target,
                goto out;
        }
 
-       sid = (union iscsi_sid)info->sid;
+       sid = *(union iscsi_sid *)&info->sid;
        sid.id.tsih = 0;
        old_sess = NULL;
 
@@ -177,7 +177,7 @@ int session_add(struct iscsi_target *target,
         */
        list_for_each_entry_reverse(session, &target->session_list,
                        session_list_entry) {
-               union iscsi_sid i = (union iscsi_sid)session->sid;
+               union iscsi_sid i = *(union iscsi_sid *)&session->sid;
                i.id.tsih = 0;
                if ((sid.id64 == i.id64) &&
                    (strcmp(info->initiator_name, session->initiator_name) == 0)) {
index b12b888..2257bf6 100644 (file)
@@ -193,7 +193,7 @@ static int disk_attach(struct scst_device *dev)
                                sizeof(sense_buffer), SCST_SENSE_ALL_VALID,
                                SCST_LOAD_SENSE(scst_sense_medium_changed_UA)) ||
                    !scst_analyze_sense(sense_buffer, sizeof(sense_buffer),
-                               SCST_SENSE_KEY_VALID | SCST_SENSE_ASC_VALID,
+                               SCST_SENSE_KEY_VALID | SCST_SENSE_ASC_VALID,
                                UNIT_ATTENTION, 0x29, 0))
                        break;
                if (!--retries) {
index c125bd7..6f299b7 100644 (file)
@@ -37,6 +37,8 @@
 static void scst_free_tgt_dev(struct scst_tgt_dev *tgt_dev);
 static void scst_check_internal_sense(struct scst_device *dev, int result,
        uint8_t *sense, int sense_len);
+static void scst_queue_report_luns_changed_UA(struct scst_session *sess,
+       int flags);
 static void __scst_check_set_UA(struct scst_tgt_dev *tgt_dev,
        const uint8_t *sense, int sense_len, int flags);
 static void scst_alloc_set_UA(struct scst_tgt_dev *tgt_dev,
@@ -434,7 +436,8 @@ static inline bool scst_is_report_luns_changed_type(int type)
 }
 
 /* scst_mutex supposed to be held */
-void scst_queue_report_luns_changed_UA(struct scst_session *sess, int flags)
+static void scst_queue_report_luns_changed_UA(struct scst_session *sess,
+                                             int flags)
 {
        uint8_t sense_buffer[SCST_STANDARD_SENSE_LEN];
        struct list_head *shead;
@@ -4088,7 +4091,7 @@ static int tm_dbg_passed_cmds_count;
 static int tm_dbg_state;
 static int tm_dbg_on_state_passes;
 static DEFINE_TIMER(tm_dbg_timer, tm_dbg_timer_fn, 0, 0);
-struct scst_tgt_dev *tm_dbg_tgt_dev;
+static struct scst_tgt_dev *tm_dbg_tgt_dev;
 
 static const int tm_dbg_on_state_num_passes[] = { 5, 1, 0x7ffffff };