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, NICE_REPLY_A,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 BE71FC433E3 for ; Thu, 16 Jul 2020 15:07:45 +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 8F3622063A for ; Thu, 16 Jul 2020 15:07:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="UQWR4HVa"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=ti.com header.i=@ti.com header.b="JUlcFezn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F3622063A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com 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: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:References: To:From:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=n9+peWrU/pUowcmdX6u0pwaVHT/+j4zNCFCp0qxQpUs=; b=UQWR4HVaS3NNSx+St52mlWf43 mjOT/kBBJI42/tnPA6aMsbuyXmq0LTFoAe+H5a0I0VzfxEd8IMFRfiT0UrA32nPfB4JC30NZSl0z0 9or8uOeFP0Gd8ONtKqt/SSHJhYgm1Z1U9L+Zr89bqS5pmvTMDseZkGzGTnAp784QUGCCXy7kjmhcY kGtCCJQH7rNqNNLrbPeeqrqmFw6dSddM/ArVLZYjxCH2kistiZJzST9U35ke4SLqgH+bWPHiw7KfB GDu2XBUgz3swziAZxgQmwmX7sqtLlIdKiWd8abrUlaZN1awC/Ca7sYlV9CSHZ3hRtlwjG1QMeTRRK x/IYjFi5Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw5Si-0004Rw-B0; Thu, 16 Jul 2020 15:06:16 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw5Se-0004Qc-Uj for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 15:06:14 +0000 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 06GF67vT094865; Thu, 16 Jul 2020 10:06:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1594911967; bh=ZRXaPKqO824iMUfjsyA2RVRrQ8jqiJKdpERWl5OpL1U=; h=Subject:From:To:CC:References:Date:In-Reply-To; b=JUlcFeznp6WTiJQYcfC7EhpCejnuoFMP2l4GWOsEpCx/9t2Gg28zuM5fine/boBB7 JL4wDkRY1yH2NWk/bzjSMMUscxLtlkRu1bjQTAmHZh4hpH6vl8J31/vI6mVNwpqlhc HiTShs2KPLu7P3f7UHDnsI9WTeRMXaibeejVybrM= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 06GF67dk062299 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 Jul 2020 10:06:07 -0500 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 16 Jul 2020 10:06:05 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE104.ent.ti.com (157.170.170.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 16 Jul 2020 10:06:05 -0500 Received: from [10.250.32.229] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 06GF64Xo039745; Thu, 16 Jul 2020 10:06:04 -0500 Subject: Re: [PATCH v30 05/16] leds: multicolor: Introduce a multicolor class definition From: Dan Murphy To: Pavel Machek References: <20200713154544.1683-1-dmurphy@ti.com> <20200713154544.1683-6-dmurphy@ti.com> <20200716083104.GA30361@amd> Message-ID: Date: Thu, 16 Jul 2020 10:06:04 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_110613_098786_0F6B4AE2 X-CRM114-Status: GOOD ( 23.73 ) 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-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="windows-1252"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Pavel On 7/16/20 10:03 AM, Dan Murphy wrote: > Pavel > > On 7/16/20 3:31 AM, Pavel Machek wrote: >> 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. > > Dictionary definition is multicolor no space.=A0 Capitalization is = > dependent on how it is use. > > Basically no capital in the middle of a sentence > >>> Introduce a multicolor class that groups colored LEDs >>> within a LED node. >>> >>> 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"? > OK >> >>> 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. >>> +=A0=A0=A0 depends on LEDS_CLASS >>> +=A0=A0=A0 help >>> +=A0=A0=A0=A0=A0 This option enables the multicolor LED sysfs class in = >>> /sys/class/leds. >>> +=A0=A0=A0=A0=A0 It wraps LED class and adds multicolor LED specific sy= sfs = >>> attributes >>> +=A0=A0=A0=A0=A0 and kernel internal API to it. You'll need this to pro= vide = >>> support >>> +=A0=A0=A0=A0=A0 for multicolor LEDs that are grouped together. This cl= ass is not >>> +=A0=A0=A0=A0=A0 intended for single color LEDs. It can be built as a m= odule. >> "single color" -> "simple"? > ok >> >>> +=A0=A0=A0 /* account for the new line at the end of the buffer */ >>> +=A0=A0=A0 offset++; >>> +=A0=A0=A0 if (offset < size) { >>> +=A0=A0=A0=A0=A0=A0=A0 ret =3D -EINVAL; >>> +=A0=A0=A0=A0=A0=A0=A0 goto err_out; >>> +=A0=A0=A0 } >> "new line" -> "newline", and actually check that character you are >> skipping is newline. Someone could put '%' in there... > > Actually we don't need to check for the character.=A0 Even if someone = > put the '%' there there will still be a '\n' at the end of the buffer. > > The for..loop above only processes the total number of available = > colors so effectively the '%' will be ignored just like the '\n'. > > If the buffer contains more entries then the number of colors an error = > will be returned via the check below since size will be greater then = > offset > > =A0=A0=A0 if (offset < size) { > =A0=A0=A0 =A0=A0=A0 ret =3D -EINVAL; > =A0=A0=A0 =A0=A0=A0 goto err_out; > =A0=A0=A0 } > > Maybe I should remove the comment as it is a bit confusing. > >>> +=A0=A0=A0=A0=A0=A0=A0 if (i < mcled_cdev->num_colors - 1) >>> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 len +=3D sprintf(buf + len, " "); >>> +=A0=A0=A0 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. > > OK > > >> Note I already applied patches 1-4. > > I will rebase on top > > One last change my legal team came back and said no to GPL v2+ so I = reverted that change Dan >> Best regards, >> =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 Pavel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel