crc-t10dif: clean up some more things
authorEric Biggers <ebiggers@google.com>
Wed, 10 Jun 2020 06:39:43 +0000 (23:39 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 18 Jun 2020 07:26:43 +0000 (17:26 +1000)
commit29195232fa2f722449c1c6850277b4ca9fa5f781
treee1e226fd4692bb3230dedb4f8c21ccd1f3fbccc7
parentbe924e0aaa315a179c25221685e3f1a35a70156e
crc-t10dif: clean up some more things

- Correctly compare the algorithm name in crc_t10dif_notify().

- Use proper NOTIFY_* status codes instead of 0.

- Consistently use CRC_T10DIF_STRING instead of "crct10dif" directly.

- Use a proper type for the shash_desc context.

- Use crypto_shash_driver_name() instead of open-coding it.

- Make crc_t10dif_transform_show() use snprintf() rather than sprintf().
  This isn't actually necessary since the buffer has size PAGE_SIZE
  and CRYPTO_MAX_ALG_NAME < PAGE_SIZE, but it's good practice.

- Give the "transform" sysfs file mode 0444 rather than 0644,
  since it doesn't implement a setter method.

- Adjust the module description to not be the same as crct10dif-generic.

Cc: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
lib/crc-t10dif.c