From patchwork Sun Aug 1 08:51:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Baker X-Patchwork-Id: 490205 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 182FBC4338F for ; Sun, 1 Aug 2021 09:52:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE855600D4 for ; Sun, 1 Aug 2021 09:52:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231464AbhHAJwi (ORCPT ); Sun, 1 Aug 2021 05:52:38 -0400 Received: from mout.gmx.net ([212.227.15.15]:51555 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbhHAJwi (ORCPT ); Sun, 1 Aug 2021 05:52:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1627811531; bh=2wkNneBgVy8D17kOJv1WptkFOFx7B1lNw8niqyN7lq4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=lCiEDO7esfxNSmSQtUQc7eh6lyfAkd5ZOwvPDcyPS8MQYmp8TNqsKAkfuyAv/leMX p2dDgieAGSxyvHrbYxDt5++YW6uJlLb98H1k9RI5py9epyuJJ24a8H90EGnSfWWn0K Ts0ltthd/kMyUIzndfe+PCcTpbbH+uVmgWK1mcuU= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([79.150.72.99]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MKbkM-1mSkNz2TG8-00L0ux; Sun, 01 Aug 2021 11:52:11 +0200 From: Len Baker To: Greg Kroah-Hartman Cc: Len Baker , Andy Shevchenko , Phil Reid , Geert Uytterhoeven , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] staging/fbtft: Remove all strcpy() uses Date: Sun, 1 Aug 2021 10:51:53 +0200 Message-Id: <20210801085155.3170-2-len.baker@gmx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210801085155.3170-1-len.baker@gmx.com> References: <20210801085155.3170-1-len.baker@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:3DBDs+sfwC8IiyfEd0c3v9UOisAbafQS6Js2T1gtq0wcmsF5j83 8qLxZYy5rn2cjuCG7PAv9TkRlCbaEL62aP2MawsHZhM7KBEuJZq1oB8yMHp6OldMFVTbR2D R1D0svvBp1nzlxlajhaGYOmFALUMOoq6DHdnuy17JGauSIK/2hoDicOyotL5vvjlFNt/Cny HR8WWsy468LRkit8AbEuQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:HKuE47COflc=:yESy/JNUZZefZ4o26Myjax mOvj9kIcubXwPKwLq2YDzJFAxuJ3HWUZ4h0f/6ft2e32x1vMgtHv0KL8Qhi3dvrQak7tDi5im TQsjyWX1VXZE80DnnFz9wccybE6SiDb32KhlqahCmCriofwTsP7YtBvSWW3bMQ20KaXyy9yL1 3RhHvTSb7Vt8oaQxZ62Su8D4s0mo5sqn/mSkgT9tfm0pQysL3uzWpGRF154n6omx3nqQil+CK ZU6lNRAcEIXfuaVsB3AWTsCWFCYdmEEO6+0mGxxWUFfDIZ/wc/OswGpr7MuASbDHONODMNpfN 4vwcZKyz/vmuJNKvlyEgpJcLdg3i5uWNxjuMp3vpUKlvIs3kr8O3V1u02mpNLvq6DYyIwOcbu SC9obBRVEPZOTnTURfjHNvmRkbmlOdsI5r0R9/Gf+iSPkZBn7jcXXa1NJGVQnB4I9A7WhdLlE QmLh67oIRbfO/k7iXJJIQIJbLIMjoe4LFANGKcrm3j7Nk9ylv0gqHUGozRC+I8qj//ntQBnCG Y1vbMwiLQqmoZk8516LVnWYa7Pq+tvJzKEnpIz4yAy3PzuVFra+r0eMKlWPq0f8mhO3r2gbam kzg/xFS0cmXb/ArmTvw+5sXZOoTc9AHj4RzBYQAu92e7/SsUibs3+rMb5nHP5EtHy7W7+6Beq 7FMjgy7JniYQHiyLDzWMoRq53UICksLLN3UHJ7TJakfrxTe5nKaBCwrVnYOmJTbxqB9I72jqZ YfqRM2MpRE0XFwSJSF61NBC6fI9++uBTeT05OKYXDQPBJVeQmZl9rKPYwc4VlzuPt9AtivozG Dsd6jroJ8ouxQ+tHDykAZ1491if96b0SRAqlSB92rJhk8FU15NKGN/om0fLteeZob2PK+C5Nt ApzVGzgFooGJtBhoAQpJrs0a6VddXAD8SYs+uvcwG4hGCc5hcRpNVuMVGz7b+NasF2BrffHXG NsUKXjT+bo4nOPMl/UJGo+VunjGYv3mYAEx/l9TV8v+XFvDY2erbRR+VASTpc9ACzDIkNa1ii isGUM8w0MH96M0CmdM+UakBJn7qwMDdPht8T0LiaG0TtuVw+rZGXPoFLeyDLeXGMF0ybUwkJf D0Zu409qxBwUkOaINBNYFjt1LYi2b3teArS Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org strcpy() performs no bounds checking on the destination buffer. This could result in linear overflows beyond the end of the buffer, leading to all kinds of misbehaviors. The safe replacement is strscpy() but in this case it is simpler to use the "%*ph" format specifier. Moreover, with the "0x%02X " in the sprintf followed by the strcat, the msg buffer (now removed) can print 128/5 values (25 hex values). So, the "%*ph" replacement won't cut output earlier than requested since this format specifier can print up to 64 bytes. Signed-off-by: Len Baker --- drivers/staging/fbtft/fbtft-core.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) -- 2.25.1 diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index 3723269890d5..e6286043bff7 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -992,8 +992,6 @@ static int fbtft_init_display_from_property(struct fbtft_par *par) int fbtft_init_display(struct fbtft_par *par) { int buf[64]; - char msg[128]; - char str[16]; int i = 0; int j; @@ -1036,17 +1034,14 @@ int fbtft_init_display(struct fbtft_par *par) switch (par->init_sequence[i]) { case -1: i++; + /* make debug message */ - strcpy(msg, ""); - j = i + 1; - while (par->init_sequence[j] >= 0) { - sprintf(str, "0x%02X ", par->init_sequence[j]); - strcat(msg, str); - j++; - } + for (j = 0; par->init_sequence[i + 1 + j] >= 0; j++); + fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, - "init: write(0x%02X) %s\n", - par->init_sequence[i], msg); + "init: write(0x%02X) %*ph\n", + par->init_sequence[i], j, + &par->init_sequence[i + 1]); /* Write */ j = 0; From patchwork Sun Aug 1 08:51:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Baker X-Patchwork-Id: 490504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA322C4338F for ; Sun, 1 Aug 2021 10:52:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AE50761054 for ; Sun, 1 Aug 2021 10:52:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231527AbhHAKwl (ORCPT ); Sun, 1 Aug 2021 06:52:41 -0400 Received: from mout.gmx.net ([212.227.15.15]:45969 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231470AbhHAKwl (ORCPT ); Sun, 1 Aug 2021 06:52:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1627815135; bh=zriJif4PDamXIhagKotUos6QWdK0gLBU/clgbZRaTUw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=Grt30lC0myWQWAeM9Lg6CfkGm+3a5Xjs0wiNekJpqxaVa/Ixzkc6NlDeYwsCZ1qVT Wv+shq3R7hdSWnN/3p0nT/RaG8dF6y/f/ylMP51yDrzssj8SzUkOvJIU7c/GRY1BCS 2NubWvcDLYR1hpmKyAx2k6CZ1BPEjiVBB3HWEcuA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([79.150.72.99]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N1OXZ-1nBh8136j5-012q4q; Sun, 01 Aug 2021 12:52:14 +0200 From: Len Baker To: Greg Kroah-Hartman Cc: Len Baker , Andy Shevchenko , Phil Reid , Geert Uytterhoeven , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/3] staging/fbtft: Remove unnecessary variable initialization Date: Sun, 1 Aug 2021 10:51:54 +0200 Message-Id: <20210801085155.3170-3-len.baker@gmx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210801085155.3170-1-len.baker@gmx.com> References: <20210801085155.3170-1-len.baker@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:/xptYz7ulSbAWUTKB7CMKJC9Pk/kJi9DY1dnZr5A98wFkmzSDYL yQz3oqeypUnZQq0rRJIU5mrD0jvqedIzHM1mPd0I4EyOROkJAxun8gS3IQi1k412yry6dT5 0O5yINMTRfTJM4Tcd/vVIjXLh/k+iPsbZ1HIujMDsn8Y9IigI64mzndr0SZMWrrESQ0XWN5 9BIN3xtoxSuYSgRimQAAA== X-UI-Out-Filterresults: notjunk:1; V03:K0:PeRB4HPzt1E=:WBgeVB7cfLOMJ4PTm+pzpA qEQHK671Sv3v2u8/3GUBPiRt3e8T5ImnhTGI+q2tpwEX6HYdF4USo9yaM/TrSr76AaTRsT5Hq WWpeJa/M8eFjiCyJIX1anaGrUCpXwNSvmaGH0/pnJhxwxgu7NNC0vbRoDZE/9BL38/jiqoct6 gS3O3i4xC6OGdoU4g/lxz1xc2wnlXrai0yuzsqiAUWs74YtZEGRJy08oYwXriruIj2F4ZOU93 0RdqvXIu8MPaNPL4thONnI6ceh3z3HxChXFEgWmkEbR/LMVYs99vqcUyZhdepmpv8Ckva00T7 ZEzIb/+VDFPYptjyZtu1qYm48WQ7YPyRNg8fszFBbF31KM2EBabbqlt5qixYFsAswkXHcVjM/ 6U5ZyLcrPHtc6w1FdAIOEhZM7mugdpOkIYNLUJLICZgBXXZimRv09dfbQGKbFzAgLZ/GIAOE4 kDzdAeUK8J12K+szniSP3GneTojgRx4lZ22tldIdI18toBE7UlNpZbTPTsIY7em3cBlXEPyaM +B/jlFVoQLS7B3B/PnVCFXqVBLtA8g2cyQjqC5TCl5+m8arpIEHhbjUDU9mAk5R2wMt8BtApt lJY4lAeqjPHNFBY/cqIsnLbTzWgfbet2jCVYIs/pRfClhMnyfPGbTst02Yns2yAoWOLiZYWJh PR8Y8FALU90ha6hmiweVsutYPQVW2RHLRYvvYK8rSqAWQHMuADLphobdBmEbSbePk7RC4oeH3 00aEYQcbWWODiFRW+XcCUyZh042g0DDmrmpc5YE6B26mUOF7obkXUn52KALvGp83JKdisaLhr cb6osQ78LzuoIEnLUi0QKAuUy15eIjZZjEUvhQLeCF7CAISs6vRSU0aVkC4/qG5PdNUA9FDGH xME5s/JejJQvwUUwMFi2MbJfcI3XsrsVWpccdND5stwAqKcR2F/9q+efpV7aHuA/wd/pccqf0 hhC9hOxKKdQZXvq8Sy7397FLLcGmCLcPaB4cW18oYueG9bTctvPnHNUNeLZb8nl3qTt43TS32 KExPM9Brb1QqzL0ndGbGcNZTweeNKTsKfMuC95MDim8tTjetdW+b0sxo5CeU6J41LKtGlOjlH vaQbVeNY1C3Il9oSA4u3RilfdNz5L7LeZeZ Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Remove the initialization of the variable "i" since it is written a few lines later. Signed-off-by: Len Baker --- drivers/staging/fbtft/fbtft-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index e6286043bff7..ed896049118c 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -992,7 +992,7 @@ static int fbtft_init_display_from_property(struct fbtft_par *par) int fbtft_init_display(struct fbtft_par *par) { int buf[64]; - int i = 0; + int i; int j; /* sanity check */ From patchwork Sun Aug 1 08:51:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Len Baker X-Patchwork-Id: 490503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00, DATE_IN_PAST_03_06, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CCE0C4338F for ; Sun, 1 Aug 2021 11:52:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6F3C9610CC for ; Sun, 1 Aug 2021 11:52:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231546AbhHALws (ORCPT ); Sun, 1 Aug 2021 07:52:48 -0400 Received: from mout.gmx.net ([212.227.17.20]:42307 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231461AbhHALws (ORCPT ); Sun, 1 Aug 2021 07:52:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1627818738; bh=BHpBlBtsblnIs/OJwA6XGXgJe+83P0AOEiqA8q2WIRE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=h3Bc4OUSQYi56YP3k2J0IBxGdnchqLmQTB9MED/FThcEr6zcFsUaQYnKqAafCQa9N yuBK72wKhmoUJjpF26wLPpSyrlQRnH5aU7ZpGIEf5aNWtTzBE9Q0OGtewjNGgDxp/2 qUFlkFYk+AXNsmyTXtClrXOBdzDYIzjBtR3FT5yk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([79.150.72.99]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mo6qp-1myNzd1r3r-00pbVB; Sun, 01 Aug 2021 13:52:18 +0200 From: Len Baker To: Greg Kroah-Hartman Cc: Len Baker , Andy Shevchenko , Phil Reid , Geert Uytterhoeven , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/3] staging/fbtft: Fix braces coding style Date: Sun, 1 Aug 2021 10:51:55 +0200 Message-Id: <20210801085155.3170-4-len.baker@gmx.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210801085155.3170-1-len.baker@gmx.com> References: <20210801085155.3170-1-len.baker@gmx.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:00bLwC3nTIERcfaw3w8RLsCAM6bKQNJn/2Riikz2relmlKOV1Yw jvY42DwN5uwXJdIYrMursuN/wyeAQKpGgiSZQZteORK4XiWO/UvcnqH3x/gGiplyFCdW37I SyYZrzLckcZtrsEdG1iiZrXmVwuHc/RbRbSpz5JJljwtmvFqGN1d1bbw+YCshZMjvGFZhFf StEa5y22VGAxN+NKU4DNQ== X-UI-Out-Filterresults: notjunk:1; V03:K0:gejn52mgomc=:Vq+HxXHUC5KqWu/o5rVdmq jeGZYOeg4pvjQq1RlkTLUxd0FkOZuBTXMPdslWSwZCV+ffYGCsUzMu087YwshlgrwE8jJlUzb TaZ/fItIyAzf1y4HVmUNoAG2e8rO2T1+mwfEQI60TTt5rEjL79Oul5lSmg4pjshPwnWEkb4TT SdPEE8UIL+nHAaYrqeS0Z0l6UNnQ0+Ka+9GrqNwNJvLDq971Z+SmwFNZ85YRTvKsIge0iHl6E sLcrKro+C+uijA+qAZoyNvs0v1tKq+XwO86nD3jLLFfRqeoHaHtxz6Wpb8hbI1pNGRbaHA0qx BZcXMuyX8uiyyfmrn11JzvUfikhLeNUvClRLqKEabUOm8v05KkvI9yUOERkmPfMQlL1Y8a0fH ZtvqH4SpM9Y7y5XbSPBIKiFm3IcFCS4gGTJvsscFooEzSQNXKfn83QYeeTK5uDzxzPv8PeG2d pK1/sZWHKdGJgNbgoowShvtAcqC/wvJc9w4VFwW0W44M0QOUqgZ2r83SXfUMTpBYAFQtt9Yiw 2vDc3tpoKnp4hyk6zb1x9gkSRX/7t5CJl60iDYCKlTOBVyrR66VQB6sc8rM3z5VoVkbm4EFzs q6Z+2Osz3+l7goxVZTzxJyoHW/BjukS7d/oVrntIgf2mWNTl9+nDqAbai9L5Q6FNtXXNepn4j I+EhtpBI32jDTEi85W6eaDe3n8dfQgalTgDcmMwoy8ONBydqOwj1hRxcd/OD1iVWWjVFjv1rn raP78nUWWhqj4LHac+mlP+JuxurPE4kuLxBNla+J7CveMEF39u720QBgCS01Qw7q3DkBM1kFn 2tR24z1n8UuLwl2+WJOO+HKZ0dgwh10E1PUZqMxJmEXu/+d195MXM6br/3yJKit2a1HwrE8Ef f94Bhzn6/Zd30A/1GaEKz4fMfivm6/IU/n+GHOQy7D28UzidDYV9fAVowONA+1uEmKKeUYu3v u5dhUYekGf3rXaQzNIW6829uEMq60XaReZ4/PuPwDaTvinmg+0FMhPAGF7hg2xUVqgrP1zSl+ D2jJPRL3DKzSbA+jXOuNW2RbGrMZW+41vvcwQ/1t8BfRdwInR+2vml9xtTJvUgXDH/t9cNZrp nWZ4r3uWSdeaLzAGcCk04st5XXbKcFleD9T Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org Add braces to the "for" loop. This way, the kernel coding style is followed. Signed-off-by: Len Baker --- drivers/staging/fbtft/fbtft-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index ed896049118c..ed992ca605eb 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -1003,9 +1003,11 @@ int fbtft_init_display(struct fbtft_par *par) } /* make sure stop marker exists */ - for (i = 0; i < FBTFT_MAX_INIT_SEQUENCE; i++) + for (i = 0; i < FBTFT_MAX_INIT_SEQUENCE; i++) { if (par->init_sequence[i] == -3) break; + } + if (i == FBTFT_MAX_INIT_SEQUENCE) { dev_err(par->info->device, "missing stop marker at end of init sequence\n");