From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f44.google.com (mail-dl1-f44.google.com [74.125.82.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 203FF27AC57 for ; Sun, 26 Apr 2026 18:22:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777227726; cv=none; b=as60zp5+vldOsLjpm1qzz0ZWoKaTk8ogBQ/nzMu6JwitAlNsOJsVyL38P9E9TOOUYoYrb5KlinIZap6gxi8FftjMN4zyfeOp1m4sw7F8Un2cc1FlnM0lYVjAx5HsWub1zJZWdNSczXGxLBuWHCe4TnW32iIE/mpWc8YYUg1uroc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777227726; c=relaxed/simple; bh=VTtRU7r9ZLGXtBxWjUtnG5wLJen74LMwEuI1tB5eHJ4=; h=Date:From:To:CC:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type; b=JWzj5wrJUFxWDLdNIWuGr+NOFKGo3/5iNu0bmxC1qFHM7VD1NRYj0TzWLPjgDtrEiVHbjx4tStMGmcnCo9a3HffbXFd0bUYS9MMt7MhcgraWXvVKMjqCc/1NfI4lUGezwNJ1Tdvx41uGTvEDzydd+yWCcgdUUp/bhGbdkY6ShUk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qYfeB9yp; arc=none smtp.client-ip=74.125.82.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qYfeB9yp" Received: by mail-dl1-f44.google.com with SMTP id a92af1059eb24-12c45281a06so12301248c88.1 for ; Sun, 26 Apr 2026 11:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777227724; x=1777832524; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=VTtRU7r9ZLGXtBxWjUtnG5wLJen74LMwEuI1tB5eHJ4=; b=qYfeB9ypP/3+btNWkUaZqtihhA12iGoNlNo1BsvvRqniJhrVXnGsiozdslICSjsomX 4vMU0jv7TeTB1G67Ywt7/IMZHLvtfsmSHqk1vxZEJaRDFew5pjoEpHAXE6z6W/4UpR+Y Uwwh7EQbuTbdZmMrX9/1eKmoRfXWon8WgEBARLVuKG4DPSvnGvVR3Sqmnbi1peYb6M7P OaGugjNKXvlY5+QIt7V5oEImb5SsqY1m85/zB3O8oRV5mbqG6co6RTvQMU0QWGtkR+ZZ UO3HZZJggf/UYg/wFYb9LdMr/NL9VQoPG7nhQxE0bdZ9aLz+WEge2PDoGLbB/JSAdHbP SaMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777227724; x=1777832524; h=content-transfer-encoding:mime-version:message-id:references :in-reply-to:user-agent:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VTtRU7r9ZLGXtBxWjUtnG5wLJen74LMwEuI1tB5eHJ4=; b=m1V/JGR+WeXVCtB34q1FzlWaS8feRAKmJjtdCfGbgGtSHU3d3UhtMDEdXel/FQ8CSY rzCE7V4JQppcSJ89xxJvy3z/lZ6dfLr+RHj0r5FWO6q1NrLo8gzfQg9CcvJru/OBkt2r GwIGDacx3ZJCjwKrCDwUtj+l5U3+6X+HAK5gZTrixC/osTSynKjd/DuY4YaU3BB3G4jy Gvx2ugYPY6qP5u5kEUqMMnv9OxynJIKQp8Ny03XiGDTvZ1IxFHk1eHBde/8iUxK79r0k 5lJNJZAzz8e9KQ5qQWsPoyB30fmr5+nwiRtwmdAngAZPEQ93qWEUE5PXVOZtGfXx12re G0lg== X-Forwarded-Encrypted: i=1; AFNElJ8piq4rGQwaaClZQLdLiit/ioXJVlSD9PvkGEr158g5NFmMU5saXKXZJU9IgI5L3aVFGNvG4DT5edWexI0=@vger.kernel.org X-Gm-Message-State: AOJu0YxXnAamygJFfilA9+UFLboNRJMOI0lswRN3Kr3Nm3wPf4iJ6B/3 jL+xZi8rt6dXkUE0occECrmKrwijsW//PN/n/Sfsk04OfxC95DHGSC9L X-Gm-Gg: AeBDietvK+Ng0/slA3vt8Rt4xNiOvh3i1fo7eUissxs8VFUZKXekMRJnBU7BfGpnlo5 X4cqy4P/Zch+duBP2Tkv5edQULYUl5dvrvf6pe6ZeqIq7L7VriCr+h+82EU/hum9teBFQwkUG7u lyJH2qNeSZ5fytILKYS+I1hrgpdd7zjip0LXV/MfQ8Y46ACzvgTYmcEUWLCe4drn07oEAIvb+0g Oh8fmQvYaikPW5p0XQxW8uHd5ZJD4CZwRlIwh0N2aIFFJDeixwI+J81mzNC0PqSK/ZpEQMG6nlI HCwmMdRpKvs4w5wCsWvOR5G4OFsQ6GfmAG3VzZ/1Yg3WpKReBRx8NIAbd1dAluLDa1BnVt6eBDc nhY4fVzLKkqWCVoXYoNF5XGTzHtk5QpY/DjDDfelHkIRpoXDoTYTXY6qUuvzEGSuAFq5JEdXa5x 6mTAeyTgM/ooFla2TyyrUQ3hQnHUC+F3F0JRJOupEOWaVedbzzK2uihQ68nCbgJ+tAk1nJHQPdZ YwMY0EgcPYtKxWQg3wn4cjCjEi9swzvYZ512z5y2nU= X-Received: by 2002:a05:7301:f90:b0:2ea:7901:8d72 with SMTP id 5a478bee46e88-2ea79019c06mr9413326eec.17.1777227724075; Sun, 26 Apr 2026 11:22:04 -0700 (PDT) Received: from ehlo.thunderbird.net (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2e53d8b944bsm40489472eec.28.2026.04.26.11.22.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Apr 2026 11:22:03 -0700 (PDT) Date: Sun, 26 Apr 2026 11:22:04 -0700 From: "Derek J. Clark" To: Yufei CHENG , mpearson-lenovo@squebb.ca, i@rong.moe CC: hansg@kernel.org, ilpo.jarvinen@linux.intel.com, platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] platform/x86: lenovo: wmi-other: Fix uninitialized User-Agent: Thunderbird for Android In-Reply-To: <20260426174332.9981-1-cd345al@gmail.com> References: <673b66893c16ca31b403e7e7cba32e9b71a7515a.camel@rong.moe> <20260426174332.9981-1-cd345al@gmail.com> Message-ID: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On April 26, 2026 10:43:32 AM PDT, Yufei CHENG wrote: >Hi Rong, > >Thanks for your feedback, I've corrected the format and resend the patch= =2E >However I think I have to point out some other issues in this file=2E > >First, we should not complexify simple things=2E You use lwmi_om_fan_get_= set() to >combine get and set into a single function with a boolean flag to determi= ne the >action=2E >This makes the control flow harder to follow and audit=2E Furthermore, th= is layer >of abstraction is not applied constantly throughout the whole file=2E In = some >places, values are set through lwmi_om_fan_get_set() and in other places, >they're called manually through lwmi_dev_evaluate_int() >This inconsistency makes the abstraction pointless and is the direct caus= e of a >second uninitialized bug > >In line 855, args=2Earg0 is set to attribute_id, but arg1 is never set=2E= Though >arg1 is omitted in read action, you're still passing stack garbage to the >lwmi_dev_evaluate_int()=2E And I think it's better to zero it out if not = used=2E Hi Yufei, This bug is already addressed in a patch series that has been submitted an= d is awaiting review from the subsystem maintainers=2E=20 >Additionally, I doubt whether bypassing the minimum RPM divisor has any >practical use at all, not to mention it's not guranteed to work and purel= y >depends on whether EC accepts that sub-division value=2E > >I may do some refactor recently, and I'm happy to hear your suggestions= =2E Rong has a large refactor series queued up to simplify much of the driver = already, pending the acceptance of the previously mentioned series=2E It wo= uld be best to avoid doing any additional large refactoring until that seri= es has landed=2E Thanks, Derek >Thanks, >Yufei >