https://github.com/torvalds/linux
Revision b9b6e4ac2da74995cb7ac9394854a5fd563014c2 authored by Takashi Iwai on 23 October 2015, 04:56:56 UTC, committed by Takashi Iwai on 23 October 2015, 04:56:56 UTC
ASoC: Fixes for v4.3

A bunch of driver fixes plus one core fix which fixes problems with
misreporting values from _SX controls following a recent refactoring.
This had gone unnoticed as such controls are quite rare.
2 parent s d289619 + f69eccc
Raw File
Tip revision: b9b6e4ac2da74995cb7ac9394854a5fd563014c2 authored by Takashi Iwai on 23 October 2015, 04:56:56 UTC
Merge tag 'asoc-fix-v4.3-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
Tip revision: b9b6e4a
lcm.c
#include <linux/compiler.h>
#include <linux/gcd.h>
#include <linux/export.h>
#include <linux/lcm.h>

/* Lowest common multiple */
unsigned long lcm(unsigned long a, unsigned long b)
{
	if (a && b)
		return (a / gcd(a, b)) * b;
	else
		return 0;
}
EXPORT_SYMBOL_GPL(lcm);

unsigned long lcm_not_zero(unsigned long a, unsigned long b)
{
	unsigned long l = lcm(a, b);

	if (l)
		return l;

	return (b ? : a);
}
EXPORT_SYMBOL_GPL(lcm_not_zero);
back to top