Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1035384pxj; Sat, 29 May 2021 00:56:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIMPBMsj409JVHT4+nHUM4z8KBp372wM2vxb9yVwOXVIfPFIvbgbBeHER0tJDt5T0bxrfc X-Received: by 2002:a5d:9343:: with SMTP id i3mr10145900ioo.77.1622274995676; Sat, 29 May 2021 00:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622274995; cv=none; d=google.com; s=arc-20160816; b=GXvkiHgKSfy+lmo7H+N10bizVLs3H8ehf+EZtKBDooPp8hbxtoDQiIuPkGgI0/FMH5 FIHud1ai8FIvWxDPx6ntdNlse4y72RZmC7BBIYGeBeni2EHP1+juhOp0p8ZCo/RJ3w7W J5WmoWmMWEbu9kQLOkvRGaKSegGOcv8X3q6v47eytxMuILTpPukrQw1R2zB49Qd0Jman /3tP/4oq0oysmH/xiDgLy1ITJH5liMDPUcXr1xOuze/C/Oe9VgLglInxIDiBeiZcs4xa Gkgk4SWksimFGj4WsWQUVtOGxxAzsZ+2B5FrB553G50fOuLJ668oCpiLnNyO/Q/OGlvS nNdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=9VngEDZWf8zqYQ8lObuf/Fz5NYel1p8aArrZZ5hl1co=; b=ENDkry/sGFOKS6/NGqBGUqWBwIh+DEnD3vviDE1dSLHw3mj6IZIPGKPhok4IlXwt1n mvLHuAOR9Hsobd0Lpr32ibul7lUQSpGi3eL9+0HATYumvu0y7Qtxe20sOctRECLiUMtA SG36Lcri5Ivat5zx+3NYqY2oABHMmiP+S8jEKxy6rLk3nYTmSXm3By4PDcft6dO4o4Jh qBOceChmS0ocOZaKSagou5y+rTP3J5bK0z4AUlVLFLXLTBTy0mTkNLbVbr1ooMPZWPJ6 kSjOKH3dXWeqRvwTnVROowc8MTvO/EQ9idkhHK7+0L3cb5eFU5uRzxmrHGqklaoYBZXS KkBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kKyfrbsC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si7954378jam.69.2021.05.29.00.56.21; Sat, 29 May 2021 00:56:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kKyfrbsC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbhE2Hyh (ORCPT + 99 others); Sat, 29 May 2021 03:54:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229559AbhE2Hyh (ORCPT ); Sat, 29 May 2021 03:54:37 -0400 Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22DC9C061574; Sat, 29 May 2021 00:53:01 -0700 (PDT) Received: by mail-pj1-x102f.google.com with SMTP id k5so3826115pjj.1; Sat, 29 May 2021 00:53:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=9VngEDZWf8zqYQ8lObuf/Fz5NYel1p8aArrZZ5hl1co=; b=kKyfrbsCjXmMvkkTj1y8OxbSUz/jJL8eJXDeK/KTwHIAfKsOGmEAIQsEMbP9ccMgEy Huz9GtJPwsCcRS61+n0uLjV1hJOZ/Lf10zvPIDdhVHHd6GI3rrCPAXpeXo9g/mYt808Z j7vmq3NV5t9vKmXf20ooTndRt74qvE6wSrhw8U1Rt7CLf2C7dLSGwHAiHYIDS/8z1Tet g1OqRjsEorHWrByvt7kcOCBhS2BwfIB7qrsyAuRStOuJmbp9JvCKVsclCJkR2MgR4yHX 2AMFqghfq/xOaVd897tGnVcaL3wFnSoPlj8cthaBAOHIfGR/9rzR0WEBoma+frhQSFas RTXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=9VngEDZWf8zqYQ8lObuf/Fz5NYel1p8aArrZZ5hl1co=; b=JxZDE6nzxLO8fGoYd3vDStT6s3S4pC85/zJJ9t4utG6SX1IASF6wU3CcabFKEBFy7r foZZuQMXKq+4fMWgOocRnoEMN/JfaIs+kghYEV0hb2KYgCcLw6XVwM40Ol8Ni3taE72I cBeMFP7I7NVdKt3rRw7cCDlh4EEEAISEFy5kREeAzFtCdKJEwGFck6qmz6xw178sLFGO OvJChQeab4/aFgbNVTGamx9KSI840JuJoYN1nwJzg8einF7JvU+EVniRnm1HVLHG57z8 cCmVT+6P+IkxdE4wDnlQdazmEGg3SwwI21m5+irr3pPDMDhusi8zTDProUUwxS7CzD6A ohXw== X-Gm-Message-State: AOAM5330XfndrqO1mJAYC+gxhJMa/lQTILKQXB/KDNPKTXz0Js+e4TeF ZySz4XupwUPwzOVlP+ViZu5TcGzlFJPMaS/LY1E= X-Received: by 2002:a17:902:8c82:b029:fc:e4ed:4958 with SMTP id t2-20020a1709028c82b02900fce4ed4958mr11595619plo.0.1622274780671; Sat, 29 May 2021 00:53:00 -0700 (PDT) MIME-Version: 1.0 References: <20210514135927.2926482-1-arnd@kernel.org> <7afc367b-8103-9d48-1bfe-d505d86553b9@kernel.org> <20210516103628.2cf899a0@jic23-huawei> <644a711e4d2639a23bfc50dffa180ad184a4acb1.camel@perches.com> In-Reply-To: From: Andy Shevchenko Date: Sat, 29 May 2021 10:52:44 +0300 Message-ID: Subject: Re: [PATCH] iio: si1133: fix format string warnings To: Joe Perches Cc: Jonathan Cameron , Nathan Chancellor , Arnd Bergmann , Nick Desaulniers , =?UTF-8?Q?Maxime_Roussin=2DB=C3=A9langer?= , Jean-Francois Dagenais , Arnd Bergmann , Lars-Peter Clausen , Alexandru Ardelean , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "clang-built-linux@googlegroups.com" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 29, 2021 at 12:35 AM Joe Perches wrote: > On Sat, 2021-05-29 at 00:16 +0300, Andy Shevchenko wrote: > > On Saturday, May 29, 2021, Joe Perches wrote: ... > > > > > Likely these should be 0x%02x > > > > > > > > What=E2=80=99s the difference (except printing 0)? > > > > > > (assuming the argument is unsigned char/u8) > > > > > > %#02x will always emit more than the specified length (3 or 4 chars) > > > values < 16 are 0x, values >=3D 16 are 0x > > > > 0 will be 0, btw. > > Hey Andy. Right. > > > > 0x%02x will always emit 4 chars > > > > *Minimum* or at least 4 characters. There is an upper limit of sizeof(i= nt) > > * 2 + 2. > > I did write assuming the argument is unsigned char/u8. > For the general unsigned int arg case, you are of course correct. Signed char also. Basically for all signed types and unsigned int cases. --=20 With Best Regards, Andy Shevchenko