From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luc Van Oostenryck Subject: Re: [PATCH v2] implement constant-folding in __builtin_bswap*() Date: Thu, 24 Nov 2016 02:36:14 +0100 Message-ID: <20161124013613.GA18220@macpro.local> References: <1479721551.8662.10.camel@sipsolutions.net> <20161122131543.GA8370@macbook.local> <20161122201650.GA12172@macpro.local> <20161123204838.GA14875@macpro.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-wj0-f196.google.com ([209.85.210.196]:36482 "EHLO mail-wj0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935138AbcKXBgR (ORCPT ); Wed, 23 Nov 2016 20:36:17 -0500 Received: by mail-wj0-f196.google.com with SMTP id jb2so2233883wjb.3 for ; Wed, 23 Nov 2016 17:36:16 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Christopher Li Cc: Johannes Berg , Linux-Sparse , Nicolai Stange On Thu, Nov 24, 2016 at 08:58:35AM +0800, Christopher Li wrote: > +/* The arguments are constant if the cost of all of them is zero */ > +int expand_bswap(struct expression *expr, int cost) > +{ > + struct symbol *sym; > + struct expression_list *args = expr->args; > + long long input; > + int count; > + > + if (cost) > + return cost; > + > + sym = expr->fn->ctype; > + count = expression_list_size(args); > + if (count != 1) { > + sparse_error(expr->pos, "Invaild number of arguments for function %s (expected 1 got %d)", Small typo here: "Invaild"