From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F41CCC4167B for ; Mon, 27 Nov 2023 08:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232603AbjK0IyC (ORCPT ); Mon, 27 Nov 2023 03:54:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232664AbjK0Ixz (ORCPT ); Mon, 27 Nov 2023 03:53:55 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5344BCB for ; Mon, 27 Nov 2023 00:54:01 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DD9EC433C7; Mon, 27 Nov 2023 08:53:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701075240; bh=YsSjMoDjG9d/dtc+Vhmds+9B8Q2fIcClNqcZlZ8pY5k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XZO4aOuXMP25TUfZbPx+yFAKcQtLr6eNyPYziWmgX5qhff78Uu3JuCLjHuCuNJ+Xy RfEhPzFygaSnA6G35DSp29oMIoXGDRfYPKnT0BgIJr8Ba3QRIJAum7/c+wYVHrzKlx CpP1r+v9aLU24TlYw7E5BGUGZBi/HR+wr3+6oj6KAmW7+rJXaUqCFrmXIDjZbABdB4 FI0UEPG64iSheuHpJGjrrfFPrT4uuGBGnRwjn7uVdR5Le602is29JplScfEwnoKbe3 Wgt9oOLs3FIJaULAtPgEgqjiRWTBn9Q+SbB+k5/TBs2/Fvv4ZHX/OvmCT5lBlVqH6t ENhCRusee4XKQ== Date: Mon, 27 Nov 2023 08:53:56 +0000 From: Lee Jones To: Andy Shevchenko Cc: Jiasheng Jiang , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mfd: intel-lpss: Add missing check for platform_get_resource Message-ID: <20231127085356.GD1470173@google.com> References: <20230609014818.28475-1-jiasheng@iscas.ac.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Nov 2023, Andy Shevchenko wrote: > On Fri, Jun 09, 2023 at 09:48:18AM +0800, Jiasheng Jiang wrote: > > Add the missing check for platform_get_resource and return error > > if it fails. > > > Fixes: 4b45efe85263 ("mfd: Add support for Intel Sunrisepoint LPSS devices") > > This does not fix anything and just introduces a duplication code. > I would like this to be reverted. Should I send one? Checking this value at the source of obtention and providing and earlier return with arguably a better return value, all at the cost of an inexpensive pointer comparison to NULL doesn't sound like a terrible idea. If you were committed to the idea of removing it, which I suggest you reconsider, I would insist that you replace it with at least a comment. -- Lee Jones [李琼斯]