Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751678AbdHPOO2 (ORCPT ); Wed, 16 Aug 2017 10:14:28 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:36029 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751370AbdHPOO1 (ORCPT ); Wed, 16 Aug 2017 10:14:27 -0400 Subject: Re: [PATCH] staging: fsl-mc: fix fsl_mc_is_allocatable strcmps To: Laurentiu Tudor , Dan Carpenter References: <20170816114451.1348-1-colin.king@canonical.com> <20170816120654.p3mpezb3zr2eqxvw@mwanda> <59944AB2.6010809@nxp.com> Cc: Stuart Yoder , Greg Kroah-Hartman , Wei Yongjun , "devel@driverdev.osuosl.org" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" From: Colin Ian King Message-ID: Date: Wed, 16 Aug 2017 15:14:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <59944AB2.6010809@nxp.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1302 Lines: 35 On 16/08/17 14:37, Laurentiu Tudor wrote: > On 08/16/2017 03:06 PM, Dan Carpenter wrote: >> On Wed, Aug 16, 2017 at 12:44:51PM +0100, Colin King wrote: >>> From: Colin Ian King >>> >>> The previous fix removed the equal to zero comparisons by the strcmps and >>> now the function always returns true. Fix this by adding in the missing >>> logical negation operators. >>> >>> Detected by CoverityScan, CID#1452267 ("Constant expression result") >>> >>> Fixes: b93ad9a067e1 ("staging: fsl-mc: be consistent when checking strcmp() return") > > Thanks Colin (and Coverity) for catching this! > >> Ugh... I did review the original patch at all. Sorry. > > As a side note, funny how i got the patch description right but not the > actual patch. :-) > >> It's better to use "== 0" because it's idiomatic. > > Agree, plus this approach would be consistent with the rest of the > driver (except one place in drivers/staging/fsl-mc/bus/dprc-driver.c +32) OK, I'll send a revert sometime today as that seems the sane solution. Colin > > --- > Best Regards, Laurentiu-- > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >