Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp39695pja; Fri, 22 Nov 2019 03:10:29 -0800 (PST) X-Google-Smtp-Source: APXvYqyVFk/zTa8IV1z6VOwuRkAXdxZOJGhYqfC0AbYDSeFTF5cRW+yoQsiJkcGe5ilpLQtvOd/L X-Received: by 2002:a17:906:6043:: with SMTP id p3mr21661005ejj.103.1574421029650; Fri, 22 Nov 2019 03:10:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574421029; cv=none; d=google.com; s=arc-20160816; b=iHkT1wqbnzp2wzl/RV0G5aeSIRQhBxa84rHpYgfDdhxTJCDy3EuIYapQ5cfVcBK8IW bZ6FbEKHPrM7McOlVJSTeWPaWgZtl8dikmfI4ZcRK6jnw7yP1hDpNJ+3Sfxe1JVIYX3i uyntinaFg9zuj7PvAWlZC+cZmmOl21Ohpd0nypHpGXnnnmLxysi8vtdPoIEpC7GhW+IN pi8NO/JRWcLKH5xbI1hfa1ljPiM8kkpYJrVeYuW0rlyrWdVCdrWVOFN4X0KV0p78WHT+ MwKJj6YZBRAHZo5pkDLouyCoLIDOb/zEX5V2OCpmW+A2A8STM91AFfCuyQAQeHHm2KKU qzsg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C407jHLMOxX+2P242tPgCmfZShnaGxhrzvFQxGxwJpk=; b=SXH0MUxJm8hfM2hlOJd3BAbV5eJXhyswT0VtwR0gaoxA6ozGAu7LCFmmvbxQhWbfgd gLnWMHVgyJuMR8Ghpop2b5lMEubnu+PnxtnIZ6taY0l6UvhdFm0GZy2R6YaOAYoJrE/W x7ytDqesSpsKhvl1js6jTnyO3ThoyeRiwnlR/GTDcWoAycN1sZM3lIYgaV7RcrLEXLET rZbNGlr7kYghVpCLMKLevw9L2/5L67byqP+j8GNqT3dWjqFUGwEB8H3bAdXFxAGQw3Nc jqaA8AYnRJdGBpYLgM0OpslYu6U+ifW3S1pWQaMpntwgZNAflKx2KlRTUzZKiV3qlhVC poqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=a63Hclo4; 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 r17si430203eje.139.2019.11.22.03.10.06; Fri, 22 Nov 2019 03:10:29 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=a63Hclo4; 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 S1728368AbfKVLHq (ORCPT + 99 others); Fri, 22 Nov 2019 06:07:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:33210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731728AbfKVLFg (ORCPT ); Fri, 22 Nov 2019 06:05:36 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D6E1220840; Fri, 22 Nov 2019 11:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574420735; bh=julWjBlCYWiwOVW4slF5Jvmglxdu1fcIEx8uEPF98IM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a63Hclo4I0spReMkO8ztfeiAHkFPxaq5YwcVPF1Xd/cx8lCyqrI2e/i6sD2DrHrCm cDBJO0wvUheAH+W4Al8Z3WIFFNXbdR97pEetPJip4FiDOcz7Jfxc3co5fsxTSaa2eh 3oNdIHaGTf+aJFwAMXtZu9cyJvtIBzC+kaJWwVw8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Daniel Thompson , Lee Jones , Sasha Levin Subject: [PATCH 4.19 171/220] backlight: lm3639: Unconditionally call led_classdev_unregister Date: Fri, 22 Nov 2019 11:28:56 +0100 Message-Id: <20191122100925.124648045@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191122100912.732983531@linuxfoundation.org> References: <20191122100912.732983531@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [ Upstream commit 7cea645ae9c5a54aa7904fddb2cdf250acd63a6c ] Clang warns that the address of a pointer will always evaluated as true in a boolean context. drivers/video/backlight/lm3639_bl.c:403:14: warning: address of 'pchip->cdev_torch' will always evaluate to 'true' [-Wpointer-bool-conversion] if (&pchip->cdev_torch) ~~ ~~~~~~~^~~~~~~~~~ drivers/video/backlight/lm3639_bl.c:405:14: warning: address of 'pchip->cdev_flash' will always evaluate to 'true' [-Wpointer-bool-conversion] if (&pchip->cdev_flash) ~~ ~~~~~~~^~~~~~~~~~ 2 warnings generated. These statements have been present since 2012, introduced by commit 0f59858d5119 ("backlight: add new lm3639 backlight driver"). Given that they have been called unconditionally since then presumably without any issues, removing the always true if statements to fix the warnings without any real world changes. Link: https://github.com/ClangBuiltLinux/linux/issues/119 Signed-off-by: Nathan Chancellor Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/video/backlight/lm3639_bl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c index cd50df5807ead..086611c7bc03c 100644 --- a/drivers/video/backlight/lm3639_bl.c +++ b/drivers/video/backlight/lm3639_bl.c @@ -400,10 +400,8 @@ static int lm3639_remove(struct i2c_client *client) regmap_write(pchip->regmap, REG_ENABLE, 0x00); - if (&pchip->cdev_torch) - led_classdev_unregister(&pchip->cdev_torch); - if (&pchip->cdev_flash) - led_classdev_unregister(&pchip->cdev_flash); + led_classdev_unregister(&pchip->cdev_torch); + led_classdev_unregister(&pchip->cdev_flash); if (pchip->bled) device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode); return 0; -- 2.20.1