Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp424619lqt; Mon, 18 Mar 2024 11:42:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXQbQEY2+Ot6kiaaKoLOnKvVINUBy66juon0nxiSdcuJmDzy3A5iqkA4trp/0o578U2PL4k7bOLDBN29I2L0b2byloBTq3bwKATpalHw== X-Google-Smtp-Source: AGHT+IFJQSnB5GgApWlOI+BcaHm3sjiopva/Vzr4EYGQ0mh8oIqAI5ox8qkYj8BJ/h+E8u1vN0Zi X-Received: by 2002:a17:907:8e9a:b0:a46:5f6c:e04b with SMTP id tx26-20020a1709078e9a00b00a465f6ce04bmr10642080ejc.52.1710787334341; Mon, 18 Mar 2024 11:42:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710787334; cv=pass; d=google.com; s=arc-20160816; b=yB11UkLyx5tbvb+e0j6sZB40UmIMfeIUeY2AqbNlcHU6pWL6O2rs+TVsTcgXwbV9aT rQYxtCHlxraSI0wwG1C6G3s5m6yoLIj4vxVvXGv8tUF4DwjwMIDN2wASTSDJAJfHen/f MkIeN9vBUCqevJfp9+K2d9lWvQ8FlQFDkYhhGQasOEIlLsEKL1WK38I3ZiK2bPgrKX5N RikvAcOdRQ4uuTtZnuGV9WnB8tKe/7qnink0nEa4KdHHP6lN7z+0UQ+Nry7z0KelMQ+n N5xls9RwT+a83TS3cJXY/DeQWnka0XGRWSNbE43Rn8TmrT99RiaUGdl8h5CAQgtj02Z1 aEfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=h2Eahz5y1g6Io4kuIZCPOk+HRz1bynd6ShyA3Ce0EGU=; fh=C9FPdjT4JtlZbS9cflaPzPrwXhYHqdkskdWVigoYfFA=; b=GzTqcBWvZqGhlGpr+a59205QGS/28PtlenILW9Tp3g4dvu3VCltxq4Fx0fn8tvwTEY mC97OoRBZaoB9T28sKhm5uBmHWrkql323uogNQ7v1fwmQfzsL3euhg9h+2HvZJhNzOWC 3IkVvr+EdZwF0vjdAB+a5kYQc6+FbjVZwtrY4UreW1sD456s0GyrJqGJylZY5vSU+4Xc Bd5dkY9hILdrgY2Zlp9W7JTwW97Mcz2/PcIaUzWczjT1gBqRXSgYZ4s0BCqGoXFLOiXh VwJdO/KMwqmbwafH7UmtchLnLXYOLqTTjyJx7mVeAAACIx2ENGfz0HnHJpxn0m9KmnF6 iWQQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=dMjyIKml; arc=pass (i=1 spf=pass spfdomain=ieee.org dkim=pass dkdomain=ieee.org dmarc=pass fromdomain=ieee.org); spf=pass (google.com: domain of linux-kernel+bounces-106527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id rv1-20020a17090710c100b00a46b75a3523si1712223ejb.832.2024.03.18.11.42.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Mar 2024 11:42:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-106527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ieee.org header.s=google header.b=dMjyIKml; arc=pass (i=1 spf=pass spfdomain=ieee.org dkim=pass dkdomain=ieee.org dmarc=pass fromdomain=ieee.org); spf=pass (google.com: domain of linux-kernel+bounces-106527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-106527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ieee.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9E1C41F23AC9 for ; Mon, 18 Mar 2024 18:41:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2165E5579D; Mon, 18 Mar 2024 18:41:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b="dMjyIKml" Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F5E354900 for ; Mon, 18 Mar 2024 18:41:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710787304; cv=none; b=pjNQmGhpbbkTMBwNEDxkPK5y1wqLfkRy32qMmhA51POozjqGTIlaG2/nOkio69kGjV4cF8P9+U1Ps4S8bY/1ZZqCnyCbexgIDg+rxXbkLFybZlEtlt9VazjZIlOGlQlGRa75t9IkrGdETnJMDY71QCxGmlMNifeXU8VMQTVlszI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710787304; c=relaxed/simple; bh=bZ8EF+f0ojIjoq6Dr918Kh/3SPma0ywuu31m4SVF0CI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=JV7zZxHGf2zgUfLx6Rwjpby0JC8Q0fOqucHs0gjCk2xpbmvU7ywa7K0bzp3TS91hoB9TGGKETmCGBUBGCDbkrgGD8/k/5GBXb5LiAkKgfzx6CO0zfFYFeM4hiYAmGcWPG1hWGVP5WABaFlkr5ZPm5ZVDpU1En/Is+SlHZJ2RJes= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ieee.org; spf=pass smtp.mailfrom=ieee.org; dkim=pass (1024-bit key) header.d=ieee.org header.i=@ieee.org header.b=dMjyIKml; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ieee.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ieee.org Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-430c63d4da9so12021871cf.0 for ; Mon, 18 Mar 2024 11:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ieee.org; s=google; t=1710787301; x=1711392101; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=h2Eahz5y1g6Io4kuIZCPOk+HRz1bynd6ShyA3Ce0EGU=; b=dMjyIKmlDNCMZ3lNdbPCCvzpwkAD6yspleRqJAznvikT+WCcOja2js+6+xd4hX2Asx leNBm+qNaNjoi4eFFyY3lgfUq9YftU2FuLRAdViMqVHLM0GVFCTB/Di0/RvySj05y0pT tMhRFiBLl+8rxRJxkk3GFhdGISmglhkBVPnug= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710787301; x=1711392101; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=h2Eahz5y1g6Io4kuIZCPOk+HRz1bynd6ShyA3Ce0EGU=; b=l6NS0McAS5n/8CxBn8uC1IWyKZ+sXLADs6lDx2bRQoGjL7nhst9MMSlPoc1dy/kFuX u6wNp18BjZbCfWz1X9QEiqRejKocD09/tL5EhKyPkOIwbva29I4qVQzFqXbfBSg6mz1L eJvvDRBJUnpudv0BKptXwtcEb0SbylAQY0I2QQnWWg75k2yEwGs4J5y8ExvAGkHuJQ6J zX+KovxeX3HDx2kj8Cg1OexjXjD1k248Hf4nRLDgszwsrKnbBNT383KeaJlhO9qKbJad giie9JoT4u+ZSv/RLrnwfn6ud8sdkG+a2Z9HnHZooGwQVnINR6ObLb4XNKueulz0bHs8 iUsA== X-Gm-Message-State: AOJu0Yy8kyk9gKylx2qzVn6zfffSBlUqs9pq5w3Hn2vog3T6wREuT64z bKmcjTYvW0Fd1gMPMdmqnTL+P/Vq5n1SUhs2sxPom3eEs1B68RfldTq0rIiYog== X-Received: by 2002:a05:622a:248:b0:430:e4ad:afbf with SMTP id c8-20020a05622a024800b00430e4adafbfmr381232qtx.20.1710787301471; Mon, 18 Mar 2024 11:41:41 -0700 (PDT) Received: from [172.22.22.28] (c-73-228-159-35.hsd1.mn.comcast.net. [73.228.159.35]) by smtp.googlemail.com with ESMTPSA id fj5-20020a05622a550500b00430b423f06csm3796449qtb.86.2024.03.18.11.41.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Mar 2024 11:41:41 -0700 (PDT) Message-ID: <3eb9d5c2-149c-460c-9684-3fdaf946c400@ieee.org> Date: Mon, 18 Mar 2024 13:41:38 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 4/5] mikrobus: Add mikroBUS driver Content-Language: en-US To: Markus Elfring , Ayush Singh , Vaishnav M A , devicetree@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, lorforlinux@beagleboard.org, greybus-dev@lists.linaro.org Cc: LKML , Alex Elder , Arnd Bergmann , Conor Dooley , Derek Kiernan , Dragan Cvetic , Greg Kroah-Hartman , Jason Kridner , Johan Hovold , Krzysztof Kozlowski , Mark Brown , Nishanth Menon , Rob Herring , Robert Nelson , Tero Kristo , Vaishnav M A , Vignesh Raghavendra References: <20240317193714.403132-5-ayushdevel1325@gmail.com> <4fe6f68a-786c-4e3d-b97d-847d6965d1d3@web.de> From: Alex Elder In-Reply-To: <4fe6f68a-786c-4e3d-b97d-847d6965d1d3@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 3/18/24 12:58 PM, Markus Elfring wrote: > … >> +++ b/drivers/misc/mikrobus/mikrobus_core.c > … >> +static int mikrobus_pinctrl_setup(struct mikrobus_port *port, >> + struct addon_board_info *board) >> +{ >> + int ret; >> + >> + if (!board || board->pin_state[MIKROBUS_PIN_PWM] == MIKROBUS_STATE_PWM) >> + ret = mikrobus_pinctrl_select(port, "pwm_default"); >> + else >> + ret = mikrobus_pinctrl_select(port, "pwm_gpio"); > … > > How do you think about to avoid the specification of a bit of duplicate source code here > by using conditional operator expressions? > > ret = mikrobus_pinctrl_select(port, > ((!board || > board->pin_state[MIKROBUS_PIN_PWM] == MIKROBUS_STATE_PWM) > ? "pwm_default" > : "pwm_gpio")); No. It's a complex enough bit of logic without trying to bury it inside the parameters passed to the function. -Alex > > > Regards, > Markus >