| 
									
										
										
										
											2010-03-15 12:46:51 +01:00
										 |  |  | #include <linux/kernel.h>
 | 
					
						
							|  |  |  | #include <linux/gcd.h>
 | 
					
						
							| 
									
										
										
										
											2011-11-16 21:29:17 -05:00
										 |  |  | #include <linux/export.h>
 | 
					
						
							| 
									
										
										
										
											2011-07-25 17:13:20 -07:00
										 |  |  | #include <linux/lcm.h>
 | 
					
						
							| 
									
										
										
										
											2010-03-15 12:46:51 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | /* Lowest common multiple */ | 
					
						
							|  |  |  | unsigned long lcm(unsigned long a, unsigned long b) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	if (a && b) | 
					
						
							| 
									
										
										
										
											2014-12-10 15:51:27 -08:00
										 |  |  | 		return (a / gcd(a, b)) * b; | 
					
						
							| 
									
										
										
										
											2014-12-10 15:51:29 -08:00
										 |  |  | 	else | 
					
						
							|  |  |  | 		return 0; | 
					
						
							| 
									
										
										
										
											2010-03-15 12:46:51 +01:00
										 |  |  | } | 
					
						
							|  |  |  | EXPORT_SYMBOL_GPL(lcm); |