Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7223703rwd; Tue, 6 Jun 2023 07:56:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zSMGvGsAbpPxkHH8e3yIUhPWrxgdS9QUXkXVlEH8Jwarrg3j6t2bCAnPRyytGAfibf+AT X-Received: by 2002:a05:622a:1492:b0:3ef:58ac:82f4 with SMTP id t18-20020a05622a149200b003ef58ac82f4mr2816790qtx.38.1686063380079; Tue, 06 Jun 2023 07:56:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686063380; cv=none; d=google.com; s=arc-20160816; b=O9tLp/mL0pkhGhrtuNx9G0oI2BzrKc70t9Lq3PlF9JtvWaKBEkzxxZA5ruP/SguTaT MDashvP/NL0cxON/UBqHGXcKR5ueQq/iXUNfYn9PLt7e3tr/9uHuFYwfcBu7Ll9u+j+W gQs21AfQK2TAJLKg4r7gm0f/tP+6JL6uaOE69916R5hMSoXDb1xj1sspu+t54oD6TS6D rrAquEH/aXquQ/iMZrFwd5n6BRsFvB8xTtoZYT3FwSJz5K18Q5z+37/sQOVIwhsGDBVS NzVEQqdHvh2MmLmy/flIuYeHutfpSifQIpZ+kMKT+svsmZaekVTy37A8HuwYvoId8hFh qfUw== 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=lvZ4XsTsTufzOmDccsqLlYK7JaxQyIdNHpPkr+8WCVU=; b=tKvfZ/kdX6+EQl8g8evcs2U7tsMr8vGz4JZTn0z5gZO//Wzl4VbzTtFphMqllh/AOR VM6fCEhFBcCiW+ZdvWpUYAhhrVw8VUMUjyzN1ORbUhrnsCZRKgOEcipq9BWFJ4utZ1qC xwa6SwwMKyOMly0oaHIoH8Vj3317yVgkRYdpeZyWWjfoDMWAweTf8753pwgVskNeSgQ7 q4RjNHEreV4tR3U6qR9JBDeZFXczV5w6QMGef6vCvlpVqUD+0yRVqtaheu5858ShxjPt 8J1M6LMvIWseptYIgMMwry8DVqXzaQt64BtMNi5Di1rG9NovGLpyy/0TxZw6JUjeIrOM P+5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=dbsKKzlS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020ac85cc6000000b003f21ee89806si6368736qta.700.2023.06.06.07.56.05; Tue, 06 Jun 2023 07:56:20 -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=@gmail.com header.s=20221208 header.b=dbsKKzlS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238424AbjFFOmd (ORCPT + 99 others); Tue, 6 Jun 2023 10:42:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238340AbjFFOmT (ORCPT ); Tue, 6 Jun 2023 10:42:19 -0400 Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4756E1FE0; Tue, 6 Jun 2023 07:40:16 -0700 (PDT) Received: by mail-qv1-xf34.google.com with SMTP id 6a1803df08f44-6260e8a1424so43329276d6.2; Tue, 06 Jun 2023 07:40:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686062379; x=1688654379; 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=lvZ4XsTsTufzOmDccsqLlYK7JaxQyIdNHpPkr+8WCVU=; b=dbsKKzlSqCxKNp0/8WqjVhH0METcILEAuzsthzhm/cPsREUocAj7XviIGDyr3X0a/R 3mwLkv0bs09MK66ezSojrCwgtaGqClR/TWa4ba8m+VdPuaJsG4a48TreBWjRqKRDb78g dWWAHowWoODwiV983zWmKsrqLxWsKOwS3PEr831YQX00EhiHGYdz7Q7BjLJ9D6g0tSX8 smWJGLG09JprEpKEN1AE0oAmIk2XO2t8DLOSyNDb9jVvZrqbbnecERzh6rMDawRxJ5jf 047Hn+K5ixMP8ou6gMxuBqiODDshPfYOqfM7WUSJ0G/tODZIZA5Ry8w4ijazb/U1eS9H cI6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686062379; x=1688654379; 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=lvZ4XsTsTufzOmDccsqLlYK7JaxQyIdNHpPkr+8WCVU=; b=ZTv5emT4vZ7u0hrUdNQRtNjj+su37t7WXcTK/h5X7YApJIlui86pz8KwB1TpGNmh5N MnDfUTTLmAhT4y+cwCIgIUjaa1DUtmbgassPVRjcA87nJXl2N1mo6HpCrdQSO1b7ZwQk UVTU99DJbM1r0u4SuKo2CBivtOir7jX5rRgfxp4Q9SUjbMB5R4wQ/pkuAljC5Nk2fdrp vBqwrGvohX2phDrgt1mSZXWu5qFbWZLBuMF91LhiWX6faZP3zfx+r/0hamSL/YQNdluG 8KwwuCL4gCN5QSHpOH28S1A10F04KgPb6KY80EYYs9K9QQZd33aToN+1y1UEwwsy3aFo 7Q5Q== X-Gm-Message-State: AC+VfDwzJPWdBSjm+RwBeHkjVYXRm+fztyjC38pPyaWzXSoCTSE4G0A2 XJn8ZPBR/C/hRnAOqPxe7d6wgbmO3iw3caNgHBU= X-Received: by 2002:a05:6214:401:b0:626:2870:7dee with SMTP id z1-20020a056214040100b0062628707deemr2664588qvx.42.1686062378686; Tue, 06 Jun 2023 07:39:38 -0700 (PDT) MIME-Version: 1.0 References: <1685277277-12209-1-git-send-email-wellslutw@gmail.com> <9ace5c4c-5e17-4207-5a02-6a47ba0aee22@web.de> In-Reply-To: <9ace5c4c-5e17-4207-5a02-6a47ba0aee22@web.de> From: Andy Shevchenko Date: Tue, 6 Jun 2023 17:39:02 +0300 Message-ID: Subject: Re: [PATCH] pinctrl: sunplus: Delete an unnecessary check before kfree() in sppctl_dt_node_to_map() To: Markus Elfring , Bartosz Golaszewski Cc: kernel-janitors@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Dvorkin Dmitry , Linus Walleij , Wells Lu , LKML , cocci@inria.fr, Wells Lu Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Tue, Jun 6, 2023 at 4:26=E2=80=AFPM Markus Elfring wrote: > > From: Markus Elfring > Date: Tue, 6 Jun 2023 15:00:18 +0200 You need to utilize what MAINTAINERS file has. > It can be known that the function =E2=80=9Ckfree=E2=80=9D performs a null= pointer check > for its input parameter. > It is therefore not needed to repeat such a check before its call. > > Thus remove a redundant pointer check. Seems reasonable to me. FWIW, Reviewed-by: Andy Shevchenko > Signed-off-by: Markus Elfring > --- > drivers/pinctrl/sunplus/sppctl.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/pinctrl/sunplus/sppctl.c b/drivers/pinctrl/sunplus/s= ppctl.c > index e91ce5b5d559..150996949ede 100644 > --- a/drivers/pinctrl/sunplus/sppctl.c > +++ b/drivers/pinctrl/sunplus/sppctl.c > @@ -971,8 +971,7 @@ static int sppctl_dt_node_to_map(struct pinctrl_dev *= pctldev, struct device_node > > sppctl_map_err: > for (i =3D 0; i < (*num_maps); i++) > - if (((*map)[i].type =3D=3D PIN_MAP_TYPE_CONFIGS_PIN) && > - (*map)[i].data.configs.configs) > + if ((*map)[i].type =3D=3D PIN_MAP_TYPE_CONFIGS_PIN) > kfree((*map)[i].data.configs.configs); > kfree(*map); > of_node_put(parent); > -- > 2.40.1 > --=20 With Best Regards, Andy Shevchenko