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 X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08504C433DF for ; Thu, 16 Jul 2020 08:32:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C86692064C for ; Thu, 16 Jul 2020 08:32:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uBjad2fx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C86692064C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=jommc/M+/EWIcaNkR6pX1e3WL5Qo4/eYZVjD5b9I/Hw=; b=uBjad2fxGropPfPp0/dpFtrfU plkkQJF0+JpRl3rYCw6lxR+SIFsC/2qPhe30BYDgXUKkStpIxZXTp4595n2Pbo25zSwSI/p6Y6Y13 v7pnAv+hwRcuz/JRxUcfS2VumD1mEmK5EGF9Q2gfgJU87ZLLV5NGlAyIQr7Xg2zgUQ25tM1VI1LPF twAY4o/Vg+I8+dKAGK6ommSm+wqNzjq+gSrMDClFUFeYCUFXacU9r7f411fogRaAwEFjJ+UBWlNY8 mIotvMZe6W+jWBMqZo2fZcgv3siyOxPOoHr6wOIuzGgBLqmoOl8MzO69bRsahi2Oc200JVMgMds9u IrXILuHbQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvzIP-0007Be-Mj; Thu, 16 Jul 2020 08:31:13 +0000 Received: from jabberwock.ucw.cz ([46.255.230.98]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvzIL-0007AW-EG for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 08:31:12 +0000 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 2A7671C0BDE; Thu, 16 Jul 2020 10:31:05 +0200 (CEST) Date: Thu, 16 Jul 2020 10:31:04 +0200 From: Pavel Machek To: Dan Murphy Subject: Re: [PATCH v30 05/16] leds: multicolor: Introduce a multicolor class definition Message-ID: <20200716083104.GA30361@amd> References: <20200713154544.1683-1-dmurphy@ti.com> <20200713154544.1683-6-dmurphy@ti.com> MIME-Version: 1.0 In-Reply-To: <20200713154544.1683-6-dmurphy@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_043109_620831_74B605C7 X-CRM114-Status: GOOD ( 15.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, robh@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, marek.behun@nic.cz, jacek.anaszewski@gmail.com, linux-leds@vger.kernel.org Content-Type: multipart/mixed; boundary="===============6679150245879406651==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============6679150245879406651== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! First, let's substitute multi.color -> multicolor globally, LEDS_CLASS_MULTI_COLOR is most visible example of this. Please also decide whether it is MultiColor or multicolor, and make it consistent. > Introduce a multicolor class that groups colored LEDs > within a LED node. >=20 > The multi color class groups monochrome LEDs and allows controlling two For example here. Plus, the LEDs are not neccessarily monochrome, we support white LEDs, too. Let's use "simple LEDs"? > aspects of the final combined color: hue and lightness. The former is > controlled via the intensity file and the latter is controlled > via brightness file. > + depends on LEDS_CLASS > + help > + This option enables the multicolor LED sysfs class in /sys/class/leds. > + It wraps LED class and adds multicolor LED specific sysfs attributes > + and kernel internal API to it. You'll need this to provide support > + for multicolor LEDs that are grouped together. This class is not > + intended for single color LEDs. It can be built as a module. "single color" -> "simple"? > + /* account for the new line at the end of the buffer */ > + offset++; > + if (offset < size) { > + ret =3D -EINVAL; > + goto err_out; > + } "new line" -> "newline", and actually check that character you are skipping is newline. Someone could put '%' in there... > + if (i < mcled_cdev->num_colors - 1) > + len +=3D sprintf(buf + len, " "); > + len +=3D sprintf(buf + len, "\n"); Using sprintf for single character has... quite a lot of overhead. Something like buf[len++] =3D '\n' would be simpler/shorter/better. Please fix all relevant places. Note I already applied patches 1-4. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --vtzGhvizbBRQ85DL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl8QEEgACgkQMOfwapXb+vLCTACff5DIlTEKpnar18gbrYa/V9pA +DEAnRF2FZd5xx4tNyqdWG9UCEZzwJhe =HdIg -----END PGP SIGNATURE----- --vtzGhvizbBRQ85DL-- --===============6679150245879406651== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============6679150245879406651==--