Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3630245pxv; Mon, 19 Jul 2021 05:09:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycTDQSMoP+Eip2U3w+n9okdzsCW2EtL8wJDJpqFuj4Ru9JxwUApfW5Hzg10XkP28lZKZ/o X-Received: by 2002:a5e:8f0d:: with SMTP id c13mr11592696iok.57.1626696560026; Mon, 19 Jul 2021 05:09:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626696560; cv=none; d=google.com; s=arc-20160816; b=RvwbuSIOMQfJJDCqiuA7IWgrJX4hvgxXIEFwEDOuTAfj9MjukJ0hcywH0LbredkIB4 TmsIzJgBhe0zgPypkHU6rLwqlDtDwOssiT7BUSoXo5ahrgtyw7sWO25136SvGk1sdlvq HTOViwj3h58sMT7entOph/82URvPkFz4YGT6AY6q4X5SZfrukPHr3/9HcblbNgZmna4b lulvVAKpkxvxiD8C0pBIFmAxNMUy2LvF+AEpThKsiqwebG/XCbVKl/6KTvTywPGsum40 un2KWgDuwOhB8JzkqF2ImE55nZwJbA13MealwpuosvKJq5VcxhkERRRUaUVQWqIETtQu 48cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fDijZbXqiy+kTbCiUoapIGWSc06F9MEEdXqoDIx/Eb8=; b=eM5PZ3pGE2P563h5aLH+CFzsHYURLA2iT8snmfSCULW726PO8iL+XMJOHThagvKwad rjPxXpDabqAdPhs2vz4DyXEq5gzfJ3Bf0jgsg7sSvBwAVkZVaG1jALko6I6HzTH5gmaA u0gba9meE9/CATVLZomhBEgn4HbD6BTaB/8NFUQ46zK/B5peQgQAAi2HNMoZrjjdGFMS BZ8ONeYIWlF8q0GS8vMdQxrXECwFz9GvVF2duSGxwer9IousIusfm8MnvP3+O/rYLA/5 UY+l3d/rcEcgohBHezZmyfmqV9r0ETgEVfRmg+sN+1AT791fsVCP2woF+ssNG0bQDrma 4NyA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si20209787iop.97.2021.07.19.05.09.08; Mon, 19 Jul 2021 05:09:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236582AbhGSL1z (ORCPT + 99 others); Mon, 19 Jul 2021 07:27:55 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:33574 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236505AbhGSL1y (ORCPT ); Mon, 19 Jul 2021 07:27:54 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id DE24B1C0B76; Mon, 19 Jul 2021 14:08:33 +0200 (CEST) Date: Mon, 19 Jul 2021 14:08:32 +0200 From: Pavel Machek To: Amy Parker Cc: linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] swap led_brightness from enum to typedef Message-ID: <20210719120832.GB20484@duo.ucw.cz> References: <9b5902665dcc4c0fca7546987303e348d8657f59.1626383424.git.apark0006@student.cerritos.edu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NDin8bjvE/0mNLFQ" Content-Disposition: inline In-Reply-To: <9b5902665dcc4c0fca7546987303e348d8657f59.1626383424.git.apark0006@student.cerritos.edu> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --NDin8bjvE/0mNLFQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > This commit changes how led_brightness, declared in header file > include/linux/leds.h, works throughout the kernel, and updates other > files in accordance. >=20 > The TODO located at drivers/leds/TODO requests: >=20 > * Get rid of led_brightness >=20 > It is really an integer, as maximum is configurable. Get rid of it, or > make it into typedef or something. >=20 > This patch changes the declaration of led_brightness from an enum to a > typedef. In order to hold the currently existing enum values, macro > definitions are provided. Files which use led_brightness are updated to > conform to the new types. Hmm... thanks. But I can't really pull this through the LED tree as it touches other people's code. > index bfa60fa1d812..e1d771513b98 100644 > --- a/drivers/leds/TODO > +++ b/drivers/leds/TODO > @@ -1,7 +1,7 @@ > -*- org -*- > =20 > * On/off LEDs should have max_brightness of 1 > -* Get rid of enum led_brightness > +* Get rid of led_brightness > =20 > It is really an integer, as maximum is configurable. Get rid of it, or > make it into typedef or something. You can delete this. Probably new type should be called led_brightness_t. And probably it should be typedef for the enum _for now_, so that we can switch users gradually. It should also be more than u8, I believe someone has more than 255 levels at this point. > +++ b/include/linux/leds.h > @@ -26,12 +26,11 @@ struct device_node; > */ > =20 > /* This is obsolete/useless. We now support variable maximum brightness.= */ > -enum led_brightness { > - LED_OFF =3D 0, > - LED_ON =3D 1, > - LED_HALF =3D 127, > - LED_FULL =3D 255, > -}; > +typedef u8 led_brightness; > +#define LED_OFF 0 > +#define LED_ON 1 > +#define LED_HALF 127 > +#define LED_FULL 255 > Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --NDin8bjvE/0mNLFQ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCYPVrQAAKCRAw5/Bqldv6 8oxQAJ4vpVLkMFtBxHpILlZoMm4jZWC72QCfSwt/mUMRhACR502Sg0mOnLGWDmg= =LRWf -----END PGP SIGNATURE----- --NDin8bjvE/0mNLFQ--