Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp4215903ybl; Tue, 20 Aug 2019 08:36:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqywbuGpP2W3DFc6aLJRyZrKf+qAfwfZSoHTWM3BjYOXEbOgNprkGkk+HVwx2W9T6L9YtL2L X-Received: by 2002:a63:5823:: with SMTP id m35mr25738589pgb.329.1566315370084; Tue, 20 Aug 2019 08:36:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566315370; cv=none; d=google.com; s=arc-20160816; b=R3Xmz2bkezfuQuqW1vy9wyX852g1cIbZ676OVMk7fL0uW2uUidFao2lvXtG63RJViG S+1dkNLGRT5M+XkZKVii04d90bxVFJN/1FYXbrPgkcqcprMlf4hSnlbwE9W7b8JdOvrZ IrkOtSM6OXoz1ux9wACMTLuVKITdaQsR8EG42XXF0gWO1LMzkj5YguF6kLIvpfiFDsf1 I/8d0mvq00quSh0+6/3KLte8R5YeVAuGakiXUxndJyywCojTlqlL/jbtaZCk3yn0HYpg 8C9ftZGdsHopS/Tp0114aCkf9akMVeov5TmltPedqLGg4nERE6G7dPrbYVVpaxWVp2kp /PLg== 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:mime-version :message-id:date:subject:cc:to:from; bh=Zvw+QlyWkLdJGokcrDj9WxfmY3yOSTLcXQTLxylEMCU=; b=ehq0ZSl2J31jm6n1NZocI+C2I+NkrV+wwk8Ycwmr8y0hTIFWCdVVZSQNSAdHOU6rCs qRJQs0BGW+jM4vspQPfJcufiZKN5DBvOJKFEvy3Ot4x2voC4xSc9yGzqXuGmf36oc7/r Pv8kHGE15MMSWlIpLdXd62u6FMwnKnDtkPf3B57HL//4fwDNtV5V1DtPU5TL65L+NBwY I53mIhQZIJmBUBBtUjuiS8+V4nJRTESeSS4ldPSBBydTxqBb6+YsfQkm1g878PNt6gyZ qqvnWlLZDwVah3RvzNM9Tu7iCN3O22qhDGmSnCqmYtcsKrBB8QL4UOxXwlMSFmedsS0l Izrg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25si13280337pfd.157.2019.08.20.08.35.55; Tue, 20 Aug 2019 08:36:10 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730613AbfHTPe6 (ORCPT + 99 others); Tue, 20 Aug 2019 11:34:58 -0400 Received: from sauhun.de ([88.99.104.3]:37450 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730204AbfHTPev (ORCPT ); Tue, 20 Aug 2019 11:34:51 -0400 Received: from localhost (p54B333DC.dip0.t-ipconnect.de [84.179.51.220]) by pokefinder.org (Postfix) with ESMTPSA id 93A542E354A; Tue, 20 Aug 2019 17:34:49 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Benson Leung , Enric Balletbo i Serra , linux-kernel@vger.kernel.org Subject: [PATCH] platform: chrome: chromeos_laptop: drop checks of NULL-safe functions Date: Tue, 20 Aug 2019 17:34:49 +0200 Message-Id: <20190820153449.7866-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 2.20.1