Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6581093rwp; Tue, 18 Jul 2023 02:42:07 -0700 (PDT) X-Google-Smtp-Source: APBJJlEJW5ZXQgkvCS3w/wZqxLOO6b7Z8bN4g3YdpLmM8vAG/mM2w8Tc8fwBfWp4gHfHT6l6sKYF X-Received: by 2002:a2e:84d7:0:b0:2b6:a3a0:5f7 with SMTP id q23-20020a2e84d7000000b002b6a3a005f7mr11160575ljh.9.1689673327036; Tue, 18 Jul 2023 02:42:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689673327; cv=none; d=google.com; s=arc-20160816; b=ufgsxjVuQjLk0GU5SAyhyn/Ql48XuTsX0Kk0dTd74VT9ztprHB2MmiGcSqtMccHVn4 mF7W4M2Kt1taz2rNSa0iRcbe81o//X4YxS7zndc+BCZAg8QePZ+ihl4J3zQsRVK4xIPj 231n65Qmb0QYNBQGXUO6BePC4AQ70Zyt09IPpypKyJSPldEqVTT+C+Qbn1PvO9CIIhqa J/fGUE26Ui9UaYWMXkqzkAB1+2fJ4YqB9sFBRqOAfx+1KXFqDzmqq/H+8/WC4Pp+YXdC bExIYbIEaURanStA293XYHezn3Jr3GdsekVkz1QbPyT/8vp6CENajPB3QwLrbgoGUxhr x1Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=mRSXKDbA+F/Ah5Ra/khVkGW1XVTL5fubGeg80ltRbHw=; fh=LXcgdepfqo3AfdNsmg6jevejXH0JgwZ1Wm14KkUHBFA=; b=z/UnGusiQvWAdJCjeuCyOQA9sZ/zPhmJ6rzfTESmNvxEz+d8j9nL2VNkoA+2FMxtRI e2fJSjYPyt7ezFXJUW7cGnCRJu0gZMK1Q1ARsEIoP/sS/A/+r3aH+iVXBOVxhoamNBOQ w4pooueo9vsC7AO7CzjM37d8Vo5rRUbeSmZBGqHGfqGUb35NkT67hrPCO9dXYi7bEflJ fPWQuo3lmWBsMHtZJn2GPYMoO+KN0eugr/aBiYTyZavU909cLPExtSC+Cnl5b1Z7svXq +rZEewFB4gegKVpl3JlyLjzRnPp/SgC4kjikhJj5MXfeSyv0I0U4J2KkhyL8ytZvaN4v LzXA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gf1-20020a170906e20100b009931f44c716si926929ejb.219.2023.07.18.02.41.43; Tue, 18 Jul 2023 02:42:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbjGRJVH (ORCPT + 99 others); Tue, 18 Jul 2023 05:21:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230116AbjGRJU4 (ORCPT ); Tue, 18 Jul 2023 05:20:56 -0400 Received: from 10.mo563.mail-out.ovh.net (10.mo563.mail-out.ovh.net [46.105.78.6]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CC1B186 for ; Tue, 18 Jul 2023 02:20:54 -0700 (PDT) Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net [152.228.215.222]) by mo563.mail-out.ovh.net (Postfix) with ESMTPS id CBC5422AAA; Tue, 18 Jul 2023 09:04:17 +0000 (UTC) Received: from director3.derp.mail-out.ovh.net (director3.derp.mail-out.ovh.net. [127.0.0.1]) by director3.derp.mail-out.ovh.net (inspect_sender_mail_agent) with SMTP for ; Tue, 18 Jul 2023 09:04:17 +0000 (UTC) Received: from pro2.mail.ovh.net (unknown [10.108.4.132]) by director3.derp.mail-out.ovh.net (Postfix) with ESMTPS id 9CED7107972; Tue, 18 Jul 2023 09:04:17 +0000 (UTC) Received: from [192.168.1.41] (88.161.25.233) by DAG1EX1.emp2.local (172.16.2.1) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 18 Jul 2023 11:04:17 +0200 Message-ID: Date: Tue, 18 Jul 2023 11:04:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v10 3/5] leds: class: store the color index in struct led_classdev To: Lee Jones CC: , References: <20230624084217.3079205-1-jjhiblot@traphandler.com> <20230624084217.3079205-4-jjhiblot@traphandler.com> <20230713095328.GH10768@google.com> Content-Language: en-US From: Jean-Jacques Hiblot In-Reply-To: <20230713095328.GH10768@google.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [88.161.25.233] X-ClientProxiedBy: DAG4EX1.emp2.local (172.16.2.31) To DAG1EX1.emp2.local (172.16.2.1) X-Ovh-Tracer-Id: 6165709368042535387 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrgeeggddutdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhepkfffgggfuffvvehfhfgjtgfgihesthejredttdefjeenucfhrhhomheplfgvrghnqdflrggtqhhuvghsucfjihgslhhothcuoehjjhhhihgslhhothesthhrrghphhgrnhgulhgvrhdrtghomheqnecuggftrfgrthhtvghrnhepieejfedukeevudfghfetudevhffhhfekjeeiudegtdehueevgfdvgeeivdeifedvnecukfhppedtrddtrddtrddtpdekkedrudeiuddrvdehrddvfeefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopeguihhrvggtthhorhefrdguvghrphdrmhgrihhlqdhouhhtrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehjjhhhihgslhhothesthhrrghphhgrnhgulhgvrhdrtghomhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhlvggushesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheeife X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/07/2023 11:53, Lee Jones wrote: > On Sat, 24 Jun 2023, Jean-Jacques Hiblot wrote: >> >> +static ssize_t color_show(struct device *dev, >> + struct device_attribute *attr, char *buf) >> +{ >> + const char *color_text = "invalid"; >> + struct led_classdev *led_cdev = dev_get_drvdata(dev); > > Can this be NULL? Thanks for your feedback. No it can't be NULL. > >> + if (led_cdev->color < LED_COLOR_ID_MAX) >> + color_text = led_colors[led_cdev->color]; > > '\n'