Message ID | 20221109150734.38874-2-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp387326wru; Wed, 9 Nov 2022 07:09:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM4Q7CQ+UARQuQ82Us98OhA+UtVYM74E1R5ryHiCb3k7sIv8eDBAX6IM3QO43p8EsEbufeF8 X-Received: by 2002:a05:6402:3457:b0:463:2017:ae64 with SMTP id l23-20020a056402345700b004632017ae64mr56801626edc.218.1668006561093; Wed, 09 Nov 2022 07:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668006561; cv=none; d=google.com; s=arc-20160816; b=LuV4OG04TJN2CFwVjabe2DvAg2GYoZ5Vt3XMsg82iOF3KB7rp/CgrWz40VJvmEisQw g5nM5P/mC26F16GKAKrUmha7c4bqRZm/V0IyR1c/vknj6QN07wzUPLLJMS7ls5nQJGAD bJTHBodQYq3meeRxaD9fG4if4nu4xio3PEE1RLEXyMzuhF+HTWOSK6T4M0c8nzTjzK9h GncE678ONky5A9wn5MHGhffUbjcgAgsJPiWLibdYALFepas6sHWuMmJq+LgoGHe4NXyy WCi/YYh+nGEAEzS4RB/2mrNpmb2tOvuZmLy2mYJal5SQSy4b77X6RnCP9VyiptnuL5gK UFvA== 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=84+Ai4MfAsUeQCK9niTUi97Q2QEGp4zHAKkL0AKPseQ=; b=f/x6azr/14aNsjhtxulhIxiSDmIU9b4+Fwn2edvtKtPAVdPPmwuclEFQRDMcikyDaN OzEruxQ1OhbjgIBBzPue61gpwcFhlYDJGp42FMCzsPagHBBZOmG5DYFQLSmJ7j360EBx 5epjD5047cWrH1+qmXYfYEynKC9bc6b8nODtCD44FFtWR+IoC8lqofkZdWL97A4mZSKl SWqO8nt/uIT7DZYhctqhxM7B25mZSnH0mmxxDRh0MKZeRD4JLOtKjiQV6g2/xDFFOV/d pIqWSaKPncfUaqyWB3b3+FvyIBFUNe8VYuaGFBE3Yb6MeoYT/3TY0tW7wzoTu9PkbF46 Ip7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=WLrl5BtT; 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 hp20-20020a1709073e1400b0073da4a0f01csi15663720ejc.743.2022.11.09.07.08.56; Wed, 09 Nov 2022 07:09:21 -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=WLrl5BtT; 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 S231886AbiKIPHf (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Wed, 9 Nov 2022 10:07:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231940AbiKIPHY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Nov 2022 10:07:24 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41D9C1C429; Wed, 9 Nov 2022 07:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668006438; x=1699542438; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vkdjifLpDIz2k79GbiPxj/nDQjo5PWlLax+xg6MpmuQ=; b=WLrl5BtTzaQVD6Phu+j9qFgXnRGpIDylL/P7tuN3lr6tTcVQ+NxzDhSX TF7kVX/HPSXWkDNVLjUx/nRxGWFVpHcyOXKcgndaUaakfOb19+1erxxpq bb5vE4UtYAaHqMhMvFR5e42bpNunZBJYgGv9F+7h8qx4EjX/hiOlAZsDp o6sJu8BshdwGnFOItmVarDb2f9Ta+SkfnnWSlGeWJLMcjSWSxtdHfcatf Md4N8c/xI+uM7xYUs3YL8fkdJBV+3amfP/wi0mcV0JFMKln8NpV6q6JYL g7B/ilySBOzi1pjoHV9bNj0VYI+jpqipSpgiiyl3i/n8fN9s2ltMUztmG w==; X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="312798262" X-IronPort-AV: E=Sophos;i="5.96,150,1665471600"; d="scan'208";a="312798262" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Nov 2022 07:07:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10526"; a="705736999" X-IronPort-AV: E=Sophos;i="5.96,150,1665471600"; d="scan'208";a="705736999" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 09 Nov 2022 07:07:15 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0D08C155; Wed, 9 Nov 2022 17:07:39 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Bartosz Golaszewski <brgl@bgdev.pl>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij <linus.walleij@linaro.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com> Subject: [PATCH v1 2/2] gpiolib: of: Drop redundant check in of_mm_gpiochip_remove() Date: Wed, 9 Nov 2022 17:07:34 +0200 Message-Id: <20221109150734.38874-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221109150734.38874-1-andriy.shevchenko@linux.intel.com> References: <20221109150734.38874-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749031647642174538?= X-GMAIL-MSGID: =?utf-8?q?1749031647642174538?= |
Series |
[v1,1/2] gpiolib: of: Prepare of_mm_gpiochip_add_data() for fwnode
|
|
Commit Message
Andy Shevchenko
Nov. 9, 2022, 3:07 p.m. UTC
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 <andriy.shevchenko@linux.intel.com>
---
drivers/gpio/gpiolib-of.c | 3 ---
1 file changed, 3 deletions(-)
Comments
On Wed, Nov 09, 2022 at 05:07:34PM +0200, Andy Shevchenko wrote: > 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 <andriy.shevchenko@linux.intel.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > 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 feeb9e8e846d..83997434215e 100644 > --- a/drivers/gpio/gpiolib-of.c > +++ b/drivers/gpio/gpiolib-of.c > @@ -963,9 +963,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); > -- > 2.35.1 >
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index feeb9e8e846d..83997434215e 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -963,9 +963,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);