Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e48b1790 authored by Vladimir Kondratiev's avatar Vladimir Kondratiev Committed by John W. Linville
Browse files

wil6210: fix for 64-bit integer division

On some platforms, cycles_t is 64-bit, and gcc generates call to
__udivdi3 for straight division of cycles_t/cycles_t. This leads
to compilation failure, as this function is not exist in the kernel
runtime. do_div() to rescue

Original report:

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git

 master
head:   2e91606f
commit: 7c0acf86 [81/103] wil6210: Tx performance monitoring
config: i386-randconfig-ha3-0620 (attached as .config)

All error/warnings:

   drivers/built-in.o: In function `wil_vring_debugfs_show':
>> debugfs.c:(.text+0x39b9be): undefined reference to `__udivdi3'

Signed-off-by: default avatarVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 6451acdc
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -83,9 +83,10 @@ static int wil_vring_debugfs_show(struct seq_file *s, void *data)
			char name[10];
			char name[10];
			/* performance monitoring */
			/* performance monitoring */
			cycles_t now = get_cycles();
			cycles_t now = get_cycles();
			cycles_t idle = txdata->idle;
			cycles_t idle = txdata->idle * 100;
			cycles_t total = now - txdata->begin;
			cycles_t total = now - txdata->begin;


			do_div(idle, total);
			txdata->begin = now;
			txdata->begin = now;
			txdata->idle = 0ULL;
			txdata->idle = 0ULL;


@@ -93,7 +94,7 @@ static int wil_vring_debugfs_show(struct seq_file *s, void *data)


			seq_printf(s, "\n%pM CID %d TID %d [%3d|%3d] idle %3d%%\n",
			seq_printf(s, "\n%pM CID %d TID %d [%3d|%3d] idle %3d%%\n",
				   wil->sta[cid].addr, cid, tid, used, avail,
				   wil->sta[cid].addr, cid, tid, used, avail,
				   (int)((idle*100)/total));
				   (int)idle);


			wil_print_vring(s, wil, name, vring, '_', 'H');
			wil_print_vring(s, wil, name, vring, '_', 'H');
		}
		}