Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2244977ybe; Sat, 14 Sep 2019 10:45:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqzuoEASjDnJpKBkQGhpMP/uQh/d7xV8o7AOlL4D3XPoKUVsBUq0wbVxHXujQRLp/KInxFAP X-Received: by 2002:a17:906:244c:: with SMTP id a12mr43689459ejb.288.1568483138741; Sat, 14 Sep 2019 10:45:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568483138; cv=none; d=google.com; s=arc-20160816; b=AdVjeq5Ol4twePnFcPrJT1p2zDYDvZI32x+l74TS+a03rxRzZ4dd6DXOfoEj0C3rVr vf3ckS5nYNEgkgqo/wybYTV9kCTvDCG++JmGFdpm+0Ff1W3hAIYtpSop1tkoktNQrcDZ 7LQ6tjq+gw96kcOGiSHtOGW7KOfXRGvtANeU0XHId4gsVJGCpIYIfUd7J6PK/6euRGrI xRe5wQQqzTwGxVnpIltVGhAXJBMrq2bmtRfr4fa15u3Gh6X3AqIEoF3OYzqY68Bg8Ers Rm+yNZp/+C5EzRJtZRPm+Ipte1p6dGANZ+GhN9t6IL7mFfmqsaugvb4IIDakeJgOshMh 4yIA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=P/8MlBwRnHCINXivwbSFj6hOBfb5ZYEu3IZeKC0ewW4=; b=Q5EL8rM4/SnDhRui2ignDy6lZYV97F/zvkOyB6D68FyYsdVkYut5pJ0Qc5prAA5Eg+ ZS8SEXhueDy27ohTF0dhDLhyi+bYbNAi52GQ58Pt8P4GtmU5YCSjoLCe/gsyGD1J9TAa YEkxYb6dmmp1FkZPnTj5cdQcIhzH/hmuGeCj23knnGs0OBM1yCT2ARu1MwW5/xfVfwqv eY9OU4fr+T9o8JvRg+iUH8MIU4QqrI4tFHfZxwIt8w/gNMa+iE3D0vnSC+4fgiOgbwJ7 0kG1Utw+VrYBp9qtYW/173wQ2Nx/F8vGkbEePyL9LeMesUHcdMN9pRLEjJ0T6C+voxE8 yuyA== ARC-Authentication-Results: i=1; mx.google.com; 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 d11si16859805ejt.301.2019.09.14.10.45.15; Sat, 14 Sep 2019 10:45:38 -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; 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 S1727363AbfINH7E (ORCPT + 99 others); Sat, 14 Sep 2019 03:59:04 -0400 Received: from ms.lwn.net ([45.79.88.28]:35694 "EHLO ms.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727184AbfINH7E (ORCPT ); Sat, 14 Sep 2019 03:59:04 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ms.lwn.net (Postfix) with ESMTPSA id 87F242CC; Sat, 14 Sep 2019 07:59:02 +0000 (UTC) Date: Sat, 14 Sep 2019 01:58:58 -0600 From: Jonathan Corbet To: Joe Perches Cc: linux-doc@vger.kernel.org, linux-kernel , Louis Taylor Subject: Re: [PATCH] docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi] Message-ID: <20190914015858.7c76e036@lwn.net> In-Reply-To: References: Organization: LWN.net X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 06 Sep 2019 14:11:51 -0700 Joe Perches wrote: > Standard integer promotion is already done and %hx and %hhx is useless > so do not encourage the use of %hh[xudi] or %h[xudi]. > > As Linus said in: > Link: https://lore.kernel.org/lkml/CAHk-=wgoxnmsj8GEVFJSvTwdnWm8wVJthefNk2n6+4TC=20e0Q@mail.gmail.com/ > > It's a pointless warning, making for more complex code, and > making people remember esoteric printf format details that have no > reason for existing. > > The "h" and "hh" things should never be used. The only reason for them > being used if if you have an "int", but you want to print it out as a > "char" (and honestly, that is a really bad reason, you'd be better off > just using a proper cast to make the code more obvious). > > So if what you have a "char" (or unsigned char) you should always just > print it out as an "int", knowing that the compiler already did the > proper type conversion. > > Signed-off-by: Joe Perches Applied, thanks. I took the liberty of removing "Link:" (but not the URL) from the commit message. That wasn't a patch tag, there is no real reason to make it look like one... jon