Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752028AbdHPNiE (ORCPT ); Wed, 16 Aug 2017 09:38:04 -0400 Received: from mail-he1eur01on0075.outbound.protection.outlook.com ([104.47.0.75]:22606 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751738AbdHPNiA (ORCPT ); Wed, 16 Aug 2017 09:38:00 -0400 From: Laurentiu Tudor To: Dan Carpenter , Colin King CC: Stuart Yoder , Greg Kroah-Hartman , Wei Yongjun , "devel@driverdev.osuosl.org" , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] staging: fsl-mc: fix fsl_mc_is_allocatable strcmps Thread-Topic: [PATCH] staging: fsl-mc: fix fsl_mc_is_allocatable strcmps Thread-Index: AQHTFoUUw2JTmY1vJ0KwoPJTJI8BY6KG40IAgAAZbQA= Date: Wed, 16 Aug 2017 13:37:55 +0000 Message-ID: <59944AB2.6010809@nxp.com> References: <20170816114451.1348-1-colin.king@canonical.com> <20170816120654.p3mpezb3zr2eqxvw@mwanda> In-Reply-To: <20170816120654.p3mpezb3zr2eqxvw@mwanda> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=laurentiu.tudor@nxp.com; x-originating-ip: [192.88.146.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0401MB1854;6:qaTGROBfsMmXz+qr9B2tVXvjIA/YPX5DD/xbmsh0uu6WAu0JtTDDsyrKo/euGvky7Z2MmqFEe0qWpx9WcnrKiJG9rGUXPtC12Mm9WUreaQNDvPLh/wqyEaqZOTq3LGbtAjzJOpWgC19QTgQkAouq2o5oSrKXWlvJf66E5CcxFx9Wc1+IwoNwulYyd3cEZNfNbkUGJsWyTFaoHo91jlnbJXCj1Fcp/7nG5FFezWPHLpWOUJXMaKh6V8yCHNj6q6cPh9Mfe7OlELo/kVXfTpoGfhUZFcGn6w1/JJ4dya+VnwgG1nSfWMhb3Gj8IexIHbKrcZXNy+zL+bGDSHAeLCWrxw==;5:uzYTY1vReNxT1mR7qPbJDKeal77VIqg1tjTzOGRSdRj7XcriICsRUR8GuzZ/d2spagiJpdrOqQDFHh1KbLVtkL6VsWKYjWgsnR8YxmxnnnOuyt1wbqakoo7rrKsx89Dmt+tNiWq9JZZME/EIuFqQSg==;24:KQepenVdWgn/O5PrI8eua+i53mzwcDGfnfv1btKbDh/5ptv20EkfLq+MQWY6wdh8i9A64ZrFxafo6kwIe4OrQ955M0xzSXTAUmMbdK6lFZE=;7:2oGEOzY6zzF20Abf6SRNzYvyUxdTAxy2+oh9jRB6gfdRWN4cuqSekOgc75LxMF8c7byEu9k0tZprHNE0h9obl2db3ojFuB+RIBPGUrHRxQzzpBKOKgLhTX3eBDFi3QnCEy27k0LRmc35zKxMPteB4fay0hTJpQzQubyitSvfak1cs66qqaOMxypSFGRlOfeYx3cjF1dC7snEga6W1mppOKNdGZCJRtNknvcMvAFVSRI= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 37de527d-0982-4765-bd6c-08d4e4ac0095 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR0401MB1854; x-ms-traffictypediagnostic: VI1PR0401MB1854: x-exchange-antispam-report-test: UriScan:(198206253151910); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0401MB1854;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0401MB1854; x-forefront-prvs: 0401647B7F x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(189002)(24454002)(199003)(377454003)(6436002)(6486002)(53546010)(99136001)(68736007)(33656002)(4326008)(478600001)(6506006)(53936002)(5250100002)(3280700002)(59896002)(3846002)(102836003)(25786009)(6512007)(105586002)(81156014)(7736002)(81166006)(14454004)(6246003)(2900100001)(101416001)(87266999)(54356999)(50986999)(5660300001)(76176999)(6116002)(2906002)(8676002)(305945005)(97736004)(8936002)(229853002)(66066001)(36756003)(86362001)(39060400002)(80316001)(3660700001)(2950100002)(54906002)(99286003)(189998001)(106356001)(65816999)(129583001)(17423001)(156123004);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB1854;H:VI1PR0401MB1856.eurprd04.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="Windows-1252" Content-ID: MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2017 13:37:55.9684 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB1854 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v7GDc9PJ013637 Content-Length: 934 Lines: 26 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) --- Best Regards, Laurentiu