From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (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 9621529994B for ; Fri, 10 Jul 2026 04:41:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783658472; cv=none; b=AIObVGWJOVjkzPr5ZD3p9Yycz8PZdspxzgXkYlf7vVlQz+oYd/u/3TcskdzfLVgx6J3E9hblIlYTIxa+lMMehA3qRuztNX6BwrkvVZC6AcgG/CTVhUdOc5gXrslY7R0rtrL45PvET1PJwgbloO3vx8WOF/qwRJ3q+QL3rm/BOSg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783658472; c=relaxed/simple; bh=DCFMHYxeBnoYQrKEoQsIMaN5DPqCs+l9VwNHik09HpA=; h=Message-ID:Date:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=n0xvHBNXlk3ILMhOwRciQXuLXCAMDzn470aMrJGGprp3NeGD+owlF9lZmwFHgsn3kOZNC2XhjOx2ghFsGfv0c9g0ntQt4xBKWUHz2Olmho0iZPZkKZUJik9NbmpZtnt/dZ5/HuA7VIqY7sAGkfFvqbJXdNCWpfbzoX0kNoV1lPI= 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=TWor20hE; arc=none smtp.client-ip=209.85.216.50 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="TWor20hE" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-3847e8b0f3aso520971a91.3 for ; Thu, 09 Jul 2026 21:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783658471; x=1784263271; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:subject:cc:to:from:date:message-id:from:to:cc:subject :date:message-id:reply-to:content-type; bh=618XwBlkSXmaSNWDLp2getHPTEbLpmZi3PDA41qTTi8=; b=TWor20hE/t+FF64MGlNnogQJebjFGJN0AGshJT6rw3uFhyH/An866oU6jg79eKEbYH kzmdtH2TvOPMVfuAEq/fbCV2awjt+w0hwrzeElsEQe6F43y5KeHxktcUsqOrDQmpTiyx f5MH/K70j6hrEbBUKCbSSIiwVDKrP5WgDWQf9Hdt6sofRoTMngUxYcBlumJNglAm3Lne BWpDk+M17R4E5dy85KimQjzhztuSVaPz5GoucNIwQccA28ENCL5DlYuDcvapUTXCQvKt k5DdmYNyqd0TLvPsbpll7NEpO/tcHg23zinFnXqyhSA+g/XIlqWwGrzbN7gnsd/BFMfG XqYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783658471; x=1784263271; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:subject:cc:to:from:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=618XwBlkSXmaSNWDLp2getHPTEbLpmZi3PDA41qTTi8=; b=cB67mE9erzkl1vIQmkxyVlvE14aRykG55kmlHnb17PUYPiliIK5p5gvqvrdsl9S0w2 iJN5+Z5Pu4VhW3H9pAuFv5zLjwH6sPoTs8fR0m+7vw/BuxrVnU5RR9Pp8AH1j1JOVITa P6/sCNsuRuzQrkH/blOCb8SpGWc0rSFs/e0AqELBK1m3aD40X6RGj5a7PBK6K5WSuLOD 6AuLha4WKxn9lDOihQz46lB+dtswC7QPfliFjSnnGjSIGqPlQRo9e5OPitad30iMY20P 5p47njI7oKoF2JcGlMV6UfffRtcAr3uNbQbygqlFiX3BbLh1Vc7AKwRbyckTGLlezDP1 +fiQ== X-Forwarded-Encrypted: i=1; AHgh+RokNQU20eRM86YA6gZrsEQpoiDPDnhMhip20fPtDNTz8vYEdTTDHKPqMS319Gd8YzsowPZ6cuTTQ+G8QSc=@vger.kernel.org X-Gm-Message-State: AOJu0YxEM65uAR/zMlNmAlddz9udv68thHUf3Fr1mZFo4SpOEBspiqgq 4ABMuHLRizxWC/YSg0/vcc9ezwI5n/i9cwDrdO/sg9BYvvmXxVzZrlc8 X-Gm-Gg: AfdE7cm7qs/4HQFpe2M1GJVwniFRUe/X4Xsz1w07V13ICByx19SA6fJL0rNJZLm5tn8 I62eDW8ef83VBGlGbBvo6C7QpLMmZ7TSbScPCEKVG204yzHM6SgJLzYb4RJ6XnZo794LwYKWzM/ fbqLFq+nInN/DMQCkYhPJSGdY9qY4YuWXpUKs+kgzYfI8msZVCy0MlKDv3SO4dnFiNLchHgN1Cl mVNkZ4KDVefW+loUpU9vKrW+zHSd8aJbfh25q3VWG4m+yJ2bWTU4XP45FlEjdd012+R3x20l+B+ ukMSQGbWUwE/7PniHO8yz9s9Kqk3AojDuK0rbyyLjekGBdZL+cN9oL3SP5WtmPishQw49E0gIV+ phpQy/VtLxOtsuMmp5tQaJopbU+Pmh3CJckFfQ5orpZKWA/dhrotQJ/4sEjB3p10Xt9ZSos9bR3 JqVZ3kq4O191KL4n55FOMftxk= X-Received: by 2002:a17:90b:5703:b0:381:21ea:9147 with SMTP id 98e67ed59e1d1-38940924754mr10622856a91.13.1783658470929; Thu, 09 Jul 2026 21:41:10 -0700 (PDT) Received: from reply2_full.eml ([49.216.173.166]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38a5516ad85sm2119312a91.2.2026.07.09.21.41.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 21:41:10 -0700 (PDT) Message-ID: <20260710124050.31335.alvinhuang0603@gmail.com> Date: Fri, 10 Jul 2026 12:40:50 +0800 From: Hao-Qun Huang To: Dan Carpenter Cc: Greg Kroah-Hartman , Viresh Kumar , Johan Hovold , Alex Elder , greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: greybus: hid: fix SET_REPORT return value In-Reply-To: References: <20260704081613.434445-1-alvinhuang0603@gmail.com> <20260710020644.6728.alvinhuang0603@gmail.com> 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: 8bit On Jul 10, 2026 at 2:50 AM, Dan Carpenter wrote: > The bug is not hard to understand, the issue is that this changes the > function completely... Was nothing checking the return before? It gets checked. The value flows unchanged through __hid_hw_raw_request() to the callers, and they look at it two ways: - hidraw returns it straight to userspace (write(), HIDIOCSFEATURE), where it is the number of bytes transferred. - in-kernel SET_REPORT callers, some testing "ret < 0" (hid-multitouch, hid-sony), some testing "ret != size" (hid-gt683r, hid-lenovo, hid-razer). So the old return 0 was wrong both ways: the first group had a failed SET_REPORT masked as success, and the second saw every SET_REPORT as a failure. Returning the count or a negative errno is what GET already does in this driver and what usbhid/i2c-hid/uhid return, so nothing working with those relied on the 0. Thanks, Hao-Qun