From: Tom Rini Date: Thu, 25 Feb 2021 08:24:43 -0500 Subject: [PATCH] cmd: pwm: Rework argc sanity checking In-Reply-To: <20210126164437.5774-1-trini@konsulko.com> References: <20210126164437.5774-1-trini@konsulko.com> Message-ID: <20210225132443.GQ10169@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Jan 26, 2021 at 11:44:37AM -0500, Tom Rini wrote: > Currently, we check argc in a number of places to make sure that we have > all of the required arguments for each of the pwm sub-commands. > However, there's at least one place where we've got dead code as we'll > never have argc == 0, due to checking that argc was at least 4 earlier > and having only subtracted 3. Rework things so that when we have > determined our subcommand make sure we have the right number of > arguments for it, or error out. This means we can stop checking against > argc again later. > > Reported-by: Coverity (CID: 316601) > Cc: Pragnesh Patel > Signed-off-by: Tom Rini Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: