Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp628843ybl; Fri, 23 Aug 2019 06:10:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqw2tHePr9cEq8JUQiL++GfEtPODJpUkePodYO/Hin5XthkAiiDBA9epbji59VAZBBgV2zpi X-Received: by 2002:a63:b919:: with SMTP id z25mr3857246pge.201.1566565858872; Fri, 23 Aug 2019 06:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566565858; cv=none; d=google.com; s=arc-20160816; b=PTfZW+y4P6jpXKxF2FwthIw0Asvf2G+B59lB65hRupnVntzU9blBfSUrwj9dvu4/Ea 0db9cxHRt7Xqf5m8/itgmzNQVhb/3pwFV39ngbAhkgVB1zOC9sU69YljjcpkdmqCeUgW 5kgvWYVckQVZFlg7FiHuMTSiEpflWj/6wnM3c1G1e2lgPKJdrCBHGkHtBFDbMnFgNLgx LDCeX26SjE53COLScaxyYYrrtqSDGCxPZutJDvPyfKobPoS5u5mdxgugUFmUMSlmozvT 7INKvSjYWnA272jeOnJdG2tVK/RA0fjBWobSq8GBe8WyMTCvzn25eu2IssczEQtEIpU9 lWig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=aRSOYmM7tsMf1QdHbKVJHD/qRAI0vwoxgsOnTWeXDSU=; b=NHW+FjKNS4hI2T0tSak3r3QLJyeFKucqrnrAUOOX1NKfopaZcOmLe5y9+7rYbx8A/l IXwuVpLhCAtrr529BEDQivOSDyuCWwwQOYxrVPTtyzdYPnfvafkMn0vj9VWlfo9Mac9o VzKjr0zQ6pQJyApXUCgwQD/BsOZv2akm+vS0lmN8Vl5MoErCwRsox9nxkz8pTjp5FXt9 LcCG5Pn4rsWu4esUPk/dKVAxcKoqzT9Zwm6D4Fmzp2c8PjoalfjAv0pIvr4968bN/3xi fhZHoLvVC3xQznH901YS3NiW0uMxjoLP0PZszC9hup2Cs+iuoDikEUqOC9JUSaDwDOxe VmHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d15si1962135pgv.90.2019.08.23.06.10.43; Fri, 23 Aug 2019 06:10:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390834AbfHVTlf (ORCPT + 99 others); Thu, 22 Aug 2019 15:41:35 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37782 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731942AbfHVTlf (ORCPT ); Thu, 22 Aug 2019 15:41:35 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id C0F0428D4C2 Subject: Re: [PATCH] platform: chrome: chromeos_laptop: drop checks of NULL-safe functions To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: Benson Leung , linux-kernel@vger.kernel.org References: <20190820153449.7866-1-wsa+renesas@sang-engineering.com> From: Enric Balletbo i Serra Message-ID: Date: Thu, 22 Aug 2019 21:41:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190820153449.7866-1-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 20/8/19 17:34, Wolfram Sang wrote: > No need to check the argument of i2c_unregister_device() and > property_entries_free() because the functions do check it. > > Signed-off-by: Wolfram Sang Thanks, applied for chrome-platform-5.4 Thanks, Enric > --- > Build tested only, buildbot is happy, too. > > Please apply to your tree. > > drivers/platform/chrome/chromeos_laptop.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c > index 7abbb6167766..8723bcf10c93 100644 > --- a/drivers/platform/chrome/chromeos_laptop.c > +++ b/drivers/platform/chrome/chromeos_laptop.c > @@ -838,18 +838,14 @@ static void chromeos_laptop_destroy(const struct chromeos_laptop *cros_laptop) > i2c_dev = &cros_laptop->i2c_peripherals[i]; > info = &i2c_dev->board_info; > > - if (i2c_dev->client) > - i2c_unregister_device(i2c_dev->client); > - > - if (info->properties) > - property_entries_free(info->properties); > + i2c_unregister_device(i2c_dev->client); > + property_entries_free(info->properties); > } > > for (i = 0; i < cros_laptop->num_acpi_peripherals; i++) { > acpi_dev = &cros_laptop->acpi_peripherals[i]; > > - if (acpi_dev->properties) > - property_entries_free(acpi_dev->properties); > + property_entries_free(acpi_dev->properties); > } > > kfree(cros_laptop->i2c_peripherals); >