PageRenderTime 28ms CodeModel.GetById 23ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 0ms

/drivers/staging/rts_pstor/general.c

https://bitbucket.org/slukk/jb-tsm-kernel-4.2
C | 35 lines | 11 code | 3 blank | 21 comment | 2 complexity | f7c3b5841704236f154494013207616b MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.0, AGPL-1.0
 1/* Driver for Realtek PCI-Express card reader
 2 *
 3 * Copyright(c) 2009 Realtek Semiconductor Corp. All rights reserved.
 4 *
 5 * This program is free software; you can redistribute it and/or modify it
 6 * under the terms of the GNU General Public License as published by the
 7 * Free Software Foundation; either version 2, or (at your option) any
 8 * later version.
 9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, see <http://www.gnu.org/licenses/>.
17 *
18 * Author:
19 *   wwang (wei_wang@realsil.com.cn)
20 *   No. 450, Shenhu Road, Suzhou Industry Park, Suzhou, China
21 */
22
23#include "general.h"
24
25int bit1cnt_long(u32 data)
26{
27	int i, cnt = 0;
28	for (i = 0; i < 32; i++) {
29		if (data & 0x01)
30			cnt++;
31		data >>= 1;
32	}
33	return cnt;
34}
35