From: Len Baker <email@example.com> To: Andy Shevchenko <firstname.lastname@example.org> Cc: Len Baker <email@example.com>, Greg Kroah-Hartman <firstname.lastname@example.org>, Phil Reid <email@example.com>, Geert Uytterhoeven <firstname.lastname@example.org>, dri-devel <email@example.com>, "open list:FRAMEBUFFER LAYER" <firstname.lastname@example.org>, email@example.com, Linux Kernel Mailing List <firstname.lastname@example.org> Subject: Re: [PATCH v2 1/3] staging/fbtft: Remove all strcpy() uses Date: Sat, 31 Jul 2021 15:43:03 +0200 [thread overview] Message-ID: <20210731134303.GA1979@titan> (raw) In-Reply-To: <CAHp75Vd=_qgnaLpAq+=Awf+ggUf9DEm0amNyTE0KkYThxtP=WQ@mail.gmail.com> On Sun, Jul 25, 2021 at 09:51:18PM +0300, Andy Shevchenko wrote: > On Sun, Jul 25, 2021 at 4:59 PM Len Baker <email@example.com> 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 <firstname.lastname@example.org> wrote: > > ... > > > > > - char msg; > > > > > > 128 / 4 = 32. So, this buffer is enough to debug print only up to 32 > > > bytes. Hence %*ph replacement won't cut output earlier than requested. > > > > I'm sorry, but I don't understand what you are trying to explain. Moreover, > > with the "0x%02X " in the sprintf followed by the strcat, the msg buffer can > > print 128/5 values (25 hex values). > > > > The %*ph replacement can print up to 64 bytes, so I don't see any problem > > 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 = i + 1; par->init_sequence[j] >= 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 aritmethic > > 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 the > > performance is not an issue and you believe that the above is more clear, 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
next prev parent reply other threads:[~2021-07-31 13:43 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-24 15:14 [PATCH v2 0/3] " Len Baker 2021-07-24 15:14 ` [PATCH v2 1/3] staging/fbtft: " Len Baker 2021-07-24 20:21 ` Andy Shevchenko 2021-07-25 13:58 ` Len Baker 2021-07-25 18:51 ` Andy Shevchenko 2021-07-31 13:43 ` Len Baker [this message] 2021-07-24 15:14 ` [PATCH v2 2/3] staging/fbtft: Remove unnecessary variable initialization Len Baker 2021-07-24 15:14 ` [PATCH v2 3/3] staging/fbtft: Fix braces coding style Len Baker 2021-07-24 18:01 ` Geert Uytterhoeven 2021-07-25 14:02 ` Len Baker
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210731134303.GA1979@titan \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --subject='Re: [PATCH v2 1/3] staging/fbtft: Remove all strcpy() uses' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).