summaryrefslogtreecommitdiff
path: root/drivers/staging/rts5208/general.c
blob: 0f912b011064f195203223306d04f1bf7e9a474a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: GPL-2.0+
/*
 * Driver for Realtek PCI-Express card reader
 *
 * Copyright(c) 2009-2013 Realtek Semiconductor Corp. All rights reserved.
 *
 * Author:
 *   Wei WANG (wei_wang@realsil.com.cn)
 *   Micky Ching (micky_ching@realsil.com.cn)
 */

#include "general.h"

int bit1cnt_long(u32 data)
{
	int i, cnt = 0;

	for (i = 0; i < 32; i++) {
		if (data & 0x01)
			cnt++;
		data >>= 1;
	}
	return cnt;
}