mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
scst: Fix the ARM build
When compiling SCST for an ARM CPU then do_div() checks whether its first argument has type u64. Make sure that this is the case. See also https://github.com/bvanassche/scst/issues/23. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9006 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -886,10 +886,13 @@ static void dev_user_flush_dcache(struct scst_user_cmd *ucmd)
|
||||
|
||||
page = buf_ucmd->data_pages[i];
|
||||
#ifdef ARCH_HAS_FLUSH_ANON_PAGE
|
||||
struct vm_area_struct *vma = find_vma(current->mm, start);
|
||||
{
|
||||
struct vm_area_struct *vma;
|
||||
|
||||
if (vma != NULL)
|
||||
flush_anon_page(vma, page, start);
|
||||
vma = find_vma(current->mm, start);
|
||||
if (vma != NULL)
|
||||
flush_anon_page(vma, page, start);
|
||||
}
|
||||
#endif
|
||||
flush_dcache_page(page);
|
||||
start += PAGE_SIZE;
|
||||
|
||||
@@ -3635,9 +3635,10 @@ void scst_limit_sg_write_len(struct scst_cmd *cmd)
|
||||
return;
|
||||
}
|
||||
|
||||
static int scst_full_len_to_data_len(int full_len, int block_shift)
|
||||
static int scst_full_len_to_data_len(u32 full_len, u32 block_shift)
|
||||
{
|
||||
int rem, res;
|
||||
u64 res;
|
||||
u32 rem;
|
||||
|
||||
res = full_len << block_shift;
|
||||
rem = do_div(res, (1 << block_shift) + (1 << SCST_DIF_TAG_SHIFT));
|
||||
@@ -3645,7 +3646,7 @@ static int scst_full_len_to_data_len(int full_len, int block_shift)
|
||||
TRACE(TRACE_MINOR, "Reminder %d for full len! (full len%d)",
|
||||
rem, full_len);
|
||||
|
||||
TRACE_DBG("data len %d (full %d)", res, full_len);
|
||||
TRACE_DBG("data len %lld (full %d)", res, full_len);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -3658,7 +3659,8 @@ static int scst_full_len_to_data_len(int full_len, int block_shift)
|
||||
*/
|
||||
int scst_cmd_get_expected_transfer_len_data(struct scst_cmd *cmd)
|
||||
{
|
||||
int rem, res;
|
||||
u64 res;
|
||||
u32 rem;
|
||||
|
||||
if (!cmd->tgt_dif_data_expected)
|
||||
return cmd->expected_transfer_len_full;
|
||||
@@ -3671,7 +3673,7 @@ int scst_cmd_get_expected_transfer_len_data(struct scst_cmd *cmd)
|
||||
cmd, scst_get_opcode_name(cmd),
|
||||
cmd->expected_transfer_len_full);
|
||||
|
||||
TRACE_DBG("Expected transfer len data %d (cmd %p)", res, cmd);
|
||||
TRACE_DBG("Expected transfer len data %lld (cmd %p)", res, cmd);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -3683,7 +3685,8 @@ int scst_cmd_get_expected_transfer_len_data(struct scst_cmd *cmd)
|
||||
*/
|
||||
int scst_cmd_get_expected_transfer_len_dif(struct scst_cmd *cmd)
|
||||
{
|
||||
int rem, res;
|
||||
u64 res;
|
||||
u32 rem;
|
||||
|
||||
if (!cmd->tgt_dif_data_expected)
|
||||
return 0;
|
||||
@@ -3695,7 +3698,7 @@ int scst_cmd_get_expected_transfer_len_dif(struct scst_cmd *cmd)
|
||||
"(cmd %p, op %s, expected len full %d)", rem, cmd,
|
||||
scst_get_opcode_name(cmd), cmd->expected_transfer_len_full);
|
||||
|
||||
TRACE_DBG("Expected transfer len DIF %d (cmd %p)", res, cmd);
|
||||
TRACE_DBG("Expected transfer len DIF %lld (cmd %p)", res, cmd);
|
||||
|
||||
return res;
|
||||
}
|
||||
@@ -15902,14 +15905,14 @@ static void __scst_update_latency_stats(struct scst_cmd *cmd,
|
||||
struct scst_lat_stat_entry *stat,
|
||||
const ktime_t now, uint64_t nowc)
|
||||
{
|
||||
int64_t delta;
|
||||
uint64_t delta;
|
||||
#ifdef SCST_MEASURE_CLOCK_CYCLES
|
||||
int64_t deltac;
|
||||
#endif
|
||||
|
||||
if (stat && ktime_to_ns(cmd->last_state_update) != 0) {
|
||||
delta = ktime_to_ns(ktime_sub(now, cmd->last_state_update));
|
||||
if (delta < 0 || delta > NSEC_PER_SEC) {
|
||||
if (delta > NSEC_PER_SEC) {
|
||||
printk_once(KERN_INFO "%d: ignoring large time delta %lld\n",
|
||||
cmd->state, delta);
|
||||
delta = 0;
|
||||
|
||||
@@ -7267,12 +7267,12 @@ static ssize_t scst_poll_us_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
int count;
|
||||
unsigned long t = scst_poll_ns;
|
||||
u64 t = scst_poll_ns;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
do_div(t, 1000);
|
||||
count = sprintf(buf, "%ld\n%s\n", t,
|
||||
count = sprintf(buf, "%lld\n%s\n", t,
|
||||
(scst_poll_ns == SCST_DEF_POLL_NS)
|
||||
? "" : SCST_SYSFS_KEY_MARK);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user