Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1999344ybl; Thu, 29 Aug 2019 02:02:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFg/iLjXLQbcdBqxCb6zm+6Eg0Rp/PXEOfUCRH8x0+lf0oemifGNZFXyav3IRdlqItKByH X-Received: by 2002:aa7:8602:: with SMTP id p2mr9913074pfn.138.1567069354580; Thu, 29 Aug 2019 02:02:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567069354; cv=none; d=google.com; s=arc-20160816; b=cry/hOP3438HLKhfi0NfbrfN30CktcbJeJgycEnZoB6Gy1DTpNqqdnxTKsXD+1rNtp 8K7gU1enJ8Ude1F4NbIwR8ukbZT+oPbUNOFAWeXl+Tl0kxrfjZ37T1wy8DDlXbJtZ5MJ Rbv6edn6UY1fyi7/5JJUQk9htbOnOBl38rZulO+VI7qJZ7kZwYhqK2AS34psnBvJRSDq T+VFUlWRSAy6/H/y5SMo7GBmjxXoYvcLF89m0/yMCFpbw46iQ7q8TzcyHBpL7ZKyv7U8 X2JJqgwSmRcmk23g4ztTLxJD4G9pdRadCzMpFFaNigTNFj3JVqaD4ghv0CWEwrw+1WVy +4Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=GflFtIVZM88+m/b3O03bHRfVUBRCQA10rQsteTPRKU0=; b=BMac/St1dVJfT0qPi7Ce6XGCywcvAY4tgxVKRpYKATM82jSNAbuHPlQs7qa5BRu0Ea cA0QBovxhyy446xLeJKrOS/gn/M3f3jpX7zUbI6wbM2br3EQgja2gFL/qC9ZS2RmFwZK tcfr+VsvZoywPE5bitlSUsP2kteiExbPkVc38e8XZoz9wMFY8AfxbTwea8KXI+ZKVkft Eifj96GlhX8gH6Ai0rJKm8L3KIBQW/BjcNLp1GV3G55o+B8BjzhtoZjxESZ8zEj2N0ZD VM3XDQ2k1Pjk32fQal9odGwdoMXBuJYtclvMn1f8UWE1bTVqHuhHnUKuyJapB98hepg+ PTqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=RP9ClfqO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u96si1660454pjb.34.2019.08.29.02.02.15; Thu, 29 Aug 2019 02:02:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=RP9ClfqO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726283AbfH2JBD (ORCPT + 99 others); Thu, 29 Aug 2019 05:01:03 -0400 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43913 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbfH2JBC (ORCPT ); Thu, 29 Aug 2019 05:01:02 -0400 Received: by mail-lf1-f68.google.com with SMTP id q27so1869511lfo.10 for ; Thu, 29 Aug 2019 02:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GflFtIVZM88+m/b3O03bHRfVUBRCQA10rQsteTPRKU0=; b=RP9ClfqOBQdl68pRWDcY1JCCs1Q5wuSwXqTQrxZa5L9iq2jlLy/LK7xGMohK9vjwrI 8QanvCJNGjB66AKh+egkfLNnsxAPiDwz0oIhnJxN/4upQRp6I9mgP6GbkpjEaklkyWNo f5ODkjYbir1wzaER7e4PsqFQ0LVLKue9Tx9J4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GflFtIVZM88+m/b3O03bHRfVUBRCQA10rQsteTPRKU0=; b=X9SbVayNTTFRV2Dc8z5Kasg+G4HEFqTDIs5z3BIznmNfs43/Q5NMyuPJDHonpVtXEx JU5wOhRHqaKHeuPCep/o6SnrnNNifIcY1UNXwX8Qv6SOUJoCFdY3WvUJVVNhkZ0cH8yd vnhEIdbe7vBNpSrvj3mtaTgzrs+atj9snLLVX5ALNTSGBUx5vd4HZo3jcsmJa0laKkuQ WAfUvjCPbtAWJWYYJ4R8gbErrxsBw9W+/kyF2vJ0pFZXV/zxOnrMADw5HZmFqevy+Tc2 PnYv+9CsfMdJOM//z0XKKKk/Q1hL2PtPewc1X4Bc6BF2vQ9XCThox/w9Z/WrPqUlDUGk nUZQ== X-Gm-Message-State: APjAAAU/mIL4iA7JNxr2Cix8MY/DqnsZpfbvjz/+Sz8To24UdPJi2Tw1 tF9SuLynxQ8KhYJbnsEVFqf9AAxxcS3WxGv7 X-Received: by 2002:a19:6d17:: with SMTP id i23mr5440814lfc.44.1567069260255; Thu, 29 Aug 2019 02:01:00 -0700 (PDT) Received: from [172.16.11.28] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id l11sm293261lfh.48.2019.08.29.02.00.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Aug 2019 02:00:59 -0700 (PDT) Subject: Re: [PATCH v2] vsprintf: introduce %dE for error constants To: Petr Mladek , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= Cc: Sergey Senozhatsky , Steven Rostedt , Andrew Morton , Jani Nikula , Jonathan Corbet , metux IT consult Enrico Weigelt , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20190827211244.7210-1-uwe@kleine-koenig.org> <20190828113216.p2yiha4xyupkbcbs@pathway.suse.cz> <74303921-aa95-9962-2254-27e556af54f4@kleine-koenig.org> <20190829081249.3zvvsa4ggb5pfozl@pathway.suse.cz> From: Rasmus Villemoes Message-ID: <39eda8f7-8c39-f899-075f-b4abdefe0098@rasmusvillemoes.dk> Date: Thu, 29 Aug 2019 11:00:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190829081249.3zvvsa4ggb5pfozl@pathway.suse.cz> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 29/08/2019 10.12, Petr Mladek wrote: > On Wed 2019-08-28 21:18:37, Uwe Kleine-K?nig wrote: > BTW: I though more about generating or cut&pasting the arrary. > I can't find any reasonable way how to generate it. Something like this seems to work, though it probably needs some massage to be accepted by kbuild folks: define filechk_errcode.h echo '#include ' | \ $(CPP) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) -dM - | \ grep 'define E' | sort -k3,3n | \ awk '{print "errcode("$$2")\t/* "$$3" */"}' endef include/generated/errcode.h: FORCE $(call filechk,errcode.h) Then one can just #define errcode(foo) ... right before #include . It cannot be used to generate cases in a switch() because some expand to the same number, but that's ok, because I can't imagine the switch actually generating good or small code. I haven't checked how or whether it works in a cross-compile situation. Rasmus