Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2632493lqp; Mon, 25 Mar 2024 05:10:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCQ6NogXa+ZRfij3x3NF99mkN88X56JCq+igoQkiaANEWRpn+1D9C32alPezm0EQyCKsixOEpRik5ZtWZMXDXGli2IWS3/GaJlC7kydQ== X-Google-Smtp-Source: AGHT+IHqnIQMXC4PkyWE4In5pk37YHvb14RI2EFb2vfv3fIa2ZsIHk631u0/B9u3rSOdTBmnOJJl X-Received: by 2002:a17:906:b015:b0:a47:3527:96d2 with SMTP id v21-20020a170906b01500b00a47352796d2mr4660452ejy.0.1711368622817; Mon, 25 Mar 2024 05:10:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711368622; cv=pass; d=google.com; s=arc-20160816; b=rikXU3qIZymTgzdb9Ri4Wx0caP9e5tUu8NjS0+2g0XHfCjwIwkmsSmdGbos2JpGhHe IfdgPH0TzjtF3tvbedMlGonr40whDmhzCERhpTMVWSAsvyXuClXy7hhoTeOCw7EyBQA0 zI0VL2xP1BwfH4FDBGwdystdBq8047EYG9PZMcb/e5fg6hhbyrW1/E1iAv9ZulOTgIpv LUbi9Hh8GsjbOpbEaHus+CIMkIpHKIwJSvI+9yoT6QMR9vXwaQI6AxJ+QyeCIPz6OE6k 3RFN6y0QX0sOnA5HDB7G+CYX57asSXc5W5QhSKhBFebzU9hezfSWwpxefHvmiky0UR95 ZfuA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=4LnrNtIij4Bn4X4TVnt4F69Di6fmhgYJ95GSudT4g/s=; fh=MmECj5qa/ljbG7IOmNdfYaHqsRJtXm3Q4IXbLyUJpmM=; b=OIi+mRmpcjSoZC70jxsel37oVOsowfHCUXZ/vg8jX0lSNng16ZuXSGkPnvXMRCVwHs oH3PnEPPcSy6QJXcf3i0iYhfgXpXKlR/t6gohJigBVg+m7h/Nq8uaytts4HHjHjMbsHS UqavD+4agpD2ee5qPJXMmt+Pstzfb6ScKanP2zbXKgMNXPipYFULfIBxWu/bbDHaWbZK MQDX8GjwBGeN4kFQWwRKpGuDbg3Qa0yHB/ypjGsH7x/tqVpQHax4oTTAcAMOUcfZ6tgw jqxV4Fkwp2WzUgstq3Am9gWtmrclcNpu9Da7My8ubssQr+Gwzw2fFi4aW7ojL7qU7Tfx O4Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nsD79n78; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116444-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116444-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dt16-20020a170906b79000b00a47c39e82ffsi1157116ejb.643.2024.03.25.05.10.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 05:10:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116444-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=nsD79n78; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-116444-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116444-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 630211F3782C for ; Mon, 25 Mar 2024 12:10:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F343312F369; Mon, 25 Mar 2024 07:31:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nsD79n78" Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) (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 591B934E9CD; Mon, 25 Mar 2024 02:51:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335067; cv=none; b=U8LT2meAU/M9oJUjAa87wMh31dT+akAC4pz4sTC71OLJJAappD48XZuWAAJU2t+sxdJE7DUgHjfjox1lWPmgmX4NYjQJMw8pmLgUWXkWXKPxaaUdVzEuem92SPRqM46cXfVI2LgiKvYpMwQzy97dva6ilT1z9S+yDS9T7zivuDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711335067; c=relaxed/simple; bh=biRFDuDFFmrGcVhDFXnntAOosUY7GJSIQ9cbUZxbPus=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Q01/3KzMjeF88gp4ZagzbpCib3MazW0J9ERRL92EkV91XwPVc9LDSFbeXExTKCRlBJKNHQEBceMzgHV8phze3FjbVpctqWKie7+DZHqAr1bSOC6WLgy46VuGeNrRHm+Wv1TMSWaYaOxXaYr5nPSuzvziQh3IlyqcDEXmf6CiZHo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=nsD79n78; arc=none smtp.client-ip=209.85.208.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2d687da75c4so46885011fa.0; Sun, 24 Mar 2024 19:51:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711335063; x=1711939863; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=4LnrNtIij4Bn4X4TVnt4F69Di6fmhgYJ95GSudT4g/s=; b=nsD79n78jjbGfEpAslqT6wW1qIR2qibW0xv8C767n6lfnsZ/wJ5lqKEMBSTx3yV4a6 hTCdQXhUTFPI7ibW1CHdAJJ6g7gtv2FHXy1jJPhQcNbW3EiaLPwkLyntUam5Km4jR9DJ 4vyiEtiQU0BKHfmtob+K93RAZr/TtKEIAovkAQq+EFnlhsyFtXtNaSkRYbgfNIDq74Pj y6cdgtAJ0P8gOx01mj4vEF3ex5lzMAxWbUJpezdIzxxWxDI+s/ug+QEcMKUi7ELSmYT7 Q8UapWqkOK9yrUuPEtGCidXBc/ebeCxMMDHW98b2Zpgpd5a27wzEk69QTCeNQDU6diNX y+dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711335063; x=1711939863; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4LnrNtIij4Bn4X4TVnt4F69Di6fmhgYJ95GSudT4g/s=; b=f1gCmHZr3qp8LkvN5c23M0+meYzO8sHaeybmugmpXfE1QD+g0KZyYmybwF4JtgNPSR CaCdD2EyRE0BurItiyGnmtLVDeam+Zt3nha+IYqz111mFUd1aPSdjDHT4QVnTm8w825D JG7Y+AlCGV08PqiyOY1VGO/8aIhObagrUI/bf7ZYGDXV+OYXmpmKqUp4bykWIHicW5Lw G3ztostqfJ6smAGHhs9Wdm3PIC6VB5AVPVdtVNuVoF9lQyZKBPdoAgy61TninMcBz/ij qsgE0zuGec44iLF/8z9H67Cr6ROzVDMkVRZCMkPkI4Q9b9OyQ+nbRsMxdSL53YSXStP9 XHKQ== X-Forwarded-Encrypted: i=1; AJvYcCVpMe6MYuctjDt9zes1j0uHMbYScasyLD90IeV6LXNgpPC9Ygmfc6wJMkW9MBugjGRl4w9TrbZksW3q6FMTkyAKvMmqju4XWEMxXKHICMSuJ9kZJW1xLNMKXQJicpnsNtdwwRla X-Gm-Message-State: AOJu0YyFStb2nWeMtzPBYkFDA8y1g2UbHDMD0j4Kj0hFRTTkJ8xKoCPM 7+6XxV/ZASf4u1PzJBMxra8LI8AMxz0dDDndfBhRe6cHhDoLOqor9+L4AiIzZqQPucSe5EQNzC8 fsIlMFI+7xOo8sZ7E8O1h2EYsoQ0= X-Received: by 2002:a05:6512:3d22:b0:515:ab5c:4a2f with SMTP id d34-20020a0565123d2200b00515ab5c4a2fmr1675869lfv.26.1711335063232; Sun, 24 Mar 2024 19:51:03 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240310-realtek-led-v1-0-4d9813ce938e@gmail.com> <20240310-realtek-led-v1-4-4d9813ce938e@gmail.com> In-Reply-To: From: Luiz Angelo Daros de Luca Date: Sun, 24 Mar 2024 23:50:51 -0300 Message-ID: Subject: Re: [PATCH net-next 4/4] net: dsa: realtek: add LED drivers for rtl8366rb To: Andrew Lunn Cc: Linus Walleij , =?UTF-8?Q?Alvin_=C5=A0ipraga?= , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > OK, I'll add _group_/_GROUP_ both to the enum name and macros. Led > > blink rate, for example, is global, used by all groups. However, it > > will be difficult to respect the 80 columns limit passing > > RTL8366RB_LED_GROUP_OFF to a rb8366rb_set_ledgroup_mode function with > > only two levels of indentation. Do you have any recommendations? Hi Andrew, > https://www.kernel.org/doc/html/v4.10/process/coding-style.html > > Now, some people will claim that having 8-character indentations > makes the code move too far to the right, and makes it hard to read > on a 80-character terminal screen. The answer to that is that if you > need more than 3 levels of indentation, you=E2=80=99re screwed anyway, = and > should fix your program. I need 3, not more than 3. > Functions should be short and sweet, and do just one thing. They > should fit on one or two screenfuls of text (the ISO/ANSI screen > size is 80x24, as we all know), and do one thing and do that well. > > Maybe you need to use more helper functions? The call that violates (by 1) the limit is to rb8366rb_set_ledgroup_mode(). With its name (a little long), the now 5-char longer macro/enum and 3 tabs, it has 81 columns when I align the argument to the opening parenthesis. static int rtl8366rb_setup(struct dsa_switch *ds) { (...) if (priv->leds_disabled) { /* Turn everything off */ regmap_update_bits(priv->map, RTL8366RB_INTERRUPT_CONTROL_REG, RTL8366RB_P4_RGMII_LED, 0); for (i =3D 0; i < RTL8366RB_NUM_LEDGROUPS; i++) { ret =3D rb8366rb_set_ledgroup_mode(priv, i, RTL8366RB_LEDGROUP_= OFF); if (ret) return ret; } } } Should I rename the rb8366rb_set_ledgroup_mode function, RTL8366RB_LEDGROUP_OFF or is the violation here acceptable? Can I use the double tab indentation here like it appears in https://elixir.bootlin.com/linux/latest/source/net/8021q/vlanproc.c#L120? Regards, Luiz