From nobody Sun Feb 8 10:04:47 2026 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 A4E2D25485E for ; Tue, 8 Apr 2025 23:25:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154742; cv=none; b=CoGHSWa3N7NI7hzgpGga5mRaeSeQbBs0vO6woplwKmkFYuDD55NRexBgVpKB9bEP8dEqKqePKa3dptubaiS1v2i7u3alZA8VEAvhZiiiiqcSx5VbR+CMVN1mdKfH9ts/8s6aVLxet8VafMUC8yqcLs3V0zCZBFPXMl3vWApK5oM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154742; c=relaxed/simple; bh=640QD7k20bcrdYb6D3bMaDTYP6L0i7TB5oP6rPlUONU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VAehvta9EiEIKxYpSnu5+mwkmfKtF4uNBdIu5/C32XIt3HfyV88LrCectYHxiMDDhEDHPQryC+c42zU3L5lfqif26Z9wMpaD9pj0dsIZNpft5KZcuB9Ir+cagI7IdJhpjVgP4rlAW4HFPikIWSiX68Z6xHX9CY3lvkeSIzGGXY0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org; spf=pass smtp.mailfrom=neverthere.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b=UUo7MlW+; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neverthere.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b="UUo7MlW+" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-7359aca7ef2so8714922b3a.2 for ; Tue, 08 Apr 2025 16:25:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1744154740; x=1744759540; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=vn6fMxD+cDOZwdFvmm5E80ak9T8erorYNtCsqpyQQZ0=; b=UUo7MlW+mb5osxQqOQU2Nd9k7bCYeI79sErhT6ai5v3+mtzsO2SuM5iMlfAm05sdnk lqaRAqCcnscP+s07qTmdUybG+v+ECOBH4CwwesNW0O9HZHET/o4gf9HH8M14fXS/n4ZK 4TvC5JmhBuw2tS+/W9S3qvduCQS8a1FNA5wukSfVyw3d/pZTcXT/x8JeS+No20j5x4aw 10jcKlyFwbReJk0vpq+ez1biD1hIGLed0eM3BQd4GNs7Oz2IQVfwVV2N5ScSDpPgFYzA psYCTMDRuMfFqLB2CtAKrnQ6NhH1acljI3Jnk6HBn83TXYvXOcAU/3LCJ2t5WmSWqZiH BpEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744154740; x=1744759540; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vn6fMxD+cDOZwdFvmm5E80ak9T8erorYNtCsqpyQQZ0=; b=aqVSaPzDbklfF6kzaAJV3Bw20ysutL6unpSPO0jcN/5KvsK/FruTwa12USfxcAxppy HEd+tvFNFzI9JIGmAef1QDD29b2JJ8sBO+EkMLz8wZtnFXkc+GerRNIUZ1gO4O6lbK9o bK4OO1WpVzRkmUAVsiTDbUGAZIN6lO7P7dWmUumEN2IvBCKt8jda7KkyP7u3aSj3ZLAr VR9suTBn7FaxjosghbH699nXKqhwST/xt6K7zFVmo2c/6VyzzfBTMMtTejSoA+37UTjU r6bx1+eiLQj2yCMbHGbRQ5nBKjQyrZ6YdYDtoQycqRlFz3OO2HwsjNjEon/Uoki/Bmsc jQtQ== X-Forwarded-Encrypted: i=1; AJvYcCXdI+EpeCPMqwH0viLxEt/75n3aiTsmd8sK8c5I6cFWdGyqfOpDW+fw4lYdg7dKnrrZU5duIRlZmqkOFAA=@vger.kernel.org X-Gm-Message-State: AOJu0YxequNO/ItXb1mfqjrYtdHHAKsqHEYLZNrZyL16cRBN4xLIKd0E Jc/Ut8M8WoH9DZIUN79/B9d6Smsm5OOrjpIXaCjPUAwzMnlenlSSUuCr+/dQ1dN1ura6rYpEADQ = X-Gm-Gg: ASbGncs2dvTgSlkJg6nGvh+lYAOLwn3xTEWs2k46VKCVGrfIRaU8uEZsO3jOkIdZyhA Bf1NpRJ+Cg8nshFb9VK/hNpyHgYUEEszxlZHN2ATAMNDYFQhYK7a31dvEvXIzUO4cmIMX5Obo1k LIos64YgW5F0IGMZudEWj71+PrZ2VZjxPXXf1y8xq3A3QY6pgUd7JAIQJdjh9oK/ctptg+id/b6 +8tc89YvbwDt0rRLQIgCeYpiFMz5JuA0PVDQhwksWvCPykS3419Wm9YdsNC05e4KTBriKzc4Snb DrpSCGT7QBUlVjzS64WtFCUfrJ/ea20pjAqhcY1u/l8kIgJ7UUkKF0MNqVBiwAT043mxo8oVCLR eoNmx7Rs9bg== X-Google-Smtp-Source: AGHT+IGl1tqjm2dSiqFkQWDhXy72/QE2y9bkx/rWioiBktFdjQArXQAGyWkZqTAbFzcxtmVR/XhJlQ== X-Received: by 2002:a05:6a21:6d81:b0:1f5:7e57:501c with SMTP id adf61e73a8af0-201592e0bc7mr970440637.39.1744154739951; Tue, 08 Apr 2025 16:25:39 -0700 (PDT) Received: from tiamat (c-69-181-214-135.hsd1.ca.comcast.net. [69.181.214.135]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-af9bc3fd3fasm9505874a12.47.2025.04.08.16.25.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 16:25:39 -0700 (PDT) From: Michael Rubin To: gregkh@linuxfoundation.org, dpenkler@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 1/7] staging: gpib: Removing typedef gpib_event_queue Date: Tue, 8 Apr 2025 23:25:29 +0000 Message-ID: <20250408232535.187528-2-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org> References: <20250408232535.187528-1-matchstick@neverthere.org> 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" Removing gpib_event_queue_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin --- drivers/staging/gpib/common/gpib_os.c | 10 +++++----- drivers/staging/gpib/include/gpibP.h | 4 ++-- drivers/staging/gpib/include/gpib_types.h | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index f2216768d8bd..684faa0c4547 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -74,7 +74,7 @@ static int t1_delay_ioctl(struct gpib_board *board, unsig= ned long arg); static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpi= b_board *board); =20 static int pop_gpib_event_nolock(struct gpib_board *board, - gpib_event_queue_t *queue, short *event_type); + struct gpib_event_queue *queue, short *event_type); =20 /* * Timer functions @@ -1839,14 +1839,14 @@ static int select_device_path_ioctl(struct gpib_boa= rd_config *config, unsigned l return 0; } =20 -unsigned int num_gpib_events(const gpib_event_queue_t *queue) +unsigned int num_gpib_events(const struct gpib_event_queue *queue) { return queue->num_events; } =20 static int push_gpib_event_nolock(struct gpib_board *board, short event_ty= pe) { - gpib_event_queue_t *queue =3D &board->event_queue; + struct gpib_event_queue *queue =3D &board->event_queue; struct list_head *head =3D &queue->event_head; gpib_event_t *event; static const unsigned int max_num_events =3D 1024; @@ -1901,7 +1901,7 @@ int push_gpib_event(struct gpib_board *board, short e= vent_type) EXPORT_SYMBOL(push_gpib_event); =20 static int pop_gpib_event_nolock(struct gpib_board *board, - gpib_event_queue_t *queue, short *event_type) + struct gpib_event_queue *queue, short *event_type) { struct list_head *head =3D &queue->event_head; struct list_head *front =3D head->next; @@ -1935,7 +1935,7 @@ static int pop_gpib_event_nolock(struct gpib_board *b= oard, } =20 // pop event from front of event queue -int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, sh= ort *event_type) +int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queu= e, short *event_type) { unsigned long flags; int retval; diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/in= clude/gpibP.h index c9cd1dbd7e6f..6461b330a3c3 100644 --- a/drivers/staging/gpib/include/gpibP.h +++ b/drivers/staging/gpib/include/gpibP.h @@ -25,9 +25,9 @@ struct pci_dev *gpib_pci_get_device(const struct gpib_boa= rd_config *config, unsi struct pci_dev *gpib_pci_get_subsys(const struct gpib_board_config *config= , unsigned int vendor_id, unsigned int device_id, unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from); -unsigned int num_gpib_events(const gpib_event_queue_t *queue); +unsigned int num_gpib_events(const struct gpib_event_queue *queue); int push_gpib_event(struct gpib_board *board, short event_type); -int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, sh= ort *event_type); +int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queu= e, short *event_type); int gpib_request_pseudo_irq(struct gpib_board *board, irqreturn_t (*handle= r)(int, void *)); void gpib_free_pseudo_irq(struct gpib_board *board); int gpib_match_device_path(struct device *dev, const char *device_path_in); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 0253ef2c94a3..66a1a1676f2b 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -178,14 +178,14 @@ struct gpib_interface { unsigned skip_check_for_command_acceptors : 1; }; =20 -typedef struct { +struct gpib_event_queue { struct list_head event_head; spinlock_t lock; // for access to event list unsigned int num_events; unsigned dropped_event : 1; -} gpib_event_queue_t; +}; =20 -static inline void init_event_queue(gpib_event_queue_t *queue) +static inline void init_event_queue(struct gpib_event_queue *queue) { INIT_LIST_HEAD(&queue->event_head); queue->num_events =3D 0; @@ -283,7 +283,7 @@ struct gpib_board { /* autospoll kernel thread */ struct task_struct *autospoll_task; /* queue for recording received trigger/clear/ifc events */ - gpib_event_queue_t event_queue; + struct gpib_event_queue event_queue; /* minor number for this board's device file */ int minor; /* struct to deal with polling mode*/ --=20 2.43.0 From nobody Sun Feb 8 10:04:47 2026 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 CA455254B02 for ; Tue, 8 Apr 2025 23:25:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154743; cv=none; b=SLQHMb2RPpItP6cRnXEnVZpfkSxFpEn2qIaKcw1X5f7SMPHq+MT1hKjIIVeY448uhaUcOUkQ4clPU+ewYsgZijkeKOpKDFa1CkOt0JNn5rpe83NYPpdpYzBkr/VACW0sQpm53kOsAd8so+JXmzL2PkZZ3FGV8jHgDsZY9LA8HKI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154743; c=relaxed/simple; bh=KLuwg37HA9d35p6YPDfUzR6m5Ve1w96Q9p2SqO1gqJQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kvim9Vl9otK4XZ/WyKNy6oO/x9yp7MNkbiFHqMVhtvkkvz6GnTKGAQtvjkFBcEob+MmUlaty2h97Fm8CE5L33Uht7Zadjss1InjB7K9iRAZSRu2IeQVPC2Opvh1eNpNnpdXLX9HONv7ReOfiWkZom2sfvovF0T4R5DSmlg/QAVk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org; spf=pass smtp.mailfrom=neverthere.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b=H9wrye1n; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neverthere.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b="H9wrye1n" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2ff799d99dcso5850946a91.1 for ; Tue, 08 Apr 2025 16:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1744154741; x=1744759541; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P411XXh9tP6xKxZOeS+c/EGq9SgVAs4t8mf9P3YcEAY=; b=H9wrye1nkjn8UkQuXYhvKQB3LvUnfkV+Ax4cbaaU8Jsl1jTQWfsz54c1bSc+eh0tNU vogF3DH1DuPK8uLU4fW5seCxSpXasJGgCR7rwZwf377KE2Wmv/qlDhWPh+8atgC9zONb ssunVBVviudVG3+9uLi8ShdAHLvAXR259Jqva6V2D2+WbDJsdJLbAye8tGebUPDYZEOU FzrOZXHXNIy3yR2kQv1Mhw9q6vE4MHgUEx7W8SJ57RwWlKUy5WHvDqPx2rPXeOPVn0qL PGbsIO3ez6MendG9k9q3wPn6ZzQBnJ8WRUm5a/2PYqaq5WrsbBDylPVEYl0PVWO++9La iuKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744154741; x=1744759541; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P411XXh9tP6xKxZOeS+c/EGq9SgVAs4t8mf9P3YcEAY=; b=uuniw9w2KlbVBlF56mLwju2uz4czM9N1Xl+hhAep2x19YJ3A30+efQ20CZtLX6dj0I Ql3jnMkzB99sPm/NP7GJqZnq7VwHsZOZCKw/NHq98dQKhriSg0pD94iJ3oRGtXulHFCg fiN0B96h89beG+oiZQsh9FELjCCQeRxYxe0Lln2YGtTJvT0SVAKay/0ypL+pWARDy1YE gONSieZM+t6o485gnKosx/T2LW8PgfRitX4gbpvKl9rmLAUwI1WO4sjW9rDPjrltrqUm p+zdzmg65TYxxQLfe8fkgP1A9Jn3hEh1xnWs3kwcosGNGiLlF98+403Ag0/IY6cpqGql jRkQ== X-Forwarded-Encrypted: i=1; AJvYcCXNVXQYF416Np0TMvDJXbMhyE0Fl6HOWtqX6DltwfKky2AeZ+Oo2CGsQ4XyVKW0dTCINVcWzAPVqf5L67E=@vger.kernel.org X-Gm-Message-State: AOJu0YzexAAa7vzzgxsy81Re+MJwBoRiMvc9tk2gK6bhOEFgc81gRe78 0rrjVeg9OsoDUXn18o8WmDPJLXvyhREaUpGLWtzDi3jDztKOYwlBQrBItnxdUA== X-Gm-Gg: ASbGnctiTLXD6bC5I3gnkDEVcji0nGjrszMsN0WzfmpSJzg3Jlb1EN2LA87PK+dB77b KXU3tcAm/r0snUl3KBr5rYTUaXUQGdCmOaANANrBIpfIt/mFJjYvEvjfGWovDVcxOD7131jYK1P NxD9ZozAkfsp0VVIxwG92fi9derU3c+2Fu1cQrMjaAOHhQ2P/GGMT/5l5bzAeaf4GCebKxl3AqC qQ9dV09Gy9Zg+cBrSBrL6FPh/WA9WIy7aBrKmI4C4TYDm/Dlb3PJQYX/TLLs14FmkIlfP0IpVuv L9RjWzWHBPVSBzJbrS0eN/QZUUmRya8hxelCj3r3hSi/r9TyhSRi4/HoIZd6ZdHpbYI1WBRieqG U/0Mrtpaj2w== X-Google-Smtp-Source: AGHT+IF9ozNozcEFD4AY8UaNsfqRMujNJK7qdpQ0MPYPXtpgegTgLnYRb1rqoIe2L+hZrQFNYEqiiw== X-Received: by 2002:a17:90b:56c6:b0:2fc:3264:3657 with SMTP id 98e67ed59e1d1-306dba63685mr1778738a91.0.1744154741086; Tue, 08 Apr 2025 16:25:41 -0700 (PDT) Received: from tiamat (c-69-181-214-135.hsd1.ca.comcast.net. [69.181.214.135]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2297866cd1dsm106403815ad.159.2025.04.08.16.25.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 16:25:40 -0700 (PDT) From: Michael Rubin To: gregkh@linuxfoundation.org, dpenkler@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 2/7] staging: gpib: Removing gpib_interface_list_t Date: Tue, 8 Apr 2025 23:25:30 +0000 Message-ID: <20250408232535.187528-3-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org> References: <20250408232535.187528-1-matchstick@neverthere.org> 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" Removing gpib_interface_list_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin --- drivers/staging/gpib/common/gpib_os.c | 10 +++++----- drivers/staging/gpib/include/gpib_types.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index 684faa0c4547..3fb369caf17e 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -826,9 +826,9 @@ static int board_type_ioctl(gpib_file_private_t *file_p= riv, =20 for (list_ptr =3D registered_drivers.next; list_ptr !=3D ®istered_driv= ers; list_ptr =3D list_ptr->next) { - gpib_interface_list_t *entry; + struct gpib_interface_list *entry; =20 - entry =3D list_entry(list_ptr, gpib_interface_list_t, list); + entry =3D list_entry(list_ptr, struct gpib_interface_list, list); if (strcmp(entry->interface->name, cmd.name) =3D=3D 0) { int i; int had_module =3D file_priv->got_module; @@ -2026,7 +2026,7 @@ void init_gpib_descriptor(gpib_descriptor_t *desc) =20 int gpib_register_driver(struct gpib_interface *interface, struct module *= provider_module) { - struct gpib_interface_list_struct *entry; + struct gpib_interface_list *entry; =20 entry =3D kmalloc(sizeof(*entry), GFP_KERNEL); if (!entry) @@ -2057,9 +2057,9 @@ void gpib_unregister_driver(struct gpib_interface *in= terface) } } for (list_ptr =3D registered_drivers.next; list_ptr !=3D ®istered_driv= ers;) { - gpib_interface_list_t *entry; + struct gpib_interface_list *entry; =20 - entry =3D list_entry(list_ptr, gpib_interface_list_t, list); + entry =3D list_entry(list_ptr, struct gpib_interface_list, list); list_ptr =3D list_ptr->next; if (entry->interface =3D=3D interface) { list_del(&entry->list); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 66a1a1676f2b..4be7cfce539f 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -209,11 +209,11 @@ static inline void init_gpib_pseudo_irq(struct gpib_p= seudo_irq *pseudo_irq) } =20 /* list so we can make a linked list of drivers */ -typedef struct gpib_interface_list_struct { +struct gpib_interface_list { struct list_head list; struct gpib_interface *interface; struct module *module; -} gpib_interface_list_t; +}; =20 /* One struct gpib_board is allocated for each physical board in the compu= ter. * It provides storage for variables local to each board, and interface --=20 2.43.0 From nobody Sun Feb 8 10:04:47 2026 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 E6EEE2566E4 for ; Tue, 8 Apr 2025 23:25:42 +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=1744154744; cv=none; b=Jfg5D7uBE0W/c58XWXQbimq/IPI48mu7Ceqqg+kLp23ROUaLVbeXWu18eGK78ALgEGcn3hXShGxDtL3OnQHDoH28I6Ybl6Vxq42+O68Ee7Kt1XkktBlo9cN2dxUvSgJ8ohIxFWOXv9X7jiDKLvzDTfzE0z4hvfFujlUvK4NHiCI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154744; c=relaxed/simple; bh=slT6m15jtOTNs/B2FLm4zfuo8rL09VaXielIzRuqlBA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AvbD81eYFn6pB+ij5wLaWvb4cDABIr1AKe2BffTkLFW+tEJmk3M8K275fY7nV/vp2snCDo5RfskL/XKxgSup8GXOsgsaX7IlWwKhzI2fOqnr7iCrc8SS5aVu35dAmFGrTvryTY5vNK9KW/6eEHK8l0RAVAHCrMHPX1fu1VuP21c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org; spf=pass smtp.mailfrom=neverthere.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b=MYohIUMb; arc=none smtp.client-ip=209.85.216.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neverthere.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b="MYohIUMb" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-306b78ae2d1so3253898a91.3 for ; Tue, 08 Apr 2025 16:25:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1744154742; x=1744759542; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rvVUYF3W9WGYrgSJIX9w9iCFvoKwdGoVDieJ1Vz/Ohc=; b=MYohIUMb+YAqHW3xWA7nC9CTDxC8Ujwx9o29W001rswHbke0NLce15nuMsCR8snVJR jI+mYRbaPybtypTCvwMW+Ape01WNhcYt9QN5UXlqf0GfYsqE9L/+aFcThPvgGSnsa6Jt lyoYMsuQP8nUe1tYRjOmwhjjX0HnjrnOZOTPBSz92ir1/rIMEhMUSj4tTkzgWuMGOjys 3T7pBGaTJkQDqHXx2UdXMEbVsGRwdMM02NbtoO5iqcC8hd/oXqUVoiGEmTWCyiDIQDmO nlzinIekqfZcJDYger/YAYvp9RRLJ90nnOqEomzgbK1uwwFj+8s1idWbsMe7CIyfRVON uyog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744154742; x=1744759542; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rvVUYF3W9WGYrgSJIX9w9iCFvoKwdGoVDieJ1Vz/Ohc=; b=o/VWl+rUawCu475n42X4zKLqRYk3s+ELTSY3j+z4MtkZV6uWFSn5CLqtPYSJDCRhBU QjhpEa+Bh/aSFeklrHJrs1FyAOZJRn5qXTYUgdZ+WAf5XFVc6HqrNBuSzHOeflET70i4 g2u5o2gkPzksx4RyYqLP0eZDCmjHTKlX52Su+4gJ4J7VyUNrVDaTt/639HNOB4H4DLQL vzyZY9ieKOQUA8jdVTSnz/s96lqKvW2ZTlxw22AdDJPjIUsZBxrz8756De0C88A57auq H5CNzW4CuWeRjcFOISzXdBMLP0KrfQDOFy62hapfS/3PAATAtzFcpDAHqSpbBau0IvIO A2Dw== X-Forwarded-Encrypted: i=1; AJvYcCVFmXkjzvNkjlINeCqOMwdtUrA5VBhr22xxaqHmzLfq3MQVnbSysqel1mMhZNxe9R3O42cvp6hLbDkmmzk=@vger.kernel.org X-Gm-Message-State: AOJu0YyTbqOofCSjzWSy+chQ5F8Rb8relrchlbwX9Fpln6odBTAxtEx5 MLs6/g4mBnrKlZog/pVz3KeHrgh9qbs0dhKvmtSIMdzYyYQPZBOA/QCHeJgwVMz+TG/249tic1Q = X-Gm-Gg: ASbGncvy2jkZlgnNrQzoNZ2a7MzmcXlw1rDgIQZNAl4PKECf9NJz2U83KvFABVRD4RN O7kb2BaVlJGEF1eWDsuqtr52o+KLPL2paqQ1A9FN9mjcZl+A64fc/d5jAOMRYGzQb0dAgCaUMMx W0zj7v1hB0TWrDfMaSlrmPQFmiawuoIVv1rwBIyyWmPXw+hJ1dKqYY/S3PopRBum4TNJ+OY5qG8 ZQ5QlWSRL6RhfMLCw6ttPTqjScd94J0tpFBfG6z9Ytadx37++FleMY6bxwF3zGXN8hW59GsrRNK o4jeUFe5hnibjqSx1x7+6KUktmHiLGDd1lcVxGoBofWur1Hpm+rqgfm7UqgHptGVD/NXQqlHanV SLs23WeRwQw== X-Google-Smtp-Source: AGHT+IFK5EKx7Wi3+ySQBoxihMaRXY/3fkiix5XLIBkPbmbfU+gZbTOS9D4JxSE8/AuYlWHhbuLCgQ== X-Received: by 2002:a17:90b:548b:b0:2fe:a742:51b0 with SMTP id 98e67ed59e1d1-306dd5789bbmr322739a91.31.1744154742199; Tue, 08 Apr 2025 16:25:42 -0700 (PDT) Received: from tiamat (c-69-181-214-135.hsd1.ca.comcast.net. [69.181.214.135]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2297866e3b2sm106860275ad.178.2025.04.08.16.25.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 16:25:41 -0700 (PDT) From: Michael Rubin To: gregkh@linuxfoundation.org, dpenkler@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 3/7] staging: gpib: Removing gpib_event_t typedef Date: Tue, 8 Apr 2025 23:25:31 +0000 Message-ID: <20250408232535.187528-4-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org> References: <20250408232535.187528-1-matchstick@neverthere.org> 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" Removing gpib_event_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin --- drivers/staging/gpib/common/gpib_os.c | 8 ++++---- drivers/staging/gpib/include/gpib_types.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index 3fb369caf17e..575d9b65f293 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1848,7 +1848,7 @@ static int push_gpib_event_nolock(struct gpib_board *= board, short event_type) { struct gpib_event_queue *queue =3D &board->event_queue; struct list_head *head =3D &queue->event_head; - gpib_event_t *event; + struct gpib_event *event; static const unsigned int max_num_events =3D 1024; int retval; =20 @@ -1861,7 +1861,7 @@ static int push_gpib_event_nolock(struct gpib_board *= board, short event_type) return retval; } =20 - event =3D kmalloc(sizeof(gpib_event_t), GFP_ATOMIC); + event =3D kmalloc(sizeof(struct gpib_event), GFP_ATOMIC); if (!event) { queue->dropped_event =3D 1; dev_err(board->gpib_dev, "failed to allocate memory for event\n"); @@ -1905,7 +1905,7 @@ static int pop_gpib_event_nolock(struct gpib_board *b= oard, { struct list_head *head =3D &queue->event_head; struct list_head *front =3D head->next; - gpib_event_t *event; + struct gpib_event *event; =20 if (num_gpib_events(queue) =3D=3D 0) { *event_type =3D EVENT_NONE; @@ -1920,7 +1920,7 @@ static int pop_gpib_event_nolock(struct gpib_board *b= oard, return -EPIPE; } =20 - event =3D list_entry(front, gpib_event_t, list); + event =3D list_entry(front, struct gpib_event, list); *event_type =3D event->event_type; =20 list_del(front); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 4be7cfce539f..8ec89290523b 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -302,10 +302,10 @@ struct gpib_board { }; =20 /* element of event queue */ -typedef struct { +struct gpib_event { struct list_head list; short event_type; -} gpib_event_t; +}; =20 /* Each board has a list of gpib_status_queue_t to keep track of all open = devices * on the bus, so we know what address to poll when we get a service reque= st --=20 2.43.0 From nobody Sun Feb 8 10:04:47 2026 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 3D94C256C7D for ; Tue, 8 Apr 2025 23:25:44 +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=1744154746; cv=none; b=AUtw2c1OBCUmKo5bFNmAFlYQnip9H9OyEiXEo5uRH1CpCje5XXZlmE2o+LYuSEqeOWxO0VdQFAFjIV/REQ6cLIDKSWn/JymA7G1KhZn9hGesEPC+J3ar2Tpa4+wxKDKPfAlYBrhVla2mBXgxXgvMvZQroJd2IMXrbBVoCDBNRFY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154746; c=relaxed/simple; bh=FDFOGHV/HYl8cOAKTE3rLMEo4J1VwlRpC9YCdCus+Dw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HNTXqznbeTbSnvTCc05RMPPXbl5pj+NKPtq8fzmA412vJrGQ9cG/zU3gwqsx8kVPySbpB9G5WtqT7n0jQla+pliUTHbhwWVFfG6zp26PQXCe4w+/E8orpGGIAqmJikD9xuAe3pelUqOXgftucL229PtRkmydkZMyP7+xV9rx4Ac= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org; spf=pass smtp.mailfrom=neverthere.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b=AlHsQ34e; arc=none smtp.client-ip=209.85.216.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neverthere.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b="AlHsQ34e" Received: by mail-pj1-f47.google.com with SMTP id 98e67ed59e1d1-301d6cbbd5bso5999287a91.3 for ; Tue, 08 Apr 2025 16:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1744154743; x=1744759543; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C1EdrhX762+aQZGDuYJmIH7iXzqOTw2NeFL65oZJFnw=; b=AlHsQ34eD1aUs0LTAIW77yuzCvYkEIKfzw7jNbbHnIkgoKnKSXEpGamTuTwPinPJ+O h1VBjff3bGGb2av3CxRKHq5Ksxmo3HFz7xWSmkZn0VayektQZxPciTCXteMzlT+1e1EM Ky2OU353WmXXjqmSvOYNQyjuxx+OgczuDkAScSdgBzsDnCTaw6hbao7zDYCufChtZ1Xv CQAMKdQYbsn2gtmOzT49szz3n31mVBZAs+Bk+C5R2AO2LXNfizWJ1AQvx0vHzvr6VilE NZGYeANks4+yUnADgOPPeuMx08kCJ3OjVZSyrIstagdf5YNtFZ1ig6T+IrozBiB/PdIy YsxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744154743; x=1744759543; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C1EdrhX762+aQZGDuYJmIH7iXzqOTw2NeFL65oZJFnw=; b=vuJYDmOZ1SNH1N5Xl2oFk20VIMNnj+iZGOD1JPsbnrIYSLudFYp8EhFFr5jMJxv+Zm hac4VayUVMR7K5HYKVxnWokT+umLuInyZGHhjrVhhOmoTfE0AVzigsFITa3uUMBoSxP5 qSi2Yeyvx/wKvmKLmwgRCFXnUQbCioEUMQ6fxCWC2PWWNUN74tDK944tmaNKUqIF89dq Srp0dBZjvWyUJ/U5ly9iMdlL5xsRX5wypV/UrxOLaBosB+XD+BWLhJd2ne7lQW86qpE4 AU/pBFV73dg/LYWhmk40bfLDKyHE2TCv62gENbMFq9NowSzYgkjwwDkdA7BxIgTxKt/J EB6Q== X-Forwarded-Encrypted: i=1; AJvYcCWyayD/MCdDXImXg/NfKig8veD2u8Zr2EfmwWdrwh1Ffe7WMZ256sDsc7S5z6EVLxLfyDJTlAvuSh+VwKA=@vger.kernel.org X-Gm-Message-State: AOJu0YwVyA1w2zjLA3DKE18vG13N8kjhNva2+S2tHlKOycOmFAE9izaX CebsE7j422HavJjfA5eWZzV1dihOj7Ywvja3esOHaOaRebbnrjuMGEBvXPfE8w== X-Gm-Gg: ASbGncvr2cqjyG+ZdYTjxkVbN5zLMEvk0SKrAkHgdw7PV7sjJhpEBpqGfEY2YtGHvc3 WcmNw4gWInCyaahu+hIkrBFLAZnJY7ooL+TEPB+ndMse3g4ergr7Jq0OoAf0S5mIvZLHTorSFPS zW0sA58TevbEgWtSpcK5EKotPE41s12IHLov1lvERng4BAWK3btGRGF4KRzd4olMZxnBQ1lC4Ou TdE6gtXubgKGNFk8CqNi9PILGJEH0vBFc1OD03Oxvf4Qz5ZJViC6RzjabAjZEN5asrMRxqyhDk7 dXbHUP5ljAOrBM1aruV8imTUPdqfQkGzvHTOGb92CB8DpjLvoqgxFV+GV4xrMMctzwGT04PGUtA MCZkqE5ILGw== X-Google-Smtp-Source: AGHT+IFc204K2TYp6h8aLBiJH4lH8yVL10grX089yjIeuOukrTAmVCMbLIDpYKtPyQEQX7YkPnw65A== X-Received: by 2002:a17:90b:5208:b0:2ff:72f8:3708 with SMTP id 98e67ed59e1d1-306dd529a7amr447376a91.17.1744154743432; Tue, 08 Apr 2025 16:25:43 -0700 (PDT) Received: from tiamat (c-69-181-214-135.hsd1.ca.comcast.net. [69.181.214.135]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-739d9804fb5sm11139056b3a.73.2025.04.08.16.25.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 16:25:43 -0700 (PDT) From: Michael Rubin To: gregkh@linuxfoundation.org, dpenkler@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 4/7] staging: gpib: Removing typedef gpib_status_queue Date: Tue, 8 Apr 2025 23:25:32 +0000 Message-ID: <20250408232535.187528-5-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org> References: <20250408232535.187528-1-matchstick@neverthere.org> 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" Removing gpib_status_queue_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin --- drivers/staging/gpib/common/gpib_os.c | 34 +++++++++++------------ drivers/staging/gpib/common/iblib.c | 6 ++-- drivers/staging/gpib/common/ibsys.h | 11 +++++--- drivers/staging/gpib/include/gpib_proto.h | 2 +- drivers/staging/gpib/include/gpib_types.h | 8 +++--- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index 575d9b65f293..a2138c7f641c 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -172,7 +172,7 @@ EXPORT_SYMBOL(gpib_free_pseudo_irq); =20 static const unsigned int serial_timeout =3D 1000000; =20 -unsigned int num_status_bytes(const gpib_status_queue_t *dev) +unsigned int num_status_bytes(const struct gpib_status_queue *dev) { if (!dev) return 0; @@ -180,7 +180,7 @@ unsigned int num_status_bytes(const gpib_status_queue_t= *dev) } =20 // push status byte onto back of status byte fifo -int push_status_byte(struct gpib_board *board, gpib_status_queue_t *device= , u8 poll_byte) +int push_status_byte(struct gpib_board *board, struct gpib_status_queue *d= evice, u8 poll_byte) { struct list_head *head =3D &device->status_bytes; status_byte_t *status; @@ -214,7 +214,7 @@ int push_status_byte(struct gpib_board *board, gpib_sta= tus_queue_t *device, u8 p } =20 // pop status byte from front of status byte fifo -int pop_status_byte(struct gpib_board *board, gpib_status_queue_t *device,= u8 *poll_byte) +int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *de= vice, u8 *poll_byte) { struct list_head *head =3D &device->status_bytes; struct list_head *front =3D head->next; @@ -245,14 +245,14 @@ int pop_status_byte(struct gpib_board *board, gpib_st= atus_queue_t *device, u8 *p return 0; } =20 -gpib_status_queue_t *get_gpib_status_queue(struct gpib_board *board, unsig= ned int pad, int sad) +struct gpib_status_queue *get_gpib_status_queue(struct gpib_board *board, = unsigned int pad, int sad) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; struct list_head *list_ptr; const struct list_head *head =3D &board->device_list; =20 for (list_ptr =3D head->next; list_ptr !=3D head; list_ptr =3D list_ptr->= next) { - device =3D list_entry(list_ptr, gpib_status_queue_t, list); + device =3D list_entry(list_ptr, struct gpib_status_queue, list); if (gpib_address_equal(device->pad, device->sad, pad, sad)) return device; } @@ -263,7 +263,7 @@ gpib_status_queue_t *get_gpib_status_queue(struct gpib_= board *board, unsigned in int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int s= ad, unsigned int usec_timeout, uint8_t *poll_byte) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; =20 device =3D get_gpib_status_queue(board, pad, sad); if (num_status_bytes(device)) @@ -429,7 +429,7 @@ int serial_poll_all(struct gpib_board *board, unsigned = int usec_timeout) int retval =3D 0; struct list_head *cur; const struct list_head *head =3D NULL; - gpib_status_queue_t *device; + struct gpib_status_queue *device; u8 result; unsigned int num_bytes =3D 0; =20 @@ -442,7 +442,7 @@ int serial_poll_all(struct gpib_board *board, unsigned = int usec_timeout) return retval; =20 for (cur =3D head->next; cur !=3D head; cur =3D cur->next) { - device =3D list_entry(cur, gpib_status_queue_t, list); + device =3D list_entry(cur, struct gpib_status_queue, list); retval =3D read_serial_poll_byte(board, device->pad, device->sad, usec_timeout, &result); if (retval < 0) @@ -1092,7 +1092,7 @@ static int write_ioctl(gpib_file_private_t *file_priv= , struct gpib_board *board, =20 static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; spoll_bytes_ioctl_t cmd; int retval; =20 @@ -1117,13 +1117,13 @@ static int increment_open_device_count(struct gpib_= board *board, struct list_hea unsigned int pad, int sad) { struct list_head *list_ptr; - gpib_status_queue_t *device; + struct gpib_status_queue *device; =20 /* first see if address has already been opened, then increment * open count */ for (list_ptr =3D head->next; list_ptr !=3D head; list_ptr =3D list_ptr->= next) { - device =3D list_entry(list_ptr, gpib_status_queue_t, list); + device =3D list_entry(list_ptr, struct gpib_status_queue, list); if (gpib_address_equal(device->pad, device->sad, pad, sad)) { dev_dbg(board->gpib_dev, "incrementing open count for pad %i, sad %i\n", device->pad, device->sad); @@ -1132,8 +1132,8 @@ static int increment_open_device_count(struct gpib_bo= ard *board, struct list_hea } } =20 - /* otherwise we need to allocate a new gpib_status_queue_t */ - device =3D kmalloc(sizeof(gpib_status_queue_t), GFP_ATOMIC); + /* otherwise we need to allocate a new struct gpib_status_queue */ + device =3D kmalloc(sizeof(struct gpib_status_queue), GFP_ATOMIC); if (!device) return -ENOMEM; init_gpib_status_queue(device); @@ -1151,11 +1151,11 @@ static int increment_open_device_count(struct gpib_= board *board, struct list_hea static int subtract_open_device_count(struct gpib_board *board, struct lis= t_head *head, unsigned int pad, int sad, unsigned int count) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; struct list_head *list_ptr; =20 for (list_ptr =3D head->next; list_ptr !=3D head; list_ptr =3D list_ptr->= next) { - device =3D list_entry(list_ptr, gpib_status_queue_t, list); + device =3D list_entry(list_ptr, struct gpib_status_queue, list); if (gpib_address_equal(device->pad, device->sad, pad, sad)) { dev_dbg(board->gpib_dev, "decrementing open count for pad %i, sad %i\n", device->pad, device->sad); @@ -2147,7 +2147,7 @@ static void init_board_array(struct gpib_board *board= _array, unsigned int length } } =20 -void init_gpib_status_queue(gpib_status_queue_t *device) +void init_gpib_status_queue(struct gpib_status_queue *device) { INIT_LIST_HEAD(&device->list); INIT_LIST_HEAD(&device->status_bytes); diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/com= mon/iblib.c index 6cca8a49e839..136be22f7eb2 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -506,7 +506,7 @@ int ibstatus(struct gpib_board *board) return general_ibstatus(board, NULL, 0, 0, NULL); } =20 -int general_ibstatus(struct gpib_board *board, const gpib_status_queue_t *= device, +int general_ibstatus(struct gpib_board *board, const struct gpib_status_qu= eue *device, int clear_mask, int set_mask, gpib_descriptor_t *desc) { int status =3D 0; @@ -573,7 +573,7 @@ static void init_wait_info(struct wait_info *winfo) timer_setup_on_stack(&winfo->timer, wait_timeout, 0); } =20 -static int wait_satisfied(struct wait_info *winfo, gpib_status_queue_t *st= atus_queue, +static int wait_satisfied(struct wait_info *winfo, struct gpib_status_queu= e *status_queue, int wait_mask, int *status, gpib_descriptor_t *desc) { struct gpib_board *board =3D winfo->board; @@ -626,7 +626,7 @@ int ibwait(struct gpib_board *board, int wait_mask, int= clear_mask, int set_mask int *status, unsigned long usec_timeout, gpib_descriptor_t *desc) { int retval =3D 0; - gpib_status_queue_t *status_queue; + struct gpib_status_queue *status_queue; struct wait_info winfo; =20 if (desc->is_board) diff --git a/drivers/staging/gpib/common/ibsys.h b/drivers/staging/gpib/com= mon/ibsys.h index 19960af809c2..a9fdf95cfa96 100644 --- a/drivers/staging/gpib/common/ibsys.h +++ b/drivers/staging/gpib/common/ibsys.h @@ -22,10 +22,13 @@ int gpib_allocate_board(struct gpib_board *board); void gpib_deallocate_board(struct gpib_board *board); =20 -unsigned int num_status_bytes(const gpib_status_queue_t *dev); -int push_status_byte(struct gpib_board *board, gpib_status_queue_t *device= , uint8_t poll_byte); -int pop_status_byte(struct gpib_board *board, gpib_status_queue_t *device,= uint8_t *poll_byte); -gpib_status_queue_t *get_gpib_status_queue(struct gpib_board *board, unsig= ned int pad, int sad); +unsigned int num_status_bytes(const struct gpib_status_queue *dev); +int push_status_byte(struct gpib_board *board, struct gpib_status_queue *d= evice, + uint8_t poll_byte); +int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *de= vice, + uint8_t *poll_byte); +struct gpib_status_queue *get_gpib_status_queue(struct gpib_board *board, + unsigned int pad, int sad); int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int s= ad, unsigned int usec_timeout, uint8_t *poll_byte); int autopoll_all_devices(struct gpib_board *board); diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gp= ib/include/gpib_proto.h index 2c7dfc02f517..80046218c834 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -48,7 +48,7 @@ int ibwait(struct gpib_board *board, int wait_mask, int c= lear_mask, int set_mask int *status, unsigned long usec_timeout, gpib_descriptor_t *desc); int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi= , size_t *bytes_written); int ibstatus(struct gpib_board *board); -int general_ibstatus(struct gpib_board *board, const gpib_status_queue_t *= device, +int general_ibstatus(struct gpib_board *board, const struct gpib_status_qu= eue *device, int clear_mask, int set_mask, gpib_descriptor_t *desc); int io_timed_out(struct gpib_board *board); int ibppc(struct gpib_board *board, uint8_t configuration); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 8ec89290523b..f85091b1bdf0 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -307,10 +307,10 @@ struct gpib_event { short event_type; }; =20 -/* Each board has a list of gpib_status_queue_t to keep track of all open = devices +/* Each board has a list of gpib_status_queue to keep track of all open de= vices * on the bus, so we know what address to poll when we get a service reque= st */ -typedef struct { +struct gpib_status_queue { /* list_head so we can make a linked list of devices */ struct list_head list; unsigned int pad; /* primary gpib address */ @@ -322,14 +322,14 @@ typedef struct { unsigned int reference_count; /* flags loss of status byte error due to limit on size of queue */ unsigned dropped_byte : 1; -} gpib_status_queue_t; +}; =20 typedef struct { struct list_head list; u8 poll_byte; } status_byte_t; =20 -void init_gpib_status_queue(gpib_status_queue_t *device); +void init_gpib_status_queue(struct gpib_status_queue *device); =20 /* Used to store device-descriptor-specific information */ typedef struct { --=20 2.43.0 From nobody Sun Feb 8 10:04:47 2026 Received: from mail-pg1-f174.google.com (mail-pg1-f174.google.com [209.85.215.174]) (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 6293B2571B0 for ; Tue, 8 Apr 2025 23:25:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154747; cv=none; b=DsV5B5SOotIcn6PovVq/7JGEeNLHIJoft4RiSd8j2y0m89uSsNL2CN4yBODU0AVGa6/7rZWKXwaQX74ZIgYdOfC/mJMcYa4eV0qo8Gs+4fABxvhCJEgO4L4xFwDcag8dJUA4ZnoLfI3BiWSTbPCEPylsSE6E9pVp6Ug+P1zXf2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154747; c=relaxed/simple; bh=f47LmV+7WjkLMPIKBfkl9xJdb7ie0wGOQSjehuWY3ZQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jj/GCVB5JYWNAJTVq0ulf5Hf0U4SI4fEMFLLEV3NbxN2qto+L7T3mYrBXLQ/tqk0fI6ahIcv7EkaJMuBIYAohqrHICsS/s2WvU+nHKpzO32jlJrnAqq+sn1CQii2/2vW5HjWUIQIYV7e0HoL4Nw4TzdNNr2POG7gMvilSr944YE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org; spf=pass smtp.mailfrom=neverthere.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b=THHR0WmW; arc=none smtp.client-ip=209.85.215.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neverthere.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b="THHR0WmW" Received: by mail-pg1-f174.google.com with SMTP id 41be03b00d2f7-af9a7717163so6056488a12.2 for ; Tue, 08 Apr 2025 16:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1744154744; x=1744759544; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f2xjIWuXyaxMet536XfRVVtc+yMtIlss6dqtracfTNw=; b=THHR0WmWDuAN2DKv1ZzquCVVcWWnfbz8LW8RY+Nu/IygP6EPbuH5eeGr6qMtvOF4m+ WRvf2TjPADvNjTCCfpywdxxJeRZEPItshHLEASgJTVubgX/J3SgSta1UINDlwvAcR7RX h7euXJaJkYyObnmbcCbC2zGG9mba7zct4hNWjXu8B9skeZAk1ei6EaSQxPZFB+myPyoa lPobnn4hp0N448jQSI2wY3bHP2Y9gDN6Qh71Qpx7/IVOKkMX5EEuH7f5OsFzXnUcJuxR youbiVhD78JwMTHwNdU9u6hCQTgdyibiJxyiQSmt55E5uktLnINX7NxfwtQJM+ZYyQg6 lflg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744154744; x=1744759544; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f2xjIWuXyaxMet536XfRVVtc+yMtIlss6dqtracfTNw=; b=eolCTWByhbvlBtsG3JX0ILcKY3C1Mnm/+EAhIg0i3IGcb43zrb5Mkm1w5fh9o2Qw1a CNBRYzoVyukkZaR53OjEf0Pm5myihV9OxzCw1HLGQaIMV6DhKt+scSjNUML7wO9lDamV 5kU3jF4WHXcbgPEI+nHRT01ilUcT33cNxY3cnb0jlCYs+4Ngc0fZ4bm00K9ffVUY6AHq Np/OZ9M36NGZxITE1qYm5SLlO/B66QskPFhSccXzH4vyfpqSsWlgFq+/Trtd9XSB15+X OKG+krnV2WRCtBOauNip6hYh3e+jjq4kP8Xrbro87NzQZy93xyQdBm/r9H6X7ED6k/4x sQrA== X-Forwarded-Encrypted: i=1; AJvYcCUZxOIZ4I6RwEpCzTlYic8PB06KWg/mQowIo3perVjnhxaf6KXrk7jd9TLCwGAOLedrw7EjNGwsfvzIxow=@vger.kernel.org X-Gm-Message-State: AOJu0Yyl8py+n6QEGmLHjnCmVM5+O0Udvj9nC/g5t3/y4lZTgJBFBICA 9UXsGPTiz4RjozCwl5+HBf99KfxXIK3+wC+dTugMBS/eCP/O3yyU44xseWt7fg== X-Gm-Gg: ASbGnct28P/IBKlGjZ9tNfP8qkqQEt2Rl2HIVXorN4xVpAc/ily5fyDQTV7W6JVtULA PE2qWog1OSZGfX15PGIW46w/+t0wYiSAasZj+NbCwzON2wno0aowQlbl/peWLpry+CycP8/owml NZwPs5SHW0L3aT/eL4COSnN8At4qLXMb442oBnmiAtB5F/ob5uUFD6riGYNwa1hYVw6R2LmlTQG ATC4d+9W0wL8LBx9UK6aCX3Ra9IX1nhI1Xhtfi3MTaHCzIa6lXSRM/djFt9CL8EnDQxaUBN8w8n 5Zg276oAK1N2Pg2HNvDeBcZWlN1g16mTBpuAmw0EdvEThtl3KMcbkUVsjw2bsSp4e9qGdONNww/ i8Wp+0q4wI+T8FvppJwXi X-Google-Smtp-Source: AGHT+IG/xSy34k0CFTgjANoPWktPJ3qK1n+UL3TMBJIpsVBenJhFTfbQo1dWwYbicmN6hxa3SriRzA== X-Received: by 2002:a17:90b:4ece:b0:2ee:5bc9:75c3 with SMTP id 98e67ed59e1d1-306dbb8db11mr1260947a91.5.1744154744609; Tue, 08 Apr 2025 16:25:44 -0700 (PDT) Received: from tiamat (c-69-181-214-135.hsd1.ca.comcast.net. [69.181.214.135]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-739d97f36besm11186913b3a.72.2025.04.08.16.25.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 16:25:44 -0700 (PDT) From: Michael Rubin To: gregkh@linuxfoundation.org, dpenkler@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 5/7] staging: gpib: Removing typedef of status_byte Date: Tue, 8 Apr 2025 23:25:33 +0000 Message-ID: <20250408232535.187528-6-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org> References: <20250408232535.187528-1-matchstick@neverthere.org> 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" Replacing typedef of status_byte_t with struct gpib_status_byte to adhere to Linux coding style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin --- drivers/staging/gpib/common/gpib_os.c | 8 ++++---- drivers/staging/gpib/include/gpib_types.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index a2138c7f641c..b06cbd53c36f 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -183,7 +183,7 @@ unsigned int num_status_bytes(const struct gpib_status_= queue *dev) int push_status_byte(struct gpib_board *board, struct gpib_status_queue *d= evice, u8 poll_byte) { struct list_head *head =3D &device->status_bytes; - status_byte_t *status; + struct gpib_status_byte *status; static const unsigned int max_num_status_bytes =3D 1024; int retval; =20 @@ -196,7 +196,7 @@ int push_status_byte(struct gpib_board *board, struct g= pib_status_queue *device, return retval; } =20 - status =3D kmalloc(sizeof(status_byte_t), GFP_KERNEL); + status =3D kmalloc(sizeof(struct gpib_status_byte), GFP_KERNEL); if (!status) return -ENOMEM; =20 @@ -218,7 +218,7 @@ int pop_status_byte(struct gpib_board *board, struct gp= ib_status_queue *device, { struct list_head *head =3D &device->status_bytes; struct list_head *front =3D head->next; - status_byte_t *status; + struct gpib_status_byte *status; =20 if (num_status_bytes(device) =3D=3D 0) return -EIO; @@ -231,7 +231,7 @@ int pop_status_byte(struct gpib_board *board, struct gp= ib_status_queue *device, return -EPIPE; } =20 - status =3D list_entry(front, status_byte_t, list); + status =3D list_entry(front, struct gpib_status_byte, list); *poll_byte =3D status->poll_byte; =20 list_del(front); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index f85091b1bdf0..6a34500af65c 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -324,10 +324,10 @@ struct gpib_status_queue { unsigned dropped_byte : 1; }; =20 -typedef struct { +struct gpib_status_byte { struct list_head list; u8 poll_byte; -} status_byte_t; +}; =20 void init_gpib_status_queue(struct gpib_status_queue *device); =20 --=20 2.43.0 From nobody Sun Feb 8 10:04:47 2026 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 A8799257440 for ; Tue, 8 Apr 2025 23:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154749; cv=none; b=Xvh8T1XWQzUZAeBTmKjKYG48ScXKsatvTK+U83JFvw/rWUODDIpeNk0X5XZS+skYrIPAmLN3SjWvdTTYcHWzvmfBJKRzXvP2+rjkyMJTTtsCHvbuBxqyEg+pYaHe15hJdlLkPy7jXN9wAGjdSjrvpK8xb1bWAA6yXPVx4490Zgo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154749; c=relaxed/simple; bh=7NsYaOHtP6scSVgtfwrSOvUeDsS990s0l6D3dRmxvtA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tuYfV7d5zQqvjvvPrBX7t64bxzjpZ88XWwqqtbn7iVTEU/bOTEw3PoRcpHSZXCdAsj/RlR6oAgkZ572Um+egtP6UgHr4fXYzw60j3N3GMc0wU8ZrFfpjqKliIHtDA4fcfQxYqrA6pU/1Qto8H73iO1Ixg15mzDiIDEtWRWmTG68= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org; spf=pass smtp.mailfrom=neverthere.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b=WzBfwFZ8; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neverthere.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b="WzBfwFZ8" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-22403cbb47fso66567795ad.0 for ; Tue, 08 Apr 2025 16:25:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1744154746; x=1744759546; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J9ON5Qv7DJQ0DX/fAqZuOiE2IxL/TP/o5xQInqAXYAQ=; b=WzBfwFZ8w3y/TI4V7ShquYCDTrYDLQbx/TmBzMijaLqOpqvyisAgRsDWnjq872+fdu lIjgPoRnCOvU6Um7mZHkOG1Cljw3V82amZDMwsLgq3bl/XlGoYtRiaQ645O+r4EM+sHE xo/aGCegC9HdlV34YwdgQ3Z7R8hFt2wxpavin0q9I+dUmNnDPSG16zsIR8qjTPKL1VUM BX35x4SoTonsbu67Nr76fep/G1KDxsdawaT98XyVFlWp6WFemdrg/Y2n2ItsaiPsf7c9 IJSsq2JsyvLYgIspjlkDQmEEbn6r2nGlx/8C60rSj1iSNYzN3T+s9p9cOFaKWRaxQswy 4YQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744154746; x=1744759546; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J9ON5Qv7DJQ0DX/fAqZuOiE2IxL/TP/o5xQInqAXYAQ=; b=rWCKsx61g1CdRNPtJJpyM+Q2f2mKsl3pgcH1EUR69Cb1iFC/VEREFGLuUrsPHAkMJE zzaZdKYq9Q+htOmHr9+b9UpwFF8fH1ybYhXo3oEP3aEgjqdyjBcnbU33diFwVtQ2vsKO TK8LcQ/nVPacPIa8nyiNtq05QnUb8LGyBfnOhc7gpocY3QpbW4CnbkJF4MYEul4iOBlN mrURJE2wkG5pMw6tgoev04Ac2jiK5JbpPbM1YIFYkpCie4PQPPbJmZirKF9q3uAzxnvA i4GRvokQtoazx1RI1/UB5zUV7lU4zYn+TqKJdbtT0eNVkuXqvkhYaIjoK5inrQtEcE0M 6hGA== X-Forwarded-Encrypted: i=1; AJvYcCW4eBvB6ltrUQZGgzQXEHnCO86GbrJhLp53Cqw5/3IdLqYI8YHdUOvXgJMuPioTdkn6mo2kwXwoNbm5bAM=@vger.kernel.org X-Gm-Message-State: AOJu0YwFSmnb2sDNO6zFCF35vGr2tEwkaMnvRmccxFkOZ0n11F+k9U+B InOq5UTL5aAJvj20vssRE5TpBczW+4Csq1UgtHRHkq4xKlxszI8U4VltXq7YZj94bKlJkBdr5wg = X-Gm-Gg: ASbGncs9jfXYnwTf7qgmriekZ3Zuv7Ew/V/FdnqGkCEfbR8gB+goo/EEjkfhVt/yCkv NWKY9RFc9V3Q4GhxH55Wle2/9YFd2PPLJHWDbgmDZJYJL+EAwP2MlTVPwWGmHXPKZDUQ5zRdDHd Qeq1DjIX8CvzRORob21jQXTO5cIFe0kQ3eY+MnyvZBdwFUx0a+yfmBRiQ1gwYzWG09MM+GNU79U kzVt0yKBHmMZccY7cLvbmkOn896P9hLEcxxZJ83qpO83uGiaNZsUxwfomwNN7g5Tr7717LGP2Mg 40zNYNm+b0VBXYS6UrU4s50vRpfDrjQ9bKgdOKFcx3tSyCuRASJoI41mlGC36Au2gqx12y4RPek rcq4GdO04Ng5DsKSngzu+ X-Google-Smtp-Source: AGHT+IG52w3InnLTyWxAM0DeNTrDyCR5cFdsTkwznxzpjIVJTgm6/qAi3+aBwVwOF8Z/NEPbzlb5FA== X-Received: by 2002:a17:903:94e:b0:223:fbc7:25f4 with SMTP id d9443c01a7336-22ac29a9929mr13305635ad.14.1744154745866; Tue, 08 Apr 2025 16:25:45 -0700 (PDT) Received: from tiamat (c-69-181-214-135.hsd1.ca.comcast.net. [69.181.214.135]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-229785c0127sm106693085ad.91.2025.04.08.16.25.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 16:25:45 -0700 (PDT) From: Michael Rubin To: gregkh@linuxfoundation.org, dpenkler@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 6/7] staging: gpib: Removing typedef gpib_descriptor_t Date: Tue, 8 Apr 2025 23:25:34 +0000 Message-ID: <20250408232535.187528-7-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org> References: <20250408232535.187528-1-matchstick@neverthere.org> 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" Removing gpib_descriptor_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin --- drivers/staging/gpib/common/gpib_os.c | 26 +++++++++++------------ drivers/staging/gpib/common/iblib.c | 6 +++--- drivers/staging/gpib/include/gpib_proto.h | 6 +++--- drivers/staging/gpib/include/gpib_types.h | 6 +++--- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index b06cbd53c36f..6aaf15ffb02b 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -494,7 +494,7 @@ int dvrsp(struct gpib_board *board, unsigned int pad, i= nt sad, return retval; } =20 -static gpib_descriptor_t *handle_to_descriptor(const gpib_file_private_t *= file_priv, +static struct gpib_descriptor *handle_to_descriptor(const gpib_file_privat= e_t *file_priv, int handle) { if (handle < 0 || handle >=3D GPIB_MAX_NUM_DESCRIPTORS) { @@ -509,7 +509,7 @@ static int init_gpib_file_private(gpib_file_private_t *= priv) { memset(priv, 0, sizeof(*priv)); atomic_set(&priv->holding_mutex, 0); - priv->descriptors[0] =3D kmalloc(sizeof(gpib_descriptor_t), GFP_KERNEL); + priv->descriptors[0] =3D kmalloc(sizeof(struct gpib_descriptor), GFP_KERN= EL); if (!priv->descriptors[0]) { pr_err("gpib: failed to allocate default board descriptor\n"); return -ENOMEM; @@ -563,7 +563,7 @@ int ibclose(struct inode *inode, struct file *filep) unsigned int minor =3D iminor(inode); struct gpib_board *board; gpib_file_private_t *priv =3D filep->private_data; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; =20 if (minor >=3D GPIB_MAX_NUM_BOARDS) { pr_err("gpib: invalid minor number of device file\n"); @@ -869,7 +869,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, s= truct gpib_board *board, int end_flag =3D 0; int retval; ssize_t read_ret =3D 0; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; size_t nbytes; =20 retval =3D copy_from_user(&read_cmd, (void __user *)arg, sizeof(read_cmd)= ); @@ -943,7 +943,7 @@ static int command_ioctl(gpib_file_private_t *file_priv, unsigned long remain; int retval; int fault =3D 0; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; size_t bytes_written; int no_clear_io_in_prog; =20 @@ -1027,7 +1027,7 @@ static int write_ioctl(gpib_file_private_t *file_priv= , struct gpib_board *board, unsigned long remain; int retval =3D 0; int fault; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; =20 fault =3D copy_from_user(&write_cmd, (void __user *)arg, sizeof(write_cmd= )); if (fault) @@ -1189,7 +1189,7 @@ static int cleanup_open_devices(gpib_file_private_t *= file_priv, struct gpib_boar int i; =20 for (i =3D 0; i < GPIB_MAX_NUM_DESCRIPTORS; i++) { - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; =20 desc =3D file_priv->descriptors[i]; if (!desc) @@ -1228,7 +1228,7 @@ static int open_dev_ioctl(struct file *filep, struct = gpib_board *board, unsigned mutex_unlock(&file_priv->descriptors_mutex); return -ERANGE; } - file_priv->descriptors[i] =3D kmalloc(sizeof(gpib_descriptor_t), GFP_KERN= EL); + file_priv->descriptors[i] =3D kmalloc(sizeof(struct gpib_descriptor), GFP= _KERNEL); if (!file_priv->descriptors[i]) { mutex_unlock(&file_priv->descriptors_mutex); return -ENOMEM; @@ -1311,7 +1311,7 @@ static int wait_ioctl(gpib_file_private_t *file_priv,= struct gpib_board *board, { wait_ioctl_t wait_cmd; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; =20 retval =3D copy_from_user(&wait_cmd, (void __user *)arg, sizeof(wait_cmd)= ); if (retval) @@ -1438,7 +1438,7 @@ static int pad_ioctl(struct gpib_board *board, gpib_f= ile_private_t *file_priv, { pad_ioctl_t cmd; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; =20 retval =3D copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); if (retval) @@ -1474,7 +1474,7 @@ static int sad_ioctl(struct gpib_board *board, gpib_f= ile_private_t *file_priv, { sad_ioctl_t cmd; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; =20 retval =3D copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); if (retval) @@ -1600,7 +1600,7 @@ static int autospoll_ioctl(struct gpib_board *board, = gpib_file_private_t *file_p { autospoll_ioctl_t enable; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; =20 retval =3D copy_from_user(&enable, (void __user *)arg, sizeof(enable)); if (retval) @@ -2015,7 +2015,7 @@ struct gpib_board board_array[GPIB_MAX_NUM_BOARDS]; =20 LIST_HEAD(registered_drivers); =20 -void init_gpib_descriptor(gpib_descriptor_t *desc) +void init_gpib_descriptor(struct gpib_descriptor *desc) { desc->pad =3D 0; desc->sad =3D -1; diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/com= mon/iblib.c index 136be22f7eb2..902807066d60 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -507,7 +507,7 @@ int ibstatus(struct gpib_board *board) } =20 int general_ibstatus(struct gpib_board *board, const struct gpib_status_qu= eue *device, - int clear_mask, int set_mask, gpib_descriptor_t *desc) + int clear_mask, int set_mask, struct gpib_descriptor *desc) { int status =3D 0; short line_status; @@ -574,7 +574,7 @@ static void init_wait_info(struct wait_info *winfo) } =20 static int wait_satisfied(struct wait_info *winfo, struct gpib_status_queu= e *status_queue, - int wait_mask, int *status, gpib_descriptor_t *desc) + int wait_mask, int *status, struct gpib_descriptor *desc) { struct gpib_board *board =3D winfo->board; int temp_status; @@ -623,7 +623,7 @@ static void remove_wait_timer(struct wait_info *winfo) * no condition is waited for. */ int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int se= t_mask, - int *status, unsigned long usec_timeout, gpib_descriptor_t *desc) + int *status, unsigned long usec_timeout, struct gpib_descriptor *desc) { int retval =3D 0; struct gpib_status_queue *status_queue; diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gp= ib/include/gpib_proto.h index 80046218c834..333f5c62da9e 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -23,7 +23,7 @@ static inline unsigned long usec_to_jiffies(unsigned int = usec) }; =20 int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); -void init_gpib_descriptor(gpib_descriptor_t *desc); +void init_gpib_descriptor(struct gpib_descriptor *desc); int dvrsp(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *result); int ibAPWait(struct gpib_board *board, int pad); @@ -45,11 +45,11 @@ int ibpad(struct gpib_board *board, unsigned int addr); int ibsad(struct gpib_board *board, int addr); int ibeos(struct gpib_board *board, int eos, int eosflags); int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int se= t_mask, - int *status, unsigned long usec_timeout, gpib_descriptor_t *desc); + int *status, unsigned long usec_timeout, struct gpib_descriptor *desc); int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi= , size_t *bytes_written); int ibstatus(struct gpib_board *board); int general_ibstatus(struct gpib_board *board, const struct gpib_status_qu= eue *device, - int clear_mask, int set_mask, gpib_descriptor_t *desc); + int clear_mask, int set_mask, struct gpib_descriptor *desc); int io_timed_out(struct gpib_board *board); int ibppc(struct gpib_board *board, uint8_t configuration); =20 diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 6a34500af65c..2b4e98d1aa76 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -332,17 +332,17 @@ struct gpib_status_byte { void init_gpib_status_queue(struct gpib_status_queue *device); =20 /* Used to store device-descriptor-specific information */ -typedef struct { +struct gpib_descriptor { unsigned int pad; /* primary gpib address */ int sad; /* secondary gpib address (negative means disabled) */ atomic_t io_in_progress; unsigned is_board : 1; unsigned autopoll_enabled : 1; -} gpib_descriptor_t; +}; =20 typedef struct { atomic_t holding_mutex; - gpib_descriptor_t *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; + struct gpib_descriptor *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; /* locked while descriptors are being allocated/deallocated */ struct mutex descriptors_mutex; unsigned got_module : 1; --=20 2.43.0 From nobody Sun Feb 8 10:04:47 2026 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 C1CB9257443 for ; Tue, 8 Apr 2025 23:25:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154749; cv=none; b=AKHvIfidyKWWaeKU+CDSLZ60YejmyyQcjGqWsQfeiVowP4tWhwVVldFEjGzCOS6FX1rE+3vQxyVD4ZC622dTFh2SKfzRFMXX20jCTiOyA7TNfuTzAB1FH0ONkj2XOyZuX1slZsRC+amJjTb8hALJuN5vkwkzMWDcbSjBaZB1Ieg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744154749; c=relaxed/simple; bh=Lmctd6vpHrfJUTj3ifUWKkU/sArZCAoIqbGi/Med02Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jL0KP/4uq2Z+kv3ZDrFHYSbwZFJBZHjNwRIjyiSxBHnhcVtW1pk3oijB248sm77w0Ms1UEbIAcejnQOds5rPkxi2pwSNZ0rt0OuakoCJAJqkiR9NzjaqNwAG/SePXIRRybONXkv53coh/w+9s15/9Y1ZiNwTNFOfMUBbw5DJLz8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org; spf=pass smtp.mailfrom=neverthere.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b=io+gw6dg; arc=none smtp.client-ip=209.85.214.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=neverthere.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=neverthere.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=neverthere.org header.i=@neverthere.org header.b="io+gw6dg" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-227a8cdd241so71535875ad.3 for ; Tue, 08 Apr 2025 16:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1744154747; x=1744759547; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7MoK6FPlVFbuKd+bgN/UwDHVwPNikkjjLk9d6W5WBjg=; b=io+gw6dgsm3usjF3zGq/eGqpmiuprfMv+fmbTZDILV6EgPIIxB4As/7f4YS9vudu7A rcYkjyMJThj5PdgEbNhRFoqZQKb6TEiZzbjggVq20V8a0y8f76N0R8hgtZpFgmTOTunj 7fJWBDVypXK1Ogh41MM+lq5hUk8A27yYQzhd42idkiJtBlT9r/GBboFwzj4UKeD25vPD ythnHir9FyXfi9T8o+EMcoKigDS1XzSDKThfFsXC/28KMU7aP/Kalf6KeVeFHnEn4v2N ZHRzs+8syAXkoHpWk5h/oeeHMNNSlWmZuR8xpJzX+s8csg2P8KC0FZBmjdBXfs9jk0Nw lskA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744154747; x=1744759547; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7MoK6FPlVFbuKd+bgN/UwDHVwPNikkjjLk9d6W5WBjg=; b=BrCtGYgqTT9Pn3UgpVJz9whr7ix9crZRoFGRYjftF2hH7N+e/QLi74cfeJnElp2/Mq UZR8Bes9/v9DPyCahAzSzdhF2/jphJWRInbAd1b8HN03/j1oolASZqg0g9dKga+0cKTK 0bTf+cP1vgaT70ifjg4JSBBXuTBDIe1QwTu80rK9PWiTDPp0WcHfOjHfTVcMGPzppyUZ 2IDUZ5OEJ01hlMrBVfsPSUT2XzlZ9XUmGLQjtdfxV4rSUECU/0XXNPNNLy3oxi8ecvF4 Jw5BOLE4nziVroCMjwbs37L4xIK/sKTW8sP3zW4BvtuZWPEAcN52sucl1fNS86/gNSey /lXw== X-Forwarded-Encrypted: i=1; AJvYcCXNsdwJJ8PF9kEhWyOKyacVYyLo1DRZRekL36ykoHKtfFlJK7jqALpDUxCk5SIBGO9dLJ2ymoId2lrGRFU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/b1vjY9PIuKV0k/dL51r/y/q5pmK/Z0thTLbNEOaAfJIMGy2e 2l5eEmpORV/j0OIeRktICtTIy6iLiwJibdWUeTt2A0QEzdL0eXl/2vVFU43tSA== X-Gm-Gg: ASbGncvGXeL5jNh4IxHnpmekcCNguSDmAl8vftwaYZDcbiNzr+BkeaH1l68B2nszw0G QPEZIMgI2gRh4LqVbAU6HUypSCRkZIrVVyLpbDSLR/oFZCB1+Vverm1cG1kMqvdANjggbhWOeom wQJ/ZjrFhHIibQ3ER6J+LxvPAoBy2rIZTJ7Ul6rtQsNGyhAytfSze+vas6hd1bRUgKXXnqCiaHE fTsd/gYHdxvoqjMKrlu6Btz1ABtqGkusfj2ii7MjPHUbTuVilEC9pSZeX7ATQHD81jTEQHFx+h8 gcrBzcdLL0GwCzyZqDV4SjPYzGBWBIB4CIrzs6HaXzt1gmkenxnhmpF3QRH6JHC+Yzg6LdZWLJF kqLV6kkxvPg== X-Google-Smtp-Source: AGHT+IFWX5QMJi9HBKsf6eI3URaf8Mln6NBm+b8Pqz2yg9dB+B2ryEhNl8VacoYUHHJvA2n82ZHxzg== X-Received: by 2002:a17:903:248:b0:223:517a:d2a3 with SMTP id d9443c01a7336-22ac29a69aemr12776565ad.17.1744154747108; Tue, 08 Apr 2025 16:25:47 -0700 (PDT) Received: from tiamat (c-69-181-214-135.hsd1.ca.comcast.net. [69.181.214.135]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2297865e066sm106849045ad.137.2025.04.08.16.25.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Apr 2025 16:25:46 -0700 (PDT) From: Michael Rubin To: gregkh@linuxfoundation.org, dpenkler@gmail.com Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 7/7] staging: gpib: Remove typedef gpib_file_private_t Date: Tue, 8 Apr 2025 23:25:35 +0000 Message-ID: <20250408232535.187528-8-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250408232535.187528-1-matchstick@neverthere.org> References: <20250408232535.187528-1-matchstick@neverthere.org> 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" Removing gpib_file_private_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin --- drivers/staging/gpib/common/gpib_os.c | 61 ++++++++++++----------- drivers/staging/gpib/include/gpib_types.h | 4 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index 6aaf15ffb02b..8365eb293d0b 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -26,26 +26,27 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB base support"); MODULE_ALIAS_CHARDEV_MAJOR(GPIB_CODE); =20 -static int board_type_ioctl(gpib_file_private_t *file_priv, +static int board_type_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg); -static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *b= oard, +static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_boa= rd *board, unsigned long arg); -static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *= board, +static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_bo= ard *board, unsigned long arg); -static int command_ioctl(gpib_file_private_t *file_priv, struct gpib_board= *board, +static int command_ioctl(struct gpib_file_private *file_priv, struct gpib_= board *board, unsigned long arg); static int open_dev_ioctl(struct file *filep, struct gpib_board *board, un= signed long arg); static int close_dev_ioctl(struct file *filep, struct gpib_board *board, u= nsigned long arg); static int serial_poll_ioctl(struct gpib_board *board, unsigned long arg); -static int wait_ioctl(gpib_file_private_t *file_priv, struct gpib_board *b= oard, unsigned long arg); +static int wait_ioctl(struct gpib_file_private *file_priv, + struct gpib_board *board, unsigned long arg); static int parallel_poll_ioctl(struct gpib_board *board, unsigned long arg= ); static int online_ioctl(struct gpib_board *board, unsigned long arg); static int remote_enable_ioctl(struct gpib_board *board, unsigned long arg= ); static int take_control_ioctl(struct gpib_board *board, unsigned long arg); static int line_status_ioctl(struct gpib_board *board, unsigned long arg); -static int pad_ioctl(struct gpib_board *board, gpib_file_private_t *file_p= riv, +static int pad_ioctl(struct gpib_board *board, struct gpib_file_private *f= ile_priv, unsigned long arg); -static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_p= riv, +static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *f= ile_priv, unsigned long arg); static int eos_ioctl(struct gpib_board *board, unsigned long arg); static int request_service_ioctl(struct gpib_board *board, unsigned long a= rg); @@ -53,9 +54,9 @@ static int request_service2_ioctl(struct gpib_board *boar= d, unsigned long arg); static int iobase_ioctl(struct gpib_board_config *config, unsigned long ar= g); static int irq_ioctl(struct gpib_board_config *config, unsigned long arg); static int dma_ioctl(struct gpib_board_config *config, unsigned long arg); -static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *= file_priv, +static int autospoll_ioctl(struct gpib_board *board, struct gpib_file_priv= ate *file_priv, unsigned long arg); -static int mutex_ioctl(struct gpib_board *board, gpib_file_private_t *file= _priv, +static int mutex_ioctl(struct gpib_board *board, struct gpib_file_private = *file_priv, unsigned long arg); static int timeout_ioctl(struct gpib_board *board, unsigned long arg); static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg); @@ -71,7 +72,7 @@ static int event_ioctl(struct gpib_board *board, unsigned= long arg); static int request_system_control_ioctl(struct gpib_board *board, unsigned= long arg); static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg); =20 -static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpi= b_board *board); +static int cleanup_open_devices(struct gpib_file_private *file_priv, struc= t gpib_board *board); =20 static int pop_gpib_event_nolock(struct gpib_board *board, struct gpib_event_queue *queue, short *event_type); @@ -494,8 +495,8 @@ int dvrsp(struct gpib_board *board, unsigned int pad, i= nt sad, return retval; } =20 -static struct gpib_descriptor *handle_to_descriptor(const gpib_file_privat= e_t *file_priv, - int handle) +static struct gpib_descriptor *handle_to_descriptor(const struct gpib_file= _private *file_priv, + int handle) { if (handle < 0 || handle >=3D GPIB_MAX_NUM_DESCRIPTORS) { pr_err("gpib: invalid handle %i\n", handle); @@ -505,7 +506,7 @@ static struct gpib_descriptor *handle_to_descriptor(con= st gpib_file_private_t *f return file_priv->descriptors[handle]; } =20 -static int init_gpib_file_private(gpib_file_private_t *priv) +static int init_gpib_file_private(struct gpib_file_private *priv) { memset(priv, 0, sizeof(*priv)); atomic_set(&priv->holding_mutex, 0); @@ -524,7 +525,7 @@ int ibopen(struct inode *inode, struct file *filep) { unsigned int minor =3D iminor(inode); struct gpib_board *board; - gpib_file_private_t *priv; + struct gpib_file_private *priv; =20 if (minor >=3D GPIB_MAX_NUM_BOARDS) { pr_err("gpib: invalid minor number of device file\n"); @@ -533,12 +534,12 @@ int ibopen(struct inode *inode, struct file *filep) =20 board =3D &board_array[minor]; =20 - filep->private_data =3D kmalloc(sizeof(gpib_file_private_t), GFP_KERNEL); + filep->private_data =3D kmalloc(sizeof(struct gpib_file_private), GFP_KER= NEL); if (!filep->private_data) return -ENOMEM; =20 priv =3D filep->private_data; - init_gpib_file_private((gpib_file_private_t *)filep->private_data); + init_gpib_file_private((struct gpib_file_private *)filep->private_data); =20 if (board->use_count =3D=3D 0) { int retval; @@ -562,7 +563,7 @@ int ibclose(struct inode *inode, struct file *filep) { unsigned int minor =3D iminor(inode); struct gpib_board *board; - gpib_file_private_t *priv =3D filep->private_data; + struct gpib_file_private *priv =3D filep->private_data; struct gpib_descriptor *desc; =20 if (minor >=3D GPIB_MAX_NUM_BOARDS) { @@ -608,7 +609,7 @@ long ibioctl(struct file *filep, unsigned int cmd, unsi= gned long arg) { unsigned int minor =3D iminor(filep->f_path.dentry->d_inode); struct gpib_board *board; - gpib_file_private_t *file_priv =3D filep->private_data; + struct gpib_file_private *file_priv =3D filep->private_data; long retval =3D -ENOTTY; =20 if (minor >=3D GPIB_MAX_NUM_BOARDS) { @@ -808,7 +809,7 @@ long ibioctl(struct file *filep, unsigned int cmd, unsi= gned long arg) return retval; } =20 -static int board_type_ioctl(gpib_file_private_t *file_priv, +static int board_type_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { struct list_head *list_ptr; @@ -860,7 +861,7 @@ static int board_type_ioctl(gpib_file_private_t *file_p= riv, return -EINVAL; } =20 -static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *b= oard, +static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_boa= rd *board, unsigned long arg) { read_write_ioctl_t read_cmd; @@ -935,7 +936,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, s= truct gpib_board *board, return read_ret; } =20 -static int command_ioctl(gpib_file_private_t *file_priv, +static int command_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { read_write_ioctl_t cmd; @@ -1019,7 +1020,7 @@ static int command_ioctl(gpib_file_private_t *file_pr= iv, return retval; } =20 -static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *= board, +static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_bo= ard *board, unsigned long arg) { read_write_ioctl_t write_cmd; @@ -1183,7 +1184,7 @@ static inline int decrement_open_device_count(struct = gpib_board *board, struct l return subtract_open_device_count(board, head, pad, sad, 1); } =20 -static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpi= b_board *board) +static int cleanup_open_devices(struct gpib_file_private *file_priv, struc= t gpib_board *board) { int retval =3D 0; int i; @@ -1212,7 +1213,7 @@ static int open_dev_ioctl(struct file *filep, struct = gpib_board *board, unsigned { open_dev_ioctl_t open_dev_cmd; int retval; - gpib_file_private_t *file_priv =3D filep->private_data; + struct gpib_file_private *file_priv =3D filep->private_data; int i; =20 retval =3D copy_from_user(&open_dev_cmd, (void __user *)arg, sizeof(open_= dev_cmd)); @@ -1261,7 +1262,7 @@ static int open_dev_ioctl(struct file *filep, struct = gpib_board *board, unsigned static int close_dev_ioctl(struct file *filep, struct gpib_board *board, u= nsigned long arg) { close_dev_ioctl_t cmd; - gpib_file_private_t *file_priv =3D filep->private_data; + struct gpib_file_private *file_priv =3D filep->private_data; int retval; =20 retval =3D copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); @@ -1306,7 +1307,7 @@ static int serial_poll_ioctl(struct gpib_board *board= , unsigned long arg) return 0; } =20 -static int wait_ioctl(gpib_file_private_t *file_priv, struct gpib_board *b= oard, +static int wait_ioctl(struct gpib_file_private *file_priv, struct gpib_boa= rd *board, unsigned long arg) { wait_ioctl_t wait_cmd; @@ -1433,7 +1434,7 @@ static int line_status_ioctl(struct gpib_board *board= , unsigned long arg) return 0; } =20 -static int pad_ioctl(struct gpib_board *board, gpib_file_private_t *file_p= riv, +static int pad_ioctl(struct gpib_board *board, struct gpib_file_private *f= ile_priv, unsigned long arg) { pad_ioctl_t cmd; @@ -1469,7 +1470,7 @@ static int pad_ioctl(struct gpib_board *board, gpib_f= ile_private_t *file_priv, return 0; } =20 -static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_p= riv, +static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *f= ile_priv, unsigned long arg) { sad_ioctl_t cmd; @@ -1595,7 +1596,7 @@ static int dma_ioctl(struct gpib_board_config *config= , unsigned long arg) return 0; } =20 -static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *= file_priv, +static int autospoll_ioctl(struct gpib_board *board, struct gpib_file_priv= ate *file_priv, unsigned long arg) { autospoll_ioctl_t enable; @@ -1633,7 +1634,7 @@ static int autospoll_ioctl(struct gpib_board *board, = gpib_file_private_t *file_p return retval; } =20 -static int mutex_ioctl(struct gpib_board *board, gpib_file_private_t *file= _priv, +static int mutex_ioctl(struct gpib_board *board, struct gpib_file_private = *file_priv, unsigned long arg) { int retval, lock_mutex; diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 2b4e98d1aa76..0dbe45894884 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -340,13 +340,13 @@ struct gpib_descriptor { unsigned autopoll_enabled : 1; }; =20 -typedef struct { +struct gpib_file_private { atomic_t holding_mutex; struct gpib_descriptor *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; /* locked while descriptors are being allocated/deallocated */ struct mutex descriptors_mutex; unsigned got_module : 1; -} gpib_file_private_t; +}; =20 #endif /* __KERNEL__ */ =20 --=20 2.43.0