svn commit: r273958 - head/sys/dev/random
Xin Li
delphij at delphij.net
Mon Nov 3 08:34:17 UTC 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 11/2/14 5:13 PM, Bruce Evans wrote:
> % - % - KASSERT(random_adaptor != NULL, ("No active random
> adaptor in %s", __func__)); % } % % void
>
> Lots of style bugs (long lines, use of the __func__ obfuscation,
> and general verboseness).
What would you recommend doing for cases like this? Do we just do
KASSERT without the __func__ and rely on ddb to provide the
information in backtrace or something else?
Speaking for long lines -- I usually use the MTA's default so the diff
won't wrap. style(9) is a little bit vague here, what should new code
appear like?
> % @@ -256,11 +258,15 @@ random_adaptor_read(struct cdev *dev
> __unused, str % /* Let the entropy source do any post-read
> cleanup. */ % (random_adaptor->ra_read)(NULL, 1); % % -
> free(random_buf, M_ENTROPY); % + if (nbytes !=
> uio->uio_resid && (error == ERESTART || % + error ==
> EINTR) ) % + error = 0; /* Return partial read, not
> error. */
>
> This adjustment has no effect. Upper layers already do it for
> these 2 errors and one more. Other cases remain broken.
>
> It is simpler to do nothing. Let upper layers get it right or
> wrong. Doesn't matter much either way.
Will remove these two portions of the change.
> % +
>
> More style bugs. Extra blank line here. Space bereofe parentheses
> above.
>
> % } % - % sx_sunlock(&random_adaptors_lock); % % +
> free(random_buf, M_ENTROPY); % +
>
> Extra blank lines are sprinkled randomly. Mostly added, but one
> was removed. There is an extra blank line after the sx_slock() that
> separates it from the blocks(s) of code that it locks; the removed
> one used the same style.
Will change the code to consistently use no blank line after
sx_slock() and before sx_sunlock() if that's correct, can you confirm?
Cheers,
-----BEGIN PGP SIGNATURE-----
iQIcBAEBCgAGBQJUVz4HAAoJEJW2GBstM+nsZnkP/0PDU6SvwEG94w/csmWiWRuE
IhhmH3oKz+LAzsU7pGUPpyE+UqWaMhRod6CHH9Io7EaJmZ9gsoMD29KWSdrYhWmS
eMuZIt/vNkHGd+4SpFMUVq15s1gmRO2AK7wev6PZ1lOeqlJQtEkelnwaO7gWZdyp
yWjdBW3MOOuVPR/kj0qF7Nx3nuCPkixO/SldXbMOeM0ofKhZw2DkiJmjSDx17Mk7
q/x2cuui4+nDxyJleFeLDpZqI+zaII/2yGly8OMzmhOsaAUtQrhxFM5I8Py/E85t
yIK6U01tuRu1pVMNtqY1EgFqEkzRAr/kWG/wHZOuiITNroGye5J+u9VLaBVgCmQF
hJW2Wthq2qFaWX2oqlSamHSss1Mt048iIzIzQd7GhwRYb6Be5IGPaqI2QOyKAYeE
ojHvddkL30xIVLwM9qkFmIiyOvaC4gi/dSc6cbSEEYarTLqsIUZlJ1Xx5X5OK9y9
sAsIIo+0v4njB/cv9x4e5aeDXsRU1ABFHk4IUb7hBv2/Um9FRTuVKyKDWiEm4mRV
U/uDxRDIFc0KAFj0bEtJXyeB/GsGsYqlba63Z978QQUvtlk7Rjtq8hDBks+I6CcC
Hb8UOttzY+jS/XDxphNw5eXeg6rgy0v6isLqSAJvmwnyrXCUPJF5oMYxUla3lYrc
QzxqUTKnPyyid4Hl+7n9
=ixEW
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: random-style.diff
Type: text/x-patch
Size: 2793 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20141103/3792d9fe/attachment.bin>
More information about the svn-src-all
mailing list