From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yx1-f48.google.com (mail-yx1-f48.google.com [74.125.224.48]) (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 5C9F42EA754 for ; Thu, 27 Nov 2025 20:35:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.224.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764275744; cv=none; b=RcR8wgHdwQJgVhRvri6/i0lhw1mxFXeWUKkeqf23oNECU3ljG0FSm6wI6bclVj38H5CDcK18/XGwjvNV7j2aFconCbZNjajQVSm5hUYotJRpIm26VxU1CgRHBnr+/iEvli7M8NQ1SgzCdchGf2QHS0BdGug/77nExlcQkClz5RM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764275744; c=relaxed/simple; bh=HtDJiGKwBcd0MheKnVnzDxPgz7tlHfxmRyB9yTFfvLQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=BASkP4LbjfTX70NjilsXhfu4f1V37wh8pT+kmoREJ3xLHkMG0gNob4xN4HTl7c4zgdkW4GCeP+XAyoAov8Vh7bd3G1jSsq0XqWVwi8GHBz/GPo6iieaBDVgc3CPSdGCKHM8OlFGykeLQVTZwvlOtNnxOEXNpbyBmaN6blcuGzF8= 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=OWPzv8q3; arc=none smtp.client-ip=74.125.224.48 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="OWPzv8q3" Received: by mail-yx1-f48.google.com with SMTP id 956f58d0204a3-641e942242cso1062295d50.1 for ; Thu, 27 Nov 2025 12:35:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764275742; x=1764880542; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=LiJqKid1AUPaq0JBx2dwztOPzocSSNqSoSuSWdADDrE=; b=OWPzv8q3Yyqzwfe12KbyyODlc+1jt13+A9+Bj7yHrw/48wfDIP+f3VbyRHuBSETRdF yEeYd1D5zozE2koqY0wezaNB25tch8QL23CcHy4ImA32zENSi4m50OhgA26lw3GxNUrN syDJPSgH3WJYoyYkxessaNfzEzHnJ6MIu0C1Tb3oFWNdIrVYPW2lUN69F3MhYc5iDnhx UJNKuupsqa2B2PEgv2IpNjJSCAsdWNlj+jVbNPSspUWWLbL4E47e4JfoyyVgL1VofTeJ Ef9hs8l6JuYLLFBlUgpDk4aT2XKNV/2l27CQ07wK7LCB54xNBRDxuPqd9eP7ctnP3Wuf bRiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764275742; x=1764880542; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LiJqKid1AUPaq0JBx2dwztOPzocSSNqSoSuSWdADDrE=; b=veyWaw483Pui3ZYUc2FbV9/rJ3GQsxXwNLWGoOZfRgU6PYu3swc7YFRtTOqhxugUlA M1BZvFqoZGBSiEyOoT3K63JupSC87wcpH6fTSQO2zWbprGNkE74+xOyRTItKQzxDo6hw MhawsKus3A7F/m+VpED/RneQnnYnmHWBkToWKjS6b0birzLmFKPG92p1UtfJAfkeOipe 9w3AlBF4YFbSWmi0dCIoTAfCnmgatRMhcr3JCnAny7X5w2nowy3r97yWpUSmsA9EqPBV BkQE5rFLKiSJWTUA5FMblx9IwNbuie6JQLk7CYf9ly/duAG3AgYMFjLeZOpNuIwLirEa kOVw== X-Forwarded-Encrypted: i=1; AJvYcCXE4CzagO87gKnqkNYx6U5NLAH63shZX7rHN45zeGcUAWbGlF0QtjzeW5/ciLWJ71dIgfCQLxfVeuOu8SE=@vger.kernel.org X-Gm-Message-State: AOJu0YzsJzJaqdgedYdg9mfOIBp1g0nF+eaPcw5IeO4jaDPlDPPPh7VS wrmHcRsIuNZeM7+hWDJ6ZGaKhJWc8jGhCAj1x1cjzp76KbLSc6+b2fX+c0tUeA== X-Gm-Gg: ASbGncszRJIq0rxkb4b1mRseSCFNyPKNU4WxOBmvRj4NekT0BUMiYIq2z9AlhcXSWiC LapvtWwWFQYk5DPNxx0jRe7cEiCEdEs25HHRbP/03BlEKnoS7QNFCYMJn2NiZtATju94vnGQQ7o pCnH1zMAD1zrefZvRU7ijsUNziTSCGuadxqmXvZQMIlX2+L4tGwiVp+TLuPyM3Y521Q0r3rq8LP U8tlpHNWJIo18ToHI0fVkOle8U2HNTZczNpRj72XdEz63JkRD/bODAIu5z+DehrZ4LxsT7Z9nMs /LrO4y9XtC8TVNCnwm0MxBmwCvIydgow7dL4VRFHqEHJNDW1BjCJ8+5VUx+tcVxdLpjMsca4Ah0 nmLA53tO/mq8SkaML3CaRPNRWenN0Big/8TwdcocWbE2V8AAFt78Mq1H4Wz04YhwP1yF8J4lc/H bO5+CyFExJpCAfnJa+KcZkQByi1V3Cx5a0HtbpJyOTlMVtHBRWCAgUhdTuWC/kGAPjPt7O X-Google-Smtp-Source: AGHT+IH1ZhvCQv2MEp+5/UarxbSxfCaOdxcBamQdmSSrJtRgTbE7ALnAkKsKzoTBGbYiZAzE6cNyag== X-Received: by 2002:a53:ce8f:0:b0:641:f5bc:6999 with SMTP id 956f58d0204a3-64302b39306mr12603551d50.85.1764275742186; Thu, 27 Nov 2025 12:35:42 -0800 (PST) Received: from ?IPV6:2600:381:6a1e:8e2d:1df2:9a47:b4c6:d8c2? ([2600:381:6a1e:8e2d:1df2:9a47:b4c6:d8c2]) by smtp.gmail.com with ESMTPSA id 00721157ae682-78ad0d5fe10sm8958637b3.14.2025.11.27.12.35.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 27 Nov 2025 12:35:41 -0800 (PST) Message-ID: <70565b52-d42d-4808-84cd-ac8587c75b10@gmail.com> Date: Thu, 27 Nov 2025 15:35:37 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/8] usb: gadget: dummy_hcd: coding style improvements and error handling change To: Clint George , stern@rowland.harvard.edu, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linux.dev, skhan@linuxfoundation.org, khalid@kernel.org References: <20251119130840.14309-1-clintbgeorge@gmail.com> Content-Language: en-US From: David Hunter In-Reply-To: <20251119130840.14309-1-clintbgeorge@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/19/25 08:08, Clint George wrote: > This patch series focuses on addressing various coding style issues in > the dummy_hcd USB gadget driver. The changes include simplifying error > handling by preventing kernel-space crashes, improving readability, and > ensuring consistency with kernel coding conventions. > > Clint George (8): > usb: gadget: dummy_hcd: replace BUG() with WARN_ON_ONCE() Hey Clint, Regarding our discussion on Discord, I wanted to give you advice and have it be closer to the code, so you could see what I was talking about. You asked about Greg's feedback regarding the "Bug()". Here is some context so that you can understand Greg's feedback a little better. In Kernel development, there are thousands of people writing code. As a result, developers will write something like "Bug()" or "Warn()" if a particular path/condition is met.This is to create a signal for future developers about situations that should not occur. A later developer might do something that causes that faulty condition to be met. When debugging, your goal is not to simply remove that line. Your goal is to find out what caused the faulty condition, and fix that. If all you do is eliminate the signal that there is an error, you are just "papering over" instead of addressing the actual issue. > usb: gadget: dummy_hcd: replace symbolic permissions (S_IRUGO) with > octal (0444) > usb: gadget: dummy_hcd: use 'unsigned int' instead of bare 'unsigned' > usb: gadget: dummy_hcd: fix block comments, blank lines and function > braces As we discussed, you can break your patches into something more focused on one type of fix. For example, one patch could be to just remove code and put in a more meaningful comment. Another patch could be removing unnecessary spaces. > usb: gadget: dummy_hcd: merge multi-line quoted strings into one line > usb: gadget: dummy_hcd: use sizeof(*ptr) instead of sizeof *ptr > usb: gadget: dummy_hcd: remove unnecessary 'else' after return Also, some things like your changing of the "else if" are things that you do not need to change. Some of the knowledge of what to change and what to ignore will come with experience. For that particular one, most developers are used to seeing "else if". > usb: gadget: dummy_hcd: fix miscellaneous coding style warnings > > drivers/usb/gadget/udc/dummy_hcd.c | 139 ++++++++++++++--------------- > 1 file changed, 67 insertions(+), 72 deletions(-) > Overall, my recommendation for you is to reduce the amount you are trying to tackle at once. You can work over a longer period of time on the file. Not everything needs to be accepted all at once. Also, feel free to continue reaching out on discord. I just wrote here to closer tie my feedback to particular patches. Good attempt at submitting your first patch series, and don't get discouraged. Getting feedback is a part of the process. Thanks, David Hunter