Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4370360ybp; Mon, 14 Oct 2019 03:39:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqxolgBaH+OdH0zRDs0kYWCznJicfkwHuB4Z2zMGtIP6doO2L15wu7OADfBA0MAD0OM1J15k X-Received: by 2002:aa7:c303:: with SMTP id l3mr27517427edq.234.1571049567497; Mon, 14 Oct 2019 03:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571049567; cv=none; d=google.com; s=arc-20160816; b=LmOuQNtDXsGbOwx7/LtkVsg2J10p/sfChofT7JrG1FU4h+7sq/4goXj/iWcPc+zDTI psYiKbG2EuD4v02cQgSafvsh/NMWkZy6UNCE0DeWQjb6MKZtC5rEaYMI+ogG0CzFI+eF gPsQ056a52PHNtqB/gaZfOrzvEA4mfNn0ZSRgSM9N4SKcf+EpNx97f6M7T/rl29pC/tQ cMg1XXSYvtynm/WtIM8Wjf7UwFw2D7zHeg1Mof3ByYeVwGqIPSQxYIkKAD3JD5hr/CRF sbLZv+eRvIvpTUfKrqtkfT8pWSpdlKjyKXTVPmr/AnZMDQAPJdl0hqIfudSQlSrp/Kzz 6umQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2TKdF4XZsAi3cmbNxmwvJlAMNLqUp9nQSOsq0fzDzFU=; b=AbZVJqj/3NrEVlWwup4TNpvirkrEzp2l8l+WL81UlieVvlELgvFO+N5WAzRA3EKIb0 c1LN+H1UurVHJccgirj441eqVfgFWNt+KDkx5iyB5cA8qmglwgjEsSDdH95E5HjpjpuO /2JTlnD44yj+0tMkTDeFmrcOFcERdp2CPNm5iJGRExFCCPDKcudf9AoJqlZzdxY94R1S IsWDnt1GTnqdPaYT3fyMODQIsmyB/S/qlva4XZ+yKNZtJ7dZqvioXYLXY6iWMcvC4/3f hop4A9yGjGTVQB547GUIRRybayWl2b3j9g6bxv1EvMLBe3SdoWcEO1kzMRKX03aiexr5 mJew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=L7h8UGPz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q13si10901846eju.46.2019.10.14.03.39.04; Mon, 14 Oct 2019 03:39:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=L7h8UGPz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731585AbfJNKiF (ORCPT + 99 others); Mon, 14 Oct 2019 06:38:05 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:32924 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731249AbfJNKiF (ORCPT ); Mon, 14 Oct 2019 06:38:05 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x9EAbtDU005926; Mon, 14 Oct 2019 05:37:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1571049475; bh=2TKdF4XZsAi3cmbNxmwvJlAMNLqUp9nQSOsq0fzDzFU=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=L7h8UGPzbB7kzMy5Je17fC1cYeqUlfyihdetkST2Pl71DRU8dqIEE0R7z8zlRT6qU lDQ3zaKO9dxLPgUZVpJkTf6YaVZFB1RLrAFrfSNqYKxk2XewFZnIYpjmQFKt2AnILG H7uFcryA8ovkvXu1mg1YX38DZDFj/AS1CIh8gTbA= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x9EAbtkl007537 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 14 Oct 2019 05:37:55 -0500 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 14 Oct 2019 05:37:54 -0500 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 14 Oct 2019 05:37:49 -0500 Received: from [10.250.99.146] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id x9EAbrc5100478; Mon, 14 Oct 2019 05:37:53 -0500 Subject: Re: [PATCH] leds: tlc591xx: update the maximum brightness To: Jacek Anaszewski , Pavel Machek CC: , , , Andrew Lunn References: <20190923100250.22326-1-jjhiblot@ti.com> <91864098-a6e8-e275-4b07-e4bb15469f78@gmail.com> <20191013114508.GI5653@amd> <844845d6-01fe-50c4-94cd-e19ce8a5d060@gmail.com> From: Jean-Jacques Hiblot Message-ID: Date: Mon, 14 Oct 2019 12:37:53 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <844845d6-01fe-50c4-94cd-e19ce8a5d060@gmail.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/10/2019 18:36, Jacek Anaszewski wrote: > On 10/13/19 1:45 PM, Pavel Machek wrote: >> Hi! >> >>>> @@ -112,11 +113,11 @@ tlc591xx_brightness_set(struct led_classdev *led_cdev, >>>> struct tlc591xx_priv *priv = led->priv; >>>> int err; >>>> >>>> - switch (brightness) { >>>> + switch ((int)brightness) { >>>> case 0: >> Can we get a rid of the cast here? Do we need to move away from the >> enum for the brightness? > I at first also wanted to ask for dropping the cast but first tried > to do it myself. Then I found out compiler (or sparse, I don't recall > exactly) complains about TLC591XX_MAX_BRIGHTNESS not being a value of > enum led_brighteess type. That's the reason for the cast Jean added, > I presume. Indeed that cast is to fix the warning. JJ >>> Added tag: >>> >>> Fixes: e370d010a5fe ("leds: tlc591xx: Driver for the TI 8/16 Channel i2c >>> LED driver") >>> >>> and applied to the for-5.5 branch. >> Actually, careful with the Fixes tag. -stable people will want to >> apply it, and it may not be a good idea in this case. Maximum >> brightness of 256 is pretty unusual, so I'd call this "a bit risky". > I entirely disagree. Not seeing anything risky in that since > max_brightness is also initialized to this value. If userspace properly > uses the ABI, then it will be safe. > >> Best regards, >> Pavel >>