From nobody Tue Dec 2 01:06:14 2025 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 6E7E42BE047 for ; Fri, 21 Nov 2025 16:12:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763741570; cv=none; b=WH6sVmFPJdjFHU7Yybv5AjdTSbEyNoBzghsbKpd6P/oyIsVdalU3SVJ6k5uSxlFdEHioaXu8Yq6Nr02ocNm5JAiW9SL826IgAarfDOwVYeWpzkS9Y7pSJ9XkB5S4P98pYjh89y87rmHPMyaV9yjSLCNC2/djqOiU4DCrruZuk6c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763741570; c=relaxed/simple; bh=OSV4yuHWf4x29JNX4a7meofzp1dJiyfdpR859z8oZgA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Ea4icBwQWNNS84RIkthNfNmLoz95WmwleqjZZe7ec9yd9/+sD7XlVoe0zpMMLQZBP8U+zGtVCFUqLkWKZMSGKpv9vAeyjmaXEPkaLiDUhM3ljaTw6N5IA2lhNq+Ja/2Mo8TK3+xCGiLr1KZKR9jb12uaBz4yE1O3ecKMaCkyr74= 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=C+Xxksh/; arc=none smtp.client-ip=209.85.214.179 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="C+Xxksh/" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2958db8ae4fso22131285ad.2 for ; Fri, 21 Nov 2025 08:12:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763741569; x=1764346369; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=RUYGnZUH6ucRi/qVcc7Heh1B7eBQygkcRityLADBB7c=; b=C+Xxksh/yPI7lXBUv5XWNv4sJ42M6hQ2SE4RVf9L5QxCVXloe1paYAoLIaQBfG7vcU 593IG+ar4kJEzfCqdqCH3fM71PPVYKBVurJnx+0s7BbGPszXUMsB3ydxt+lXOPnNZNen 5FwuDmnu6zrSE36Om804KWirLjK6ST+ThuIWG3xcr56AskMve1fQR0e62dM0/T7zWgHv OxOnXNUtxaieQIDYJXhrbJlGa89wcdI8hWRpQ7AsDxK1YPm0KvE0tl8iuXip3Nhk4MSu 0jsVdzCypenImMynDBlWYJ7up20XigPpX3funuVsYHiS68KJDNRRpR/kVw/OXKX47QIO qjng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763741569; x=1764346369; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RUYGnZUH6ucRi/qVcc7Heh1B7eBQygkcRityLADBB7c=; b=UM5W2+yd+c8qIyuoeutdekawca4XybIOv6LqAu6RPuQeRwvw76BeJQEnf1cXHADRsm M5JTKYTLX3B9m2zkLXROW74WQJaekbU6SuPl/G8qYnZz89KQgHNaq4DNh5lC/2iHiRX/ 4TpoC+MW8ya/b2zYzuHnbj2CcdAzVBRMUbQnOm6LR/yDHKoqhjKL/FF8uyjDbWpiEAFh hhHyjbX9Hmuw62bLqIycgZTdUKidBZ+ogISkmoJfYokTAg+rAyIJqD7xUWOb2OPzPIVF BJt3h13SXxzmhonoy7Cr+q7mWpLCmfanPyHFW5VyU8A0yAOCgLUGNCYa79s+xry7ZDKu wbiA== X-Forwarded-Encrypted: i=1; AJvYcCVzmXnxDbhQeTVIenOGIpWjC3BzdnJcmVvxtETqfsTyPteenb0tEtlxsqO8RY49lospz5MwuS3EmVU88Zc=@vger.kernel.org X-Gm-Message-State: AOJu0YxzQaLY4dbGXa88vzCBTqlVX1NZpBXQhpWnIK4/5nz+k/ovK1jT skAYdcMCPmo26Q9EThCdWFp8sqzWkVMMEgpmX2GXagqvss2D3oxe8BVi5dv/D6w3FQ== X-Gm-Gg: ASbGnctJ3AfucwAFsKAe+xcV18WptrVptNrE9nPTi+z5dko1C0iNd8UOJf7pE89cEPd mmpd4mhtbTA3PstXsR8g6RZT6ZyYreAAMLqTfdaqx2CW6TJJwvj0jeEXAX+/CDeC7VFI6IhD/NS UPO0MK5F4VPkNS7LCk0VroOVuDmeqUkA20ddmAeOmAsxAXEVIsbcdqfGs4NTNHyZpOtv61zEP+8 sjD52vlnCr0NSysFtylliulbQdF50VjFwikdBTTKUluiYZ2+lHsJfu5aiSLjBY1OrVM+YiOTmc6 WuXeD26aBtxM2K2DAfmKIo1Iz9NWRnWNRhEcf7hOcmJ6DSvUAIog7BKBTlATK78Tc4gveNcnIkU +xNCC5V4rH1POYEajij6gAwywFP5g6E3gYByWUbNGzbfDCPi6qdS5Hr419SDmEH7JsLgyMXWDxx qG7SL+mwNkOblrPfP8is0o1aw+rZkwMjGfRrs/6SFUeokGKoS1x++uBoX1Ig== X-Google-Smtp-Source: AGHT+IFe3vZd/heh8xQX4oxZVNWWgfEL4GySIy2S5i8PL75Bj440r7ZwasVMkYR7MLLz2bRkgXushA== X-Received: by 2002:a17:90b:4a51:b0:32a:34d8:33d3 with SMTP id 98e67ed59e1d1-34733d6eb30mr3001668a91.0.1763741568572; Fri, 21 Nov 2025 08:12:48 -0800 (PST) Received: from samee-VMware-Virtual-Platform.. ([2402:e280:3d9e:537:8ccb:550c:e84d:a5b1]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3472692ed92sm5976363a91.10.2025.11.21.08.12.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Nov 2025 08:12:48 -0800 (PST) From: Sameeksha Sankpal To: gregkh@linuxfoundation.org Cc: sumanth.gavini@yahoo.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Sameeksha Sankpal Subject: [PATCH] usb: gadget: f_uac1: fix coding style warnings Date: Fri, 21 Nov 2025 21:42:40 +0530 Message-ID: <20251121161240.25818-1-sameekshasankpal@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Fix several checkpatch.pl warnings in f_uac1.c including: - replace NULL comparisons with !ptr - remove unnecessary parentheses around simple equality checks - remove a redundant 'else' after a return statement - clean up superfluous blank lines - use 'unsigned int' instead of bare 'unsigned' - enclose a macro with complex value (USBDHDR) in parentheses These changes clean up coding style and improve readability without altering the behavior of the driver. Signed-off-by: Sameeksha Sankpal --- drivers/usb/gadget/function/f_uac1.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/func= tion/f_uac1.c index 9da9fb4e1239..d2c6fb18ce16 100644 --- a/drivers/usb/gadget/function/f_uac1.c +++ b/drivers/usb/gadget/function/f_uac1.c @@ -446,13 +446,13 @@ static int audio_notify(struct g_audio *audio, int un= it_id, int cs) } =20 req =3D usb_ep_alloc_request(uac1->int_ep, GFP_ATOMIC); - if (req =3D=3D NULL) { + if (!req) { ret =3D -ENOMEM; goto err_dec_int_count; } =20 msg =3D kmalloc(sizeof(*msg), GFP_ATOMIC); - if (msg =3D=3D NULL) { + if (!msg) { ret =3D -ENOMEM; goto err_free_request; } @@ -496,8 +496,8 @@ in_rq_cur(struct usb_function *fn, const struct usb_ctr= lrequest *cr) u8 control_selector =3D w_value >> 8; int value =3D -EOPNOTSUPP; =20 - if ((FUIN_EN(opts) && (entity_id =3D=3D USB_IN_FU_ID)) || - (FUOUT_EN(opts) && (entity_id =3D=3D USB_OUT_FU_ID))) { + if ((FUIN_EN(opts) && entity_id =3D=3D USB_IN_FU_ID) || + (FUOUT_EN(opts) && entity_id =3D=3D USB_OUT_FU_ID)) { unsigned int is_playback =3D 0; =20 if (FUIN_EN(opts) && (entity_id =3D=3D USB_IN_FU_ID)) @@ -547,8 +547,8 @@ in_rq_min(struct usb_function *fn, const struct usb_ctr= lrequest *cr) u8 control_selector =3D w_value >> 8; int value =3D -EOPNOTSUPP; =20 - if ((FUIN_EN(opts) && (entity_id =3D=3D USB_IN_FU_ID)) || - (FUOUT_EN(opts) && (entity_id =3D=3D USB_OUT_FU_ID))) { + if ((FUIN_EN(opts) && entity_id =3D=3D USB_IN_FU_ID) || + (FUOUT_EN(opts) && entity_id =3D=3D USB_OUT_FU_ID)) { unsigned int is_playback =3D 0; =20 if (FUIN_EN(opts) && (entity_id =3D=3D USB_IN_FU_ID)) @@ -714,11 +714,6 @@ out_rq_cur_complete(struct usb_ep *ep, struct usb_requ= est *req) u_audio_set_volume(audio, is_playback, volume); =20 return; - } else { - dev_err(&audio->gadget->dev, - "%s:%d control_selector=3D%d TODO!\n", - __func__, __LINE__, control_selector); - usb_ep_set_halt(ep); } } else { dev_err(&audio->gadget->dev, @@ -930,7 +925,7 @@ f_audio_setup(struct usb_function *f, const struct usb_= ctrlrequest *ctrl) return value; } =20 -static int f_audio_set_alt(struct usb_function *f, unsigned intf, unsigned= alt) +static int f_audio_set_alt(struct usb_function *f, unsigned int intf, unsi= gned int alt) { struct usb_composite_dev *cdev =3D f->config->cdev; struct usb_gadget *gadget =3D cdev->gadget; @@ -984,7 +979,7 @@ static int f_audio_set_alt(struct usb_function *f, unsi= gned intf, unsigned alt) return ret; } =20 -static int f_audio_get_alt(struct usb_function *f, unsigned intf) +static int f_audio_get_alt(struct usb_function *f, unsigned int intf) { struct usb_composite_dev *cdev =3D f->config->cdev; struct usb_gadget *gadget =3D cdev->gadget; @@ -1004,7 +999,6 @@ static int f_audio_get_alt(struct usb_function *f, uns= igned intf) return -EINVAL; } =20 - static void f_audio_disable(struct usb_function *f) { struct f_uac1 *uac1 =3D func_to_uac1(f); @@ -1079,7 +1073,7 @@ uac1_ac_header_descriptor *build_ac_header_desc(struc= t f_uac1_opts *opts) } =20 /* Use macro to overcome line length limitation */ -#define USBDHDR(p) (struct usb_descriptor_header *)(p) +#define USBDHDR(p) ((struct usb_descriptor_header *)(p)) =20 static void setup_descriptor(struct f_uac1_opts *opts) { --=20 2.43.0