Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp534664imw; Wed, 13 Jul 2022 03:22:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uC/If0EacFN32QBPLdD/tLSSZatbhsckzVOX46gpYiHK88R8H6WOjL3/A4IbEMYKpA4uDi X-Received: by 2002:a17:903:11d2:b0:167:8a0f:8d4b with SMTP id q18-20020a17090311d200b001678a0f8d4bmr2754202plh.78.1657707776023; Wed, 13 Jul 2022 03:22:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657707776; cv=none; d=google.com; s=arc-20160816; b=M63cucCW528MrQtwfp08jHh9/hkHMQ5LNP8MnpL1mYsbw/k+dVCsttGZWIDfL2yYk8 8OyeJ75FGSYseQx2WbVFIM0YpVDBhSX8B12iy2ADI0eett5XjtxmXNKEwc2d46lx9w04 pJR+CcQrvk5oV0ASpqqK9LgLB2pvhIOGEMSSVQrJu3jYxvGX0vRbmwxf88AcBrjzyWna D6gbUjAnYhQIoa41N0IlCS0/57h04pr+xaQIhSfU5QTakutnJONU69r4So0nATKMddhx oClquownsmD5XAGXXFxHjqdvmDyis4M7AI50+1WswBFgxu1ijY3WTPdCk1GImFBzAYaW 4ISA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=E2TlXEAIZFvPmK9h/xYib4bfCYK2i9suWn0UJBr3XYM=; b=LIiRq1VJ1UQS6x47dnnImPbsxtVFXXJGlBQl3h0uaSlu4XhKWvgofOCjnrcO3IAv4D MsMiCNd+V5L5AC0YLIhDajH2Sx5s9Y5NovJqaueGO+ssGU0SP0+g52w4aEdWMmACG5iF EMrEdFkuE/2N+kW9VVTcHQINEUIP9+dMN7Oz3Vs4nI/EJplOXydyLVlEpVEptzJc/HfY W1zTBQs7u6H15fIBWbe+4oYIQpmKLUnVoH1WImsm1wbtZGcNn6s2554znIM6M7NaP0+S lgXUAMHPUHfraU1u+NQhKjStc4B9FaVxtytffJOaR03D/lDJNBhCljFxc/Abzwe6Xslb 19Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R3H4xNPl; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f64-20020a636a43000000b00415ea6ac484si12810114pgc.372.2022.07.13.03.22.43; Wed, 13 Jul 2022 03:22:56 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=R3H4xNPl; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235420AbiGMKJO (ORCPT + 99 others); Wed, 13 Jul 2022 06:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235575AbiGMKJL (ORCPT ); Wed, 13 Jul 2022 06:09:11 -0400 Received: from mail-yw1-x112f.google.com (mail-yw1-x112f.google.com [IPv6:2607:f8b0:4864:20::112f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 352143121C; Wed, 13 Jul 2022 03:09:10 -0700 (PDT) Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-3137316bb69so107029767b3.10; Wed, 13 Jul 2022 03:09:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=E2TlXEAIZFvPmK9h/xYib4bfCYK2i9suWn0UJBr3XYM=; b=R3H4xNPlytdYvhfcrA/DcKC13l0wft2b74FnHF4HmnuTvRR0I3y2nSP2CYLjeCfDoh NJ5qHO0dtSkhIJdJAbf1RveCRGZ9x4/8goj3FTvPgpH3g4PUk9NghmHXKMaiw1DgTYUU nwIW9fMp6eKwqHQ3OqbxssE8oSLuHJ8U4vHhD8IpHebZ7OtZ8J9O1OlAZlYBqczLvHhH y8gGWMN+iyIkEvad+0efDNndedad2bIfckI5w9cpwqLUtDYvytP1XlvTRRYT4YjX3nc9 VDZRsSubYRIDE+3U17XV10Ln9L6v+wAhQfzjN7fxM4TW4z89LNoRZTGyuNCF1GyxBjf/ KKKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=E2TlXEAIZFvPmK9h/xYib4bfCYK2i9suWn0UJBr3XYM=; b=CEP0SwqYLrw78ith4hHL1dJCJi99mahqMKz8oP/qTWF9PJf+qM5mAipvWTo622zufx oS0/0UcQv+/tM5JycDiaIBX7NciXG5zgC9o39aqwxUGGmnZ2dZSI+WyhdB/KqZvIsZeZ Z1qBbl4N6JZNxs2hF/5pUskXMry0T4tPdIW3DpVPHPy7tdrz75NFaU1y7aMhElfY0xTA NyS8gRP7MTTKMlTscVA5OyE2qNU2JGh+uub4lKePeT6ZVraV4DizVsEnYWXBx9cgbNOL QTObFk0NNLG6neOPmLAfd+iCC9PzqVZa1eOJll0YNr7ag3cLlaFN8PB/b4n9ptVMmEmR Iw6Q== X-Gm-Message-State: AJIora8vNiFOImUr2XOoT8sZjN3GrdbULVEDx8Tybr0DXrD/ziNA6+Ma oYoVDTvhsl/tSmG2I2nlCRag6nyECPMH/pV/5O07zUXJCwWV2A== X-Received: by 2002:a81:108f:0:b0:31c:d7ae:9ff1 with SMTP id 137-20020a81108f000000b0031cd7ae9ff1mr3203739ywq.18.1657706949440; Wed, 13 Jul 2022 03:09:09 -0700 (PDT) MIME-Version: 1.0 References: <20220713013721.68879-1-warthog618@gmail.com> In-Reply-To: <20220713013721.68879-1-warthog618@gmail.com> From: Andy Shevchenko Date: Wed, 13 Jul 2022 12:08:33 +0200 Message-ID: Subject: Re: [PATCH 0/6] gpiolib: cdev: code cleanup following hte integration To: Kent Gibson Cc: Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Linus Walleij , Dipen Patel Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, Jul 13, 2022 at 3:38 AM Kent Gibson wrote: > > This patch series is a collection of improvements to simplify the > code, improve readability, and compile out unused code. > There are no functional changes. > > The first patch is a cleanup for my recent linereq_free() fix. I > noted then that the edge_detector_stop() could probably be safely > moved inside the line desc check block, but wanted to keep that > change minimal just in case. It can be safely moved, and so here > it is. > > Patch 2 makes use of an existing macro to simplify a call. > > Patch 3 replaces some more if-else chains with switches, which is > more readable (YMMV). > > Patch 4 reorganizes the line identification code to share code > common to alternate paths. > > Patch 5 consolidates a number of separate flags into one. This > reduces code complexity, simplifies any future edge source additions, > and makes patch 6 significantly simpler. > > Patch 6 totally compiles out the hte specific code when CONFIG_HTE > is not selected. > > I've based this series on gpio/for-current, as it requires the fix > patch - > commit c8e27a4a5136 ("gpiolib: cdev: fix null pointer dereference in linereq_free()") > Happy to rebase if that doesn't suit. > > Dipen, I don't have any HTE compatible hardware to test with, so > could you check that this still works for you? Reviewed-by: Andy Shevchenko for uncommented patches. You may also use it if you are going to address comments as suggested. > Kent Gibson (6): > gpiolib: cdev: simplify linereq_free > gpiolib: cdev: simplify parameter in call to hte_edge_setup > gpiolib: cdev: replace if-else chains with switches > gpiolib: cdev: simplify line event identification > gpiolib: cdev: consolidate edge detector configuration flags > gpiolib: cdev: compile out HTE unless CONFIG_HTE selected > > drivers/gpio/gpiolib-cdev.c | 286 +++++++++++++++++++----------------- > 1 file changed, 149 insertions(+), 137 deletions(-) > > > base-commit: 7329b071729645e243b6207e76bca2f4951c991b > -- > 2.37.0 > -- With Best Regards, Andy Shevchenko