[lkml]   [2009]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: next Feb 13 drivers/scsi/aha1542.ko build break
Randy Dunlap wrote:
> Sachin P. Sant wrote:
>> Feb 13 next x86 allmodconfig build breaks with
>> ERROR: "__udivdi3" [drivers/scsi/aha1542.ko] undefined!
>> .config attached.
> I'm seeing that also. I think that it's this line in aha1542.c:
> 495: mbo = (scsi2int(mb[mbi].ccbptr) - (SCSI_BUF_PA(&ccb[0]))) / sizeof(struct ccb);
> since I can comment out the "/ sizeof(struct ccb)" and the driver builds successfully.
> This may need a patch to use one of the div() macros (?).

In the above case, this problem might not occur if sizeof(struct ccb) happened to
be a power of 2, since the compiler generates a shift in that case.
Then later someone could increase the size of the struct and introduce this problem.

The kernel infrastructure should fix that without requiring the driver to change.
Drivers ought to be allowed to divide.

I've also seen this in another driver that divided a u64 by a constant.
I noticed that linux/math64.h provides div_u64(), but it seems awkward to call
that when the compiler generates a call to __udivdi3 (apparently).

Can't we just provide __udivdi3, since gcc generates that call?
Otherwise, problems like this will continue to crop up.


 \ /
  Last update: 2009-02-13 20:17    [W:0.060 / U:1.588 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site