/* * Copyright (C) 2014 Filipe David Borba Manana * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License v2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. */ #include #include #include "hash.h" static struct crypto_shash *tfm; int __init btrfs_hash_init(void) { tfm = crypto_alloc_shash("crc32c", 0, 0); return PTR_ERR_OR_ZERO(tfm); } const char* btrfs_crc32c_impl(void) { return crypto_tfm_alg_driver_name(crypto_shash_tfm(tfm)); } void btrfs_hash_exit(void) { crypto_free_shash(tfm); } u32 btrfs_crc32c(u32 crc, const void *address, unsigned int length) { SHASH_DESC_ON_STACK(shash, tfm); u32 *ctx = (u32 *)shash_desc_ctx(shash); int err; shash->tfm = tfm; shash->flags = 0; *ctx = crc; err = crypto_shash_update(shash, address, length); BUG_ON(err); return *ctx; } rivate-remove net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
:
AgeCommit message (Expand)AuthorFilesLines
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-12-25 12:43:07 +0100
committerThomas Gleixner <tglx@linutronix.de>2016-12-25 17:21:23 +0100
commit1f3a8e49d8f28f498b8694464623ac20aebfe62a (patch)
treeda0b5101c3be3e18b55b0a11974f63a3195704f9 /sound/pci/trident/Makefile
parent8b0e195314fabd58a331c4f7b6db75a1565535d7 (diff)
ktime: Get rid of ktime_equal()
No point in going through loops and hoops instead of just comparing the values. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: Peter Zijlstra <peterz@infradead.org>
Diffstat (limited to 'sound/pci/trident/Makefile')