Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp793369rwd; Tue, 16 May 2023 07:49:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ44gxbAUC2sj5XbYgQ3+noJ3lfJO94cgxERLJL3MMg9Q9ZtObx0fYsNiZnH006XRtMOLm92 X-Received: by 2002:a05:6a20:3d87:b0:102:b3b7:6c5b with SMTP id s7-20020a056a203d8700b00102b3b76c5bmr25750719pzi.2.1684248593376; Tue, 16 May 2023 07:49:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684248593; cv=none; d=google.com; s=arc-20160816; b=pf8h8uy0H6pnDrHTqhazCAt56AChG15XsdR+L8LA+DVrvj+e4PWv7cUpS7AfHYvpWp NfboIYs2Y60nA77H9MDbt1LFNBp5IVb4Aqo6Svw0H2RtYZyyQBRv0K726eAmlrSiQ+fc wN1XX0Pz2+YwW+FWQ8mJi2xBtSm61hdcf3b97jIYKTDCvGyIdhVv8QKBz795ZXt83cp7 DwzOVzldNTpon1TAn8nWZ3nY7144RkW+1pngKGDqmX62G0/aqT4KqE1bOsDWOEDUEISf LSJnCneraRAqwnwR771bPauIAYVvRyGDMFkUON+bha/i3kxTcLvZ4uMZzyOXdVTr7/8T HL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=xgs1T+D3BnF9rZPvYtr/6djf/K6Fti2h/uEggWBDOQ8=; b=iE7j5AAnaM9QOzS+F9fHWwhSEX6z1vBgS2tNc0sdDl2Er19LpQ4F9jqQXVPyLibQJ1 3MwqaetaFmCbW46n6QsC2DbHf+7/y9RI1oUlqpOUYkKQ30NL8jhyljZCBoyFyvbITWN0 dxI2Z8/LpFQNsdcux/8Huk55Q/UwojuMY2vwq95GB3h/xjmTuTfJmeNackxUYyY1WsLY NjSiAGnwrDkoN41i/dMw7C9Qbm6SxyWKr3cO5xDMdWtO3Y2IobUnM8fIyNj3wEWsPVeh tv77PdM8RvQyd7acqjEtA7kR8QF/2P2vTWLNkGa+7EBTN9WgWTuEd2nATN1ndFp7bNXo uzrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Ao3ee+hO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s127-20020a637785000000b005309c3a0b82si10608913pgc.660.2023.05.16.07.49.40; Tue, 16 May 2023 07:49:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=Ao3ee+hO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234026AbjEPOpl (ORCPT + 99 others); Tue, 16 May 2023 10:45:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232526AbjEPOpi (ORCPT ); Tue, 16 May 2023 10:45:38 -0400 Received: from mail-ua1-x92a.google.com (mail-ua1-x92a.google.com [IPv6:2607:f8b0:4864:20::92a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F079E7EDD for ; Tue, 16 May 2023 07:45:31 -0700 (PDT) Received: by mail-ua1-x92a.google.com with SMTP id a1e0cc1a2514c-77d049b9040so3938273241.1 for ; Tue, 16 May 2023 07:45:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1684248331; x=1686840331; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=xgs1T+D3BnF9rZPvYtr/6djf/K6Fti2h/uEggWBDOQ8=; b=Ao3ee+hO+FQ/lXtOVQhIqKzbCJ+HwLYtVgALF4JWBCWHsS3WnL2fjmjkgKYSs6gcGb 3L8SobB2/kujgBt6bQOVY07F47JbMU2pzlqYiQ2XFw24q/PigIki8gOM3O4nAmjtNLXk 7ae3Xsn9eYkoR175qcRTb+rZ1PmXlwNA/jhdbsioE80zD7wzTh4Pb+VlRwr5ykvwxs2X +wexPTgtLXN9ohq0+/3VVq5WXvXpURKXPgL9G6aTGc0Vjk60QDt8Yznuic2RCotMTTnq JhafM6N4F+jrC9C0bnIq8nMoWaOfd/IfVOsOWWFfLS6T5fCeAmGK9phqkuPR5utJ1M1G VFMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684248331; x=1686840331; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xgs1T+D3BnF9rZPvYtr/6djf/K6Fti2h/uEggWBDOQ8=; b=KuEc6TFvGxN6nnNh+Xojse5K5BJxOpzOuNGKjGNQ/ftMIA6YKc+nIsVRfAOH9odq72 aUMMehi+U4Yqy+bmaq2njEKTjmOlrkvjFiMcNAFnr/GTg/J7IxxgJ5TjPjpo2yPYph1c eiq+E/EEsn+G4fYxAa2Xp6U/8Rf3nifT6qzU7mentyxr6fe5dbpYLh6OAOKUTtI4yggB FmZ/PSWjXmFfSIxDXgjEtdBT4eTrTgktPAmut+btCdrB3aUyIwtlyzggV18igRA9Wsvn 8EfTH/abk/ihUPuUwXN8484dXH8bKdB6JGzzDJk24YrOJOr6ZU01huXxQATtDOYjsq52 xigg== X-Gm-Message-State: AC+VfDwr3MLCBWwdELX3QlZhZ0R2D3K5ZIjbGtA0VPDXzoTEu5dPLQhI LJDGSUUhalJgyY3fMtNPjzNzPKfuo1b1oqw8hI9fMA== X-Received: by 2002:a05:6102:3ec1:b0:430:13cb:8156 with SMTP id n1-20020a0561023ec100b0043013cb8156mr16365539vsv.13.1684248331119; Tue, 16 May 2023 07:45:31 -0700 (PDT) MIME-Version: 1.0 References: <20230515175042.495377-1-afd@ti.com> <20230515175042.495377-2-afd@ti.com> In-Reply-To: <20230515175042.495377-2-afd@ti.com> From: Bartosz Golaszewski Date: Tue, 16 May 2023 16:45:20 +0200 Message-ID: Subject: Re: [PATCH v2 2/2] i2c: davinci: Use struct name not type with devm_kzalloc() To: Andrew Davis Cc: Wolfram Sang , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 15, 2023 at 7:50=E2=80=AFPM Andrew Davis wrote: > > This reduces chance of error if the type of "dev" changes. While here > remove extra error print out, this is not usually done for memory > allocation failures. > > Signed-off-by: Andrew Davis > --- > drivers/i2c/busses/i2c-davinci.c | 7 ++----- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-da= vinci.c > index c55bd937def7..135f76593e6f 100644 > --- a/drivers/i2c/busses/i2c-davinci.c > +++ b/drivers/i2c/busses/i2c-davinci.c > @@ -767,12 +767,9 @@ static int davinci_i2c_probe(struct platform_device = *pdev) > if (irq < 0) > return dev_err_probe(&pdev->dev, irq, "can't get irq reso= urce\n"); > > - dev =3D devm_kzalloc(&pdev->dev, sizeof(struct davinci_i2c_dev), > - GFP_KERNEL); > - if (!dev) { > - dev_err(&pdev->dev, "Memory allocation failed\n"); > + dev =3D devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); > + if (!dev) > return -ENOMEM; > - } > > init_completion(&dev->cmd_complete); > > -- > 2.39.2 > Reviewed-by: Bartosz Golaszewski