Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp738909pxj; Fri, 28 May 2021 14:37:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzON3RL6AJPUgtXVJ7rv/f2gMv/+G68FiEb4hvcnjLT0dr6qMDivxQGO5fTUOp4IDH2Fpst X-Received: by 2002:a05:6638:dd2:: with SMTP id m18mr10598494jaj.40.1622237832409; Fri, 28 May 2021 14:37:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622237832; cv=none; d=google.com; s=arc-20160816; b=rsAeKGWWFNVRXfY85iOUEb/6YTa+iDnoWOZ4XyXuWCgiQ4h8IQIRiww5vwAPgUiM2l ++Zz3i5SfQlEWfC4yH4GKvCahXE5IthPaHKfTMTLvqrfPsLWu7sDP4FZilR/nUnkoMlP uliMyQJBSehbWAsI0Mv4cVhOe0HpseCfrINMfe4dvO7yeINCQy+9OmQlI+7WVo9F6PSN WHS+rIzKndVuvjZjcHsYhC5UlzEvZLxd6u4QdHzT1+qpkxc+BpR6Z+d6MVB0PJPmdAkU WVSEiV2YML7SzAPQxjXWvOO2ISGwMkFytbZQX9H7WR77J23812qG9BJz5GYiUaX9VxyU /qGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=umASXhhJoBDoJQq16nL14r1AB3gsTZPPpxaAi34FiZ8=; b=zobcAu0MgTLDB9EFIaqKnWyHCnxC9LAq+0AlnfhObBNZ6tVe2Fi78K0b5X+5rwju2e qz5kPZFCZ89ZmadkyYcQGIdUqleJUomt7AiMuqseq8mbj6VXf6uyz1z1Cq5cIL0PreUa O7YU+BC0PPa2HTUq+WibkePCqjkvIxMGpKQZmj9LJ20sgzyXzE5e2IHlNg9vrsVCEv7U jIMv5i86e3PwB3LoUq3IEmwiW/X9LfpohhhV4khGB2P1CjONOONkz51uTHgQ6zTXHG8b 1t2F1Wkf1G7uKg3DPGQG2fU0QOSbsjW5+fuEIE/Go5UKehF9X4a8WgH/8/QCuuDeHwYx MpoQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o13si5959636ilt.118.2021.05.28.14.36.59; Fri, 28 May 2021 14:37:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbhE1Vgl (ORCPT + 99 others); Fri, 28 May 2021 17:36:41 -0400 Received: from smtprelay0027.hostedemail.com ([216.40.44.27]:51234 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229565AbhE1Vgk (ORCPT ); Fri, 28 May 2021 17:36:40 -0400 Received: from omf16.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id 8B11E181D3025; Fri, 28 May 2021 21:35:04 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: joe@perches.com) by omf16.hostedemail.com (Postfix) with ESMTPA id 5A2292550F6; Fri, 28 May 2021 21:35:02 +0000 (UTC) Message-ID: Subject: Re: [PATCH] iio: si1133: fix format string warnings From: Joe Perches To: Andy Shevchenko Cc: Jonathan Cameron , Nathan Chancellor , Arnd Bergmann , Nick Desaulniers , Maxime =?ISO-8859-1?Q?Roussin-B=E9langer?= , 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" Date: Fri, 28 May 2021 14:35:01 -0700 In-Reply-To: References: <20210514135927.2926482-1-arnd@kernel.org> <7afc367b-8103-9d48-1bfe-d505d86553b9@kernel.org> <20210516103628.2cf899a0@jic23-huawei> <644a711e4d2639a23bfc50dffa180ad184a4acb1.camel@perches.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.60 X-Stat-Signature: kkmhc1bttsasinfggbmtofn51u6bb65q X-Rspamd-Server: rspamout04 X-Rspamd-Queue-Id: 5A2292550F6 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Session-ID: U2FsdGVkX1+V3ZAlIxraiLN1BNQJiiyx7LjKDDaWv6E= X-HE-Tag: 1622237702-401044 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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’s 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 >= 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(int) > * 2 + 2. I did write assuming the argument is unsigned char/u8. For the general unsigned int arg case, you are of course correct.