lkml.org 
[lkml]   [2018]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] sysctl: add overflow detection to proc_get_long()
> > Yecchh...  First of all, the cast back to unsigned long long is completely
> > pointless. What's more,
>
> Sorry, seriously asking: why?

In C everything is casted to the same type before doing an operation,
in this case comparison

> This was meant to handle the case where
> sizeof(unsigned long long) != sizeof(unsigned long) and I just looked at
> _kstrtoul() which does the same:

Second cast is unnecessary. I don't remember why I did 2 casts.

\
 
 \ /
  Last update: 2018-10-15 00:14    [W:0.024 / U:1.532 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site