From patchwork Tue Feb 19 00:36:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kim Phillips X-Patchwork-Id: 2160731 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 16A773FDF1 for ; Tue, 19 Feb 2013 00:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756814Ab3BSAjo (ORCPT ); Mon, 18 Feb 2013 19:39:44 -0500 Received: from db3ehsobe006.messaging.microsoft.com ([213.199.154.144]:29845 "EHLO db3outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755433Ab3BSAjn (ORCPT ); Mon, 18 Feb 2013 19:39:43 -0500 Received: from mail25-db3-R.bigfish.com (10.3.81.249) by DB3EHSOBE007.bigfish.com (10.3.84.27) with Microsoft SMTP Server id 14.1.225.23; Tue, 19 Feb 2013 00:39:42 +0000 Received: from mail25-db3 (localhost [127.0.0.1]) by mail25-db3-R.bigfish.com (Postfix) with ESMTP id 14EC84C01CC; Tue, 19 Feb 2013 00:39:42 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275bh8275dh19a27bhz2dh2a8h668h839h944hd24he5bhf0ah1220h1288h12a5h12a9h12bdh137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1155h) Received: from mail25-db3 (localhost.localdomain [127.0.0.1]) by mail25-db3 (MessageSwitch) id 1361234380805131_7881; Tue, 19 Feb 2013 00:39:40 +0000 (UTC) Received: from DB3EHSMHS014.bigfish.com (unknown [10.3.81.226]) by mail25-db3.bigfish.com (Postfix) with ESMTP id C24FC260044; Tue, 19 Feb 2013 00:39:40 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB3EHSMHS014.bigfish.com (10.3.87.114) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 19 Feb 2013 00:39:39 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Tue, 19 Feb 2013 00:39:38 +0000 Received: from x9.am.freescale.net (x9.am.freescale.net [10.82.120.9]) by az84smr01.freescale.net (8.14.3/8.14.0) with SMTP id r1J0dZwE010235; Mon, 18 Feb 2013 17:39:35 -0700 Date: Mon, 18 Feb 2013 18:36:29 -0600 From: Kim Phillips To: CC: Christopher Li Subject: [PATCH] sparse: add built-in byte swap identifiers Message-ID: <20130218183629.d2a9238ac848758359582e28@freescale.com> Organization: Freescale Semiconductor, Inc. X-Mailer: Sylpheed 3.2.0 (GTK+ 2.24.13; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-OriginatorOrg: freescale.com Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org this patch stops sparse from complaining about them not being defined: include/uapi/linux/swab.h:60:16: error: undefined identifier '__builtin_bswap32' include/uapi/linux/swab.h:60:33: error: not a function Signed-off-by: Kim Phillips --- Based on: git://git.kernel.org/pub/scm/devel/sparse/chrisl/sparse.git since it's more up-to-date than: git://git.kernel.org/pub/scm/devel/sparse/sparse.git which is what's advertised as the main sparse tree, here: https://sparse.wiki.kernel.org/index.php/Main_Page lib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib.c b/lib.c index 6bd10d3..4f69e11 100644 --- a/lib.c +++ b/lib.c @@ -727,6 +727,11 @@ void declare_builtin_functions(void) add_pre_buffer("extern int __builtin_popcountl(unsigned long);\n"); add_pre_buffer("extern int __builtin_popcountll(unsigned long long);\n"); + /* And byte swaps.. */ + add_pre_buffer("extern unsigned short __builtin_bswap16(unsigned short);\n"); + add_pre_buffer("extern unsigned int __builtin_bswap32(unsigned int);\n"); + add_pre_buffer("extern unsigned long long __builtin_bswap64(unsigned long long);\n"); + /* And some random ones.. */ add_pre_buffer("extern void *__builtin_return_address(unsigned int);\n"); add_pre_buffer("extern void *__builtin_extract_return_addr(void *);\n");