Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp266739pxy; Sat, 31 Jul 2021 06:45:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaBvlFs79HqUtwLlFkCwOvgMMX2vZVgvsKwCMV+kDi2K5wB8CwvZtNpO02cCVexKmrPHHo X-Received: by 2002:a17:907:9602:: with SMTP id gb2mr7526892ejc.354.1627739149639; Sat, 31 Jul 2021 06:45:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627739149; cv=none; d=google.com; s=arc-20160816; b=mUi3DUyi8aTaLPsED16OKr1rGG3VDnZyB3M2YdlYViOAMMdjCl6AMEjWxWsAlHU/q6 MJUfu6XEEXxxaMMHAiZ6E3RjdFlepWlB9uStPW/3gX8VUFP+xFgyVTILIQaKv5vCz7lP udsISBC1/jCWQbVDGZY8dDWXZGDRG8n+0wHw6wyq5KRBQXMQvdTsfjixTHexnH8OODJc 7Acizl0YykoFpMs4jVuEAqKTkyoBJxo81zcEeKJdpEyrWliU1j8U0W1RnK5NgYLIwsqE 63inLUubAU5VOTcHi6JRSWVYjWN3HtBbZpjYjxcHG6jPt8WEqKmGjlKp0X6aLy+e2duJ Z9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ApscuGnO9kwavfb8gvj5eRzc+0BxiutjLqOnQgzp4eU=; b=fSZNntU+PRnMXG8OE8vIzeAvMvrh0Q5okNPQ7KgqHTqLO/07KTWZrXoZdiFOgYpZgj rO2DowdUz1CeOjXj3jVjxxojD03/p/dLqFrISzRFadfhAYWfd06bTgdDlPYSZ1CcYNyL rpJ5gEmTf70OGjV0WDRxv+WdE6OGLdeawEhQ5crsoLbdzXMcAbtmWu2PXCh8c05uFpqc Np/jxdJIpuxqUSJRA5tdR7C2bJa4uYdcGNo2egqkVfduthOYW6dqRIhBGAlD3qMR8UNW l6gk3sDq4oLevknktXJqc1Q531YU256AdV4HTRKSL70RK58WnxHyjRkVuFOp2tOPotDx eUCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=ZsL7JBbs; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si5098660ejr.611.2021.07.31.06.45.24; Sat, 31 Jul 2021 06:45:49 -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=@gmx.net header.s=badeba3b8450 header.b=ZsL7JBbs; 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=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233214AbhGaNnu (ORCPT + 99 others); Sat, 31 Jul 2021 09:43:50 -0400 Received: from mout.gmx.net ([212.227.15.19]:41057 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233207AbhGaNnr (ORCPT ); Sat, 31 Jul 2021 09:43:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1627738996; bh=Fu/lW7pPCxMAVtTTCjrX6D5BTYRamvOOTo6hAqwjT+M=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=ZsL7JBbsitWzQJ5WHefWqlFAwGe7vJbhBj2faIoGOl88YzZTi5tGfkfH4bOBa7px9 StEJYLOeYKn/M6DazE9IQoM6PEzwTFJTynEpHLZypO7Za35UYAJRTBrNcbfCFk/4A8 KaadioHrg2gvzVdhC8DaNWlMa/g5tj8RuZSkW3lA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from titan ([79.150.72.99]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N63Vi-1nG7GW0WYy-016QDW; Sat, 31 Jul 2021 15:43:16 +0200 Date: Sat, 31 Jul 2021 15:43:03 +0200 From: Len Baker To: Andy Shevchenko Cc: Len Baker , Greg Kroah-Hartman , Phil Reid , Geert Uytterhoeven , dri-devel , "open list:FRAMEBUFFER LAYER" , linux-staging@lists.linux.dev, Linux Kernel Mailing List Subject: Re: [PATCH v2 1/3] staging/fbtft: Remove all strcpy() uses Message-ID: <20210731134303.GA1979@titan> References: <20210724151411.9531-1-len.baker@gmx.com> <20210724151411.9531-2-len.baker@gmx.com> <20210725135844.GA1953@titan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:DfpDEk+H0BF86NTgWDM1eIV7LCLQS0mvdmiGmakvUXg55dsSL2J 56o7cLVbGe9OJ1bVo0UskmwedbqtAit7HeAC1EbxrtgzUfQgPWmSQvhH/4UzluXfSUxa5TR rWiiCQB5D782uCPZAH0YyipX3JZR3lpMuUrj+J7+HtR3QsRpSyDAvQk6LB72RWj9iZHSlfY em3DBJgdQNEFuTcfH6Hdw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:tH6Wma+ggNg=:igYXSXxsqbjd7FSyhf80oM FqmUZ4+wQF9/cPupsLE0OcFE+yhEk5TnW3wfWy1SDebC8/k1KCoR4DH6rhfs5Eo8c4edpUgPs YEc8EK5y0kDU67PEtXwfuZChISRADttUjSaolNl56RE1qfiote4aJh/P0Vb2CXCxoacFHwp5z 5ggX2auQdiE99YGYTOM460ezh4kOobmRv740UdN8TUecwa/5HU3/IKsYznyzoonPpC1dciNnU C4bk/4FoPt/aW5q7jJ5PmpuW1Y30IjW3pTgc3HI6X8BlmYdsh8Cz5oqIsIU44buQhjqOFQa3d +duOZ5zxXqHFOvQ0+fAqLwAsY7qzD0oLTCOchzFIrWDyzQ5z32X3eP8/G3xN/0Q3Lj5E53iP0 xLVe2XfZzhKayNBDROVVBXsJJQY7HvCG7xrN7wQN2B2osSpQWNiqBx/zIOVqjLCQN5Oi77Opn xi7xIAnPbUFX2VfZJaa/60OT6aczVyt0WDGioMJvgiNUxnKZiIoC8pyeXiQ38NsLVnjGkbBgh svDAUiO320GHoOhPZtKxN04960uVN0Tm2jZ1szbVPEMMr/gfz95yk06786NhOICtCvp47lg9o /9wedIflNsYZtLu2pVPeAU2HsL48Ujmz2yK9X8HN21UPxwML/GKYM48u1SRaP9MBmempr0tdj d0Zi01Vmj7fXa+68IJ0ZOSog6EKrjXsMmEJ6P+W2VNS/j8eFzaww8EVRHW9UsS4Wc072l3Ylv TA9swyt+AkHrMcW8tOVyntq6EufS/Owy0YO59Zq1fhHe3xcSxoSMpbq6rk7kPrh4RS1tbgpNM fZq4svBGzOFKu+76OwiTFgBHGT2tGSr5nLrNagBOkeXJS/cyXAwjf6KvsEO9GhbZjfevioDHF +4RL9gc2XS9JECa8BPuTJhM5jy77ZNf0dZE35SSJxVnkbHejPIec7NMcLuMBvI0jGIyOJSxx6 Gk6e1X84wFslP8aAD/ngeaLiYSN5AtoCsjgTkjHL+f1uh09Rb1i26TKNMC/yB6Fib1ozlBQE0 biuyG2ajaeExfSsNleq8Djb5u+MK+8grVZmtKfKrlDbj28FoOkJ6dnKrIiW+JuApDbh/Zfz3n ACMnR5GdXGcshMpiaj9KEDC8fG8mg+Qml7M Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 25, 2021 at 09:51:18PM +0300, Andy Shevchenko wrote: > On Sun, Jul 25, 2021 at 4:59 PM Len Baker wrote: > > On Sat, Jul 24, 2021 at 11:21:04PM +0300, Andy Shevchenko wrote: > > > On Sat, Jul 24, 2021 at 7:05 PM Len Baker wrote: > > ... > > > > > - char msg[128]; > > > > > > 128 / 4 =3D 32. So, this buffer is enough to debug print only up to = 32 > > > bytes. Hence %*ph replacement won't cut output earlier than requeste= d. > > > > I'm sorry, but I don't understand what you are trying to explain. More= over, > > with the "0x%02X " in the sprintf followed by the strcat, the msg buff= er can > > print 128/5 values (25 hex values). > > > > The %*ph replacement can print up to 64 bytes, so I don't see any prob= lem > > here. > > Right. That's what I am trying to say and the hint here is to combine > this part into a phrase in the commit message in the next version of > the patch. Ok, I will update the commit changelog for the next version. > > ... > > > > > + for (j =3D i + 1; par->init_sequence[j] >= =3D 0; j++); > > > > > > Why is i + 1 initial for the j? You may rather access the 'i + 1 + > > > j'th element in the array... > > > > > > ... > > > > > > > + par->init_sequence[i], j - i= - 1, > > > > > > ...and get rid of the ' - i -1' part here. > > > > Yes, it was the first idea but I prefer this method since we save arit= methic > > operations. In other words, if I use what you suggest, the index for > > par->init_sequence is calculated as a "sum" every iteration. But if th= e > > performance is not an issue and you believe that the above is more cle= ar, I > > have no problem. What do you prefer? > > I prefer my variant and I believe the compilers nowadays are clever > enough to understand this. Ok, understood. Thanks. > Have you tried to compile and compare the real assembly? I will test it. > -- > With Best Regards, > Andy Shevchenko Regards, Len