From patchwork Thu Dec 20 07:22:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1898681 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 4DCE740061 for ; Thu, 20 Dec 2012 07:22:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750991Ab2LTHWM (ORCPT ); Thu, 20 Dec 2012 02:22:12 -0500 Received: from userp1040.oracle.com ([156.151.31.81]:29938 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750933Ab2LTHWL (ORCPT ); Thu, 20 Dec 2012 02:22:11 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qBK7M99l027956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Dec 2012 07:22:09 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qBK7M8tT011956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 20 Dec 2012 07:22:08 GMT Received: from abhmt104.oracle.com (abhmt104.oracle.com [141.146.116.56]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qBK7M8FL013003; Thu, 20 Dec 2012 01:22:08 -0600 Received: from mwanda (/41.212.103.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 19 Dec 2012 23:22:07 -0800 Date: Thu, 20 Dec 2012 10:22:13 +0300 From: Dan Carpenter To: Simon Que Cc: smatch@vger.kernel.org, linux-sparse@vger.kernel.org Subject: Re: Using smatch on Chrome OS kernel, cannot process "__restrict__" Message-ID: <20121220072212.GO5032@mwanda> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org On Wed, Dec 19, 2012 at 06:06:43PM -0800, Simon Que wrote: > Hi, > > I am trying to apply smatch to the Chrome OS kernel, which is a > modified Linux Kernel 3.4. There is one "error" that smatch is having > trouble processing. It is in drivers/md/dm-bht.c: > > sprintf((char *__restrict__)hex, "%02hhx", (int)*binary); > > The word "__restrict__" is throwing off smatch somehow and it causes > the build to fail. > > When I run make without smatch, the build passes. > When remove the "__restrict__" and make CHECK=smatch, the build passes. > Thanks for the report. That's a Sparse thing. I'll commit this patch with a: Reported-by: Simon Que regards, dan carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/parse.c b/parse.c index 5dd9a06..bf5894d 100644 --- a/parse.c +++ b/parse.c @@ -419,6 +419,7 @@ static struct init_keyword { /* Ignored for now.. */ { "restrict", NS_TYPEDEF, .op = &restrict_op}, { "__restrict", NS_TYPEDEF, .op = &restrict_op}, + { "__restrict__", NS_TYPEDEF, .op = &restrict_op}, /* Storage class */ { "auto", NS_TYPEDEF, .op = &auto_op },