lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 17 May 2014 21:12:25 -0700
From:	Joe Perches <joe@...ches.com>
To:	David Matlack <matlackdavid@...il.com>
Cc:	gregkh@...uxfoundation.org, linux-kernel@...r.kernel.org,
	devel@...verdev.osuosl.org, liodot@...il.com,
	charrer@...critech.com
Subject: Re: [PATCH 1/2] staging: slicoss: rewrite eeprom checksum code

On Sat, 2014-05-17 at 21:00 -0700, David Matlack wrote:
[]
> diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
[]
> +static inline u16 __reduce(u32 checksum)
> +{
> +	u16 lower_16 = checksum & 0xFFFF;
> +	u16 upper_16 = (checksum >> 16) & 0xFFFF;
> +
> +	checksum = lower_16 + upper_16;
> +
> +	if (checksum > 65535)
> +		checksum -= 65535;
> +
> +	return checksum;
> +}

The if seems unnecessary.

Perhaps declare a u16 return var or use

	return lower_16 + upper_16;


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists