From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f47.google.com (mail-pj1-f47.google.com [209.85.216.47]) (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 5D0B2399887 for ; Thu, 9 Jul 2026 18:07:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783620436; cv=none; b=kx9Zk34uHZSzA8e16Zyh4MKJ1ROJ+2BFkxgJb7ESm9hmVLqwRzV55k0qQ/WrpGIdldd21aAoxq4dCn+ouJcLWT2vJaknSZEKOgwoIoqeAmIVfJMVyEgpsbD2ezkbPdJj+2b4PIwyVt37AzAp+GpT82rtmDd3C+3c7gJ40HDt1D0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783620436; c=relaxed/simple; bh=oQOseecGKDFNJSZZXs3hPi/MUWkyn6FC9h7zrLmB03A=; h=Message-ID:Date:MIME-Version:Content-Type:From:To:Cc:Subject: In-Reply-To:References; b=O8aSh9ZodttB8VioWDpqw/csdv2N+1wlM6tMIUqPr31NI5Njd0/Ihe1EYsewxGzCabV91Qtj65EeqRoGFULQTY5Jm05btP5Jbs4pb3+pA3/RXiRLk+isEs0n9xWZq0lDCEaM4SYKUAtKUOiAHsx2k48XtfewyTL3TvicmN6gBAk= 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=rNf18GKw; arc=none smtp.client-ip=209.85.216.47 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="rNf18GKw" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-3856d6fbcb3so179155a91.2 for ; Thu, 09 Jul 2026 11:07:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783620434; x=1784225234; darn=vger.kernel.org; h=references:in-reply-to:subject:cc:to:from:content-transfer-encoding :content-type:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to:content-type; bh=QuKvNdMtfPuGOqhShdOewBpMLJ6Se1itd0me42XQ/vg=; b=rNf18GKwuYbzwYRU7O0WbL3w2KxK3Nb0EffBCPQBVcJyUfiBcYrZjthjGPkCfz+OdX aTI9bRAMtREQbwM00qrQZFHMjvzfsdxrqHEKtGHryd5ZUPD8K55rjjrUsxzuBlHot+CX vBCsaHzXeyz1fRcCdju3nCVlj9WZ+oZmzto/PsjOm0hlB1B17/aAkPJ6LuTAkLxMoMDm GC02Qe0ws4YO+4s//gIKu45Bdiqz9422VSP+s1ArypZguCQrni3lmDLx4z8iWYWv04hH YkPjEsJhaghjmtdeN8bM2PuMpUsGWTwzSrvKbeISB+lqcsK6598qR0DqllTZN8q3R+vX m4Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783620434; x=1784225234; h=references:in-reply-to:subject:cc:to:from:content-transfer-encoding :content-type:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=QuKvNdMtfPuGOqhShdOewBpMLJ6Se1itd0me42XQ/vg=; b=cq60JlpX2LIlmuOrxU67TPvD72jxS6mGUNDJYRr9rrZafHLY8vY3tXbF9olPVDYLpf jBB5lQ3gCzLlR3Uwgsu6YzQYXnYrBzTAHDzT1uWiQFQaYGgOT2NNShs3sFk0VKgcASAs WFwd3PL46zDW/eSxjHHlgMsI7CSbohBEted37+gi8bxi2dAXR/yFDD/ulXYgH7YKGgDw qR5p+teewFQX++G6JO8UFg1foLJAZHu4yYxb+gDao2zS/LN3lNX9pPopuU6W0W+yrb9o hMAYSeJInJQydEUV9s7RsVSmmP1eiWFlv1FNqNdbKoaiyMt+JIrKgJrxP+PbDEx/WfXS VK3Q== X-Forwarded-Encrypted: i=1; AHgh+RrIy9yxp11OeV2Z10VCSUXUZzBqV2XcUBsJkeDu2lMHM0S4OdS3V7UqiCRioB2WR3spd9PqgIxweUAtl6c=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7imsb62oelcob9Tea/t9nrX3UNrl2Iee/UF+zJ9zj1If4qYIo kzeIrZY+42llqROzuQd7Oz8tZ1wCmFGi+9Z8vX578C5AI8suW4Jt4pSR X-Gm-Gg: AfdE7cksqYSMt0JL5o0Z5hfdzXb9z0SRLes/F/AW6LJSwOz4iT3JBtacaiBC5gIStww Wyqh9lrR9oTlXsoLapyim6GGzTk/8z1F2hIS7HwPDOYeiNKFk79pe05bZbhexUv1IOEUmmotED5 6qd8G4QypJhIweqPN6SDZ1Zr6biz+Y6xqR+f0cdEgizd8drfoDvZ5aLaKQc0E82y7NVumo/ES+P WG2mT/R5yJ/TkwOYLUn+71R5K+UDBkjQc1MLbF/kyb5PMNuha7B1dxGtkAIFdPEVjVAEHPD9QnV NzoLkxo08GW1gEABHxluSEuNmGoQHS7xKt7DeAzVqq/f0VpRoxIhWDMpbD1B/AAJHUnz9GXHwsH MfJ9bJR/Hj5R0vGZ8uoe/wFYYiBIv8iU5QXyHwyWk7Odp2yKsE6DXQe9JyTux/CCZYjaVQCVS7L q7UfHMECBvktRAfAHND/YebA== X-Received: by 2002:a17:90b:3d87:b0:382:3dcc:1487 with SMTP id 98e67ed59e1d1-389417e521emr8243228a91.25.1783620434200; Thu, 09 Jul 2026 11:07:14 -0700 (PDT) Received: from reply_full.eml ([49.216.173.166]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-38a57dc46f4sm1618505a91.11.2026.07.09.11.07.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 11:07:13 -0700 (PDT) Message-ID: <20260710020644.6728.alvinhuang0603@gmail.com> Date: Fri, 10 Jul 2026 02:06:44 +0800 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 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> On Jul 9, 2026 at 6:52 PM, Dan Carpenter wrote: > These kinds of changes require testing. How have you tested this > change? I compile-tested it (W=1, building gb-hid, greybus and hid together) and traced the return path by hand. I don't have Greybus HID hardware and couldn't find a working emulator (gbsim has been dead since Ara), so I haven't run it on a live device. The bug is that gb_hid_set_report() returns -errno on failure and len on success, and __gb_hid_output_raw_report() computes that into ret (even adding one back for the report ID byte) and then returns 0, discarding it. So a successful hidraw write reports 0 bytes written and a failed SET_REPORT looks like success. The GET path next to it already returns the count, as do usbhid, i2c-hid and uhid, so callers already handle a positive return and greybus HID was the only one returning 0. Thanks, Hao-Qun