From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (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 E4CAB32ABC1 for ; Mon, 17 Nov 2025 11:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763377761; cv=none; b=VT6NoB2SuncaaBiKtyHlfGe91Li2oRTKdNcFI8eeIyFj5DsUXhDkoi8s/owZh41XWkAX0KipjM8pOkISmJsCEgjsuVkkgaVDuV+lfwqWqCIzW/WisgjdCKBHLzu+X3y5nJayfaLjzyHCwemyTd+I7PkohJ8ad3W+NgLAXIpq3+o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763377761; c=relaxed/simple; bh=8kAqYrhnwJc7djMWVWH59rq4OKcZ9J4xOpx2+3RNXQk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fdtMRi/cVq3g8rarIlcxBveI/nJUHF/Xu54VYsjWEW5nlUDuZlNWsg8uw7wP96vAYN8mFLq05aNlLwOGTZ9kJOhewoOPxO6eRecnmDjn/qOOEZdlyYs0DvMzP+0UOIv5iuinJW1Cs1YmLKVIoIG0zutnVQ5DX/IuMVwZpK2EhTc= 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=Je15vrXm; arc=none smtp.client-ip=209.85.210.176 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="Je15vrXm" Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-7b6dd81e2d4so3799459b3a.0 for ; Mon, 17 Nov 2025 03:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763377759; x=1763982559; 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=rVb3qgwqhkzzV9bGO5gDmFq8cifzLPzDZg1sUntGPZE=; b=Je15vrXmIOnkqhFxAFDvR+yEeORQTf2YdJEQlT65yLbhCbtroW5JXPYr4Gy+0eUANR tq0Q9gKkNovdOBtdTnLATDVr9YohOtp2U8MtKzgHvPs6sljggXnFOHB0mVRH8J5LkRFQ HNYihZFVXY0QbjltkjImBaSTdHgHHnLXPYEkJxCUBcZbQ0OaMFChGv1VCOZBSAl4Aj+O ZLTASFlSOIqmU7NGH71c8nqM4+g85R6xeOWp4h2lHODfW3JW/jxgZIOkz5IA4S1lagFC gmSn781hgvM31mblBu/za6xoxfTRFntjTzngwIvxuMHK6iRLaR1dKtz+E1Fqznm1fU1B 0fVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763377759; x=1763982559; 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=rVb3qgwqhkzzV9bGO5gDmFq8cifzLPzDZg1sUntGPZE=; b=LMorD893YhL588r3Z0R2g8vAD3nqXBTbgnCR4MN6X1PUrbg+Xz3K0ooJ/bCH2PVFtf obZubCe3f/Rel+povBYCnRNYVnWgT9yuhei5qxd1idnjE9llaG9wkDyoIZsCXrFBkWvv cP5gZby3wYUAzLPC2Q2WZ9W0Q/V3wNtffnybK2zrT24NHDYhnFwfJq0lMZ/uaqcKkwat sL/dE0OwZ6ZaFt+2NcGaf2xKyadsUtZgpi1ljivy5PnG8UwhdnN7V+gxE0saElauANnu a9CJJ+6Ymo2x3Ls0IbE8CW8JLa9qVxZ9econEGUGAZFhk+K7wD7z9D+Mqgm3pZTVSQBV SX0Q== X-Forwarded-Encrypted: i=1; AJvYcCVaf9gb2391F0fn+6178Zdb5p2j6UZAEuYfckcBTS8P3KhwhfK83Xs7rrXHjiDOYhRBRmGfz5cfvmdcwV4=@vger.kernel.org X-Gm-Message-State: AOJu0YwOem5/dILbdxI5XTgloDIjebmDmuKUG/+IWlUb1hqE20V+njq1 P0eBZ/346eK1jfMosFC0CB35s6S/eu0905eW+uHx0eNZ1K1POxQc01Nb X-Gm-Gg: ASbGncs+JXA2DS+4NdS1Iw8ixL5nxe9EdYtoca6HfatyfqhOihedIOwa7b/ymskeBvS kSbf5a2UYpy3nuEWd1OpcTULZruA49dEVSi/Dy15Qw0kgToWt3ItkWU6Q2FBSqwgecnH00fHemm ZyDiHsUkm974GnPCY6v8OVv6nCVvZ3FK1fpFi1dcGIkSGRo0ZRhYfj8oz5gpITnj4jqTWYGqBIf vwhDB0kFHB5THo8uEpXaobd/aIq+x58tULpWBT+KlD/ephKIJ6ahotmmK9JnzhS4yn/SicIJDh7 BLgzWkjTs79bD/hrWs1f76TAvZTvT7N/3fng3EBR+TNxNYL+Lv9MGMHM8ASgt1hmd375jJODl3+ wfXHc1Z9cdg1T963mDavznq0LKLTyNXpgzN80DcH1g+NrX7GavblDJR8+SNsuKBhtPR0xVt5hve NCy9TFVQPus2yAtvKwpKcjOXcdsCsw5KtlW3oZ+tylvEHicams9Jxo21MUeox0ktIMGgNdz1bZh Pkxfn/SF6gJgQka X-Google-Smtp-Source: AGHT+IFNC8oRx8kyKtIo4TAJnCQb/oYWsg36DcsPoQSHwwGpNv7/UFCo8RzOVp6iDBFOliG1UAqC/Q== X-Received: by 2002:a05:6a00:1311:b0:7b8:383d:870e with SMTP id d2e1a72fcca58-7ba39ce56d3mr14041556b3a.2.1763377759137; Mon, 17 Nov 2025 03:09:19 -0800 (PST) Received: from prakrititz-UB.. ([119.161.98.68]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7b927c22c5fsm12920375b3a.67.2025.11.17.03.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Nov 2025 03:09:18 -0800 (PST) From: Nirbhay Sharma To: Takashi Sakamoto Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, skhan@linuxfoundation.org, david.hunter.linux@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, Nirbhay Sharma Subject: [PATCH] firewire: Replace ENOSYS with appropriate error codes Date: Mon, 17 Nov 2025 16:39:01 +0530 Message-ID: <20251117110901.686828-1-nirbhay.lkd@gmail.com> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ENOSYS is reserved for "invalid syscall number" and should not be used for other error conditions. Replace incorrect usages with more appropriate error codes: - In sbp2.c: Use -EOPNOTSUPP for unsupported operation (re-adding logical units via SCSI stack). - In ohci.c: Use -EINVAL for invalid ISO context types in switch statements, and -EOPNOTSUPP for unsupported Pinnacle MovieBoard hardware. - In core-cdev.c: Use -EACCES for access policy violations when operations are restricted to local nodes' device files. Signed-off-by: Nirbhay Sharma --- drivers/firewire/core-cdev.c | 6 +++--- drivers/firewire/ohci.c | 8 ++++---- drivers/firewire/sbp2.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 49dc1612c691..a62ac2f02c49 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -935,7 +935,7 @@ static int ioctl_add_descriptor(struct client *client, union ioctl_arg *arg) /* Access policy: Allow this ioctl only on local nodes' device files. */ if (!client->device->is_local) - return -ENOSYS; + return -EACCES; if (a->length > 256) return -EINVAL; @@ -1628,7 +1628,7 @@ static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg) /* Access policy: Allow this ioctl only on local nodes' device files. */ if (!client->device->is_local) - return -ENOSYS; + return -EACCES; e = kzalloc(sizeof(*e) + sizeof(a->data), GFP_KERNEL); if (e == NULL) @@ -1676,7 +1676,7 @@ static int ioctl_receive_phy_packets(struct client *client, union ioctl_arg *arg /* Access policy: Allow this ioctl only on local nodes' device files. */ if (!client->device->is_local) - return -ENOSYS; + return -EACCES; // NOTE: This can be without irq when we can guarantee that __fw_send_request() for local // destination never runs in any type of IRQ context. diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 030aed5453a1..15aec93b42fb 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2918,7 +2918,7 @@ static struct fw_iso_context *ohci_allocate_iso_context(struct fw_card *card, default: index = -1; - ret = -ENOSYS; + ret = -EINVAL; } if (index < 0) @@ -3370,7 +3370,7 @@ static int ohci_queue_iso(struct fw_iso_context *base, case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL: return queue_iso_buffer_fill(ctx, packet, buffer, payload); default: - return -ENOSYS; + return -EINVAL; } } @@ -3401,7 +3401,7 @@ static int ohci_flush_iso_completions(struct fw_iso_context *base) flush_ir_buffer_fill(ctx); break; default: - ret = -ENOSYS; + ret = -EINVAL; } clear_bit_unlock(0, &ctx->flushing_completions); @@ -3485,7 +3485,7 @@ static int pci_probe(struct pci_dev *dev, if (dev->vendor == PCI_VENDOR_ID_PINNACLE_SYSTEMS) { dev_err(&dev->dev, "Pinnacle MovieBoard is not yet supported\n"); - return -ENOSYS; + return -EOPNOTSUPP; } ohci = devres_alloc(release_ohci, sizeof(*ohci), GFP_KERNEL); diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c index 1a19828114cf..2e17402466e2 100644 --- a/drivers/firewire/sbp2.c +++ b/drivers/firewire/sbp2.c @@ -1496,7 +1496,7 @@ static int sbp2_scsi_sdev_init(struct scsi_device *sdev) /* (Re-)Adding logical units via the SCSI stack is not supported. */ if (!lu) - return -ENOSYS; + return -EOPNOTSUPP; sdev->allow_restart = 1; -- 2.48.1