From patchwork Mon Nov 14 18:46:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 19996 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2304846wru; Mon, 14 Nov 2022 10:46:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf6fToGicDUVH//olPzz0BdmuHpIIRol0KUsBJCzR0hJc85v6cQDutZnfkV+3hrFXVhj4ESp X-Received: by 2002:a62:3287:0:b0:56c:3a0e:cf13 with SMTP id y129-20020a623287000000b0056c3a0ecf13mr15015589pfy.29.1668451614019; Mon, 14 Nov 2022 10:46:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668451614; cv=none; d=google.com; s=arc-20160816; b=0giM6hHyEiBdw9Vn8acNNapyIcV4GYReJg+9lmAGRw6Ul3QcqN7AXAVfih260YLRSy CbvaUA6xsP7dZtXWqlVbUgI8Z1GE69GsKYbC+hhmrUWQWzn198enlGdAwkP6OZ5236Au ljarv7xyddHxUeL9nfYwYEpzbpmhSay37SD7SNhsxNqmmdTu1GKxAOHjgQ5KjB1z9Z+d u6usxVr/4LuQIqUtN0KgU1z5PtciG5E3JxBJyntO9o4NeUtv4qpZKPP/hbzucg0dG9RT 2MTNOnSIWMgo5XaoqCehAJUWJiY237yDj5x/BCj2wqKgiDZD6PcPEi5FQiwMSZEgQNVe PuWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=grMdlWLiOEVms3yDpwrjA0Xb5oE8YKX0A4YdnxvFvXk=; b=HVJNnobjyAJz+l/HGNGi2+ck7eP7XlgZFA6VZ/tj/4TGcUVj7zVmokCODYw/FlEJcM eQ8DDd/xHWZfXn5oIVf046ykx5PaoK+0z9kL1P5HLaJgOrkW47hUwWfjmLWwhroJEuWF Ve/7AOA31ajiWUMGdcymv94vmnZW4LV6AV7qjLvMqd8bnbTWvAHRJZX5zncaOx3pVaju GZ6REZz93k67tAPI/emyM+C1txm6jrReO0NRZOf4tr7FvrVk8ozurP6k3vwtm+BpGt22 q6uVMDd3HfAuimnb0QfQTAXDhwacDjVsOJr7VBC3csYC5RwDFmKsQF8ldtX6lcNWraC7 Oh9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="euXhwPP/"; 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=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a13-20020a65654d000000b00476a08c5d9bsi1173750pgw.602.2022.11.14.10.46.39; Mon, 14 Nov 2022 10:46:54 -0800 (PST) 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=@intel.com header.s=Intel header.b="euXhwPP/"; 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=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236679AbiKNSqM (ORCPT + 99 others); Mon, 14 Nov 2022 13:46:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236525AbiKNSqI (ORCPT ); Mon, 14 Nov 2022 13:46:08 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F182013F75; Mon, 14 Nov 2022 10:46:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668451568; x=1699987568; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=p9xXZ7oRWXft1etC6JnOSiiOdeH9ZPyYQGV7NIbMwgs=; b=euXhwPP/nmFaGJ25es547rF2Wb0U5pxtFlXQ0OdpvIrK86nvGYpnUik6 isXFnqK/Z8Wf8siiXmVLNG6QNBsdoQl/7L5P9ZOoeJ9EwPY5C0wJV4tni qCHO0aGMqWyX+tw46ProB4DjwK4rke31N7rntOACQb8tLuhb9rwnLGSF8 ed7LnaRKJMaNjlGC/nClm4mQIawUNmo/or0H75bcOGYPQQ/X0h1ekdYTT Vf0aCpd9S3CGrFXFP2/cyU+jwlu+2CEtZoo5QWw+DbwCdK/NM0wDqLCIP E+FBr6t6xKy1k+HSPqfXkBr621GuKnJ9/nKw/YTxKmC/fUjdmcH5XG0Pj Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="313197442" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="313197442" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 10:46:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="669773436" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="669773436" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 14 Nov 2022 10:46:05 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 8857DB7; Mon, 14 Nov 2022 20:46:29 +0200 (EET) From: Andy Shevchenko To: Bartosz Golaszewski , Dmitry Torokhov , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Andy Shevchenko Subject: [PATCH v2 2/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() Date: Mon, 14 Nov 2022 20:46:26 +0200 Message-Id: <20221114184626.64214-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221114184626.64214-1-andriy.shevchenko@linux.intel.com> References: <20221114184626.64214-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749498319324070506?= X-GMAIL-MSGID: =?utf-8?q?1749498319324070506?= The callers never call the function with invalid pointer. Moreover, compiler quite likely dropped that check anyway because we use that pointer before the check. Signed-off-by: Andy Shevchenko Acked-by: Linus Walleij Reviewed-by: Dmitry Torokhov --- v2: added tags (Linus, Dmitry) drivers/gpio/gpiolib-of.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index d30a5210dfdd..f96cb6fe6831 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -962,9 +962,6 @@ void of_mm_gpiochip_remove(struct of_mm_gpio_chip *mm_gc) { struct gpio_chip *gc = &mm_gc->gc; - if (!mm_gc) - return; - gpiochip_remove(gc); iounmap(mm_gc->regs); kfree(gc->label);