Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp16054imw; Wed, 13 Jul 2022 18:04:41 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u9Bptchd9gxvUFVgkQsq2HLbL/gK3OzcwGXrQEqB2G3mm4r0l81mZxXKWF0G9v9/Cw9kRa X-Received: by 2002:a17:906:d54f:b0:726:4424:9d31 with SMTP id cr15-20020a170906d54f00b0072644249d31mr6176370ejc.227.1657760680777; Wed, 13 Jul 2022 18:04:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657760680; cv=none; d=google.com; s=arc-20160816; b=SQx619LujbXcUlfTTEqWqEuRwGcn04DqdDXpvE8+8Vqmi+UuRg3ELW9yT/nfSEEZIQ 5d4lgiCEgDU+sCRInI4taQK64i1J8qzrsdYiyRgstIi/T198tNfTafbujhZzsM4VJJmV 2gAP6EZc4qFVIY7764DY+JGPC4EhFv6IYIF0EKaJzoBRSItzrc0+/7L96HuHy0+Lf8rD PNkc9JoWHucP+AJ4PmIZXvxF5xVd7YxgDGI0I1HX9uMCD8A+XoC/PzvwyZFTVjdh3Qmz SWoSKy8WJlBfE3fSGwwJweCrzggVe23q0Tze0hSqg+rsk89c1tpGlkpnZ4/OyOUjhUQZ z6uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=MM9AZwRsJa4u3kZSBjtvlRoNVdyeEyJLv7qGDDBUOJU=; b=gkkBfDJMeYf5WOLR3vhOIrIUlKgmvDCXTuGyo2v3s/eLOI2te40P2GRUPNSjFIhbGT dcbot1pg4Js91Rx0fakQYhyryso5EbRXZhdkIF4NzIa2l5j32qPwP4ImVZI4c89cUkKs ZWhthDqxPngd6YoDYNOHPgjdTveUCpg1aRZCg8JyeSv32mAGUAlDW3DdPNRC/wHehJqm mNJzHLrC0Q90JeAtidsAHVMhvRe3l0O4cHCFt0VtOIMUyNA1ycHFnp4inxrh/5YT6FME ZQUps7pWADc7MsWVUnw47xw4YTSnjhZKhEfNSgdfXUO/TEuCzZpYb3ef+Jwr34ZQlnN9 Bz7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=X+lYPHUD; 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 u26-20020a170906951a00b0070c519c7b69si190888ejx.409.2022.07.13.18.04.15; Wed, 13 Jul 2022 18:04:40 -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=X+lYPHUD; 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 S230119AbiGNAcg (ORCPT + 99 others); Wed, 13 Jul 2022 20:32:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55222 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbiGNAce (ORCPT ); Wed, 13 Jul 2022 20:32:34 -0400 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2212CF5A5; Wed, 13 Jul 2022 17:32:34 -0700 (PDT) Received: by mail-pj1-x1034.google.com with SMTP id fz10so804572pjb.2; Wed, 13 Jul 2022 17:32:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=MM9AZwRsJa4u3kZSBjtvlRoNVdyeEyJLv7qGDDBUOJU=; b=X+lYPHUDqWHSbSUn0lNMXuI0Z2lTKUlOJD5+Od036ugTsXzSbewrfRcQ1OCbtUiOy/ iO4ogCWwajRvbkn5NoeHYaMhNCLN4bWg35lHYRZ6tBLXkPubQDyUjMlU3NucQbsm4Gf0 ZU/yZMctKeBR1Vn1j393NnWxvUMq6CmJVkef5U8Wj8uLByLVAd7YIi8koDJkSG6yABX9 fB9pIj2T0n4RZGmfu583yEt5qaPzXeBGPod0WshRHyqioXa1yTM8wDHbgCharifWZAmW 7MwXMNW0YLdzKKJqJmP5SWOnQ/8Si8gTGB2kL8GkCXCulAOYfRf0LUX8BKMck83tZ268 M4Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MM9AZwRsJa4u3kZSBjtvlRoNVdyeEyJLv7qGDDBUOJU=; b=7acZ7GBxTyKBHB0sX06SIB19zE3hHyeT6vM6TQqLOp6Q4tNPbcz9q0hlS6MkpSYdxL jB/Vr71KzzrLoidwXN9q5RiS/Wpwr4ljt+lzamFFPIuVEOTu1g3pnj3c8dL49q/xuSkm ICNzwH1jG6jCwIJnwRmOFNYQUVpqxJjC7AfP5WWxrtouBr0G1cmKQSgSxh1Gayq7U0hk jCdOrtyYsEcfLhHA//HINMvqpQdRsv8ZXHgp6yjQTzsQF5oAFruhS5yQVXdOrcnGVqrJ fhQyZ9MREVyelM9DvDgY29qZs6uriQ7J/9Hb8TktcPa9UrlcwH2x3R9cO52tYSYIjHfN wBKA== X-Gm-Message-State: AJIora/TWHF0qCoBMb5t2ax4n9Tbvwud9h0sZsr3MZymwvJYg7PRaMrZ FOjRJAXxM0On/y9cHOP2ckw= X-Received: by 2002:a17:90b:38c4:b0:1f0:59c0:570 with SMTP id nn4-20020a17090b38c400b001f059c00570mr12706155pjb.178.1657758753470; Wed, 13 Jul 2022 17:32:33 -0700 (PDT) Received: from sol (110-174-58-111.static.tpgi.com.au. [110.174.58.111]) by smtp.gmail.com with ESMTPSA id e29-20020aa7981d000000b0052a8128699fsm132310pfl.207.2022.07.13.17.32.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 17:32:32 -0700 (PDT) Date: Thu, 14 Jul 2022 08:32:27 +0800 From: Kent Gibson To: Andy Shevchenko Cc: Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , Bartosz Golaszewski , Linus Walleij , Dipen Patel Subject: Re: [PATCH 4/6] gpiolib: cdev: simplify line event identification Message-ID: <20220714003227.GA18272@sol> References: <20220713013721.68879-1-warthog618@gmail.com> <20220713013721.68879-5-warthog618@gmail.com> <20220713102710.GB113115@sol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, 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 01:24:33PM +0200, Andy Shevchenko wrote: > On Wed, Jul 13, 2022 at 12:27 PM Kent Gibson wrote: > > On Wed, Jul 13, 2022 at 11:59:10AM +0200, Andy Shevchenko wrote: > > > On Wed, Jul 13, 2022 at 3:39 AM Kent Gibson wrote: > > ... > > > > > + le.id = level ? GPIO_V2_LINE_EVENT_RISING_EDGE : > > > > + GPIO_V2_LINE_EVENT_FALLING_EDGE; > > > > > > It seems several times you are doing the same, perhaps a helper? > > > > If by several times you mean twice, then yeah. > > Not sure that reaches the threshold for a helper though. > > Up to you, then! > Turns out there are three instances, so a helper it is. Cheers, Kent.