Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2699052ybe; Sat, 7 Sep 2019 22:26:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqxTVoBCZsGzxBJqbY0zS+PHT0V4dN2XmhO8jq208cAOXRXnHd0EoH0kT2bX93g2eQaTLT4B X-Received: by 2002:a62:ae17:: with SMTP id q23mr20525021pff.62.1567920409053; Sat, 07 Sep 2019 22:26:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567920409; cv=none; d=google.com; s=arc-20160816; b=OCVESXi6BDUMsVML7LHzClO15lQpcZRJDp/G93ZylZn9hZqF/qSkCjiMhA9pRvounP tFpwGpZH/ag0F62SoiYAv/GzjUjWMiHYiXaltpViCOAWzsVteQwbCsnaZaVHZ+fty2O5 V1Q940OKxtA61Vre0V3ycWoSD0XzKfuAbhv+crE4riKBdm/iEZmNZgl4Nue6syTvJc6e GnmgwEOMnA32c+tY/NMaNej0LAVNx7WUlaUXLriO8lnTONvmeykzfF5C6OdXp82E7Ywh 05ZT6euvpDr1ORcrG/70zv7jI/H86T3MSHd16hzKyhGFogO7K6hiyaouotIGgZPFCvtg V/ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=8lEHoZAxZRxpTMRYBgPVsjVs/tSBcLbaOLSEdPXXZZc=; b=G1AyHQgOuyXdaFZMNOAvMKL6qRkGFvCSHpz3D4wAdfByS1QXwFBGMRylnFSuyYeZdG Iowin4+y3ZPjGv+XuYvbNjHSBwnpXl3z1V3iZ1/IFLwYgfzSb4kqRo+zmg9cJARiE8OR hLgBAdKDFbZYUzRfV8ihmbuRzxGEZ8SJAnoEmTcPMpPVQdy3W1bN8/YwxQ0k4gHbs2WP WjVx3lYxQgDkFY14ApqhGxQRaJDcW0kZ/oM5jefVWgA4hjEr8lVxm6qJyyTQeXvOQySK 0ddnX8Q+1W52Tg+alqfXSq6jWQR9oASToIZ3/2B7/YfhrPqfuLb/Jb1t/qRTowUnSfKK VAlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kragniz.eu header.s=google header.b=JS1TGHU5; 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 h34si9291220pld.78.2019.09.07.22.26.03; Sat, 07 Sep 2019 22:26:49 -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=@kragniz.eu header.s=google header.b=JS1TGHU5; 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 S2391920AbfIFVdw (ORCPT + 99 others); Fri, 6 Sep 2019 17:33:52 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:37606 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731289AbfIFVdv (ORCPT ); Fri, 6 Sep 2019 17:33:51 -0400 Received: by mail-wm1-f68.google.com with SMTP id r195so8568495wme.2 for ; Fri, 06 Sep 2019 14:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kragniz.eu; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8lEHoZAxZRxpTMRYBgPVsjVs/tSBcLbaOLSEdPXXZZc=; b=JS1TGHU5NCROSoRlcU+zIbbKnd6aj8LivEAdS2CcVkX0z1qQVenhkOeRmkvYTN6Guw rJ6hvVPBAuVge5tk/EsMUzgG74J2krUU/QOyTIY3V2AI+9To9NVX2sjcz3Wwk04pJS7j a9n9fg/8vOvU+Kc6nqnzKHh93EYlccRCPvl2A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8lEHoZAxZRxpTMRYBgPVsjVs/tSBcLbaOLSEdPXXZZc=; b=bgI4w128yuzOqxv2gosNn5daySaDqMMf038dcXjAekWDaykILZdYw2HlxdbAFmhW/H OucZdwPQ0qq5+nfnxdb4s4Tu2oNvrbI7wEaI7AnUukxN+t0lx6PFEJPjZoXa5vCZAgQP b367VYq9Ovt/FQTpWiOtVaYYJeowAySXJ8Ygdy3cVr0EHqpC7QcAZTiX1WNDz09qHZmO O69TXMC0BteyzbnNMuOWceeTopx9HAIqic+lATtJQ8Z5otEdKWkAwDveNCOzrmz/l32f mMsVjiTEy2VPCGiqK2tUm+kUMu5ZvrbOHLUr/Ttg0uzyBspcemdfZoXKuZNHOjP2I2Hz zMzA== X-Gm-Message-State: APjAAAUBiPuubXRCXgUqu/bb6prxjPyvPpa+Dr4HJ3+NU5xMmy2HDLRG AZWOVmgdjJBei5+v5z9mTauIiQ== X-Received: by 2002:a1c:a8cb:: with SMTP id r194mr8842529wme.156.1567805629375; Fri, 06 Sep 2019 14:33:49 -0700 (PDT) Received: from gmail.com ([2.31.167.169]) by smtp.gmail.com with ESMTPSA id 189sm9895231wmz.19.2019.09.06.14.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Sep 2019 14:33:48 -0700 (PDT) Date: Fri, 6 Sep 2019 22:37:29 +0100 From: Louis Taylor To: Joe Perches Cc: linux-doc@vger.kernel.org, corbet@lwn.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi] Message-ID: <20190906213729.GA18504@gmail.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 06, 2019 at 02:11:51PM -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. Yeah, makes sense. Sorry for adding these in the first place. Reviewed-by: Louis Taylor