iscsi-scst: Suppress a compiler warning

Avoid that the compiler complains that the variable 'pad_bytes'
is not used with CONFIG_LIBCRC32C=n.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6314 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2015-06-15 22:06:29 +00:00
parent 9e700c6c03
commit 15535bf648

View File

@@ -61,7 +61,6 @@ static __be32 evaluate_crc32_from_sg(struct scatterlist *sg, int nbytes,
uint32_t padding)
{
u32 crc = ~0;
int pad_bytes = ((nbytes + 3) & -4) - nbytes;
#ifdef CONFIG_SCST_ISCSI_DEBUG_DIGEST_FAILURES
if (((scst_random() % 100000) == 752)) {
@@ -71,15 +70,19 @@ static __be32 evaluate_crc32_from_sg(struct scatterlist *sg, int nbytes,
#endif
#if defined(CONFIG_LIBCRC32C_MODULE) || defined(CONFIG_LIBCRC32C)
while (nbytes > 0) {
int d = min(nbytes, (int)(sg->length));
crc = crc32c(crc, sg_virt(sg), d);
nbytes -= d;
sg++;
}
{
int pad_bytes = ((nbytes + 3) & -4) - nbytes;
if (pad_bytes)
crc = crc32c(crc, (u8 *)&padding, pad_bytes);
while (nbytes > 0) {
int d = min(nbytes, (int)(sg->length));
crc = crc32c(crc, sg_virt(sg), d);
nbytes -= d;
sg++;
}
if (pad_bytes)
crc = crc32c(crc, (u8 *)&padding, pad_bytes);
}
#endif
return (__force __be32)~cpu_to_le32(crc);