From patchwork Fri Aug 25 10:49:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 110990 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp810155qge; Fri, 25 Aug 2017 03:51:36 -0700 (PDT) X-Received: by 10.28.22.69 with SMTP id 66mr1265611wmw.165.1503658296614; Fri, 25 Aug 2017 03:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503658296; cv=none; d=google.com; s=arc-20160816; b=oyZhSqMnhXdSs1BWLUkmH7ZQIMP1s7SEQf2zSqkLeNcAUVEcij1ALBAkPca4Mcwvvm lPomCrhfHeg6xCWM000eQMg3r9UzvUNs3z/+rVfo4Hsq6C53cL4K+6fN4zoQCBRcBH/b Hh4oi4opz8MCoOvdKbywn2+RfFZIdVtTti52ud2yZPgiFmye2EDRDQCJ0oTLw9uVMH6I SDIOhqrn2ervt7+UOBnBB1VaYkCyx9H61Gh0ipkU5kJ01tpTPDRn444Xuu5aON8uaOYx qLE/WIHM17kwrS2Y0rQBfSJA/5RomJtzVcJMHYLggdlBeMVZqVbwWXJ4vZuBkIZqe4tK iULA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:cc:to:from:arc-authentication-results; bh=kq5v9zaZCIAR562B5/TN4cGwFiC5JH8NbNlNw0DFBf4=; b=kKR3h7NCQnpXu/7eM6aQJ+/u6pl34k5EUTiFEWpJYdP5RKnI7BNLNDoOvVKxj8ab4z Kc0vapGzWvd56UlCnYfmJFw7XOSk8NtanAvPducG0MqwrUlBbF+q78UlOMcTrR3izfrN L2zzpJVie3zD6kBoVh3GaNNmPk6C0L9e1ZPd2vLvhE8FK32fi0Bum/iId5Xaemhp1fjV 7tPZPXZUzJX1Em0AMf99mQqBczl0A+eSfrMSjzb57ov5NbE4b15z5tO3J9cjpLvGuGc2 5EtE9WfnmeuGXfkgOO+UV5wIbfwWYI8mYhnZnSMmi6sxxApOkovPhi/5EZK95Hk+Iqv6 rQmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org ([2001:4b98:dc0:41:216:3eff:fe72:dd13]) by mx.google.com with ESMTP id e24si712294wre.205.2017.08.25.03.51.36; Fri, 25 Aug 2017 03:51:36 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) client-ip=2001:4b98:dc0:41:216:3eff:fe72:dd13; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 2001:4b98:dc0:41:216:3eff:fe72:dd13 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 6E065913D; Fri, 25 Aug 2017 12:50:21 +0200 (CEST) Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0058.outbound.protection.outlook.com [104.47.42.58]) by dpdk.org (Postfix) with ESMTP id 9A5B7910B for ; Fri, 25 Aug 2017 12:50:16 +0200 (CEST) Received: from CY4PR03CA0092.namprd03.prod.outlook.com (10.171.242.161) by CO2PR03MB2261.namprd03.prod.outlook.com (10.166.92.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1385.9; Fri, 25 Aug 2017 10:50:15 +0000 Received: from BN1AFFO11FD044.protection.gbl (2a01:111:f400:7c10::143) by CY4PR03CA0092.outlook.office365.com (2603:10b6:910:4d::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1362.18 via Frontend Transport; Fri, 25 Aug 2017 10:50:14 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD044.mail.protection.outlook.com (10.58.52.191) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1341.15 via Frontend Transport; Fri, 25 Aug 2017 10:50:14 +0000 Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.134.28]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v7PAnw6B032070; Fri, 25 Aug 2017 03:50:12 -0700 From: Hemant Agrawal To: CC: , Date: Fri, 25 Aug 2017 16:19:23 +0530 Message-ID: <1503658183-4078-8-git-send-email-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> References: <1503658183-4078-1-git-send-email-hemant.agrawal@nxp.com> X-EOPAttributedMessage: 0 X-Matching-Connectors: 131481318145681188; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39860400002)(39380400002)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(498600001)(86362001)(76176999)(50986999)(104016004)(105606002)(189998001)(106466001)(53936002)(2351001)(36756003)(68736007)(33646002)(54906002)(85426001)(110136004)(77096006)(5003940100001)(47776003)(626005)(2950100002)(6666003)(6916009)(4326008)(97736004)(2906002)(305945005)(50466002)(8936002)(81156014)(8676002)(356003)(81166006)(50226002)(5660300001)(48376002)(8656003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO2PR03MB2261; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD044; 1:x9vMs9Dl/c7QC5bCwUx196H8gPg2h+wsnEKXL49aY9SjW2Tz4xnLKqQArD3vPylPLM47adAJ8vxiYdBrI+jZzH98rlROC+N+QeimgcGygeXeL7ybvBzQS5vibtICqKQZ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 946ffb34-48c3-4da5-6724-08d4eba71123 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CO2PR03MB2261; X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2261; 3:eyRoSVXsqHa329LKlHpROflriG3fEtldBW1bXgAS4nukXmnUKr2kQPz8AqEf9WW98KBv4Tqx2c6OS5xXlR7iUPvrEbaEIM7jhBgGVCWDyuYycE/CUs78OnvxruGolqA4K1LXpG1tAtuSVMDizUnzsRwi5kg6ZEFvzRA+sAwz3OFhTldZoQGRmeQLpr5jWwzqaD5cd3TkQ+d42Rk3OCegvwmtqcDIF87Jw6XgevDeldRiI7W+h3O846/TLfanXoZfUqNySs33+PeJZDjaChZYE1LQwKVW8ZIqO0A8n9VLw4MrlQM96tt4oBZfCclt1pc7bXqEMSQj3ocZ9HBH/xTysUqcoMU8AR4jFXKDjImx2zk=; 25:L1AdwmAHFozCp/PZZPQGNQqkVASnPR2xSX+yi29jmaV/BDEN9YnDh5Z1OcGTPuJld1Cy8YcFdTV7Y3NauD+TqSbT2Twhz8l7LmqReuJkHS+pZR12AD4/Wy0yogNYiMsO8DcIypj2TNPqtg5JenRDsDeYJx+zJXrBzIso8CJ/yYHeUj1LD60r7911aPNgZ7MhvIfPF8PFYkXxiIS4t+Ridzg4FOVOn7W0uVU2PgOI02jzAW81c2PjRg/rivImROdtXGj8Egm8cISKCA8L5DnmlTKwvsd5tLukOj1BdjY45tZVTM4B2YO+yHpNXsIrXtsUPhd6kgPU/ZWeFLlNeT4C+A== X-MS-TrafficTypeDiagnostic: CO2PR03MB2261: X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2261; 31:n33lWeeMDVWh49h4q2AyO/6qxnU/KkcCL04Uhdkr8jDVBBYY5w9usn/dfon4cyzqz52CzU5fuRBhIrAbZZHsQ2utYWcuQd1EaIAw60O0/mqCNLC2FjWQAXX1hn0y0HDb0r3KS6nD/cZxLaF0huLCSoYPicKO1LITGVnt0W0NHWPvkwCeNbXePhsehPN1Q3T10qedR+dCugy4S+Bzkt6TQq4hcTyrhnGiQj0EeIoY6sE=; 4:KzQmsbCtehVsnyEE//vjgh3URpdiQOm/sCgZY4FaEewT/z+vwfJaR9esuKfJaQTHX9sqInwKJRS+snmQ7wXHrwrtZXlCSerGF+c7H19FQMOeRGBTHKIOVZ9Hj2NhDzrTZWnpRUVpIOY8rTUgZyB0HVeFpMALYKRc8f+fYQ9Uxmv9wA51nCDh/MT2IniBINUSOwwF+aTSK62zI2+JhcNcwgCpbOBA2Hm1krjQp5ZYwK5lNDDVizN26QwD+NTpdkrqS7ziGfkt8z20divyQrpZdUgrkUR1zETIrZ+NUftOMXo= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(8121501046)(13018025)(13016025)(5005006)(100000703101)(100105400095)(3002001)(93006095)(93001095)(10201501046)(6055026)(6096035)(20161123565025)(20161123561025)(20161123559100)(201703131430075)(201703131433075)(201703131448075)(201703161259150)(201703151042153)(20161123556025)(20161123563025)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO2PR03MB2261; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO2PR03MB2261; X-Forefront-PRVS: 041032FF37 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR03MB2261; 23:hJR5LND0hWXSI6CnyvvMcqhEtkQNSa9PChb7oT8jG?= V5G/z2GOScfrlBTCvru8LeZnr4EVC4ya7Nc0YGb9FXJGD7+zqIguX4ktmFs6NqdFU1fAbP6tJOYfJ1JZE54fTSWAg1K7FDukpKeJzjygZzfNYTQSoG0fcMlujULkHSJrn+TGwr0NgV+501afBBFR1IF64EkzN/BwZ7fzbU+Bi4TzVAwY9biU27OMlNq/SnUPHJmzHKOI0AoBK8iK/C+izCB3TzLnJd7ljSAoQzkryD+JD3xBZ090j4nhyaxIDcBLFxNpyLOBmsYuvBnfw2GBMXNJO9Pl7Lx9K1Fh9L8wJI6xFo4ErNJjfnN37doT/8j4ZG4JbwZU8koKx1m9bbKscq+QTx0cFDdpezzaGki7ts2h46uvaU0f8KUvrvKoY+pkFEChWCEay3roY6QaLGHbO/FH04C9V5VWw9tQjFCQSaQML7N2+woq3ZvzZDcqP/lZcYii8jc8xMLAllmvMTxpaFwQrgfyT5aYbZo551o/ukygE8oROlnbrPJ8nsDSi6z5L6ZjIuImHz2zP6JvyLRO13/GkmyKwV6FP9gVrUBkiS6PLR1R+aMsN56//pRUlE+A5X2uoaIFh0YbM/U7bb9/jZJOqJHo7hLSk5+B913gqaB9Adg9Roz1PN3OBHqw/scTh2L4YklA/T9YzpWi5/8CLF1x155JTxRrIIYPLpGqSvbT69DxMMzaVYx2R5DL/InomAu6e481iTEPrTHvmRR5/DCNzgT7NpBooi4qHkjDzMjy7QktLycM9x104591eJEbqcGrGaYPEUQw8vy3omGRP6tyrqzJ78jt585YAZXR8nY9Ju2ynJE1PRB7uHafkWow/z6RuAGJ2OIdgHdNSAoJVZSKPMEHcU9E30UqXSZ8qIhimZvd+jG5/ZMdFcvzE+g5p843uv1mSlZVPNDOwhxxe4dZMVaxR1haac9ugbHeDlNKzkzkQBSDEAkd2CO2VpA+3WmMyTx+Y6dmnUQwNLKXLAJ1CofS8Kz1EHSaG12JP7unQ5+o9B/6iFKXnbwvaj8KS6/IPT/QB+OIkN7x+D5s24xmBN9/Aljt938kKDYYj2HNRxt2XVdZE1w77GC/nUxRfrcTFYQuaxarZGfYt7qjB2U X-Microsoft-Exchange-Diagnostics: 1; CO2PR03MB2261; 6:qhHFpTKz1BhM8MY0jvFpVc0SYlTSqktOLHYB+3TZn1PpvKYgk06m8OQw/AyU2bxW+1OZH/PvSu3MTrmjbUv+MlIVMMQ2e+aFnE/8ki0HnUBOPmn60AVPj9u7zSWlwtVJOBUVW1ZMQM14669bVtuglvC8CZ7Jieme4LfaoZ2H0DhPBAaqrN+7zga2qaYjQDAvmyyUl3YQAIv7cIUq6paIlWRxx+be1HfDSVrNb5xPOE/bAHF30oaP4scGk9jjmqXvKSr6QFqHyNbaTl2lmU6Rbc+co4utH8pSGtnASBnKb1XhiJr2JMWh1HUnkpIyTwmUvWFLwSYPLwoR5g7TBgekcQ==; 5:i/KXlbEQMo4k87kd9Tdwcksd2OjdBlW1n0r/WkaOGkj4isI2lxIHbVPpC4VIM/5H6Cnw2d7eO5Xr1T9UglQ7WvU+lxLsVgOzNya+zyr6LiIMsxP0ua2LffshBghlIA3r82YNsPKGlze7RXfdd3DXjA==; 24:6n2U88y+HiwYPdk0kobgL3xXrtiOeh1cJud58hxqlIIYFdjKljdBXRuRsmwtbk3gJEEhKyyH8CZP0appH7nwa2RZNX3oaJXWOkIoeLFOQ8I=; 7:za2UDrTgH95VQGeFI7b/FVS73oqgvcOjoZSCI19wo+xCdJ2NZEoS/F9mc2UfDhVADHmJc2Cfsxd6FQc/M32etkO0UmehDb10MOIbyBsgJT6RcUbkh5MFnlQecxc1eFRe1G1rZW2Xr9iw9ZYQw+XsKlDJ5bHMaMFMEwIiIIJYpdVOC7/Plr/tU/2TW63FiTunkUFD71DdBQZEXEBeiZMSTPuGojfhnJfg4X09qe28vuc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2017 10:50:14.3965 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR03MB2261 Subject: [dpdk-dev] [PATCH 07/27] bus/fslmc: cleanup compat file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Signed-off-by: Hemant Agrawal --- drivers/bus/fslmc/qbman/include/compat.h | 187 +------------------------------ drivers/bus/fslmc/qbman/qbman_private.h | 2 +- 2 files changed, 3 insertions(+), 186 deletions(-) -- 2.7.4 diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index 7b69fd1..528441f 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -65,16 +65,9 @@ */ /* Required compiler attributes */ -#define __user #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) #define ____cacheline_aligned __attribute__((aligned(L1_CACHE_BYTES))) -#undef container_of -#define container_of(ptr, type, member) ({ \ - typeof(((type *)0)->member)(*__mptr) = (ptr); \ - (type *)((char *)__mptr - offsetof(type, member)); }) -#define __stringify_1(x) #x -#define __stringify(x) __stringify_1(x) #ifdef ARRAY_SIZE #undef ARRAY_SIZE @@ -88,17 +81,8 @@ typedef uint32_t u32; typedef uint64_t u64; typedef uint64_t dma_addr_t; typedef cpu_set_t cpumask_t; -typedef u32 compat_uptr_t; - -static inline void __user *compat_ptr(compat_uptr_t uptr) -{ - return (void __user *)(unsigned long)uptr; -} - -static inline compat_uptr_t ptr_to_compat(void __user *uptr) -{ - return (u32)(unsigned long)uptr; -} +typedef unsigned int gfp_t; +typedef uint32_t phandle; /* I/O operations */ static inline u32 in_be32(volatile void *__p) @@ -128,8 +112,6 @@ static inline void out_be32(volatile void *__p, u32 val) #undef pr_debug #endif #define pr_debug(fmt, args...) {} -#define might_sleep_if(c) {} -#define msleep(x) {} #define WARN_ON(c, str) \ do { \ static int warned_##__LINE__; \ @@ -147,103 +129,20 @@ do { \ #define ALIGN(x, a) (((x) + ((typeof(x))(a) - 1)) & ~((typeof(x))(a) - 1)) -/****************/ -/* Linked-lists */ -/****************/ - -struct list_head { - struct list_head *prev; - struct list_head *next; -}; - -#define LIST_HEAD(n) \ -struct list_head n = { \ - .prev = &n, \ - .next = &n \ -} - -#define INIT_LIST_HEAD(p) \ -do { \ - struct list_head *__p298 = (p); \ - __p298->next = __p298; \ - __p298->prev = __p298->next; \ -} while (0) -#define list_entry(node, type, member) \ - (type *)((void *)node - offsetof(type, member)) -#define list_empty(p) \ -({ \ - const struct list_head *__p298 = (p); \ - ((__p298->next == __p298) && (__p298->prev == __p298)); \ -}) -#define list_add(p, l) \ -do { \ - struct list_head *__p298 = (p); \ - struct list_head *__l298 = (l); \ - __p298->next = __l298->next; \ - __p298->prev = __l298; \ - __l298->next->prev = __p298; \ - __l298->next = __p298; \ -} while (0) -#define list_add_tail(p, l) \ -do { \ - struct list_head *__p298 = (p); \ - struct list_head *__l298 = (l); \ - __p298->prev = __l298->prev; \ - __p298->next = __l298; \ - __l298->prev->next = __p298; \ - __l298->prev = __p298; \ -} while (0) -#define list_for_each(i, l) \ - for (i = (l)->next; i != (l); i = i->next) -#define list_for_each_safe(i, j, l) \ - for (i = (l)->next, j = i->next; i != (l); \ - i = j, j = i->next) -#define list_for_each_entry(i, l, name) \ - for (i = list_entry((l)->next, typeof(*i), name); &i->name != (l); \ - i = list_entry(i->name.next, typeof(*i), name)) -#define list_for_each_entry_safe(i, j, l, name) \ - for (i = list_entry((l)->next, typeof(*i), name), \ - j = list_entry(i->name.next, typeof(*j), name); \ - &i->name != (l); \ - i = j, j = list_entry(j->name.next, typeof(*j), name)) -#define list_del(i) \ -do { \ - (i)->next->prev = (i)->prev; \ - (i)->prev->next = (i)->next; \ -} while (0) - /* Other miscellaneous interfaces our APIs depend on; */ - #define lower_32_bits(x) ((u32)(x)) #define upper_32_bits(x) ((u32)(((x) >> 16) >> 16)) /* Compiler/type stuff */ -typedef unsigned int gfp_t; -typedef uint32_t phandle; #define __iomem -#define EINTR 4 -#define ENODEV 19 #define GFP_KERNEL 0 #define __raw_readb(p) (*(const volatile unsigned char *)(p)) #define __raw_readl(p) (*(const volatile unsigned int *)(p)) #define __raw_writel(v, p) {*(volatile unsigned int *)(p) = (v); } -/* Completion stuff */ -#define DECLARE_COMPLETION(n) int n = 0 -#define complete(n) { *n = 1; } -#define wait_for_completion(n) \ -do { \ - while (!*n) { \ - bman_poll(); \ - qman_poll(); \ - } \ - *n = 0; \ -} while (0) - /* Allocator stuff */ #define kmalloc(sz, t) malloc(sz) -#define vmalloc(sz) malloc(sz) #define kfree(p) { if (p) free(p); } static inline void *kzalloc(size_t sz, gfp_t __foo __rte_unused) { @@ -269,88 +168,6 @@ static inline void free_page(unsigned long p) free((void *)p); } -/* Bitfield stuff. */ -#define BITS_PER_ULONG (sizeof(unsigned long) << 3) -#define SHIFT_PER_ULONG (((1 << 5) == BITS_PER_ULONG) ? 5 : 6) -#define BITS_MASK(idx) ((unsigned long)1 << ((idx) & (BITS_PER_ULONG - 1))) -#define BITS_IDX(idx) ((idx) >> SHIFT_PER_ULONG) -static inline unsigned long test_bits(unsigned long mask, - volatile unsigned long *p) -{ - return *p & mask; -} - -static inline int test_bit(int idx, volatile unsigned long *bits) -{ - return test_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); -} - -static inline void set_bits(unsigned long mask, volatile unsigned long *p) -{ - *p |= mask; -} - -static inline void set_bit(int idx, volatile unsigned long *bits) -{ - set_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); -} - -static inline void clear_bits(unsigned long mask, volatile unsigned long *p) -{ - *p &= ~mask; -} - -static inline void clear_bit(int idx, volatile unsigned long *bits) -{ - clear_bits(BITS_MASK(idx), bits + BITS_IDX(idx)); -} - -static inline unsigned long test_and_set_bits(unsigned long mask, - volatile unsigned long *p) -{ - unsigned long ret = test_bits(mask, p); - - set_bits(mask, p); - return ret; -} - -static inline int test_and_set_bit(int idx, volatile unsigned long *bits) -{ - int ret = test_bit(idx, bits); - - set_bit(idx, bits); - return ret; -} - -static inline int test_and_clear_bit(int idx, volatile unsigned long *bits) -{ - int ret = test_bit(idx, bits); - - clear_bit(idx, bits); - return ret; -} - -static inline int find_next_zero_bit(unsigned long *bits, int limit, int idx) -{ - while ((++idx < limit) && test_bit(idx, bits)) - ; - return idx; -} - -static inline int find_first_zero_bit(unsigned long *bits, int limit) -{ - int idx = 0; - - while (test_bit(idx, bits) && (++idx < limit)) - ; - return idx; -} - -static inline u64 div64_u64(u64 n, u64 d) -{ - return n / d; -} - #define atomic_t rte_atomic32_t #define atomic_read(v) rte_atomic32_read(v) #define atomic_set(v, i) rte_atomic32_set(v, i) diff --git a/drivers/bus/fslmc/qbman/qbman_private.h b/drivers/bus/fslmc/qbman/qbman_private.h index 4f48b47..32e5c5d 100644 --- a/drivers/bus/fslmc/qbman/qbman_private.h +++ b/drivers/bus/fslmc/qbman/qbman_private.h @@ -27,7 +27,7 @@ */ /* Perform extra checking */ -#define QBMAN_CHECKING +/*#define QBMAN_CHECKING*/ /* To maximise the amount of logic that is common between the Linux driver and * other targets (such as the embedded MC firmware), we pivot here between the