X86 platform drivers
 help / color / mirror / Atom feed
From: Denis Benato <denis.benato@linux.dev>
To: luke@ljones.dev, Dan Carpenter <dan.carpenter@linaro.org>
Cc: platform-driver-x86@vger.kernel.org
Subject: Re: [bug report] platform/x86: asus-armoury: move existing tunings to asus-armoury module
Date: Thu, 20 Nov 2025 03:44:21 +0100	[thread overview]
Message-ID: <5c8624ca-e7ca-4003-b5ca-ef7ea5889adf@linux.dev> (raw)
In-Reply-To: <E8438648-F06F-4CA2-9F12-8F9A7258DAEA@ljones.dev>


On 11/19/25 08:46, luke@ljones.dev wrote:
> I’m not working on this. CCing Denis.
>
>> On 19 Nov 2025, at 20:27, Dan Carpenter <dan.carpenter@linaro.org> wrote:
>>
>> Hello Luke D. Jones,
>>
>> Commit f99eb098090e ("platform/x86: asus-armoury: move existing
>> tunings to asus-armoury module") from Nov 2, 2025 (linux-next), leads
>> to the following Smatch static checker warning:
>>
>> 	drivers/platform/x86/asus-armoury.c:429 mini_led_mode_current_value_show()
>> 	warn: iterator 'i' not incremented
>>
>> drivers/platform/x86/asus-armoury.c
>>    399 static ssize_t mini_led_mode_current_value_show(struct kobject *kobj,
>>    400                                                 struct kobj_attribute *attr, char *buf)
>>    401 {
>>    402         u32 *mini_led_mode_map;
>>    403         size_t mini_led_mode_map_size;
>>    404         u32 i, mode;
>>    405         int err;
>>    406 
>>    407         switch (asus_armoury.mini_led_dev_id) {
>>    408         case ASUS_WMI_DEVID_MINI_LED_MODE:
>>    409                 mini_led_mode_map = mini_led_mode1_map;
>>    410                 mini_led_mode_map_size = ARRAY_SIZE(mini_led_mode1_map);
>>    411                 break;
>>    412 
>>    413         case ASUS_WMI_DEVID_MINI_LED_MODE2:
>>    414                 mini_led_mode_map = mini_led_mode2_map;
>>    415                 mini_led_mode_map_size = ARRAY_SIZE(mini_led_mode2_map);
>>    416                 break;
>>    417 
>>    418         default:
>>    419                 pr_err("Unrecognized mini-LED device: %u\n", asus_armoury.mini_led_dev_id);
>>    420                 return -ENODEV;
>>    421         }
>>    422 
>>    423         err = armoury_get_devstate(attr, &mode, asus_armoury.mini_led_dev_id);
>>    424         if (err)
>>    425                 return err;
>>    426 
>>    427         mode = FIELD_GET(ASUS_MINI_LED_MODE_MASK, 0);
>>    428 
>> --> 429         for (i = 0; i < mini_led_mode_map_size; i++)
>>    430                 return sysfs_emit(buf, "%u\n", mini_led_mode_map[i]);
>>
>> This loop doesn't make sense.  It just prints the first element in
>> the mini_led_mode_map[] array and returns.
Thank you both for this.

Fix available here: https://lore.kernel.org/all/20251120024059.1341326-1-denis.benato@linux.dev/
>>
>>    431 
>>    432         pr_warn("Unrecognized mini-LED mode: %u", mode);
>>    433         return -EINVAL;
>>    434 }
>>
>> regards,
>> dan carpenter

  reply	other threads:[~2025-11-20  2:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19  7:27 [bug report] platform/x86: asus-armoury: move existing tunings to asus-armoury module Dan Carpenter
2025-11-19  7:46 ` luke
2025-11-20  2:44   ` Denis Benato [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-11-24 11:53 Dan Carpenter
2025-12-01  5:16 ` luke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c8624ca-e7ca-4003-b5ca-ef7ea5889adf@linux.dev \
    --to=denis.benato@linux.dev \
    --cc=dan.carpenter@linaro.org \
    --cc=luke@ljones.dev \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox