summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rts5208/general.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/rts5208/general.c')
-rw-r--r--drivers/staging/rts5208/general.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/staging/rts5208/general.c b/drivers/staging/rts5208/general.c
new file mode 100644
index 000000000..0f912b011
--- /dev/null
+++ b/drivers/staging/rts5208/general.c
@@ -0,0 +1,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;
+}
+