Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp522930imw; Wed, 13 Jul 2022 03:07:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sCaexpAZ/+VlMiRbOji2aAEHl1g9gY1Lr0S4h6AW6EB2Pc/x8zwniD5D5pPyi041DnixG5 X-Received: by 2002:aa7:cd4d:0:b0:43a:2ce0:3a6f with SMTP id v13-20020aa7cd4d000000b0043a2ce03a6fmr3744875edw.181.1657706872191; Wed, 13 Jul 2022 03:07:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657706872; cv=none; d=google.com; s=arc-20160816; b=EZlTbcErZiYMW3UiA9wXupO9bgaB6or/WQWmmSRsd0c0wqhoeO5loLSyswR+ojvVGS e/M9TOXdMiinJE23KXA8SwVKeij1W9plZWvR+emT6n08DKZtZ/9TEGdcIXzLI7R3ZVIx 33q1ObWDWBB/x2xFZNLgAC3zM5dHpSPmur7DL/aoqH5IVJa2WCCiQBQAEDTau4hwO27e w24EegCsHVvGgNcZ0NnxZZcCEtefikhymGxyq1tyDnQk8PRhvTYHZuU6jAbNTY73pt6v iXunppv8iX6k6i7t28WvBngu1vPXBkCDb3LxOPWMre/vEs329p/Y8E7O/bG93UU0eTGh QItw== 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=3V7JNBzAmCFMy3KxZokjQA49UEMuoZy2lqB3+H595sU=; b=IEQDgwWdkpRx605aEk4IG6QaFwH6YXCv8nz9XkSuxPUsVu64pPR2gld9+HhuZci8YO vnu1sHdOclv/56ayuMfFzEbotktXFAM5uXl/LOdOo3spA7c+lNNv5KBW+C7hWoQGfpWX zAm0oeJ8uIn9WRp9l9QnXuCAZz0pgZVMnOgdmC1kbmdCxYSUxm2BshuR7LSCQj7k8XgK /nUwb5VcnvpIai7ap6PPS5BvSauLt0fPBdH4a9uo9A7hD/YZvcv453XD3BH5Xa/Umvzj +smBHCQ1N2Qgvu7ETk/ZBwd0yZB7ojzWoSmtPyCwI3OcIlu+6AY4vELfKjHA21JKgZcc bYGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VZ4UJtzK; 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 j13-20020a170906830d00b00715849159ebsi14457314ejx.144.2022.07.13.03.07.20; Wed, 13 Jul 2022 03:07:52 -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=VZ4UJtzK; 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 S234569AbiGMJ7u (ORCPT + 99 others); Wed, 13 Jul 2022 05:59:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229863AbiGMJ7t (ORCPT ); Wed, 13 Jul 2022 05:59:49 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0124265D51; Wed, 13 Jul 2022 02:59:47 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id p129so18415551yba.7; Wed, 13 Jul 2022 02:59:47 -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=3V7JNBzAmCFMy3KxZokjQA49UEMuoZy2lqB3+H595sU=; b=VZ4UJtzK8yDW1jD4r6pXDGeurS3US2G79ZHGbw++f7O8EcsTWHlHnWZ3YdgXIrm+TB h3ehiMpWVlBbisUH55ntPt3Fwulgmn8JeLuLarVKHc1NbCyUrp2NxXAKWCRDRtsS8486 ROx3NR/YyUeny7fkiPCmMgTsYvP7+YItl2cFmbJY5DHNrtdODQf0rWMcDcqQXGV7W+g3 2DrFgGZjAsqiE/E7Nu8jBcidl9+6Nqen0Pvui+LSoLfer4pV0sY7qBq/KbwSEOiU+P6B 9dke3usKPuSmxFp2suGzxV4T+lG3Zn1ATGKE3Hw41OLfKH/9cd2K8NJ4+n9zMIhHZ/oz CZfA== 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=3V7JNBzAmCFMy3KxZokjQA49UEMuoZy2lqB3+H595sU=; b=bKpc73mF46vOMBH91b2JpDcivVIDn375cyTpnjjuuAozm1+OwURkwrVufVrqCFHK93 2duxSEuPrMGbnKjfvg+IKnqt/JvKVxWu2MF4M0/RgAEs+wCRjLfG3CR13qKlkmtBx1DY SeNtd/wyYy3A86MgNvRsoVATzkgYolYHMCn+NHWUzgiZFjF3lkIn/kck2m53o9o5dgdp /dE73Qz7V7La4w/SIjCLBDHqf6TA1Q0eBhdbcJ0C03wwG5Gouv8m3/rgvOQelZeQM0Sk dSgb6KmznQ1WdKbYJ8Eoktb5MbTta0eWrqGoOCqIkdfxRHicoXsQeaPQYdWVxOvQqyCr mp2g== X-Gm-Message-State: AJIora9hiFl3mjn9WB+FcJ/TpqG61vE68f+jciWIOPKKA81kh9DF5a5s wav/IY+20Wlhqg1Ydz9GdFQoTxepPkWMTK5mYSQ= X-Received: by 2002:a05:6902:686:b0:66e:627f:4d29 with SMTP id i6-20020a056902068600b0066e627f4d29mr2556805ybt.385.1657706387134; Wed, 13 Jul 2022 02:59:47 -0700 (PDT) MIME-Version: 1.0 References: <20220713013721.68879-1-warthog618@gmail.com> <20220713013721.68879-5-warthog618@gmail.com> In-Reply-To: <20220713013721.68879-5-warthog618@gmail.com> From: Andy Shevchenko Date: Wed, 13 Jul 2022 11:59:10 +0200 Message-ID: Subject: Re: [PATCH 4/6] gpiolib: cdev: simplify line event identification 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:39 AM Kent Gibson wrote: > > Reorganise line event identification code to reduce code duplication, > and replace if-else initializers with the ternary equivalent to > improve readability. ... > + 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? -- With Best Regards, Andy Shevchenko