From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD4CFC433F5 for ; Wed, 2 Feb 2022 10:54:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241316AbiBBKyd (ORCPT ); Wed, 2 Feb 2022 05:54:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235348AbiBBKyc (ORCPT ); Wed, 2 Feb 2022 05:54:32 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6575C06173B for ; Wed, 2 Feb 2022 02:54:32 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id p15so64135826ejc.7 for ; Wed, 02 Feb 2022 02:54:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qRzI+h4+4G3K8WlXyiWrWECSH5mt2N8z3QLOfw+ZawA=; b=6crsEOUF+BltFBb1hKPB45Jbk3Fyj4l9PeUrgNqQ8AOLnFw4LYEyRY5oa1GelyZK81 8nGw12FZcCEM2I4sANtgtnYatCUbNXNep0WJn6RCGxLJ32w0zRK+nLRrdYCrk3psTiCr PG3jOoCIiRmfA0pZ7w5P1eK5nikm24Ii4caBBq9/AMLek/z39uJOOga6xvzbx6dbqu// MVvIimT51bMKW6c4S0KYvG4bAr3XTZdoM7nNKDfQVug0KHZhB3pV+QhkE1dshbn3W/WG fLGChz5vNMF5IgKBkwhmpiDF2zkS99eIUCTGhljZJG4cSsS0tlGb0bnNMw2r1s7g8px/ tm5A== 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=qRzI+h4+4G3K8WlXyiWrWECSH5mt2N8z3QLOfw+ZawA=; b=QoIGsas4fLkr1hXkURvJYsDhFplmluCsVRQo1gMyPAJJRwrMC1G64UbPIX3bD5muzY APx44M+PasA9wYzItLGQ4tm0lcTvPPRzBOrVsJEZwBw9T+qUoa2Zn8akYIt/+N6z+KQb VuDSKRwy8to7BZ+EzWkg0yXSOrU1ZBcbEJJWw/nf118c2V70dUx0A10t5fnmurOAw7wx oS9ylpMu8Pwo4HIcU5FJXEk7sGbUQkmAcaE9UPWXbO3jLmP7j/UeMpaN4sYNNXnR86SA c86VEJKlRNSXAuC4v8Ie6NEGzdei2CQjKpebOmbdvIo9OqrbBI9psCEqZXbg1GHG85Ak qMGQ== X-Gm-Message-State: AOAM53032PXmyqO2ZAx2IL2XyguL4sNolRz0hj+8IE+dkpGRNmvkHTfD dRoz7MMNkEDFEXpxb43JGUYtW5ZV9xiu7lcITuq5pg== X-Google-Smtp-Source: ABdhPJwAMLpCwX1yF59xEw6bQlSCaxNpbgzeRxBctFwzXbjiP2pgZK6JNnp4qRE8QXsuXDh6SGCvOFE6PO5MkpWrlys= X-Received: by 2002:a17:906:c150:: with SMTP id dp16mr23410451ejc.736.1643799271223; Wed, 02 Feb 2022 02:54:31 -0800 (PST) MIME-Version: 1.0 References: <6a62a531227cd4f20d77d50cdde60c7a18b9f052.1643625325.git.geert+renesas@glider.be> In-Reply-To: From: Bartosz Golaszewski Date: Wed, 2 Feb 2022 11:54:20 +0100 Message-ID: Subject: Re: [PATCH] gpio: aggregator: Fix calling into sleeping GPIO controllers To: Andy Shevchenko Cc: Geert Uytterhoeven , Linus Walleij , =?UTF-8?Q?Mikko_Salom=C3=A4ki?= , "open list:GPIO SUBSYSTEM" , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Feb 1, 2022 at 9:59 PM Andy Shevchenko wrote: > > On Tue, Feb 1, 2022 at 10:54 PM Geert Uytterhoeven wrote: > > On Tue, Feb 1, 2022 at 9:35 PM Andy Shevchenko > > wrote: > > > On Tue, Feb 1, 2022 at 10:09 PM Geert Uytterhoeven > > > wrote: > > ... > > > > > + return chip->can_sleep ? gpiod_get_value_cansleep(fwd->descs[offset]) > > > > + : gpiod_get_value(fwd->descs[offset]); > > > > > > This indentation kills the perfectionist in me :-) > > > > Why? The above is aligned perfectly ("?" just above ":")? > > > > > What about: > > > > > > return chip->can_sleep ? > > > gpiod_get_value_cansleep(fwd->descs[offset]) : > > > gpiod_get_value(fwd->descs[offset]); > > > > > > ? > > > > > > Or as variant > > > > > > struct gpio_desc *desc = fwd->descs[offset]; > > > > > > return chip->can_sleep ? gpiod_get_value_cansleep(desc) : > > > gpiod_get_value(desc); > > > > > > ? > > > > IMHO, those are ugly as hell ;-) > > I have the same opinion about your initial variant. :-) > > So, up to the maintainer(s) what to do. > It's Geert's code so let's keep his version. I like it better myself too. Queued for fixes. Bart