From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (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 F0D07210192 for ; Wed, 19 Mar 2025 21:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421580; cv=none; b=GiIz0S8ICu/bbmZHnZ2xVL57I2PDSxghGS2yQa/XioCj45Nd+93fwTMiAdExxeXakPzkZ+iHjgWvrd+JjekPLb+ShvqM4wCUmr2iUosP9yV1ncOBtKUNJN7XJExQeJIQxLWozbmY71bVFiakRjH9hUEuDj0akEvM6220trCrvV0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421580; c=relaxed/simple; bh=RKb+1sIHBOGYefHzaK1Sib+IBGYlcCV1odTLTle3f3E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AlAgfsEE0j73m/HgSxm61DkxEnjEC/W/FxiFFqujdDs9rolraqypUAANGS/c1UsV0Ks744MT7BbKFrhoS7XitHxIsi3PVFhx6RD5lkYdsSrcGOBr1LFgx7n041ZND5R769n+Mnx4hCrZRKtpvYXT4Uc+yE+Tl0rYNGdPUISd+0I= 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=iB9k9508; arc=none smtp.client-ip=209.85.216.41 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="iB9k9508" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-301d6cbbd5bso208383a91.3 for ; Wed, 19 Mar 2025 14:59:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421578; x=1743026378; 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=QFQ/YvYbZ8R0CaqRMB9MAnlKHCmO+BcDVa05l7CnOdE=; b=iB9k9508kNSGKoN6TikntabhPU9rfGLREOiRGZSQMrtAuMeLhN4xysf6IR9Ahhgugv 97Ro4HezTaRJEsrZUk94i1nHf/KNcAJvdeDKr7J/hRjaQZYNigA/T5A8p1Qixjf6ah5A Z5jo8cA5zBtqYVqRcPX5yV/B1kEHg1Td22NXQ4Tfz5YXWWkveNNGPrPfwWpUfDHXAthQ HHF+HJv5F5wWsQwixIdRd7IwmBb4BwMIxlJNyqGx4OHla0hCVn9PcQjbb38evUu6QiPq tl7vO20PZgO1nsEY1O9MjcOaixsO+45t6SZDu9eqtJNU4OD1qwM0mWuzsN1XZ6+Zmyq6 iKTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421578; x=1743026378; 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=QFQ/YvYbZ8R0CaqRMB9MAnlKHCmO+BcDVa05l7CnOdE=; b=TVbQo+XtB2wzWSWbwa6KsW+A6gIHFt+sRvH71LpAotMpijA2LVQ+AqQ85/TiM2M4QJ A7is+LQZGbc5XZUQY0ssCxE9pkExofWpvXSVbQgVfwCwKp0i+aDp1G/HvXuKhhaXZD3m th0RfrAFHQUB5SS+kUPxtgJsCm11dUoloLeSIf0d5indjmn6oe7KmuGAFFr6rv6d3P4d 92QMVHtW9/g1rnQkJXn7sysofjXA1k7ILjsq98Cr8V4PgKDGdTeL8UxMab9w7WrlP5ZA AlvuhiNiFKHHrDgF/6vMEaDpD96a71IoaTHuuCI56AkyYgK2h9zU+IXM89HbohXhdyyD 4q0g== X-Forwarded-Encrypted: i=1; AJvYcCWbnVZHoCanPUDi0+24jQKaPITTBW6jlZUwLVBmwM9nvBhZ9vn6r17g7GIFn4xysx1wkpsPIsCEXxoNZ7w=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1bXU6aMdlKAkXgDxsjzYJJY915nF+63W+gBX5amKPZ/nY/ars 6XRI31XUIUchRftRMOxrvrSPjSRafoYRxAh8Qz37MzxV22XCDopJn3O5v2LbLxm9sLtxmC2Z/40 = X-Gm-Gg: ASbGncsZTQ/oU/RoCPgUIlfs2/YneyMfk4N6m0UdMCvVPPDDpUvsmO6mAnlMBdxIs74 Z57il5k487Gr5ggyAQrePWcurfb1QCYSRdAmM9+hDjkAYvTk9Ps0zJNZk3kGJZ+rTwmdFzqzvSj GjcEId7P93l0yhpYsktvDV5IUYQhUsisMjgwsO70klPmKNmQqwAWDrYtEPBM12Y9ZMYaxEmh0mu x18fECZJ+Pn1/tMsfQbDs1asFynfxp16zBOrDsaMgw6xlLrOgGjVwO3xM0oKCDXR9Je3waZjL67 54PGcbrf+CC0b5CR2l/Y/MLr1If6mzp2T+o1/FVYEc7uj+Hez6vS35YCmw5WKfI5hJSj9CXzHMu qrE6HmZWBDQ== X-Google-Smtp-Source: AGHT+IF60U1DlELYjOK158XzDQ0+T3RR0ImRj2326/SIg63h43OsS6AtFzreZLXkisKErOKfa8tzXg== X-Received: by 2002:a17:90b:390c:b0:2ee:9d49:3ae6 with SMTP id 98e67ed59e1d1-301bde62d9amr7148937a91.10.1742421578198; Wed, 19 Mar 2025 14:59:38 -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 98e67ed59e1d1-301bf5cfd9dsm2220991a91.44.2025.03.19.14.59.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:37 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 01/20] staging: gpib: struct typing for gpib_board Date: Wed, 19 Mar 2025 21:59:05 +0000 Message-ID: <20250319215924.19387-2-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for gpib_board struct in .h to allow drivers to migr= ate. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/include/gpib_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index b41781a55a60..7dc5a16e427b 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -23,7 +23,7 @@ #include =20 typedef struct gpib_interface_struct gpib_interface_t; -typedef struct gpib_board_struct gpib_board_t; +typedef struct gpib_board gpib_board_t; =20 /* config parameters that are only used by driver attach functions */ typedef struct { @@ -220,7 +220,7 @@ typedef struct gpib_interface_list_struct { * It provides storage for variables local to each board, and interface * functions for performing operations on the board */ -struct gpib_board_struct { +struct gpib_board { /* functions used by this board */ gpib_interface_t *interface; /* Pointer to module whose use count we should increment when --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 289D42165E9 for ; Wed, 19 Mar 2025 21:59:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421581; cv=none; b=RMHK+BLxPpPpZ5Di1sNoe9Jtf6SHVWwpHWbFAerOmcEcLiKxx/M8T9USUWntwH+d2CJbAYyg/QsB0Qa7/Ib3PEH3PAWXyzsE3JP3ZCoZt3T3/3WLXGWUfOJu5xTATSJ0QTkUmXewO0YyWrBCPou5IVahshjUKVZjaFUpzhAboJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421581; c=relaxed/simple; bh=GvYMUi/WMdyjCVqwHV7+4gp6hpfc2LY6Iy29RCoZFVg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J0rk1vg+pSqLMcW5Jze0yL3VZi1zZKy0rcpxMono0a6CoeLUnEsryPA6gzOmQru1+SHViyDPJ0DS4t3/ZUejfgUTkjsq6AtRmEyYbkYO6qFfQKfbW2GvVk/F6NLDTSSNTmF0sHezVhD4RWWtBwOdWuHsb1hu3NqtGhLcElvnNyA= 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=SFlEsfsQ; arc=none smtp.client-ip=209.85.214.180 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="SFlEsfsQ" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2235189adaeso2437625ad.0 for ; Wed, 19 Mar 2025 14:59:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421579; x=1743026379; 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=Nh9H79q8RgOXoC1LKOVoZppx+POUhL+mHZSn1kSXCPM=; b=SFlEsfsQfTJNuE2g5jf2lq/GrfdTMcRdwxEHc+UY00OpOCiQxrMqpn/oJMF00u7y/C OR1cPnKqF1ygRjAOAc9CsQAc91Yhy9y4cmvSqGwrPFfEeEHWWMXTB5RbTbapC5mO+rMI 2EfFpECzYqHMJj68VoaIISTzpSYJB26lIcfSkZ0fO0mzQAnD2ZgaurMmQI4jw95pvayw R/eE4D79HyYgQlJc4ZfKj+cPk/8YRw+yGY8DNUWhX9WV35dL4RpEDRI0ZM9gts9ZV8yk bJsrbu2eBkAEvnNcVts+ElDyHpPbhPVc27OoC3KbJVrWgujz0sFFdBbhaUVWWX2jcAqW khDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421579; x=1743026379; 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=Nh9H79q8RgOXoC1LKOVoZppx+POUhL+mHZSn1kSXCPM=; b=gbKqeMmUsrL9x7EXMBMbzwDMCiUwlu9JXJt26L8kc/tg29A/+6PmQ7N1dL+h1UrpXx ybuPbdk6uxxyfWmRbxEBNjrx+qjaasOxqlise9Mv7h+mwIamWl2Eoarg4yN9PGFtSEXu UaDg5TJUJ/nI+C1zSPaHm3EEOcwzV2M986gzdkeTPcXxl2ALrTAOadddA3nkz+uXM/9+ dJaIuCFTwLSL0NQdQVLJenabgvDpXyBo4OwAq2BKUcr0sWABqQKGdHf2iuggUSb9rr4E JNsDe+s9hmkJAx9uats6w2puJaZn0iUkM6AQD2iPP3lk0yIIFvVH+ZlSeqoeU+8JX8if /6Og== X-Forwarded-Encrypted: i=1; AJvYcCVXRMwEuq52UiMiLCPsABCVWQs0pQL6P2JRfBWSPEqqAMF6JIzzdwPDDKchGQXqVi7Os3ESCsgdQqTqe6Y=@vger.kernel.org X-Gm-Message-State: AOJu0Ywfr7s03xjsN1rI/Gi5vTC0etpdOspEF3nZMJRpL5IJEuQYTUei mwzucVV0vlLCNZmPXdmyUnvcrbYcI4Ydr6sGfkJE3Fmbg774zdXMwlgr+PfwkdilNucG6AGVgZU = X-Gm-Gg: ASbGnctNDdyMGblJsF6/hrEAJFNqiEgBWAehBToUJixYhrMQKAI1N+vFd9E8xe4zQNJ P0ae23eTMLjzO7MvMqlxTNMArMlyAdc8U0mG4nzG/BT1qiH4hmWrBWKAcRRHCrudd8wdcas0ml2 oqvZ8WLCyd2t0iSkvzObd+L6ctshy5pTPNydGLVEHQ5hF7fC3KQWqJZAK18w5PZmiHLecoxS3Y0 giyLtTT92A7CS1dCPQo3BKRa8hPqlo2+h8DmuBuiVevIl/ye4GZDryICvifeQUM65B+2y9ryZvN noUTmEHp9glboVrAGz0AUCdKVbYyPRMjR0/qoe0mD3RR3wZc93p0TN6djYXRLoW6mS8ETZgjaVy A/C0EBqyY3g== X-Google-Smtp-Source: AGHT+IH36U87CyLy7MyHotv12JNc0MNjEHl/5uTWkWfgilG0uE2PIMoQUh4iTe4MoLuXwAu+CG0dnA== X-Received: by 2002:a17:902:e543:b0:224:3994:8a8c with SMTP id d9443c01a7336-2265e69d92dmr14733935ad.8.1742421579382; Wed, 19 Mar 2025 14:59: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 d2e1a72fcca58-7371167d88fsm12664720b3a.96.2025.03.19.14.59.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:39 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 02/20] staging: gpib: agilent_82350b: struct gpib_board Date: Wed, 19 Mar 2025 21:59:06 +0000 Message-ID: <20250319215924.19387-3-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- .../gpib/agilent_82350b/agilent_82350b.c | 99 ++++++++++--------- 1 file changed, 55 insertions(+), 44 deletions(-) diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers= /staging/gpib/agilent_82350b/agilent_82350b.c index f83e1f321561..15a9c4ab77ba 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c @@ -25,13 +25,13 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for Agilent 82350b"); =20 static int read_transfer_counter(struct agilent_82350b_priv *a_priv); -static unsigned short read_and_clear_event_status(gpib_board_t *board); +static unsigned short read_and_clear_event_status(struct gpib_board *board= ); static void set_transfer_counter(struct agilent_82350b_priv *a_priv, int c= ount); -static int agilent_82350b_write(gpib_board_t *board, uint8_t *buffer, size= _t length, int send_eoi, - size_t *bytes_written); +static int agilent_82350b_write(struct gpib_board *board, uint8_t *buffer, + size_t length, int send_eoi, size_t *bytes_written); =20 -static int agilent_82350b_accel_read(gpib_board_t *board, uint8_t *buffer,= size_t length, int *end, - size_t *bytes_read) +static int agilent_82350b_accel_read(struct gpib_board *board, uint8_t *bu= ffer, + size_t length, int *end, size_t *bytes_read) =20 { struct agilent_82350b_priv *a_priv =3D board->private_data; @@ -130,7 +130,7 @@ static int agilent_82350b_accel_read(gpib_board_t *boar= d, uint8_t *buffer, size_ return 0; } =20 -static int translate_wait_return_value(gpib_board_t *board, int retval) +static int translate_wait_return_value(struct gpib_board *board, int retva= l) =20 { struct agilent_82350b_priv *a_priv =3D board->private_data; @@ -145,8 +145,9 @@ static int translate_wait_return_value(gpib_board_t *bo= ard, int retval) return 0; } =20 -static int agilent_82350b_accel_write(gpib_board_t *board, uint8_t *buffer= , size_t length, - int send_eoi, size_t *bytes_written) +static int agilent_82350b_accel_write(struct gpib_board *board, uint8_t *b= uffer, + size_t length, int send_eoi, + size_t *bytes_written) { struct agilent_82350b_priv *a_priv =3D board->private_data; struct tms9914_priv *tms_priv =3D &a_priv->tms9914_priv; @@ -227,7 +228,7 @@ static int agilent_82350b_accel_write(gpib_board_t *boa= rd, uint8_t *buffer, size return 0; } =20 -static unsigned short read_and_clear_event_status(gpib_board_t *board) +static unsigned short read_and_clear_event_status(struct gpib_board *board) { struct agilent_82350b_priv *a_priv =3D board->private_data; unsigned long flags; @@ -245,7 +246,7 @@ static irqreturn_t agilent_82350b_interrupt(int irq, vo= id *arg) { int tms9914_status1 =3D 0, tms9914_status2 =3D 0; int event_status; - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct agilent_82350b_priv *a_priv =3D board->private_data; unsigned long flags; irqreturn_t retval =3D IRQ_NONE; @@ -272,7 +273,7 @@ static irqreturn_t agilent_82350b_interrupt(int irq, vo= id *arg) return retval; } =20 -static void agilent_82350b_detach(gpib_board_t *board); +static void agilent_82350b_detach(struct gpib_board *board); =20 static int read_transfer_counter(struct agilent_82350b_priv *a_priv) { @@ -296,17 +297,16 @@ static void set_transfer_counter(struct agilent_82350= b_priv *a_priv, int count) } =20 // wrappers for interface functions -static int agilent_82350b_read(gpib_board_t *board, uint8_t *buffer, size_= t length, int *end, - size_t *bytes_read) - +static int agilent_82350b_read(struct gpib_board *board, uint8_t *buffer, + size_t length, int *end, size_t *bytes_read) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_read(board, &priv->tms9914_priv, buffer, length, end, byte= s_read); } =20 -static int agilent_82350b_write(gpib_board_t *board, uint8_t *buffer, size= _t length, int send_eoi, - size_t *bytes_written) +static int agilent_82350b_write(struct gpib_board *board, uint8_t *buffer, + size_t length, int send_eoi, size_t *bytes_written) =20 { struct agilent_82350b_priv *priv =3D board->private_data; @@ -314,8 +314,8 @@ static int agilent_82350b_write(gpib_board_t *board, ui= nt8_t *buffer, size_t len return tms9914_write(board, &priv->tms9914_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int agilent_82350b_command(gpib_board_t *board, uint8_t *buffer, si= ze_t length, - size_t *bytes_written) +static int agilent_82350b_command(struct gpib_board *board, uint8_t *buffe= r, + size_t length, size_t *bytes_written) =20 { struct agilent_82350b_priv *priv =3D board->private_data; @@ -323,7 +323,7 @@ static int agilent_82350b_command(gpib_board_t *board, = uint8_t *buffer, size_t l return tms9914_command(board, &priv->tms9914_priv, buffer, length, bytes_= written); } =20 -static int agilent_82350b_take_control(gpib_board_t *board, int synchronou= s) +static int agilent_82350b_take_control(struct gpib_board *board, int synch= ronous) =20 { struct agilent_82350b_priv *priv =3D board->private_data; @@ -331,7 +331,7 @@ static int agilent_82350b_take_control(gpib_board_t *bo= ard, int synchronous) return tms9914_take_control_workaround(board, &priv->tms9914_priv, synchr= onous); } =20 -static int agilent_82350b_go_to_standby(gpib_board_t *board) +static int agilent_82350b_go_to_standby(struct gpib_board *board) =20 { struct agilent_82350b_priv *priv =3D board->private_data; @@ -339,7 +339,8 @@ static int agilent_82350b_go_to_standby(gpib_board_t *b= oard) return tms9914_go_to_standby(board, &priv->tms9914_priv); } =20 -static void agilent_82350b_request_system_control(gpib_board_t *board, int= request_control) +static void agilent_82350b_request_system_control(struct gpib_board *board, + int request_control) =20 { struct agilent_82350b_priv *a_priv =3D board->private_data; @@ -357,7 +358,7 @@ static void agilent_82350b_request_system_control(gpib_= board_t *board, int reque tms9914_request_system_control(board, &a_priv->tms9914_priv, request_cont= rol); } =20 -static void agilent_82350b_interface_clear(gpib_board_t *board, int assert) +static void agilent_82350b_interface_clear(struct gpib_board *board, int a= ssert) =20 { struct agilent_82350b_priv *priv =3D board->private_data; @@ -365,91 +366,97 @@ static void agilent_82350b_interface_clear(gpib_board= _t *board, int assert) tms9914_interface_clear(board, &priv->tms9914_priv, assert); } =20 -static void agilent_82350b_remote_enable(gpib_board_t *board, int enable) +static void agilent_82350b_remote_enable(struct gpib_board *board, int ena= ble) { struct agilent_82350b_priv *priv =3D board->private_data; =20 tms9914_remote_enable(board, &priv->tms9914_priv, enable); } =20 -static int agilent_82350b_enable_eos(gpib_board_t *board, uint8_t eos_byte= , int compare_8_bits) +static int agilent_82350b_enable_eos(struct gpib_board *board, uint8_t eos= _byte, + int compare_8_bits) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_enable_eos(board, &priv->tms9914_priv, eos_byte, compare_8= _bits); } =20 -static void agilent_82350b_disable_eos(gpib_board_t *board) +static void agilent_82350b_disable_eos(struct gpib_board *board) { struct agilent_82350b_priv *priv =3D board->private_data; =20 tms9914_disable_eos(board, &priv->tms9914_priv); } =20 -static unsigned int agilent_82350b_update_status(gpib_board_t *board, unsi= gned int clear_mask) +static unsigned int agilent_82350b_update_status(struct gpib_board *board, + unsigned int clear_mask) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_update_status(board, &priv->tms9914_priv, clear_mask); } =20 -static int agilent_82350b_primary_address(gpib_board_t *board, unsigned in= t address) +static int agilent_82350b_primary_address(struct gpib_board *board, + unsigned int address) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_primary_address(board, &priv->tms9914_priv, address); } =20 -static int agilent_82350b_secondary_address(gpib_board_t *board, unsigned = int address, int enable) +static int agilent_82350b_secondary_address(struct gpib_board *board, + unsigned int address, int enable) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_secondary_address(board, &priv->tms9914_priv, address, ena= ble); } =20 -static int agilent_82350b_parallel_poll(gpib_board_t *board, uint8_t *resu= lt) +static int agilent_82350b_parallel_poll(struct gpib_board *board, uint8_t = *result) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_parallel_poll(board, &priv->tms9914_priv, result); } =20 -static void agilent_82350b_parallel_poll_configure(gpib_board_t *board, ui= nt8_t config) +static void agilent_82350b_parallel_poll_configure(struct gpib_board *boar= d, + uint8_t config) { struct agilent_82350b_priv *priv =3D board->private_data; =20 tms9914_parallel_poll_configure(board, &priv->tms9914_priv, config); } =20 -static void agilent_82350b_parallel_poll_response(gpib_board_t *board, int= ist) +static void agilent_82350b_parallel_poll_response(struct gpib_board *board= , int ist) { struct agilent_82350b_priv *priv =3D board->private_data; =20 tms9914_parallel_poll_response(board, &priv->tms9914_priv, ist); } =20 -static void agilent_82350b_serial_poll_response(gpib_board_t *board, uint8= _t status) +static void agilent_82350b_serial_poll_response(struct gpib_board *board, = uint8_t status) { struct agilent_82350b_priv *priv =3D board->private_data; =20 tms9914_serial_poll_response(board, &priv->tms9914_priv, status); } =20 -static uint8_t agilent_82350b_serial_poll_status(gpib_board_t *board) +static uint8_t agilent_82350b_serial_poll_status(struct gpib_board *board) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_serial_poll_status(board, &priv->tms9914_priv); } =20 -static int agilent_82350b_line_status(const gpib_board_t *board) +static int agilent_82350b_line_status(const struct gpib_board *board) { struct agilent_82350b_priv *priv =3D board->private_data; =20 return tms9914_line_status(board, &priv->tms9914_priv); } =20 -static unsigned int agilent_82350b_t1_delay(gpib_board_t *board, unsigned = int nanosec) +static unsigned int agilent_82350b_t1_delay(struct gpib_board *board, + unsigned int nanosec) { struct agilent_82350b_priv *a_priv =3D board->private_data; static const int nanosec_per_clock =3D 30; @@ -464,14 +471,14 @@ static unsigned int agilent_82350b_t1_delay(gpib_boar= d_t *board, unsigned int na return value * nanosec_per_clock; } =20 -static void agilent_82350b_return_to_local(gpib_board_t *board) +static void agilent_82350b_return_to_local(struct gpib_board *board) { struct agilent_82350b_priv *priv =3D board->private_data; =20 tms9914_return_to_local(board, &priv->tms9914_priv); } =20 -static int agilent_82350b_allocate_private(gpib_board_t *board) +static int agilent_82350b_allocate_private(struct gpib_board *board) { board->private_data =3D kzalloc(sizeof(struct agilent_82350b_priv), GFP_K= ERNEL); if (!board->private_data) @@ -479,13 +486,14 @@ static int agilent_82350b_allocate_private(gpib_board= _t *board) return 0; } =20 -static void agilent_82350b_free_private(gpib_board_t *board) +static void agilent_82350b_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 -static int init_82350a_hardware(gpib_board_t *board, const gpib_board_conf= ig_t *config) +static int init_82350a_hardware(struct gpib_board *board, + const gpib_board_config_t *config) { struct agilent_82350b_priv *a_priv =3D board->private_data; static const unsigned int firmware_length =3D 5302; @@ -550,7 +558,7 @@ static int init_82350a_hardware(gpib_board_t *board, co= nst gpib_board_config_t * return 0; } =20 -static int test_sram(gpib_board_t *board) +static int test_sram(struct gpib_board *board) =20 { struct agilent_82350b_priv *a_priv =3D board->private_data; @@ -579,7 +587,8 @@ static int test_sram(gpib_board_t *board) return 0; } =20 -static int agilent_82350b_generic_attach(gpib_board_t *board, const gpib_b= oard_config_t *config, +static int agilent_82350b_generic_attach(struct gpib_board *board, + const gpib_board_config_t *config, int use_fifos) =20 { @@ -721,17 +730,19 @@ static int agilent_82350b_generic_attach(gpib_board_t= *board, const gpib_board_c return 0; } =20 -static int agilent_82350b_unaccel_attach(gpib_board_t *board, const gpib_b= oard_config_t *config) +static int agilent_82350b_unaccel_attach(struct gpib_board *board, + const gpib_board_config_t *config) { return agilent_82350b_generic_attach(board, config, 0); } =20 -static int agilent_82350b_accel_attach(gpib_board_t *board, const gpib_boa= rd_config_t *config) +static int agilent_82350b_accel_attach(struct gpib_board *board, + const gpib_board_config_t *config) { return agilent_82350b_generic_attach(board, config, 1); } =20 -static void agilent_82350b_detach(gpib_board_t *board) +static void agilent_82350b_detach(struct gpib_board *board) { struct agilent_82350b_priv *a_priv =3D board->private_data; struct tms9914_priv *tms_priv; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 4CBB521A457 for ; Wed, 19 Mar 2025 21:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421583; cv=none; b=sGGR7Qu2CEYA9REsnjdbQpahqwFZh5uHDmevh8CGW/8fe1ckfaq2Pvkh2Idnxl/dfJr0C86sluYaaQKzIUQJN6gMzWnPsstHOy89PDmoBhwjbjythUc7bkY9yTd249QEI+TQMbMG56K38XmbJ6Ckx1fnH8SKa8wyFEKqWsWhUPA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421583; c=relaxed/simple; bh=N1HKkuxG1bE2v1BdEkRER6ufX3Om7ctf6FOYachWE4Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=f5ntWayOJFgzCaEgk4srxrSC+yAwUqhRgxf0CrxkTlWd0QAk0Zjmi/4D5F+39atxGBVWnaGx/2MwbHQo++9KmjkJtRpS6Ybm9WD3gaHQIKuzyNIUUNcF0sPXzcZRtfwQq6vuwZcaGZbajYB9aFgO7Ril4/7rRUBu/DIKlh/7FIQ= 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=fZHp03Kl; arc=none smtp.client-ip=209.85.214.182 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="fZHp03Kl" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2239c066347so877075ad.2 for ; Wed, 19 Mar 2025 14:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421580; x=1743026380; 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=Htv0WV+K2Gnen6DZUmspEXU595vjMhnsIFhE4ehhG2I=; b=fZHp03Kl/hazlyg29qX8nGjW2DXPS+UO3PL2B5uK2ZVVD5VLay47Gf6+nEZtueSNMa W34pDNHI3YHm8vxL6dR6cxgjHL20tOeJ7wmoupMKPTX+QMwAMyRuQLvNvlbUjr5MZGUv jlfBVDxdBM3UTZ4b18IHbZbYhhZJ1p709Z/Qf+MTZC3jlq1b3BONeFA0u8X8f4P2PtWM tYELqvvL2W44Z/o4lJ+ws/4yHMmyd4y6Ir8to0v9Njb5oE8wnLltQ+UpQC+Q+HBc4rJr 7MTRDB79XxYR83mJqozGb/RPTDtRik+CcxTTsQzdfZ5p7YgtFiJpiF5rvCJLsCVpsgPL Q4rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421580; x=1743026380; 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=Htv0WV+K2Gnen6DZUmspEXU595vjMhnsIFhE4ehhG2I=; b=haH0Gv1M8uTwNzT7Fs2J59ZG7XQu36DoIjkJx+4FNjeJK5uyPo/ywbdQW9McEJJZAC /13is8GTW7aH3rQahxxsmhEMuej756rJt4nLRm7rgFUTZgMvgLRn8RLuSiCufHXTPg8D aN2KqajLOKGag3oRJkcsH9cAgSuPGvSMsQ4xaL4XFcNOLld0N6wKMd6WrrxKa+6tVuUP 8QWg8x12rPVZzQgMq5mz1BJnsCzCnucT38MuFA1PGWRDQIeDxSkYgUZRapo8AlJoIG0i x+CKbI16d0k+DXg6Hp4Mv9t9X15F5IkRGPA4ZR0wpRvgPRDEPE4IJdtT6EQN2SQ/yb+5 42Sg== X-Forwarded-Encrypted: i=1; AJvYcCXk47B+8eLdENFi9iT5Ewh1I4a0CpwyeXyNvVTYwlV7ovVkidUb6BP/49oubmly35VT7rWMVWCV5QE/eSE=@vger.kernel.org X-Gm-Message-State: AOJu0YyWv/5K1MmxUN0kslR2c78dSLqbZdvIsJ9JS3cBeDZw7vYj7HKg 2lnGC0/NvH9JH2s3ej5PYcg4moftY68YCOufCiLa/DhFyjxk0EHwAwIrwkT2WnDUzYQ8HYhARAI = X-Gm-Gg: ASbGncv86+nBn/wImPqDfLxcy1sqbW80Bs7Y6xMg+fZuh+lS6iN4Ij2rxkqhzWd5EsB 81eJO6ROjp43d02HOd9hVFOsNb3ZrV00Nf5ErcPInXCOqnXFVHZh2jfvbD3B7+SNx5FC0lixblm wOtSSJExgMvBvIRahc3emmtsmu5Na6irCVTu40CkdJHdGNT7uSx/5kMuhDvOuxJbrJ64ZsP++qN jatDu2zJdnoBl+suC+nNd9DkeCtIw6FmI4x6IjRq3odqreTnsA21lU9near3NfLHrDLUf9KHh15 PARhtHPXkukIJcOYf9CPSfjMmi36IGiuUbNwguXAz8MZ4pmWFbncInVzSMwA1E8ikqkDyFeOyj7 HfxIQdx/9FQ== X-Google-Smtp-Source: AGHT+IFqgTSMZQqnbkKdylyk/FzKX7HUs7NWNYBKz0uuuCCNwYXKCOHO37RiTzZhZE5O1becrsYXCQ== X-Received: by 2002:a17:903:1c4:b0:21f:6546:9af0 with SMTP id d9443c01a7336-22649cb44fbmr67294105ad.44.1742421580561; Wed, 19 Mar 2025 14:59:40 -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-225c68a8796sm120102805ad.99.2025.03.19.14.59.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:40 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 03/20] staging: gpib: agilent_82357a: struct gpib_board Date: Wed, 19 Mar 2025 21:59:07 +0000 Message-ID: <20250319215924.19387-4-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- .../gpib/agilent_82357a/agilent_82357a.c | 85 ++++++++++--------- 1 file changed, 46 insertions(+), 39 deletions(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers= /staging/gpib/agilent_82357a/agilent_82357a.c index 5b5b55e90435..702a3071bd58 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -25,9 +25,10 @@ MODULE_DESCRIPTION("GPIB driver for Agilent 82357A/B usb= adapters"); static struct usb_interface *agilent_82357a_driver_interfaces[MAX_NUM_8235= 7A_INTERFACES]; static DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board inserti= on and removal =20 -static unsigned int agilent_82357a_update_status(gpib_board_t *board, unsi= gned int clear_mask); +static unsigned int agilent_82357a_update_status(struct gpib_board *board, + unsigned int clear_mask); =20 -static int agilent_82357a_take_control_internal(gpib_board_t *board, int s= ynchronous); +static int agilent_82357a_take_control_internal(struct gpib_board *board, = int synchronous); =20 static void agilent_82357a_bulk_complete(struct urb *urb) { @@ -419,10 +420,10 @@ static int agilent_82357a_abort(struct agilent_82357a= _priv *a_priv, int flush) } =20 // interface functions -int agilent_82357a_command(gpib_board_t *board, uint8_t *buffer, size_t le= ngth, +int agilent_82357a_command(struct gpib_board *board, uint8_t *buffer, size= _t length, size_t *bytes_written); =20 -static int agilent_82357a_read(gpib_board_t *board, uint8_t *buffer, size_= t length, int *end, +static int agilent_82357a_read(struct gpib_board *board, uint8_t *buffer, = size_t length, int *end, size_t *nbytes) { int retval; @@ -529,8 +530,10 @@ static int agilent_82357a_read(gpib_board_t *board, ui= nt8_t *buffer, size_t leng return retval; } =20 -static ssize_t agilent_82357a_generic_write(gpib_board_t *board, uint8_t *= buffer, size_t length, - int send_commands, int send_eoi, size_t *bytes_written) +static ssize_t agilent_82357a_generic_write(struct gpib_board *board, + uint8_t *buffer, size_t length, + int send_commands, int send_eoi, + size_t *bytes_written) { int retval; struct agilent_82357a_priv *a_priv =3D board->private_data; @@ -664,19 +667,19 @@ static ssize_t agilent_82357a_generic_write(gpib_boar= d_t *board, uint8_t *buffer return 0; } =20 -static int agilent_82357a_write(gpib_board_t *board, uint8_t *buffer, size= _t length, - int send_eoi, size_t *bytes_written) +static int agilent_82357a_write(struct gpib_board *board, uint8_t *buffer, + size_t length, int send_eoi, size_t *bytes_written) { return agilent_82357a_generic_write(board, buffer, length, 0, send_eoi, b= ytes_written); } =20 -int agilent_82357a_command(gpib_board_t *board, uint8_t *buffer, size_t le= ngth, +int agilent_82357a_command(struct gpib_board *board, uint8_t *buffer, size= _t length, size_t *bytes_written) { return agilent_82357a_generic_write(board, buffer, length, 1, 0, bytes_wr= itten); } =20 -int agilent_82357a_take_control_internal(gpib_board_t *board, int synchron= ous) +int agilent_82357a_take_control_internal(struct gpib_board *board, int syn= chronous) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -695,7 +698,7 @@ int agilent_82357a_take_control_internal(gpib_board_t *= board, int synchronous) return retval; } =20 -static int agilent_82357a_take_control(gpib_board_t *board, int synchronou= s) +static int agilent_82357a_take_control(struct gpib_board *board, int synch= ronous) { const int timeout =3D 10; int i; @@ -720,7 +723,7 @@ static int agilent_82357a_take_control(gpib_board_t *bo= ard, int synchronous) return 0; } =20 -static int agilent_82357a_go_to_standby(gpib_board_t *board) +static int agilent_82357a_go_to_standby(struct gpib_board *board) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -736,7 +739,8 @@ static int agilent_82357a_go_to_standby(gpib_board_t *b= oard) } =20 //FIXME should change prototype to return int -static void agilent_82357a_request_system_control(gpib_board_t *board, int= request_control) +static void agilent_82357a_request_system_control(struct gpib_board *board, + int request_control) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -764,7 +768,7 @@ static void agilent_82357a_request_system_control(gpib_= board_t *board, int reque return;// retval; } =20 -static void agilent_82357a_interface_clear(gpib_board_t *board, int assert) +static void agilent_82357a_interface_clear(struct gpib_board *board, int a= ssert) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -782,7 +786,7 @@ static void agilent_82357a_interface_clear(gpib_board_t= *board, int assert) dev_err(&usb_dev->dev, "write_registers() returned error\n"); } =20 -static void agilent_82357a_remote_enable(gpib_board_t *board, int enable) +static void agilent_82357a_remote_enable(struct gpib_board *board, int ena= ble) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -800,7 +804,8 @@ static void agilent_82357a_remote_enable(gpib_board_t *= board, int enable) return;// 0; } =20 -static int agilent_82357a_enable_eos(gpib_board_t *board, uint8_t eos_byte= , int compare_8_bits) +static int agilent_82357a_enable_eos(struct gpib_board *board, uint8_t eos= _byte, + int compare_8_bits) { struct agilent_82357a_priv *a_priv =3D board->private_data; =20 @@ -812,14 +817,15 @@ static int agilent_82357a_enable_eos(gpib_board_t *bo= ard, uint8_t eos_byte, int return 0; } =20 -static void agilent_82357a_disable_eos(gpib_board_t *board) +static void agilent_82357a_disable_eos(struct gpib_board *board) { struct agilent_82357a_priv *a_priv =3D board->private_data; =20 a_priv->eos_mode &=3D ~REOS; } =20 -static unsigned int agilent_82357a_update_status(gpib_board_t *board, unsi= gned int clear_mask) +static unsigned int agilent_82357a_update_status(struct gpib_board *board, + unsigned int clear_mask) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -878,7 +884,7 @@ static unsigned int agilent_82357a_update_status(gpib_b= oard_t *board, unsigned i return board->status; } =20 -static int agilent_82357a_primary_address(gpib_board_t *board, unsigned in= t address) +static int agilent_82357a_primary_address(struct gpib_board *board, unsign= ed int address) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -896,14 +902,15 @@ static int agilent_82357a_primary_address(gpib_board_= t *board, unsigned int addr return retval; } =20 -static int agilent_82357a_secondary_address(gpib_board_t *board, unsigned = int address, int enable) +static int agilent_82357a_secondary_address(struct gpib_board *board, + unsigned int address, int enable) { if (enable) return -EOPNOTSUPP; return 0; } =20 -static int agilent_82357a_parallel_poll(gpib_board_t *board, uint8_t *resu= lt) +static int agilent_82357a_parallel_poll(struct gpib_board *board, uint8_t = *result) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -942,37 +949,37 @@ static int agilent_82357a_parallel_poll(gpib_board_t = *board, uint8_t *result) return 0; } =20 -static void agilent_82357a_parallel_poll_configure(gpib_board_t *board, ui= nt8_t config) +static void agilent_82357a_parallel_poll_configure(struct gpib_board *boar= d, uint8_t config) { //board can only be system controller return;// 0; } =20 -static void agilent_82357a_parallel_poll_response(gpib_board_t *board, int= ist) +static void agilent_82357a_parallel_poll_response(struct gpib_board *board= , int ist) { //board can only be system controller return;// 0; } =20 -static void agilent_82357a_serial_poll_response(gpib_board_t *board, uint8= _t status) +static void agilent_82357a_serial_poll_response(struct gpib_board *board, = uint8_t status) { //board can only be system controller return;// 0; } =20 -static uint8_t agilent_82357a_serial_poll_status(gpib_board_t *board) +static uint8_t agilent_82357a_serial_poll_status(struct gpib_board *board) { //board can only be system controller return 0; } =20 -static void agilent_82357a_return_to_local(gpib_board_t *board) +static void agilent_82357a_return_to_local(struct gpib_board *board) { //board can only be system controller return;// 0; } =20 -static int agilent_82357a_line_status(const gpib_board_t *board) +static int agilent_82357a_line_status(const struct gpib_board *board) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -1022,7 +1029,7 @@ static unsigned short nanosec_to_fast_talker_bits(uns= igned int *nanosec) return bits; } =20 -static unsigned int agilent_82357a_t1_delay(gpib_board_t *board, unsigned = int nanosec) +static unsigned int agilent_82357a_t1_delay(struct gpib_board *board, unsi= gned int nanosec) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -1039,7 +1046,7 @@ static unsigned int agilent_82357a_t1_delay(gpib_boar= d_t *board, unsigned int na =20 static void agilent_82357a_interrupt_complete(struct urb *urb) { - gpib_board_t *board =3D urb->context; + struct gpib_board *board =3D urb->context; struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); int retval; @@ -1077,7 +1084,7 @@ static void agilent_82357a_interrupt_complete(struct = urb *urb) dev_err(&usb_dev->dev, "failed to resubmit interrupt urb\n"); } =20 -static int agilent_82357a_setup_urbs(gpib_board_t *board) +static int agilent_82357a_setup_urbs(struct gpib_board *board) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev; @@ -1141,7 +1148,7 @@ static void agilent_82357a_release_urbs(struct agilen= t_82357a_priv *a_priv) } } =20 -static int agilent_82357a_allocate_private(gpib_board_t *board) +static int agilent_82357a_allocate_private(struct gpib_board *board) { struct agilent_82357a_priv *a_priv; =20 @@ -1156,14 +1163,14 @@ static int agilent_82357a_allocate_private(gpib_boa= rd_t *board) return 0; } =20 -static void agilent_82357a_free_private(gpib_board_t *board) +static void agilent_82357a_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 #define INIT_NUM_REG_WRITES 18 -static int agilent_82357a_init(gpib_board_t *board) +static int agilent_82357a_init(struct gpib_board *board) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -1253,7 +1260,7 @@ static inline int agilent_82357a_device_match(struct = usb_interface *interface, return 1; } =20 -static int agilent_82357a_attach(gpib_board_t *board, const gpib_board_con= fig_t *config) +static int agilent_82357a_attach(struct gpib_board *board, const gpib_boar= d_config_t *config) { int retval; int i; @@ -1329,7 +1336,7 @@ static int agilent_82357a_attach(gpib_board_t *board,= const gpib_board_config_t return retval; } =20 -static int agilent_82357a_go_idle(gpib_board_t *board) +static int agilent_82357a_go_idle(struct gpib_board *board) { struct agilent_82357a_priv *a_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(a_priv->bus_interface); @@ -1358,7 +1365,7 @@ static int agilent_82357a_go_idle(gpib_board_t *board) return 0; } =20 -static void agilent_82357a_detach(gpib_board_t *board) +static void agilent_82357a_detach(struct gpib_board *board) { struct agilent_82357a_priv *a_priv; =20 @@ -1466,7 +1473,7 @@ static void agilent_82357a_driver_disconnect(struct u= sb_interface *interface) =20 for (i =3D 0; i < MAX_NUM_82357A_INTERFACES; ++i) { if (agilent_82357a_driver_interfaces[i] =3D=3D interface) { - gpib_board_t *board =3D usb_get_intfdata(interface); + struct gpib_board *board =3D usb_get_intfdata(interface); =20 if (board) { struct agilent_82357a_priv *a_priv =3D board->private_data; @@ -1502,7 +1509,7 @@ static int agilent_82357a_driver_suspend(struct usb_i= nterface *interface, pm_mes =20 for (i =3D 0; i < MAX_NUM_82357A_INTERFACES; ++i) { if (agilent_82357a_driver_interfaces[i] =3D=3D interface) { - gpib_board_t *board =3D usb_get_intfdata(interface); + struct gpib_board *board =3D usb_get_intfdata(interface); =20 if (board) { struct agilent_82357a_priv *a_priv =3D board->private_data; @@ -1538,7 +1545,7 @@ static int agilent_82357a_driver_suspend(struct usb_i= nterface *interface, pm_mes static int agilent_82357a_driver_resume(struct usb_interface *interface) { struct usb_device *usb_dev =3D interface_to_usbdev(interface); - gpib_board_t *board; + struct gpib_board *board; int i, retval; =20 mutex_lock(&agilent_82357a_hotplug_lock); --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 9065A21B9F1 for ; Wed, 19 Mar 2025 21:59:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421584; cv=none; b=QMWuJvDzavMdLMYutcLQUzv4eZhFtsyT5Bn4emAyB4YsAb7uuAx+Bun+gzbq7bKHkoOQQz8sj/9Fp1OfU5YaRXClupA9/m5i8U66jIO4pai6KuN7N1CIzGSei5dpJSNg/HPa3K5AmXmPFGAjWqG1BQlwZ1NbfwnMOrrgS++o/0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421584; c=relaxed/simple; bh=nMiOYWnyWIgJqVZZLK8NhGgU5fP9ICLyNqQ9BS/rbug=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q5lWZnxxlyyCShCa6yJdGc/eoVxxAmfslJOyrlhac3U1dpmVi0PpA4wz/xoP8IyUnjK5c1SsSCi8F6VWkDKheEzjvQ78HjrprB12vHsK1wZj559CjHqeHu2n0lSZcxcHFa0HgbN2VL7+DX2QPMmyY9fHpEGbd0T5MwrnJVZGFUQ= 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=OQu/elGH; arc=none smtp.client-ip=209.85.214.171 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="OQu/elGH" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-223a7065ff8so1443235ad.0 for ; Wed, 19 Mar 2025 14:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421582; x=1743026382; 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=R74GxULIgBcQ77BKtt+ZheFRKnjYiWu/3C/3toyQPuY=; b=OQu/elGHyRzvfx+N7h7FGvO4rIcr2D8Q4JmY5HwgryG+E+Qu/azc63y2v52oSdTU+Y 3SrcRFPAB1RHsoV06aw2oM4efpoq3zaB8O2SOeTc/gCHqSNQJzMEg4FNfCCFeYz2O3/4 Oo6Q7MhjxfoJsO46hConhFDKBQqQKTUSzqKwXEa8zYlUr++ex6hni2wr1jHws8AsON/8 LZtGb9wC1QvYh7P14SC8/vSplxyi86NX1jLc16gIWn7sSHOiKuQxmMjNXQeszvHDgA7s OmhnNFSyHnH5HDaaUjEoeWnE6d6QTSUbIhWTe1YS63uxb77kimIHXlmZXiNdpp8PtjwN OThg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421582; x=1743026382; 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=R74GxULIgBcQ77BKtt+ZheFRKnjYiWu/3C/3toyQPuY=; b=J87OML4T1JYhzOqVmz21bn5IS2CXAvNlq8qBmJIP+hmbrMS7xw9RAk8xU+aZ5YbPA6 dPgI0bnC44C86aTA5xo95P6TqreKBy2rhr6tiNX319NDznWC42qMU2bBKE6CXDU4RMoN rjn8jE+MTV1VJNBS/lglMloZQTGNfHDbORlFTK9v1UPwSVOlLDuUpbbjReOO0oJIKdNo ELw4wl5vJyIbmCMcEjAlEGeaZlvLvm1jMw+FmD9RI8XfwZYF+4nnbF96kxXuVBcSGY61 fKhTFqqXMFQLGICbOXTWZj26EUkkAeE7Nu9U45Cfn49deYPbZ0mbv3wLbWHAg1q1cIeK fM9g== X-Forwarded-Encrypted: i=1; AJvYcCVUjnZmGj7FmePq9Yy1OvBOnCXiB6MtA6uW2rAvHfZpAlALP/r4cZ81IP5T5IbnMzNAWqhmCzI8AKvuKMk=@vger.kernel.org X-Gm-Message-State: AOJu0YzWR7cTWdtaZ+sYHif2XKhpT9KoOPL8m9YExmRPYw4q51k77NgE cCounVaDhbwtp2BkzdK4knhGtQ+2DtjaPYsbVkowLWqSkL6V2yBW+PrQSW8Wrri+CS51HT/jbU4 = X-Gm-Gg: ASbGncsSSyZW2wWAsFJ2FunGfEtOXwYjMNsxBbOBIXZuHM9C5wjzVHzs3t9gGuAbE5Y ODTnRjU16EwFmM3Jf8scSETdse4P5kQpCKKH4eLOeAjBTGATJZvwITqHabM3fhmLjKRpGMA9o1B ELv0TIedisv2rYqmJzCGmxsc8MjqOKX9/WqhiZFkLSriM7omaeToLc/kcnxyp76VvxseQEkQKEe j9gvDSuX2QKI+jL8LjxzqArFCui8TG1qkAdN5bAMFECjXCDNRsCTvpXi4nB8D6yaOZHX4WonvQW N+04xShm8YFzL0bmMH/H+ZtZ+S1BxfjKuWcCYF9kVejEPekYR/u+mGEqDx7h3tGN9gVLUB2HFrJ Mh25mrQHyxQ== X-Google-Smtp-Source: AGHT+IEHKB83JWORDLqVWnA69Hqlc5qiM+x12zTZemAeViUz709pMq725MoDRiZWObzTMPH0TeWFyA== X-Received: by 2002:a05:6a20:12d5:b0:1f5:8678:183d with SMTP id adf61e73a8af0-1fbeba8fdfcmr7554267637.14.1742421581747; Wed, 19 Mar 2025 14:59: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 d2e1a72fcca58-7371167e02esm12576276b3a.95.2025.03.19.14.59.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:41 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 04/20] staging: gpib: cb7210: struct gpib_board Date: Wed, 19 Mar 2025 21:59:08 +0000 Message-ID: <20250319215924.19387-5-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/cb7210/cb7210.c | 107 ++++++++++++++------------- 1 file changed, 54 insertions(+), 53 deletions(-) diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb= 7210/cb7210.c index 808e0a71dfd6..621aa8fda913 100644 --- a/drivers/staging/gpib/cb7210/cb7210.c +++ b/drivers/staging/gpib/cb7210/cb7210.c @@ -27,7 +27,7 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver Measurement Computing boards using cb7210.= 2 and cbi488.2"); =20 -static int cb7210_read(gpib_board_t *board, uint8_t *buffer, size_t length, +static int cb7210_read(struct gpib_board *board, uint8_t *buffer, size_t l= ength, int *end, size_t *bytes_read); =20 static inline int have_fifo_word(const struct cb7210_priv *cb_priv) @@ -40,7 +40,7 @@ static int cb7210_read(gpib_board_t *board, uint8_t *buff= er, size_t length, return 0; } =20 -static inline void input_fifo_enable(gpib_board_t *board, int enable) +static inline void input_fifo_enable(struct gpib_board *board, int enable) { struct cb7210_priv *cb_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &cb_priv->nec7210_priv; @@ -76,7 +76,7 @@ static inline void input_fifo_enable(gpib_board_t *board,= int enable) spin_unlock_irqrestore(&board->spinlock, flags); } =20 -static int fifo_read(gpib_board_t *board, struct cb7210_priv *cb_priv, uin= t8_t *buffer, +static int fifo_read(struct gpib_board *board, struct cb7210_priv *cb_priv= , uint8_t *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval =3D 0; @@ -170,7 +170,7 @@ static int fifo_read(gpib_board_t *board, struct cb7210= _priv *cb_priv, uint8_t * return retval; } =20 -static int cb7210_accel_read(gpib_board_t *board, uint8_t *buffer, +static int cb7210_accel_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval; @@ -229,7 +229,7 @@ static int output_fifo_empty(const struct cb7210_priv *= cb_priv) return 0; } =20 -static inline void output_fifo_enable(gpib_board_t *board, int enable) +static inline void output_fifo_enable(struct gpib_board *board, int enable) { struct cb7210_priv *cb_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &cb_priv->nec7210_priv; @@ -264,7 +264,8 @@ static inline void output_fifo_enable(gpib_board_t *boa= rd, int enable) spin_unlock_irqrestore(&board->spinlock, flags); } =20 -static int fifo_write(gpib_board_t *board, uint8_t *buffer, size_t length,= size_t *bytes_written) +static int fifo_write(struct gpib_board *board, uint8_t *buffer, size_t le= ngth, + size_t *bytes_written) { size_t count =3D 0; ssize_t retval =3D 0; @@ -349,8 +350,8 @@ static int fifo_write(gpib_board_t *board, uint8_t *buf= fer, size_t length, size_ return retval; } =20 -static int cb7210_accel_write(gpib_board_t *board, uint8_t *buffer, size_t= length, int send_eoi, - size_t *bytes_written) +static int cb7210_accel_write(struct gpib_board *board, uint8_t *buffer, + size_t length, int send_eoi, size_t *bytes_written) { struct cb7210_priv *cb_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &cb_priv->nec7210_priv; @@ -377,7 +378,7 @@ static int cb7210_accel_write(gpib_board_t *board, uint= 8_t *buffer, size_t lengt return retval; } =20 -static int cb7210_line_status(const gpib_board_t *board) +static int cb7210_line_status(const struct gpib_board *board) { int status =3D VALID_ALL; int bsr_bits; @@ -407,7 +408,7 @@ static int cb7210_line_status(const gpib_board_t *board) return status; } =20 -static unsigned int cb7210_t1_delay(gpib_board_t *board, unsigned int nano= _sec) +static unsigned int cb7210_t1_delay(struct gpib_board *board, unsigned int= nano_sec) { struct cb7210_priv *cb_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &cb_priv->nec7210_priv; @@ -424,7 +425,7 @@ static unsigned int cb7210_t1_delay(gpib_board_t *board= , unsigned int nano_sec) return retval; } =20 -static irqreturn_t cb7210_locked_internal_interrupt(gpib_board_t *board); +static irqreturn_t cb7210_locked_internal_interrupt(struct gpib_board *boa= rd); =20 /* * GPIB interrupt service routines @@ -433,7 +434,7 @@ static irqreturn_t cb7210_locked_internal_interrupt(gpi= b_board_t *board); static irqreturn_t cb_pci_interrupt(int irq, void *arg) { int bits; - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct cb7210_priv *priv =3D board->private_data; =20 // first task check if this is really our interrupt in a shared irq envir= onment @@ -462,7 +463,7 @@ static irqreturn_t cb_pci_interrupt(int irq, void *arg) return cb7210_locked_internal_interrupt(arg); } =20 -static irqreturn_t cb7210_internal_interrupt(gpib_board_t *board) +static irqreturn_t cb7210_internal_interrupt(struct gpib_board *board) { int hs_status, status1, status2; struct cb7210_priv *priv =3D board->private_data; @@ -516,7 +517,7 @@ static irqreturn_t cb7210_internal_interrupt(gpib_board= _t *board) return IRQ_HANDLED; } =20 -static irqreturn_t cb7210_locked_internal_interrupt(gpib_board_t *board) +static irqreturn_t cb7210_locked_internal_interrupt(struct gpib_board *boa= rd) { unsigned long flags; irqreturn_t retval; @@ -532,14 +533,14 @@ static irqreturn_t cb7210_interrupt(int irq, void *ar= g) return cb7210_internal_interrupt(arg); } =20 -static int cb_pci_attach(gpib_board_t *board, const gpib_board_config_t *c= onfig); -static int cb_isa_attach(gpib_board_t *board, const gpib_board_config_t *c= onfig); +static int cb_pci_attach(struct gpib_board *board, const gpib_board_config= _t *config); +static int cb_isa_attach(struct gpib_board *board, const gpib_board_config= _t *config); =20 -static void cb_pci_detach(gpib_board_t *board); -static void cb_isa_detach(gpib_board_t *board); +static void cb_pci_detach(struct gpib_board *board); +static void cb_isa_detach(struct gpib_board *board); =20 // wrappers for interface functions -static int cb7210_read(gpib_board_t *board, uint8_t *buffer, size_t length, +static int cb7210_read(struct gpib_board *board, uint8_t *buffer, size_t l= ength, int *end, size_t *bytes_read) { struct cb7210_priv *priv =3D board->private_data; @@ -547,7 +548,7 @@ static int cb7210_read(gpib_board_t *board, uint8_t *bu= ffer, size_t length, return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, byte= s_read); } =20 -static int cb7210_write(gpib_board_t *board, uint8_t *buffer, size_t lengt= h, +static int cb7210_write(struct gpib_board *board, uint8_t *buffer, size_t = length, int send_eoi, size_t *bytes_written) { struct cb7210_priv *priv =3D board->private_data; @@ -555,7 +556,7 @@ static int cb7210_write(gpib_board_t *board, uint8_t *b= uffer, size_t length, return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int cb7210_command(gpib_board_t *board, uint8_t *buffer, size_t len= gth, +static int cb7210_command(struct gpib_board *board, uint8_t *buffer, size_= t length, size_t *bytes_written) { struct cb7210_priv *priv =3D board->private_data; @@ -563,21 +564,21 @@ static int cb7210_command(gpib_board_t *board, uint8_= t *buffer, size_t length, return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_= written); } =20 -static int cb7210_take_control(gpib_board_t *board, int synchronous) +static int cb7210_take_control(struct gpib_board *board, int synchronous) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } =20 -static int cb7210_go_to_standby(gpib_board_t *board) +static int cb7210_go_to_standby(struct gpib_board *board) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_go_to_standby(board, &priv->nec7210_priv); } =20 -static void cb7210_request_system_control(gpib_board_t *board, int request= _control) +static void cb7210_request_system_control(struct gpib_board *board, int re= quest_control) { struct cb7210_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -591,91 +592,91 @@ static void cb7210_request_system_control(gpib_board_= t *board, int request_contr nec7210_request_system_control(board, nec_priv, request_control); } =20 -static void cb7210_interface_clear(gpib_board_t *board, int assert) +static void cb7210_interface_clear(struct gpib_board *board, int assert) { struct cb7210_priv *priv =3D board->private_data; =20 nec7210_interface_clear(board, &priv->nec7210_priv, assert); } =20 -static void cb7210_remote_enable(gpib_board_t *board, int enable) +static void cb7210_remote_enable(struct gpib_board *board, int enable) { struct cb7210_priv *priv =3D board->private_data; =20 nec7210_remote_enable(board, &priv->nec7210_priv, enable); } =20 -static int cb7210_enable_eos(gpib_board_t *board, uint8_t eos_byte, int co= mpare_8_bits) +static int cb7210_enable_eos(struct gpib_board *board, uint8_t eos_byte, i= nt compare_8_bits) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8= _bits); } =20 -static void cb7210_disable_eos(gpib_board_t *board) +static void cb7210_disable_eos(struct gpib_board *board) { struct cb7210_priv *priv =3D board->private_data; =20 nec7210_disable_eos(board, &priv->nec7210_priv); } =20 -static unsigned int cb7210_update_status(gpib_board_t *board, unsigned int= clear_mask) +static unsigned int cb7210_update_status(struct gpib_board *board, unsigne= d int clear_mask) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } =20 -static int cb7210_primary_address(gpib_board_t *board, unsigned int addres= s) +static int cb7210_primary_address(struct gpib_board *board, unsigned int a= ddress) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_primary_address(board, &priv->nec7210_priv, address); } =20 -static int cb7210_secondary_address(gpib_board_t *board, unsigned int addr= ess, int enable) +static int cb7210_secondary_address(struct gpib_board *board, unsigned int= address, int enable) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_secondary_address(board, &priv->nec7210_priv, address, ena= ble); } =20 -static int cb7210_parallel_poll(gpib_board_t *board, uint8_t *result) +static int cb7210_parallel_poll(struct gpib_board *board, uint8_t *result) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } =20 -static void cb7210_parallel_poll_configure(gpib_board_t *board, uint8_t co= nfiguration) +static void cb7210_parallel_poll_configure(struct gpib_board *board, uint8= _t configuration) { struct cb7210_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_configure(board, &priv->nec7210_priv, configuration= ); } =20 -static void cb7210_parallel_poll_response(gpib_board_t *board, int ist) +static void cb7210_parallel_poll_response(struct gpib_board *board, int is= t) { struct cb7210_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } =20 -static void cb7210_serial_poll_response(gpib_board_t *board, uint8_t statu= s) +static void cb7210_serial_poll_response(struct gpib_board *board, uint8_t = status) { struct cb7210_priv *priv =3D board->private_data; =20 nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } =20 -static uint8_t cb7210_serial_poll_status(gpib_board_t *board) +static uint8_t cb7210_serial_poll_status(struct gpib_board *board) { struct cb7210_priv *priv =3D board->private_data; =20 return nec7210_serial_poll_status(board, &priv->nec7210_priv); } =20 -static void cb7210_return_to_local(gpib_board_t *board) +static void cb7210_return_to_local(struct gpib_board *board) { struct cb7210_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -851,7 +852,7 @@ static gpib_interface_t cb_isa_accel_interface =3D { .return_to_local =3D cb7210_return_to_local, }; =20 -static int cb7210_allocate_private(gpib_board_t *board) +static int cb7210_allocate_private(struct gpib_board *board) { struct cb7210_priv *priv; =20 @@ -864,14 +865,14 @@ static int cb7210_allocate_private(gpib_board_t *boar= d) return 0; } =20 -static void cb7210_generic_detach(gpib_board_t *board) +static void cb7210_generic_detach(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 // generic part of attach functions shared by all cb7210 boards -static int cb7210_generic_attach(gpib_board_t *board) +static int cb7210_generic_attach(struct gpib_board *board) { struct cb7210_priv *cb_priv; struct nec7210_priv *nec_priv; @@ -889,7 +890,7 @@ static int cb7210_generic_attach(gpib_board_t *board) return 0; } =20 -static int cb7210_init(struct cb7210_priv *cb_priv, gpib_board_t *board) +static int cb7210_init(struct cb7210_priv *cb_priv, struct gpib_board *boa= rd) { struct nec7210_priv *nec_priv =3D &cb_priv->nec7210_priv; =20 @@ -925,7 +926,7 @@ static int cb7210_init(struct cb7210_priv *cb_priv, gpi= b_board_t *board) return 0; } =20 -static int cb_pci_attach(gpib_board_t *board, const gpib_board_config_t *c= onfig) +static int cb_pci_attach(struct gpib_board *board, const gpib_board_config= _t *config) { struct cb7210_priv *cb_priv; struct nec7210_priv *nec_priv; @@ -1007,7 +1008,7 @@ static int cb_pci_attach(gpib_board_t *board, const g= pib_board_config_t *config) return cb7210_init(cb_priv, board); } =20 -static void cb_pci_detach(gpib_board_t *board) +static void cb_pci_detach(struct gpib_board *board) { struct cb7210_priv *cb_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -1030,7 +1031,7 @@ static void cb_pci_detach(gpib_board_t *board) cb7210_generic_detach(board); } =20 -static int cb_isa_attach(gpib_board_t *board, const gpib_board_config_t *c= onfig) +static int cb_isa_attach(struct gpib_board *board, const gpib_board_config= _t *config) { int isr_flags =3D 0; struct cb7210_priv *cb_priv; @@ -1066,7 +1067,7 @@ static int cb_isa_attach(gpib_board_t *board, const g= pib_board_config_t *config) return cb7210_init(cb_priv, board); } =20 -static void cb_isa_detach(gpib_board_t *board) +static void cb_isa_detach(struct gpib_board *board) { struct cb7210_priv *cb_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -1132,8 +1133,8 @@ static struct pci_driver cb7210_pci_driver =3D { =20 static int cb_gpib_config(struct pcmcia_device *link); static void cb_gpib_release(struct pcmcia_device *link); -static int cb_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t= *config); -static void cb_pcmcia_detach(gpib_board_t *board); +static int cb_pcmcia_attach(struct gpib_board *board, const gpib_board_con= fig_t *config); +static void cb_pcmcia_detach(struct gpib_board *board); =20 /* * A linked list of "instances" of the gpib device. Each actual @@ -1166,7 +1167,7 @@ static struct pcmcia_device *curr_dev; =20 struct local_info { struct pcmcia_device *p_dev; - gpib_board_t *dev; + struct gpib_board *dev; }; =20 /* @@ -1222,7 +1223,7 @@ static int cb_gpib_probe(struct pcmcia_device *link) static void cb_gpib_remove(struct pcmcia_device *link) { struct local_info *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 if (info->dev) cb_pcmcia_detach(info->dev); @@ -1287,7 +1288,7 @@ static void cb_gpib_release(struct pcmcia_device *lin= k) static int cb_gpib_suspend(struct pcmcia_device *link) { //struct local_info *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 if (link->open) dev_warn(&link->dev, "Device still open\n"); @@ -1299,7 +1300,7 @@ static int cb_gpib_suspend(struct pcmcia_device *link) static int cb_gpib_resume(struct pcmcia_device *link) { //struct local_info *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 /*if (link->open) { * ni_gpib_probe(dev); / really? @@ -1416,7 +1417,7 @@ static gpib_interface_t cb_pcmcia_accel_interface =3D= { .return_to_local =3D cb7210_return_to_local, }; =20 -static int cb_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t= *config) +static int cb_pcmcia_attach(struct gpib_board *board, const gpib_board_con= fig_t *config) { struct cb7210_priv *cb_priv; struct nec7210_priv *nec_priv; @@ -1452,7 +1453,7 @@ static int cb_pcmcia_attach(gpib_board_t *board, cons= t gpib_board_config_t *conf return cb7210_init(cb_priv, board); } =20 -static void cb_pcmcia_detach(gpib_board_t *board) +static void cb_pcmcia_detach(struct gpib_board *board) { struct cb7210_priv *cb_priv =3D board->private_data; struct nec7210_priv *nec_priv; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 D3EF9210192 for ; Wed, 19 Mar 2025 21:59:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421585; cv=none; b=k0U2BrNYkN56SE77Lo0GAFZ41Wmj8NkcQyLX+gQLyQfTk6S+8mIQ282MKl/eSbzOg+kuTbjfJMN4I+Uat8O6Lt27WTa21ouQbue9m0cEsePULf+kS3qrWxrCWEFgRXSqOaaeAWYMWhQpfKvqsSDnOlNGUMBnGkvxsqU6IthtNoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421585; c=relaxed/simple; bh=vD6quqeCzKlpnY7dOUwCk16YlEJO6p4KoywYWJNFZPg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tkCHgiyksygHyREt+i4cKoQnn+lRQl1k56qh1MR6Lybjk0st1bYCw1PlGkga55wdD/fJ/N6Jcye5agfedhTYM7XXdfwixOnLfQ7HnaBXPjzcXm1vT4f37G7C26ovDddUpL0n6vZCDAi/viP0DwkwnvTLfI6HwE8NoHqYNi8wcGU= 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=kJJFXC1N; arc=none smtp.client-ip=209.85.214.171 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="kJJFXC1N" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2260c915749so464195ad.3 for ; Wed, 19 Mar 2025 14:59:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421583; x=1743026383; 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=HUNOx6AMS3SHRYHpYYpQh3DOz0o7uDzbGPhBpeav/x8=; b=kJJFXC1N7W4C1mSK1mIiWQUhaGKpBfax3oGSzac4U6DFzUv5hDP9sSPdPmOEyKY32j Xq6Rhgd+wupkrFWWfVQPZ5cAg0Lp3uRZYMBD0/fVVvznsfcdfO9ytLNCCqayB0A63EO4 66f3ERXBrzPeev9qcgMcMsggI1i10+TzqlxT/oYHSzVA+vq7jhktsRsa0zd2PuiMvKgc 60mETw+v7belj8fCsUtxwK0PtmF893FH9RbQUAS0UMuMCw53qhP2ORvgLcH3lwwatGtu flITtbtCO0RCJ+RX6mN3KW1uG4kDVXIXFGDZfSwKbTc7U4s3P4PBXGPWt+AGiy8GN1ax u/Hg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421583; x=1743026383; 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=HUNOx6AMS3SHRYHpYYpQh3DOz0o7uDzbGPhBpeav/x8=; b=F4zGrclKyx+ivAc/SnsOEfPfuTbw5BNQdni234G2l0Mpal05k7sa/4KKEpcY9gFtWl TOHwVsFLV8zCFx0WzTJuLFSQQjR5+giYCG1MJtC7npUjN7B+0q/RKwie+hD/4GChWLxL J7PncOxsTCIfF9VuAwyWh2cXAVQ45TruAPwmuZkYpMndIVe4Fy7kYZIMVEFY9KPgDU7B z/xTPDE0LJpxpJIGGfY2464IpXGUJe+LGJJPa2/y0w/TO94ZL9BMOwAH2wLOobYRNQWb M9aIlF0+28TpCJAX0qFPzSZYydcr2BfpFcsR8Vy29O2A02Nvx6JZlGw8dcSmcHNi8nOe 8Rsg== X-Forwarded-Encrypted: i=1; AJvYcCV3NacHWoSZgF7LcpuXVj2ygbXMO7YZDBeCznHUu8xX+IT4vZAismbnMG6ngPjvMvV6id/t2VR77/PGJZw=@vger.kernel.org X-Gm-Message-State: AOJu0YywL7yB8JyNjjJ03bcMEzJ0rcHzJvljhsPvLZ2KDdWH+pnflFGD 1aBG7LgC5pgb6ADtpC1yfsygZaNTD0cxNDg2qeWHxwldj6T9WZkg+dIoK9Q5QQ== X-Gm-Gg: ASbGnctjRZ3phMB3xebdRPGtGPclJ6XoqxrFHu/+DTvp7p30D6bWfytyPI8a3KgVXIf b4smCLdbqrZ3w58MLYNf80RKJSvziXEKZkAr1a5ZH9/nyGpDCYl9+kMllba7gOZhlWG8hrjh76P IoRNIH7wNTJPNxW9RA/TxtxoDqv7mntcQN2ZRyBTcPRqhXV4QyYibuR6+kpTw99hfHCQJWDMMoj AckIeVVHFWCbuQNfK7qttqhdgnYf0XJyw/QOY0JosC0iharKFp9tbWdn8pl+kz5z/E7Z2JNgK6r 8Nii+LSZh3UheExo95YmUpcoNgBgOqDHFuObzlUBQu1EDvM3tMSxWQQCERb6BiPVxVnoU7dXhCZ VPF0qhptr+g== X-Google-Smtp-Source: AGHT+IHLf1ezARTJkSh0ZQFiWLFXkKppFFH7GG+XwSuM6etYQCdBrwI9LnCcqVJt1FzhpXaNPQKvbQ== X-Received: by 2002:a17:902:e5ce:b0:224:23ab:b88b with SMTP id d9443c01a7336-2265ed81a4emr11237995ad.8.1742421583017; Wed, 19 Mar 2025 14:59: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 d9443c01a7336-225c6bbe7ccsm120016755ad.174.2025.03.19.14.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:42 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 05/20] staging: gpib: cec_gpib: struct gpib_board Date: Wed, 19 Mar 2025 21:59:09 +0000 Message-ID: <20250319215924.19387-6-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/cec/cec_gpib.c | 59 +++++++++++++++-------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec= /cec_gpib.c index 8f2b4b46a446..abe5b1b8bc5b 100644 --- a/drivers/staging/gpib/cec/cec_gpib.c +++ b/drivers/staging/gpib/cec/cec_gpib.c @@ -25,7 +25,7 @@ MODULE_DESCRIPTION("GPIB driver for CEC PCI and PCMCIA bo= ards"); =20 static irqreturn_t cec_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct cec_priv *priv =3D board->private_data; unsigned long flags; irqreturn_t retval; @@ -40,12 +40,12 @@ static irqreturn_t cec_interrupt(int irq, void *arg) #define CEC_DEV_ID 0x5cec #define CEC_SUBID 0x9050 =20 -static int cec_pci_attach(gpib_board_t *board, const gpib_board_config_t *= config); +static int cec_pci_attach(struct gpib_board *board, const gpib_board_confi= g_t *config); =20 -static void cec_pci_detach(gpib_board_t *board); +static void cec_pci_detach(struct gpib_board *board); =20 // wrappers for interface functions -static int cec_read(gpib_board_t *board, uint8_t *buffer, size_t length, i= nt *end, +static int cec_read(struct gpib_board *board, uint8_t *buffer, size_t leng= th, int *end, size_t *bytes_read) { struct cec_priv *priv =3D board->private_data; @@ -53,7 +53,7 @@ static int cec_read(gpib_board_t *board, uint8_t *buffer,= size_t length, int *en return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, byte= s_read); } =20 -static int cec_write(gpib_board_t *board, uint8_t *buffer, size_t length, = int send_eoi, +static int cec_write(struct gpib_board *board, uint8_t *buffer, size_t len= gth, int send_eoi, size_t *bytes_written) { struct cec_priv *priv =3D board->private_data; @@ -61,126 +61,127 @@ static int cec_write(gpib_board_t *board, uint8_t *bu= ffer, size_t length, int se return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int cec_command(gpib_board_t *board, uint8_t *buffer, size_t length= , size_t *bytes_written) +static int cec_command(struct gpib_board *board, uint8_t *buffer, + size_t length, size_t *bytes_written) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_= written); } =20 -static int cec_take_control(gpib_board_t *board, int synchronous) +static int cec_take_control(struct gpib_board *board, int synchronous) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } =20 -static int cec_go_to_standby(gpib_board_t *board) +static int cec_go_to_standby(struct gpib_board *board) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_go_to_standby(board, &priv->nec7210_priv); } =20 -static void cec_request_system_control(gpib_board_t *board, int request_co= ntrol) +static void cec_request_system_control(struct gpib_board *board, int reque= st_control) { struct cec_priv *priv =3D board->private_data; =20 nec7210_request_system_control(board, &priv->nec7210_priv, request_contro= l); } =20 -static void cec_interface_clear(gpib_board_t *board, int assert) +static void cec_interface_clear(struct gpib_board *board, int assert) { struct cec_priv *priv =3D board->private_data; =20 nec7210_interface_clear(board, &priv->nec7210_priv, assert); } =20 -static void cec_remote_enable(gpib_board_t *board, int enable) +static void cec_remote_enable(struct gpib_board *board, int enable) { struct cec_priv *priv =3D board->private_data; =20 nec7210_remote_enable(board, &priv->nec7210_priv, enable); } =20 -static int cec_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compa= re_8_bits) +static int cec_enable_eos(struct gpib_board *board, uint8_t eos_byte, int = compare_8_bits) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8= _bits); } =20 -static void cec_disable_eos(gpib_board_t *board) +static void cec_disable_eos(struct gpib_board *board) { struct cec_priv *priv =3D board->private_data; =20 nec7210_disable_eos(board, &priv->nec7210_priv); } =20 -static unsigned int cec_update_status(gpib_board_t *board, unsigned int cl= ear_mask) +static unsigned int cec_update_status(struct gpib_board *board, unsigned i= nt clear_mask) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } =20 -static int cec_primary_address(gpib_board_t *board, unsigned int address) +static int cec_primary_address(struct gpib_board *board, unsigned int addr= ess) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_primary_address(board, &priv->nec7210_priv, address); } =20 -static int cec_secondary_address(gpib_board_t *board, unsigned int address= , int enable) +static int cec_secondary_address(struct gpib_board *board, unsigned int ad= dress, int enable) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_secondary_address(board, &priv->nec7210_priv, address, ena= ble); } =20 -static int cec_parallel_poll(gpib_board_t *board, uint8_t *result) +static int cec_parallel_poll(struct gpib_board *board, uint8_t *result) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } =20 -static void cec_parallel_poll_configure(gpib_board_t *board, uint8_t confi= g) +static void cec_parallel_poll_configure(struct gpib_board *board, uint8_t = config) { struct cec_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config); } =20 -static void cec_parallel_poll_response(gpib_board_t *board, int ist) +static void cec_parallel_poll_response(struct gpib_board *board, int ist) { struct cec_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } =20 -static void cec_serial_poll_response(gpib_board_t *board, uint8_t status) +static void cec_serial_poll_response(struct gpib_board *board, uint8_t sta= tus) { struct cec_priv *priv =3D board->private_data; =20 nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } =20 -static uint8_t cec_serial_poll_status(gpib_board_t *board) +static uint8_t cec_serial_poll_status(struct gpib_board *board) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_serial_poll_status(board, &priv->nec7210_priv); } =20 -static unsigned int cec_t1_delay(gpib_board_t *board, unsigned int nano_se= c) +static unsigned int cec_t1_delay(struct gpib_board *board, unsigned int na= no_sec) { struct cec_priv *priv =3D board->private_data; =20 return nec7210_t1_delay(board, &priv->nec7210_priv, nano_sec); } =20 -static void cec_return_to_local(gpib_board_t *board) +static void cec_return_to_local(struct gpib_board *board) { struct cec_priv *priv =3D board->private_data; =20 @@ -215,7 +216,7 @@ static gpib_interface_t cec_pci_interface =3D { .return_to_local =3D cec_return_to_local, }; =20 -static int cec_allocate_private(gpib_board_t *board) +static int cec_allocate_private(struct gpib_board *board) { struct cec_priv *priv; =20 @@ -228,13 +229,13 @@ static int cec_allocate_private(gpib_board_t *board) return 0; } =20 -static void cec_free_private(gpib_board_t *board) +static void cec_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 -static int cec_generic_attach(gpib_board_t *board) +static int cec_generic_attach(struct gpib_board *board) { struct cec_priv *cec_priv; struct nec7210_priv *nec_priv; @@ -252,7 +253,7 @@ static int cec_generic_attach(gpib_board_t *board) return 0; } =20 -static void cec_init(struct cec_priv *cec_priv, const gpib_board_t *board) +static void cec_init(struct cec_priv *cec_priv, const struct gpib_board *b= oard) { struct nec7210_priv *nec_priv =3D &cec_priv->nec7210_priv; =20 @@ -264,7 +265,7 @@ static void cec_init(struct cec_priv *cec_priv, const g= pib_board_t *board) nec7210_board_online(nec_priv, board); } =20 -static int cec_pci_attach(gpib_board_t *board, const gpib_board_config_t *= config) +static int cec_pci_attach(struct gpib_board *board, const gpib_board_confi= g_t *config) { struct cec_priv *cec_priv; struct nec7210_priv *nec_priv; @@ -322,7 +323,7 @@ static int cec_pci_attach(gpib_board_t *board, const gp= ib_board_config_t *config return 0; } =20 -static void cec_pci_detach(gpib_board_t *board) +static void cec_pci_detach(struct gpib_board *board) { struct cec_priv *cec_priv =3D board->private_data; struct nec7210_priv *nec_priv; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 4142B21C9EA for ; Wed, 19 Mar 2025 21:59:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421588; cv=none; b=mp/lrXPZB+d4k524V52526wDtaErXTuH35aIIKmqjwW2wFoFMTXyTRqgJ4wQWJEMZcKK9kwL4grqyhaSl2pAro96fsoZNLILHNJpTjZ6r6+0KH0rDqrRClRQJnomkMz3ZG7K94WVx+udAH6o2CiObJaLqNATibZHdgXnErXMMwo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421588; c=relaxed/simple; bh=HRSOYbPGWoo6z/JmzinxHLZ36CdZ23R6tDdcp+KW+YE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cLyD7P2VF1P/XS4jzhUou8G4GhJ7nKnixqySPN7larp5SILwGbJTEdJq+BIFQqhjaf8BUiqHaIild/VKDN3wpKiKZCeF8yX12ngsDWiwTQ0R9COexK5dNg7Hkqo40NfoFEA74jP3aTjBAaBO5h3W5ym9BwiE/iR79ahA/QsRNfI= 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=HU8rLMUe; arc=none smtp.client-ip=209.85.214.172 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="HU8rLMUe" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-224171d6826so1069645ad.3 for ; Wed, 19 Mar 2025 14:59:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421584; x=1743026384; 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=wbfsr64MCoaFkYQZ9IhCGlHZeUo705MTmbhGCEUuF6o=; b=HU8rLMUej8NwO3CC6ZRqiIlt1yUSzEAR2K/5dS0nwwvU626S+LPBupaKlHw62X5aRZ P9TZJHNtMUEMNJ8Fr4btfvXx55D8uMvCNeqsYoWgXgiqDhNNmRjr4b6uLa2KrTWk87OF SyLppGzxGyfhJnYSR3kJ80KZSMpOel3Y8MwrBztByczHIUcSnhwfyoj9VnOPLBWqII01 6pwX7jCXkcAABmI3OvfwRYHcdC6U3gWcMqxzO66D4m1EnLCYs5kShLaICTxlrZpniIHY ahqvvlAz//VXiGMjObsFoaNFTGagOi1etKIAbM7JTTXyIbNkxZ2ssyDmdTGO5svR19Ia u4Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421584; x=1743026384; 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=wbfsr64MCoaFkYQZ9IhCGlHZeUo705MTmbhGCEUuF6o=; b=RugiMi+iPpA8cMQZZLpq4aevlmMNUMB81h6GWdeF7DtNn5p6N5dzIPdoEecok7lU84 1feanBlQaHVotIgLyPl/rYmfhcPzqu7sCvM2EWpvsZmimYmk9SOZGb0dutT7Wk6m8vXj GWNGKmod2I9lAQgSOVHR7BibVeG/Q0lvXbpPApGQ6FSlJEv9Wt7ht3KI1ZyPbpmTSgxR 136gDdhiDLBYo5h/Im+8UYeLgjvaA6vYqlSRX5lcxir4WasQ2Sc4t0FmxZvZj7MkwxKP kazHL5uYyBVbKvux64N/VBDL5JO3Gc9nQGew3ghHt4bGMqEcJlmu1ZPKJGT54u2cv1QZ dcbw== X-Forwarded-Encrypted: i=1; AJvYcCXdSRLPefoMN24Yy4xaerFi7MUzqnQONsjZ/JliUqGfDwLwyeO3cclldAQGWZ0xN6Yz9AfoYaxXxZ+9+7k=@vger.kernel.org X-Gm-Message-State: AOJu0YzmSo/nxeuBT2FNSu2OFdSJyyOHfsx4GQcIL15FyRL5XpE6akHr Mth0bbrT3N77RmIntaoP1LkxrGb8FaBoiij3iJYLEz+bG0+5ONtVQ8wsQVHIdw== X-Gm-Gg: ASbGncv3HtEusAfjmo1WlZFFYGJkoYScBGkRQIKHZBOtit9+Q3mbf9n5VJfU6LvJFzk Q29yn63e6gH+zHqbvSApOK4tCK2cgoUo/QITEyixcMM0UMGGTF6KOgqAAhEK3K3voxFPpjfQlYM BNJcpvXZsHu4y/4lfBevIcvBi5lUgi5Ypt+s1xnBobrvpaBu8voMeeq7q2mk7z1UhWfcxEF9anj jhYwCYLMztUU4uaoo8brre+zBhJm38pAOPawsi4T5PJ2/7osfyoEb54mRMYbSszPTnPmy4H7NlE LtN7td8cimns9jOapXIa8ua4TBmo/pVXfwwYotSuo1F80nSYe5MVNwWZIDjLsw9QR56jDVbU437 ju2SIXuIUag== X-Google-Smtp-Source: AGHT+IFKxR9lbtWsl1kDtTJcwDx+/Q6jcgrrOK3hxMnEwWn9VxhW3pEUlNc88vzgJSkYEPgI2Jkauw== X-Received: by 2002:a05:6a00:a86:b0:736:5545:5b84 with SMTP id d2e1a72fcca58-7376d5ea4ddmr7417056b3a.3.1742421584345; Wed, 19 Mar 2025 14:59: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-7371167d88fsm12664806b3a.96.2025.03.19.14.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:44 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 06/20] staging: gpib: common: struct gpib_board Date: Wed, 19 Mar 2025 21:59:10 +0000 Message-ID: <20250319215924.19387-7-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Acked-By: Dave Penkler --- drivers/staging/gpib/common/gpib_os.c | 196 +++++++++++++------------- drivers/staging/gpib/common/iblib.c | 50 +++---- drivers/staging/gpib/common/ibsys.h | 14 +- 3 files changed, 130 insertions(+), 130 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index 301c8a1a62c2..9bf2076cbbb3 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -26,53 +26,53 @@ 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, gpib_board_t *= board, unsigned long arg); -static int read_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board, +static int board_type_ioctl(gpib_file_private_t *file_priv, struct gpib_bo= ard *board, unsigned long arg); +static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *b= oard, unsigned long arg); -static int write_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board, +static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *= board, unsigned long arg); -static int command_ioctl(gpib_file_private_t *file_priv, gpib_board_t *boa= rd, +static int command_ioctl(gpib_file_private_t *file_priv, struct gpib_board= *board, unsigned long arg); -static int open_dev_ioctl(struct file *filep, gpib_board_t *board, unsigne= d long arg); -static int close_dev_ioctl(struct file *filep, gpib_board_t *board, unsign= ed long arg); -static int serial_poll_ioctl(gpib_board_t *board, unsigned long arg); -static int wait_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board,= unsigned long arg); -static int parallel_poll_ioctl(gpib_board_t *board, unsigned long arg); -static int online_ioctl(gpib_board_t *board, unsigned long arg); -static int remote_enable_ioctl(gpib_board_t *board, unsigned long arg); -static int take_control_ioctl(gpib_board_t *board, unsigned long arg); -static int line_status_ioctl(gpib_board_t *board, unsigned long arg); -static int pad_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv, +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 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, unsigned long arg); -static int sad_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv, +static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_p= riv, unsigned long arg); -static int eos_ioctl(gpib_board_t *board, unsigned long arg); -static int request_service_ioctl(gpib_board_t *board, unsigned long arg); -static int request_service2_ioctl(gpib_board_t *board, 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); +static int request_service2_ioctl(struct gpib_board *board, unsigned long = arg); static int iobase_ioctl(gpib_board_config_t *config, unsigned long arg); static int irq_ioctl(gpib_board_config_t *config, unsigned long arg); static int dma_ioctl(gpib_board_config_t *config, unsigned long arg); -static int autospoll_ioctl(gpib_board_t *board, gpib_file_private_t *file_= priv, +static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *= file_priv, unsigned long arg); -static int mutex_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv, +static int mutex_ioctl(struct gpib_board *board, gpib_file_private_t *file= _priv, unsigned long arg); -static int timeout_ioctl(gpib_board_t *board, unsigned long arg); -static int status_bytes_ioctl(gpib_board_t *board, unsigned long arg); -static int board_info_ioctl(const gpib_board_t *board, unsigned long arg); -static int ppc_ioctl(gpib_board_t *board, unsigned long arg); -static int set_local_ppoll_mode_ioctl(gpib_board_t *board, unsigned long a= rg); -static int get_local_ppoll_mode_ioctl(gpib_board_t *board, unsigned long a= rg); -static int query_board_rsv_ioctl(gpib_board_t *board, unsigned long arg); -static int interface_clear_ioctl(gpib_board_t *board, 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); +static int board_info_ioctl(const struct gpib_board *board, unsigned long = arg); +static int ppc_ioctl(struct gpib_board *board, unsigned long arg); +static int set_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned l= ong arg); +static int get_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned l= ong arg); +static int query_board_rsv_ioctl(struct gpib_board *board, unsigned long a= rg); +static int interface_clear_ioctl(struct gpib_board *board, unsigned long a= rg); static int select_pci_ioctl(gpib_board_config_t *config, unsigned long arg= ); static int select_device_path_ioctl(gpib_board_config_t *config, unsigned = long arg); -static int event_ioctl(gpib_board_t *board, unsigned long arg); -static int request_system_control_ioctl(gpib_board_t *board, unsigned long= arg); -static int t1_delay_ioctl(gpib_board_t *board, unsigned long arg); +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, gpib_board= _t *board); +static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpi= b_board *board); =20 -static int pop_gpib_event_nolock(gpib_board_t *board, gpib_event_queue_t *= queue, short *event_type); +static int pop_gpib_event_nolock(struct gpib_board *board, gpib_event_queu= e_t *queue, short *event_type); =20 /* * Timer functions @@ -82,14 +82,14 @@ static int pop_gpib_event_nolock(gpib_board_t *board, g= pib_event_queue_t *queue, =20 static void watchdog_timeout(struct timer_list *t) { - gpib_board_t *board =3D from_timer(board, t, timer); + struct gpib_board *board =3D from_timer(board, t, timer); =20 set_bit(TIMO_NUM, &board->status); wake_up_interruptible(&board->wait); } =20 /* install timer interrupt handler */ -void os_start_timer(gpib_board_t *board, unsigned int usec_timeout) +void os_start_timer(struct gpib_board *board, unsigned int usec_timeout) /* Starts the timeout task */ { if (timer_pending(&board->timer)) { @@ -105,14 +105,14 @@ void os_start_timer(gpib_board_t *board, unsigned int= usec_timeout) } } =20 -void os_remove_timer(gpib_board_t *board) +void os_remove_timer(struct gpib_board *board) /* Removes the timeout task */ { if (timer_pending(&board->timer)) del_timer_sync(&board->timer); } =20 -int io_timed_out(gpib_board_t *board) +int io_timed_out(struct gpib_board *board) { if (test_bit(TIMO_NUM, &board->status)) return 1; @@ -140,7 +140,7 @@ static void pseudo_irq_handler(struct timer_list *t) mod_timer(&pseudo_irq->timer, jiffies + pseudo_irq_period()); } =20 -int gpib_request_pseudo_irq(gpib_board_t *board, irqreturn_t (*handler)(in= t, void *)) +int gpib_request_pseudo_irq(struct gpib_board *board, irqreturn_t (*handle= r)(int, void *)) { if (timer_pending(&board->pseudo_irq.timer) || board->pseudo_irq.handler)= { dev_err(board->gpib_dev, "only one pseudo interrupt per board allowed\n"= ); @@ -159,7 +159,7 @@ int gpib_request_pseudo_irq(gpib_board_t *board, irqret= urn_t (*handler)(int, voi } EXPORT_SYMBOL(gpib_request_pseudo_irq); =20 -void gpib_free_pseudo_irq(gpib_board_t *board) +void gpib_free_pseudo_irq(struct gpib_board *board) { atomic_set(&board->pseudo_irq.active, 0); =20 @@ -178,7 +178,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(gpib_board_t *board, gpib_status_queue_t *device, u8 = poll_byte) +int push_status_byte(struct gpib_board *board, gpib_status_queue_t *device= , u8 poll_byte) { struct list_head *head =3D &device->status_bytes; status_byte_t *status; @@ -212,7 +212,7 @@ int push_status_byte(gpib_board_t *board, gpib_status_q= ueue_t *device, u8 poll_b } =20 // pop status byte from front of status byte fifo -int pop_status_byte(gpib_board_t *board, gpib_status_queue_t *device, u8 *= poll_byte) +int pop_status_byte(struct gpib_board *board, gpib_status_queue_t *device,= u8 *poll_byte) { struct list_head *head =3D &device->status_bytes; struct list_head *front =3D head->next; @@ -243,7 +243,7 @@ int pop_status_byte(gpib_board_t *board, gpib_status_qu= eue_t *device, u8 *poll_b return 0; } =20 -gpib_status_queue_t *get_gpib_status_queue(gpib_board_t *board, unsigned i= nt pad, int sad) +gpib_status_queue_t *get_gpib_status_queue(struct gpib_board *board, unsig= ned int pad, int sad) { gpib_status_queue_t *device; struct list_head *list_ptr; @@ -258,7 +258,7 @@ gpib_status_queue_t *get_gpib_status_queue(gpib_board_t= *board, unsigned int pad return NULL; } =20 -int get_serial_poll_byte(gpib_board_t *board, unsigned int pad, int sad, u= nsigned int usec_timeout, +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; @@ -270,7 +270,7 @@ int get_serial_poll_byte(gpib_board_t *board, unsigned = int pad, int sad, unsigne return dvrsp(board, pad, sad, usec_timeout, poll_byte); } =20 -int autopoll_all_devices(gpib_board_t *board) +int autopoll_all_devices(struct gpib_board *board) { int retval; =20 @@ -301,7 +301,7 @@ int autopoll_all_devices(gpib_board_t *board) return retval; } =20 -static int setup_serial_poll(gpib_board_t *board, unsigned int usec_timeou= t) +static int setup_serial_poll(struct gpib_board *board, unsigned int usec_t= imeout) { u8 cmd_string[8]; int i; @@ -333,7 +333,7 @@ static int setup_serial_poll(gpib_board_t *board, unsig= ned int usec_timeout) return 0; } =20 -static int read_serial_poll_byte(gpib_board_t *board, unsigned int pad, +static int read_serial_poll_byte(struct gpib_board *board, unsigned int pa= d, int sad, unsigned int usec_timeout, uint8_t *result) { u8 cmd_string[8]; @@ -378,7 +378,7 @@ static int read_serial_poll_byte(gpib_board_t *board, u= nsigned int pad, return 0; } =20 -static int cleanup_serial_poll(gpib_board_t *board, unsigned int usec_time= out) +static int cleanup_serial_poll(struct gpib_board *board, unsigned int usec= _timeout) { u8 cmd_string[8]; int ret; @@ -404,7 +404,7 @@ static int cleanup_serial_poll(gpib_board_t *board, uns= igned int usec_timeout) return 0; } =20 -static int serial_poll_single(gpib_board_t *board, unsigned int pad, int s= ad, +static int serial_poll_single(struct gpib_board *board, unsigned int pad, = int sad, unsigned int usec_timeout, uint8_t *result) { int retval, cleanup_retval; @@ -422,7 +422,7 @@ static int serial_poll_single(gpib_board_t *board, unsi= gned int pad, int sad, return 0; } =20 -int serial_poll_all(gpib_board_t *board, unsigned int usec_timeout) +int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout) { int retval =3D 0; struct list_head *cur; @@ -469,7 +469,7 @@ int serial_poll_all(gpib_board_t *board, unsigned int u= sec_timeout) * SPD and UNT are sent at the completion of the poll. */ =20 -int dvrsp(gpib_board_t *board, unsigned int pad, int sad, +int dvrsp(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *result) { int status =3D ibstatus(board); @@ -521,7 +521,7 @@ static int init_gpib_file_private(gpib_file_private_t *= priv) int ibopen(struct inode *inode, struct file *filep) { unsigned int minor =3D iminor(inode); - gpib_board_t *board; + struct gpib_board *board; gpib_file_private_t *priv; =20 if (minor >=3D GPIB_MAX_NUM_BOARDS) { @@ -559,7 +559,7 @@ int ibopen(struct inode *inode, struct file *filep) int ibclose(struct inode *inode, struct file *filep) { unsigned int minor =3D iminor(inode); - gpib_board_t *board; + struct gpib_board *board; gpib_file_private_t *priv =3D filep->private_data; gpib_descriptor_t *desc; =20 @@ -605,7 +605,7 @@ int ibclose(struct inode *inode, struct file *filep) long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) { unsigned int minor =3D iminor(filep->f_path.dentry->d_inode); - gpib_board_t *board; + struct gpib_board *board; gpib_file_private_t *file_priv =3D filep->private_data; long retval =3D -ENOTTY; =20 @@ -806,7 +806,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, gpib_board_t *= board, unsigned long arg) +static int board_type_ioctl(gpib_file_private_t *file_priv, struct gpib_bo= ard *board, unsigned long arg) { struct list_head *list_ptr; board_type_ioctl_t cmd; @@ -857,7 +857,7 @@ static int board_type_ioctl(gpib_file_private_t *file_p= riv, gpib_board_t *board, return -EINVAL; } =20 -static int read_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board, +static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *b= oard, unsigned long arg) { read_write_ioctl_t read_cmd; @@ -933,7 +933,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, g= pib_board_t *board, } =20 static int command_ioctl(gpib_file_private_t *file_priv, - gpib_board_t *board, unsigned long arg) + struct gpib_board *board, unsigned long arg) { read_write_ioctl_t cmd; u8 __user *userbuf; @@ -1016,7 +1016,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, gpib_board_t *board, +static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *= board, unsigned long arg) { read_write_ioctl_t write_cmd; @@ -1087,7 +1087,7 @@ static int write_ioctl(gpib_file_private_t *file_priv= , gpib_board_t *board, return retval; } =20 -static int status_bytes_ioctl(gpib_board_t *board, unsigned long arg) +static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg) { gpib_status_queue_t *device; spoll_bytes_ioctl_t cmd; @@ -1110,7 +1110,7 @@ static int status_bytes_ioctl(gpib_board_t *board, un= signed long arg) return 0; } =20 -static int increment_open_device_count(gpib_board_t *board, struct list_he= ad *head, +static int increment_open_device_count(struct gpib_board *board, struct li= st_head *head, unsigned int pad, int sad) { struct list_head *list_ptr; @@ -1145,7 +1145,7 @@ static int increment_open_device_count(gpib_board_t *= board, struct list_head *he return 0; } =20 -static int subtract_open_device_count(gpib_board_t *board, struct list_hea= d *head, +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; @@ -1174,13 +1174,13 @@ static int subtract_open_device_count(gpib_board_t = *board, struct list_head *hea return -EINVAL; } =20 -static inline int decrement_open_device_count(gpib_board_t *board, struct = list_head *head, +static inline int decrement_open_device_count(struct gpib_board *board, st= ruct list_head *head, unsigned int pad, int sad) { return subtract_open_device_count(board, head, pad, sad, 1); } =20 -static int cleanup_open_devices(gpib_file_private_t *file_priv, gpib_board= _t *board) +static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpi= b_board *board) { int retval =3D 0; int i; @@ -1205,7 +1205,7 @@ static int cleanup_open_devices(gpib_file_private_t *= file_priv, gpib_board_t *bo return 0; } =20 -static int open_dev_ioctl(struct file *filep, gpib_board_t *board, unsigne= d long arg) +static int open_dev_ioctl(struct file *filep, struct gpib_board *board, un= signed long arg) { open_dev_ioctl_t open_dev_cmd; int retval; @@ -1255,7 +1255,7 @@ static int open_dev_ioctl(struct file *filep, gpib_bo= ard_t *board, unsigned long return 0; } =20 -static int close_dev_ioctl(struct file *filep, gpib_board_t *board, unsign= ed long arg) +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; @@ -1282,7 +1282,7 @@ static int close_dev_ioctl(struct file *filep, gpib_b= oard_t *board, unsigned lon return 0; } =20 -static int serial_poll_ioctl(gpib_board_t *board, unsigned long arg) +static int serial_poll_ioctl(struct gpib_board *board, unsigned long arg) { serial_poll_ioctl_t serial_cmd; int retval; @@ -1303,7 +1303,7 @@ static int serial_poll_ioctl(gpib_board_t *board, uns= igned long arg) return 0; } =20 -static int wait_ioctl(gpib_file_private_t *file_priv, gpib_board_t *board, +static int wait_ioctl(gpib_file_private_t *file_priv, struct gpib_board *b= oard, unsigned long arg) { wait_ioctl_t wait_cmd; @@ -1330,7 +1330,7 @@ static int wait_ioctl(gpib_file_private_t *file_priv,= gpib_board_t *board, return 0; } =20 -static int parallel_poll_ioctl(gpib_board_t *board, unsigned long arg) +static int parallel_poll_ioctl(struct gpib_board *board, unsigned long arg) { u8 poll_byte; int retval; @@ -1346,7 +1346,7 @@ static int parallel_poll_ioctl(gpib_board_t *board, u= nsigned long arg) return 0; } =20 -static int online_ioctl(gpib_board_t *board, unsigned long arg) +static int online_ioctl(struct gpib_board *board, unsigned long arg) { online_ioctl_t online_cmd; int retval; @@ -1390,7 +1390,7 @@ static int online_ioctl(gpib_board_t *board, unsigned= long arg) return retval; } =20 -static int remote_enable_ioctl(gpib_board_t *board, unsigned long arg) +static int remote_enable_ioctl(struct gpib_board *board, unsigned long arg) { int enable; int retval; @@ -1402,7 +1402,7 @@ static int remote_enable_ioctl(gpib_board_t *board, u= nsigned long arg) return ibsre(board, enable); } =20 -static int take_control_ioctl(gpib_board_t *board, unsigned long arg) +static int take_control_ioctl(struct gpib_board *board, unsigned long arg) { int synchronous; int retval; @@ -1414,7 +1414,7 @@ static int take_control_ioctl(gpib_board_t *board, un= signed long arg) return ibcac(board, synchronous, 1); } =20 -static int line_status_ioctl(gpib_board_t *board, unsigned long arg) +static int line_status_ioctl(struct gpib_board *board, unsigned long arg) { short lines; int retval; @@ -1430,7 +1430,7 @@ static int line_status_ioctl(gpib_board_t *board, uns= igned long arg) return 0; } =20 -static int pad_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv, +static int pad_ioctl(struct gpib_board *board, gpib_file_private_t *file_p= riv, unsigned long arg) { pad_ioctl_t cmd; @@ -1466,7 +1466,7 @@ static int pad_ioctl(gpib_board_t *board, gpib_file_p= rivate_t *file_priv, return 0; } =20 -static int sad_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv, +static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_p= riv, unsigned long arg) { sad_ioctl_t cmd; @@ -1501,7 +1501,7 @@ static int sad_ioctl(gpib_board_t *board, gpib_file_p= rivate_t *file_priv, return 0; } =20 -static int eos_ioctl(gpib_board_t *board, unsigned long arg) +static int eos_ioctl(struct gpib_board *board, unsigned long arg) { eos_ioctl_t eos_cmd; int retval; @@ -1513,7 +1513,7 @@ static int eos_ioctl(gpib_board_t *board, unsigned lo= ng arg) return ibeos(board, eos_cmd.eos, eos_cmd.eos_flags); } =20 -static int request_service_ioctl(gpib_board_t *board, unsigned long arg) +static int request_service_ioctl(struct gpib_board *board, unsigned long a= rg) { u8 status_byte; int retval; @@ -1525,7 +1525,7 @@ static int request_service_ioctl(gpib_board_t *board,= unsigned long arg) return ibrsv2(board, status_byte, status_byte & request_service_bit); } =20 -static int request_service2_ioctl(gpib_board_t *board, unsigned long arg) +static int request_service2_ioctl(struct gpib_board *board, unsigned long = arg) { request_service2_t request_service2_cmd; int retval; @@ -1592,7 +1592,7 @@ static int dma_ioctl(gpib_board_config_t *config, uns= igned long arg) return 0; } =20 -static int autospoll_ioctl(gpib_board_t *board, gpib_file_private_t *file_= priv, +static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *= file_priv, unsigned long arg) { autospoll_ioctl_t enable; @@ -1630,7 +1630,7 @@ static int autospoll_ioctl(gpib_board_t *board, gpib_= file_private_t *file_priv, return retval; } =20 -static int mutex_ioctl(gpib_board_t *board, gpib_file_private_t *file_priv, +static int mutex_ioctl(struct gpib_board *board, gpib_file_private_t *file= _priv, unsigned long arg) { int retval, lock_mutex; @@ -1670,7 +1670,7 @@ static int mutex_ioctl(gpib_board_t *board, gpib_file= _private_t *file_priv, return 0; } =20 -static int timeout_ioctl(gpib_board_t *board, unsigned long arg) +static int timeout_ioctl(struct gpib_board *board, unsigned long arg) { unsigned int timeout; int retval; @@ -1685,7 +1685,7 @@ static int timeout_ioctl(gpib_board_t *board, unsigne= d long arg) return 0; } =20 -static int ppc_ioctl(gpib_board_t *board, unsigned long arg) +static int ppc_ioctl(struct gpib_board *board, unsigned long arg) { ppoll_config_ioctl_t cmd; int retval; @@ -1711,7 +1711,7 @@ static int ppc_ioctl(gpib_board_t *board, unsigned lo= ng arg) return 0; } =20 -static int set_local_ppoll_mode_ioctl(gpib_board_t *board, unsigned long a= rg) +static int set_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned l= ong arg) { local_ppoll_mode_ioctl_t cmd; int retval; @@ -1728,7 +1728,7 @@ static int set_local_ppoll_mode_ioctl(gpib_board_t *b= oard, unsigned long arg) return 0; } =20 -static int get_local_ppoll_mode_ioctl(gpib_board_t *board, unsigned long a= rg) +static int get_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned l= ong arg) { local_ppoll_mode_ioctl_t cmd; int retval; @@ -1741,7 +1741,7 @@ static int get_local_ppoll_mode_ioctl(gpib_board_t *b= oard, unsigned long arg) return 0; } =20 -static int query_board_rsv_ioctl(gpib_board_t *board, unsigned long arg) +static int query_board_rsv_ioctl(struct gpib_board *board, unsigned long a= rg) { int status; int retval; @@ -1755,7 +1755,7 @@ static int query_board_rsv_ioctl(gpib_board_t *board,= unsigned long arg) return 0; } =20 -static int board_info_ioctl(const gpib_board_t *board, unsigned long arg) +static int board_info_ioctl(const struct gpib_board *board, unsigned long = arg) { board_info_ioctl_t info; int retval; @@ -1778,7 +1778,7 @@ static int board_info_ioctl(const gpib_board_t *board= , unsigned long arg) return 0; } =20 -static int interface_clear_ioctl(gpib_board_t *board, unsigned long arg) +static int interface_clear_ioctl(struct gpib_board *board, unsigned long a= rg) { unsigned int usec_duration; int retval; @@ -1841,7 +1841,7 @@ unsigned int num_gpib_events(const gpib_event_queue_t= *queue) return queue->num_events; } =20 -static int push_gpib_event_nolock(gpib_board_t *board, short event_type) +static int push_gpib_event_nolock(struct gpib_board *board, short event_ty= pe) { gpib_event_queue_t *queue =3D &board->event_queue; struct list_head *head =3D &queue->event_head; @@ -1879,7 +1879,7 @@ static int push_gpib_event_nolock(gpib_board_t *board= , short event_type) } =20 // push event onto back of event queue -int push_gpib_event(gpib_board_t *board, short event_type) +int push_gpib_event(struct gpib_board *board, short event_type) { unsigned long flags; int retval; @@ -1897,7 +1897,7 @@ int push_gpib_event(gpib_board_t *board, short event_= type) } EXPORT_SYMBOL(push_gpib_event); =20 -static int pop_gpib_event_nolock(gpib_board_t *board, gpib_event_queue_t *= queue, short *event_type) +static int pop_gpib_event_nolock(struct gpib_board *board, gpib_event_queu= e_t *queue, short *event_type) { struct list_head *head =3D &queue->event_head; struct list_head *front =3D head->next; @@ -1931,7 +1931,7 @@ static int pop_gpib_event_nolock(gpib_board_t *board,= gpib_event_queue_t *queue, } =20 // pop event from front of event queue -int pop_gpib_event(gpib_board_t *board, gpib_event_queue_t *queue, short *= event_type) +int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, sh= ort *event_type) { unsigned long flags; int retval; @@ -1942,7 +1942,7 @@ int pop_gpib_event(gpib_board_t *board, gpib_event_qu= eue_t *queue, short *event_ return retval; } =20 -static int event_ioctl(gpib_board_t *board, unsigned long arg) +static int event_ioctl(struct gpib_board *board, unsigned long arg) { event_ioctl_t user_event; int retval; @@ -1961,7 +1961,7 @@ static int event_ioctl(gpib_board_t *board, unsigned = long arg) return 0; } =20 -static int request_system_control_ioctl(gpib_board_t *board, unsigned long= arg) +static int request_system_control_ioctl(struct gpib_board *board, unsigned= long arg) { rsc_ioctl_t request_control; int retval; @@ -1975,7 +1975,7 @@ static int request_system_control_ioctl(gpib_board_t = *board, unsigned long arg) return 0; } =20 -static int t1_delay_ioctl(gpib_board_t *board, unsigned long arg) +static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg) { t1_delay_ioctl_t cmd; unsigned int delay; @@ -2004,7 +2004,7 @@ static const struct file_operations ib_fops =3D { .release =3D &ibclose, }; =20 -gpib_board_t board_array[GPIB_MAX_NUM_BOARDS]; +struct gpib_board board_array[GPIB_MAX_NUM_BOARDS]; =20 LIST_HEAD(registered_drivers); =20 @@ -2039,7 +2039,7 @@ void gpib_unregister_driver(gpib_interface_t *interfa= ce) struct list_head *list_ptr; =20 for (i =3D 0; i < GPIB_MAX_NUM_BOARDS; i++) { - gpib_board_t *board =3D &board_array[i]; + struct gpib_board *board =3D &board_array[i]; =20 if (board->interface =3D=3D interface) { if (board->use_count > 0) @@ -2069,7 +2069,7 @@ static void init_gpib_board_config(gpib_board_config_= t *config) config->pci_slot =3D -1; } =20 -void init_gpib_board(gpib_board_t *board) +void init_gpib_board(struct gpib_board *board) { board->interface =3D NULL; board->provider_module =3D NULL; @@ -2104,7 +2104,7 @@ void init_gpib_board(gpib_board_t *board) board->local_ppoll_mode =3D 0; } =20 -int gpib_allocate_board(gpib_board_t *board) +int gpib_allocate_board(struct gpib_board *board) { if (!board->buffer) { board->buffer_length =3D 0x4000; @@ -2117,7 +2117,7 @@ int gpib_allocate_board(gpib_board_t *board) return 0; } =20 -void gpib_deallocate_board(gpib_board_t *board) +void gpib_deallocate_board(struct gpib_board *board) { short dummy; =20 @@ -2130,7 +2130,7 @@ void gpib_deallocate_board(gpib_board_t *board) pop_gpib_event(board, &board->event_queue, &dummy); } =20 -static void init_board_array(gpib_board_t *board_array, unsigned int lengt= h) +static void init_board_array(struct gpib_board *board_array, unsigned int = length) { int i; =20 diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/com= mon/iblib.c index 92e792e12301..6cca8a49e839 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -21,7 +21,7 @@ * If fallback_to_async is non-zero, try to take control asynchronously * if synchronous attempt fails. */ -int ibcac(gpib_board_t *board, int sync, int fallback_to_async) +int ibcac(struct gpib_board *board, int sync, int fallback_to_async) { int status =3D ibstatus(board); int retval; @@ -61,7 +61,7 @@ int ibcac(gpib_board_t *board, int sync, int fallback_to_= async) * set the skip_check_for_command_acceptors flag in their * gpib_interface_struct to avoid useless overhead. */ -static int check_for_command_acceptors(gpib_board_t *board) +static int check_for_command_acceptors(struct gpib_board *board) { int lines; =20 @@ -96,7 +96,7 @@ static int check_for_command_acceptors(gpib_board_t *boar= d) * must be called to initialize the GPIB and enable * the interface to leave the controller idle state. */ -int ibcmd(gpib_board_t *board, uint8_t *buf, size_t length, size_t *bytes_= written) +int ibcmd(struct gpib_board *board, uint8_t *buf, size_t length, size_t *b= ytes_written) { ssize_t ret =3D 0; int status; @@ -131,7 +131,7 @@ int ibcmd(gpib_board_t *board, uint8_t *buf, size_t len= gth, size_t *bytes_writte * active state, i.e., turn ATN off. */ =20 -int ibgts(gpib_board_t *board) +int ibgts(struct gpib_board *board) { int status =3D ibstatus(board); int retval; @@ -146,7 +146,7 @@ int ibgts(gpib_board_t *board) return retval; } =20 -static int autospoll_wait_should_wake_up(gpib_board_t *board) +static int autospoll_wait_should_wake_up(struct gpib_board *board) { int retval; =20 @@ -162,7 +162,7 @@ static int autospoll_wait_should_wake_up(gpib_board_t *= board) =20 static int autospoll_thread(void *board_void) { - gpib_board_t *board =3D board_void; + struct gpib_board *board =3D board_void; int retval =3D 0; =20 dev_dbg(board->gpib_dev, "entering autospoll thread\n"); @@ -199,7 +199,7 @@ static int autospoll_thread(void *board_void) return retval; } =20 -int ibonline(gpib_board_t *board) +int ibonline(struct gpib_board *board) { int retval; =20 @@ -238,7 +238,7 @@ int ibonline(gpib_board_t *board) } =20 /* XXX need to make sure board is generally not in use (grab board lock?) = */ -int iboffline(gpib_board_t *board) +int iboffline(struct gpib_board *board) { int retval; =20 @@ -270,7 +270,7 @@ int iboffline(gpib_board_t *board) * Next LSB (bits 8-15) - STATUS lines mask (lines that are currently set). * */ -int iblines(const gpib_board_t *board, short *lines) +int iblines(const struct gpib_board *board, short *lines) { int retval; =20 @@ -297,7 +297,7 @@ int iblines(const gpib_board_t *board, short *lines) * calling ibcmd. */ =20 -int ibrd(gpib_board_t *board, uint8_t *buf, size_t length, int *end_flag, = size_t *nbytes) +int ibrd(struct gpib_board *board, uint8_t *buf, size_t length, int *end_f= lag, size_t *nbytes) { ssize_t ret =3D 0; int retval; @@ -343,7 +343,7 @@ int ibrd(gpib_board_t *board, uint8_t *buf, size_t leng= th, int *end_flag, size_t * 1. Prior to conducting the poll the interface is placed * in the controller active state. */ -int ibrpp(gpib_board_t *board, uint8_t *result) +int ibrpp(struct gpib_board *board, uint8_t *result) { int retval =3D 0; =20 @@ -358,7 +358,7 @@ int ibrpp(gpib_board_t *board, uint8_t *result) return retval; } =20 -int ibppc(gpib_board_t *board, uint8_t configuration) +int ibppc(struct gpib_board *board, uint8_t configuration) { configuration &=3D 0x1f; board->interface->parallel_poll_configure(board, configuration); @@ -367,7 +367,7 @@ int ibppc(gpib_board_t *board, uint8_t configuration) return 0; } =20 -int ibrsv2(gpib_board_t *board, uint8_t status_byte, int new_reason_for_se= rvice) +int ibrsv2(struct gpib_board *board, uint8_t status_byte, int new_reason_f= or_service) { int board_status =3D ibstatus(board); const unsigned int MSS =3D status_byte & request_service_bit; @@ -400,7 +400,7 @@ int ibrsv2(gpib_board_t *board, uint8_t status_byte, in= t new_reason_for_service) * ibcmd in order to initialize the bus and enable the * interface to leave the controller idle state. */ -int ibsic(gpib_board_t *board, unsigned int usec_duration) +int ibsic(struct gpib_board *board, unsigned int usec_duration) { if (board->master =3D=3D 0) return -EINVAL; @@ -419,7 +419,7 @@ int ibsic(gpib_board_t *board, unsigned int usec_durati= on) } =20 /* FIXME make int */ -void ibrsc(gpib_board_t *board, int request_control) +void ibrsc(struct gpib_board *board, int request_control) { board->master =3D request_control !=3D 0; if (board->interface->request_system_control) @@ -430,7 +430,7 @@ void ibrsc(gpib_board_t *board, int request_control) * IBSRE * Send REN true if v is non-zero or false if v is zero. */ -int ibsre(gpib_board_t *board, int enable) +int ibsre(struct gpib_board *board, int enable) { if (board->master =3D=3D 0) return -EINVAL; @@ -447,7 +447,7 @@ int ibsre(gpib_board_t *board, int enable) * change the GPIB address of the interface board. The address * must be 0 through 30. ibonl resets the address to PAD. */ -int ibpad(gpib_board_t *board, unsigned int addr) +int ibpad(struct gpib_board *board, unsigned int addr) { if (addr > MAX_GPIB_PRIMARY_ADDRESS) return -EINVAL; @@ -465,7 +465,7 @@ int ibpad(gpib_board_t *board, unsigned int addr) * The address must be 0 through 30, or negative disables. ibonl resets t= he * address to SAD. */ -int ibsad(gpib_board_t *board, int addr) +int ibsad(struct gpib_board *board, int addr) { if (addr > MAX_GPIB_SECONDARY_ADDRESS) return -EINVAL; @@ -486,7 +486,7 @@ int ibsad(gpib_board_t *board, int addr) * Set the end-of-string modes for I/O operations to v. * */ -int ibeos(gpib_board_t *board, int eos, int eosflags) +int ibeos(struct gpib_board *board, int eos, int eosflags) { int retval; =20 @@ -501,12 +501,12 @@ int ibeos(gpib_board_t *board, int eos, int eosflags) return retval; } =20 -int ibstatus(gpib_board_t *board) +int ibstatus(struct gpib_board *board) { return general_ibstatus(board, NULL, 0, 0, NULL); } =20 -int general_ibstatus(gpib_board_t *board, const gpib_status_queue_t *devic= e, +int general_ibstatus(struct gpib_board *board, const gpib_status_queue_t *= device, int clear_mask, int set_mask, gpib_descriptor_t *desc) { int status =3D 0; @@ -552,7 +552,7 @@ int general_ibstatus(gpib_board_t *board, const gpib_st= atus_queue_t *device, } =20 struct wait_info { - gpib_board_t *board; + struct gpib_board *board; struct timer_list timer; int timed_out; unsigned long usec_timeout; @@ -576,7 +576,7 @@ static void init_wait_info(struct wait_info *winfo) static int wait_satisfied(struct wait_info *winfo, gpib_status_queue_t *st= atus_queue, int wait_mask, int *status, gpib_descriptor_t *desc) { - gpib_board_t *board =3D winfo->board; + struct gpib_board *board =3D winfo->board; int temp_status; =20 if (mutex_lock_interruptible(&board->big_gpib_mutex)) @@ -622,7 +622,7 @@ static void remove_wait_timer(struct wait_info *winfo) * If the mask is 0 then * no condition is waited for. */ -int ibwait(gpib_board_t *board, int wait_mask, int clear_mask, int set_mas= k, +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 retval =3D 0; @@ -677,7 +677,7 @@ int ibwait(gpib_board_t *board, int wait_mask, int clea= r_mask, int set_mask, * well as the interface board itself must be * addressed by calling ibcmd. */ -int ibwrt(gpib_board_t *board, uint8_t *buf, size_t cnt, int send_eoi, siz= e_t *bytes_written) +int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi= , size_t *bytes_written) { int ret =3D 0; int retval; diff --git a/drivers/staging/gpib/common/ibsys.h b/drivers/staging/gpib/com= mon/ibsys.h index da20971e9c7e..19960af809c2 100644 --- a/drivers/staging/gpib/common/ibsys.h +++ b/drivers/staging/gpib/common/ibsys.h @@ -19,13 +19,13 @@ #define MAX_GPIB_PRIMARY_ADDRESS 30 #define MAX_GPIB_SECONDARY_ADDRESS 31 =20 -int gpib_allocate_board(gpib_board_t *board); -void gpib_deallocate_board(gpib_board_t *board); +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(gpib_board_t *board, gpib_status_queue_t *device, uin= t8_t poll_byte); -int pop_status_byte(gpib_board_t *board, gpib_status_queue_t *device, uint= 8_t *poll_byte); -gpib_status_queue_t *get_gpib_status_queue(gpib_board_t *board, unsigned i= nt pad, int sad); -int get_serial_poll_byte(gpib_board_t *board, unsigned int pad, int sad, +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); +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(gpib_board_t *board); +int autopoll_all_devices(struct gpib_board *board); --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 61E1C21CA03 for ; Wed, 19 Mar 2025 21:59:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421588; cv=none; b=IVh7Ub+h2MSbeI0iM5TqiK2zoGso88NXeJ1nsZ30hrn7jr36BO2tjm+Sf8SJ+/qLdq9eCQm9TF5fixuwWNcJg6yhOwx/HbynT3V4iFt+eKjXpUT+6FEs792kBzdFiQoQwtGEqQ4CFJpsyDgQr9Ydq0Gwm+MrSSTOL40VaHgweRQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421588; c=relaxed/simple; bh=P/5ykYZI10RLWyKwkmYwJcya+qVgmSlheP+M6T2keQI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V2LZxDjpozFFlc5uVo6d8t8I/rFaIUu7iKhXLNWC0U/rlfxoSV4EwgztgHzVCKNk5a+/xg0Y4HQpqjty9ehbSNL1ofux8jiEqPg9iWs6paqOndJ+pn/5EpvvF8WWdz6r5kqMWOdulK0w9YyXqNJu1mEFTcPDv9pqS9RVj+5z7+s= 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=Og1DPyT6; arc=none smtp.client-ip=209.85.214.177 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="Og1DPyT6" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-225fbdfc17dso591185ad.3 for ; Wed, 19 Mar 2025 14:59:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421586; x=1743026386; 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=elxSKl7AGO+ZSNzT6IOEbe4Fdz4wwlKYMK78WvS7mAw=; b=Og1DPyT6cMwvUS1do7BG2YR444fJVoPLSRvVZYbOg4ocGfYALiwR+S08xfGgFEgzpH 9vVwVPo1LnFkiVSq1uy4K/1uYG5kNV0vJIA51vqNalqE7xe45vUa4vlR4grXTNa33Mxa 9e1NK2n3TNMGeIxzgCJIlHFVv8UwWbofWWGRuxIXridBesSU3p+kvF5sUZfKrhC92AuX zWzdx3AOYzxiNlrdl4FOYklzfcsTeRzRncF4WmbnZOo9E1S+sU9m72B+59KpKaMlVNFf vUcht/AM4mZ1zJqjxEsjUuz1D0ZNxFQWrzL2FhtO6TnjHU4UD7qGqWmjP19uwPBwvesr ucDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421586; x=1743026386; 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=elxSKl7AGO+ZSNzT6IOEbe4Fdz4wwlKYMK78WvS7mAw=; b=QcSqvUmgsOqOH8wkzF3S7Rk9PQAvkKepVDfR6sjFpkFbSDXw4yzbcbxMcpdYE65n0J wdvOHTglOpHZHEBcj1l2PGxgLFSBqVQEgNibL4r9DjHBs+m+mPRKTF7jvQVbLLgI0sHB qfXibtdJ83dX01WqIoOLPWinRftwyg+CHmi7MODcCPHiGpLkkJWfa0uY0wdMbiM2xWv3 KNvOHdOsIk90YCb4yF5TtoeAs29XVOWhHOWwvdQ/iqi+LTJxXSnaV6am3F/eFOvb1zfL GX9pc5c5gw806sDoigC7IheoXtG51jytMqSOKz94Ysq5VQOM+l1HWJmU3/1j1SiYTjA8 Mwag== X-Forwarded-Encrypted: i=1; AJvYcCUqezuRSbsk5x85vN99UhvKtJDQuhO+O6kAIdJQ5IswDr8p3F0kpnHKwxo4gzGV3kzSIKqG+4Plm2y3BqI=@vger.kernel.org X-Gm-Message-State: AOJu0YwvqM9eC2qlTadqKs0i0s4mB0bX7RpM7zvvmgD04sOnSIOo3jA/ 9mw52/u8ZEEoVEJL8/63/1PrHGKBp6ANQrmmmstlPy9d+J0PQ2sBYu22UzyZFkIwL8nYIhi6rGc = X-Gm-Gg: ASbGncs5qqRiT4iyIc6DOb9TZ6+jDu/Wx0uit9Ndc8tkdX1DImxxE01GnWBzhLwrqoc ItcPx4YR1H+tiR7Ije+F+VThwIytwz//Kb4XeLN+4JZ0y9fH8N26SXxRtBKrLrYR2Ay7ymSyDjf LGJ8sCMBQpEzrzkEGzBpcRPVUtqyPPdYFtk0yq5+NZXjxGdqQ3ljvYd4sGZq7q9Rua5S2LygCh1 CFuQDXd3I8BSF/KSGlZEghROwTkohVxHPzD7Tsc/WVIsRCf8sT9mYAYCFeLjgN6OfiUEfzDyu2B 3ceuo81nWNJCYQfJsOc/5u6dEUYZlJT0BYj0ta5XbnsNjKNJSsk00/wji6I5W6lMfwlHU0v3fct BDe0CTRmU3Q== X-Google-Smtp-Source: AGHT+IFYbsQ1m57VdkJpKBY3iiNXPXlGziicMAq7oKaC/qg+0o6Iw376vNVx3icGfiQlopRRUceOTQ== X-Received: by 2002:a05:6a20:a126:b0:1f5:77bd:ecbc with SMTP id adf61e73a8af0-1fbeb9991e4mr6690469637.16.1742421585682; Wed, 19 Mar 2025 14:59: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 41be03b00d2f7-af56ea7c718sm11529841a12.62.2025.03.19.14.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:45 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 07/20] staging: gpib: eastwood: struct gpib_board Date: Wed, 19 Mar 2025 21:59:11 +0000 Message-ID: <20250319215924.19387-8-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/eastwood/fluke_gpib.c | 93 +++++++++++----------- 1 file changed, 47 insertions(+), 46 deletions(-) diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/g= pib/eastwood/fluke_gpib.c index bcddf3125b8c..b3b629c892e2 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -24,11 +24,11 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB Driver for Fluke cda devices"); =20 -static int fluke_attach_holdoff_all(gpib_board_t *board, const gpib_board_= config_t *config); -static int fluke_attach_holdoff_end(gpib_board_t *board, const gpib_board_= config_t *config); -static void fluke_detach(gpib_board_t *board); -static int fluke_config_dma(gpib_board_t *board, int output); -static irqreturn_t fluke_gpib_internal_interrupt(gpib_board_t *board); +static int fluke_attach_holdoff_all(struct gpib_board *board, const gpib_b= oard_config_t *config); +static int fluke_attach_holdoff_end(struct gpib_board *board, const gpib_b= oard_config_t *config); +static void fluke_detach(struct gpib_board *board); +static int fluke_config_dma(struct gpib_board *board, int output); +static irqreturn_t fluke_gpib_internal_interrupt(struct gpib_board *board); =20 static struct platform_device *fluke_gpib_pdev; =20 @@ -54,7 +54,7 @@ static void fluke_locking_write_byte(struct nec7210_priv = *nec_priv, uint8_t byte } =20 // wrappers for interface functions -static int fluke_read(gpib_board_t *board, uint8_t *buffer, size_t length,= int *end, +static int fluke_read(struct gpib_board *board, uint8_t *buffer, size_t le= ngth, int *end, size_t *bytes_read) { struct fluke_priv *priv =3D board->private_data; @@ -62,7 +62,7 @@ static int fluke_read(gpib_board_t *board, uint8_t *buffe= r, size_t length, int * return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, byte= s_read); } =20 -static int fluke_write(gpib_board_t *board, uint8_t *buffer, size_t length, +static int fluke_write(struct gpib_board *board, uint8_t *buffer, size_t l= ength, int send_eoi, size_t *bytes_written) { struct fluke_priv *priv =3D board->private_data; @@ -70,28 +70,29 @@ static int fluke_write(gpib_board_t *board, uint8_t *bu= ffer, size_t length, return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int fluke_command(gpib_board_t *board, uint8_t *buffer, size_t leng= th, size_t *bytes_written) +static int fluke_command(struct gpib_board *board, uint8_t *buffer, + size_t length, size_t *bytes_written) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_= written); } =20 -static int fluke_take_control(gpib_board_t *board, int synchronous) +static int fluke_take_control(struct gpib_board *board, int synchronous) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } =20 -static int fluke_go_to_standby(gpib_board_t *board) +static int fluke_go_to_standby(struct gpib_board *board) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_go_to_standby(board, &priv->nec7210_priv); } =20 -static void fluke_request_system_control(gpib_board_t *board, int request_= control) +static void fluke_request_system_control(struct gpib_board *board, int req= uest_control) { struct fluke_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -99,91 +100,91 @@ static void fluke_request_system_control(gpib_board_t = *board, int request_contro nec7210_request_system_control(board, nec_priv, request_control); } =20 -static void fluke_interface_clear(gpib_board_t *board, int assert) +static void fluke_interface_clear(struct gpib_board *board, int assert) { struct fluke_priv *priv =3D board->private_data; =20 nec7210_interface_clear(board, &priv->nec7210_priv, assert); } =20 -static void fluke_remote_enable(gpib_board_t *board, int enable) +static void fluke_remote_enable(struct gpib_board *board, int enable) { struct fluke_priv *priv =3D board->private_data; =20 nec7210_remote_enable(board, &priv->nec7210_priv, enable); } =20 -static int fluke_enable_eos(gpib_board_t *board, uint8_t eos_byte, int com= pare_8_bits) +static int fluke_enable_eos(struct gpib_board *board, uint8_t eos_byte, in= t compare_8_bits) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8= _bits); } =20 -static void fluke_disable_eos(gpib_board_t *board) +static void fluke_disable_eos(struct gpib_board *board) { struct fluke_priv *priv =3D board->private_data; =20 nec7210_disable_eos(board, &priv->nec7210_priv); } =20 -static unsigned int fluke_update_status(gpib_board_t *board, unsigned int = clear_mask) +static unsigned int fluke_update_status(struct gpib_board *board, unsigned= int clear_mask) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } =20 -static int fluke_primary_address(gpib_board_t *board, unsigned int address) +static int fluke_primary_address(struct gpib_board *board, unsigned int ad= dress) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_primary_address(board, &priv->nec7210_priv, address); } =20 -static int fluke_secondary_address(gpib_board_t *board, unsigned int addre= ss, int enable) +static int fluke_secondary_address(struct gpib_board *board, unsigned int = address, int enable) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_secondary_address(board, &priv->nec7210_priv, address, ena= ble); } =20 -static int fluke_parallel_poll(gpib_board_t *board, uint8_t *result) +static int fluke_parallel_poll(struct gpib_board *board, uint8_t *result) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } =20 -static void fluke_parallel_poll_configure(gpib_board_t *board, uint8_t con= figuration) +static void fluke_parallel_poll_configure(struct gpib_board *board, uint8_= t configuration) { struct fluke_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_configure(board, &priv->nec7210_priv, configuration= ); } =20 -static void fluke_parallel_poll_response(gpib_board_t *board, int ist) +static void fluke_parallel_poll_response(struct gpib_board *board, int ist) { struct fluke_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } =20 -static void fluke_serial_poll_response(gpib_board_t *board, uint8_t status) +static void fluke_serial_poll_response(struct gpib_board *board, uint8_t s= tatus) { struct fluke_priv *priv =3D board->private_data; =20 nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } =20 -static uint8_t fluke_serial_poll_status(gpib_board_t *board) +static uint8_t fluke_serial_poll_status(struct gpib_board *board) { struct fluke_priv *priv =3D board->private_data; =20 return nec7210_serial_poll_status(board, &priv->nec7210_priv); } =20 -static void fluke_return_to_local(gpib_board_t *board) +static void fluke_return_to_local(struct gpib_board *board) { struct fluke_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -193,7 +194,7 @@ static void fluke_return_to_local(gpib_board_t *board) write_byte(nec_priv, AUX_RTL, AUXMR); } =20 -static int fluke_line_status(const gpib_board_t *board) +static int fluke_line_status(const struct gpib_board *board) { int status =3D VALID_ALL; int bsr_bits; @@ -223,7 +224,7 @@ static int fluke_line_status(const gpib_board_t *board) return status; } =20 -static unsigned int fluke_t1_delay(gpib_board_t *board, unsigned int nano_= sec) +static unsigned int fluke_t1_delay(struct gpib_board *board, unsigned int = nano_sec) { struct fluke_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -240,7 +241,7 @@ static unsigned int fluke_t1_delay(gpib_board_t *board,= unsigned int nano_sec) return retval; } =20 -static int lacs_or_read_ready(gpib_board_t *board) +static int lacs_or_read_ready(struct gpib_board *board) { const struct fluke_priv *e_priv =3D board->private_data; const struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -256,7 +257,7 @@ static int lacs_or_read_ready(gpib_board_t *board) /* Wait until it is possible for a read to do something useful. This * is not essential, it only exists to prevent RFD holdoff from being rele= ased pointlessly. */ -static int wait_for_read(gpib_board_t *board) +static int wait_for_read(struct gpib_board *board) { struct fluke_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -313,7 +314,7 @@ static int source_handshake_is_sids_or_sgns(struct fluk= e_priv *e_priv) * If the chip is SGNS it is probably waiting for a a byte to * be written to it. */ -static int wait_for_data_out_ready(gpib_board_t *board) +static int wait_for_data_out_ready(struct gpib_board *board) { struct fluke_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -332,7 +333,7 @@ static int wait_for_data_out_ready(gpib_board_t *board) return retval; } =20 -static int wait_for_sids_or_sgns(gpib_board_t *board) +static int wait_for_sids_or_sgns(struct gpib_board *board) { struct fluke_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -353,7 +354,7 @@ static int wait_for_sids_or_sgns(gpib_board_t *board) =20 static void fluke_dma_callback(void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct fluke_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; unsigned long flags; @@ -370,7 +371,7 @@ static void fluke_dma_callback(void *arg) spin_unlock_irqrestore(&board->spinlock, flags); } =20 -static int fluke_dma_write(gpib_board_t *board, uint8_t *buffer, size_t le= ngth, +static int fluke_dma_write(struct gpib_board *board, uint8_t *buffer, size= _t length, size_t *bytes_written) { struct fluke_priv *e_priv =3D board->private_data; @@ -455,7 +456,7 @@ static int fluke_dma_write(gpib_board_t *board, uint8_t= *buffer, size_t length, return retval; } =20 -static int fluke_accel_write(gpib_board_t *board, uint8_t *buffer, size_t = length, +static int fluke_accel_write(struct gpib_board *board, uint8_t *buffer, si= ze_t length, int send_eoi, size_t *bytes_written) { struct fluke_priv *e_priv =3D board->private_data; @@ -543,7 +544,7 @@ static int fluke_get_dma_residue(struct dma_chan *chan,= dma_cookie_t cookie) return state.residue; } =20 -static int fluke_dma_read(gpib_board_t *board, uint8_t *buffer, +static int fluke_dma_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read) { struct fluke_priv *e_priv =3D board->private_data; @@ -656,7 +657,7 @@ static int fluke_dma_read(gpib_board_t *board, uint8_t = *buffer, return retval; } =20 -static int fluke_accel_read(gpib_board_t *board, uint8_t *buffer, size_t l= ength, +static int fluke_accel_read(struct gpib_board *board, uint8_t *buffer, siz= e_t length, int *end, size_t *bytes_read) { struct fluke_priv *e_priv =3D board->private_data; @@ -786,7 +787,7 @@ static gpib_interface_t fluke_interface =3D { .return_to_local =3D fluke_return_to_local, }; =20 -irqreturn_t fluke_gpib_internal_interrupt(gpib_board_t *board) +irqreturn_t fluke_gpib_internal_interrupt(struct gpib_board *board) { int status0, status1, status2; struct fluke_priv *priv =3D board->private_data; @@ -823,7 +824,7 @@ irqreturn_t fluke_gpib_internal_interrupt(gpib_board_t = *board) =20 static irqreturn_t fluke_gpib_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; unsigned long flags; irqreturn_t retval; =20 @@ -833,7 +834,7 @@ static irqreturn_t fluke_gpib_interrupt(int irq, void *= arg) return retval; } =20 -static int fluke_allocate_private(gpib_board_t *board) +static int fluke_allocate_private(struct gpib_board *board) { struct fluke_priv *priv; =20 @@ -850,7 +851,7 @@ static int fluke_allocate_private(gpib_board_t *board) return 0; } =20 -static void fluke_generic_detach(gpib_board_t *board) +static void fluke_generic_detach(struct gpib_board *board) { if (board->private_data) { struct fluke_priv *e_priv =3D board->private_data; @@ -862,7 +863,7 @@ static void fluke_generic_detach(gpib_board_t *board) } =20 // generic part of attach functions shared by all cb7210 boards -static int fluke_generic_attach(gpib_board_t *board) +static int fluke_generic_attach(struct gpib_board *board) { struct fluke_priv *e_priv; struct nec7210_priv *nec_priv; @@ -882,7 +883,7 @@ static int fluke_generic_attach(gpib_board_t *board) return 0; } =20 -static int fluke_config_dma(gpib_board_t *board, int output) +static int fluke_config_dma(struct gpib_board *board, int output) { struct fluke_priv *e_priv =3D board->private_data; struct dma_slave_config config; @@ -907,7 +908,7 @@ static int fluke_config_dma(gpib_board_t *board, int ou= tput) return dmaengine_slave_config(e_priv->dma_channel, &config); } =20 -static int fluke_init(struct fluke_priv *e_priv, gpib_board_t *board, int = handshake_mode) +static int fluke_init(struct fluke_priv *e_priv, struct gpib_board *board,= int handshake_mode) { struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; =20 @@ -942,7 +943,7 @@ static bool gpib_dma_channel_filter(struct dma_chan *ch= an, void *filter_param) return chan->chan_id =3D=3D 0; } =20 -static int fluke_attach_impl(gpib_board_t *board, const gpib_board_config_= t *config, +static int fluke_attach_impl(struct gpib_board *board, const gpib_board_co= nfig_t *config, unsigned int handshake_mode) { struct fluke_priv *e_priv; @@ -1048,17 +1049,17 @@ static int fluke_attach_impl(gpib_board_t *board, c= onst gpib_board_config_t *con return fluke_init(e_priv, board, handshake_mode); } =20 -int fluke_attach_holdoff_all(gpib_board_t *board, const gpib_board_config_= t *config) +int fluke_attach_holdoff_all(struct gpib_board *board, const gpib_board_co= nfig_t *config) { return fluke_attach_impl(board, config, HR_HLDA); } =20 -int fluke_attach_holdoff_end(gpib_board_t *board, const gpib_board_config_= t *config) +int fluke_attach_holdoff_end(struct gpib_board *board, const gpib_board_co= nfig_t *config) { return fluke_attach_impl(board, config, HR_HLDE); } =20 -void fluke_detach(gpib_board_t *board) +void fluke_detach(struct gpib_board *board) { struct fluke_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 AF2C221CC5A for ; Wed, 19 Mar 2025 21:59:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421590; cv=none; b=X07n3R0UzWjoE1w8GmuvARSpEnJpUdfU8PGqfTY7x95E5zyKhO2p0kA5mrgBA9VkNifev8HY/zWPgti1P+yaJ4xFSArUdr2ggBMDHn3IbwS4yYmoYaFeaZfRkMawJI24AEgfgJ1Okpp6VbKA9oeOJa0YIY0osDQxRAJBymBkd7Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421590; c=relaxed/simple; bh=H4tAdHGKRxmeP2+t6k9qL6m43FWvtV7f/v514CY/+00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bW1Mb0kZ7/fl5GjwPHz/3KKaeYrAYJC3kg4yQTnaqD5vZYvh6low65DdRE28mv6CbfPBV2dyPRKcV17TbBzz/8a9031/urJFzCJiusGafFjxoVMM+W4W62UDZ4Ms0DRf8kvyWq0b+ARuUgMvHnAA1NygL2IiVcA0kNjPLuSFADY= 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=e4BSzAta; arc=none smtp.client-ip=209.85.214.180 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="e4BSzAta" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-2241053582dso1174015ad.1 for ; Wed, 19 Mar 2025 14:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421587; x=1743026387; 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=6jvVAbWtCF4UFk7VFZydpOT77H5oUWGBA+2hIXnrdGo=; b=e4BSzAtaPj5jAkLOgWzHYbtUzdxxTI/+OvjK/w30iBWaxb1GruiCXG7pHG6Y7YgFuR 8vCQ3o0fYnHbob4PV9370uvpVpU7bgct+5YDaTb/j+OvWhoVFuOkfDldVSEddumtvffm idD4aeQRMSUuoh8yIzgxY2/HeO4xulnAqnA/8nVdznMriBJU8qcFyQ6fapU/KqcBxgUE R9lkCKIBsVvzkZXcZ/XIziItmtctbSd2X1pHUHqzBDVfwtzbSNGIhaPQeDvXI/iCFn2Y 4ySD9B/Zbo+KSB7CHFEaV0ukbVKYZLtmFj2RtoRQ5GZudB8U4+yD/H/TLEyrmCulBjjF S3Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421587; x=1743026387; 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=6jvVAbWtCF4UFk7VFZydpOT77H5oUWGBA+2hIXnrdGo=; b=vwJLqHdvkNBl0L/DzqrAZszaehtNDJjrsnTkzAmRhWsXYfLjRNSdXS7nMwwfBuQZv6 bse5Epy5zWP7L6iftyfv3P43LRxxj2ADbeRvXC2ydO48uRbXBFZGwi4Rir6LOETiFPBu U1qyiRLZA6ubL7z+vyvOFadGhVErUEIla5FgknzakCKcYS5IG1x4r98mGH6XfwcIa4MT mqe5nO/GOfZovNy+rgZ1H0ikd0E2wijVRdrOSGk//Kpj/keEOOTauKKCh4BSbEro77de 27ihQfTqfBlUnVzT2U9Z1TX+xX2A+jYrA4ONjRHx5Hf/EsYSfDkjClGlkzebzGY/Y1FB fUmQ== X-Forwarded-Encrypted: i=1; AJvYcCVbg2d6aOK2kz5HHZj9VgrRH2EZCMJ49Mx+b5qsdeghar7laIHkObx2xhDivyPyf1xQXyCIAG0fXSvqgyE=@vger.kernel.org X-Gm-Message-State: AOJu0YwsUDJOokVkS1rdsbvuYIz22oQrpF7p8LfUNnsDl1xCpxRP9j0i lcaz/jjT/pegrtBIWhlvMi/YBKEgGw/WQf+qdXVEP1stgkpAatXkpBMAgDUU3w== X-Gm-Gg: ASbGncskN26rR0U5UqnKxDa4ksFOk8QXgvL5MMqj4VASt8jHsyx57TrmWEgz1bE+09g huNxuMKz+fjNRtHaBg5T/Is9DtbieNLd69fZQxjbd1gnLWHAtO8c/hpXruzqHDNHYuwSkuZ4sv6 R2gRoMjJnHkkedR/5HEZw62xmZPbZRpaD0yjgwgOU3dgFW0jo2cGlGfFM0949wtttXvZW3isjFl IbcMs/6BBGmaiJefhAl5GkqYOY0KJTqClzuSA39L1X9QiVL2RAOMDWpLHHWnOUtbbijLgjh82KR IeD8Ts++2/5YR2KFxWc2CwvFUII/MW3dIWZox8GZuU1UPVQeA6HMQyte5Zqhr/DITB1kHFNZT0r HE5Au5YAzsA== X-Google-Smtp-Source: AGHT+IE/WxDPhpSJnUoHA5HSJMxQdaYFmPalzo1sj8bjoPh17FHSDlZv6vk5LD5jrwaB0CmQGdqyfA== X-Received: by 2002:a05:6a20:7347:b0:1f5:679a:226c with SMTP id adf61e73a8af0-1fbeb3a00f3mr6582212637.5.1742421586908; Wed, 19 Mar 2025 14:59:46 -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-737115781fesm12172738b3a.77.2025.03.19.14.59.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:46 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 08/20] staging: gpib: fmh_gpib: struct gpib_board Date: Wed, 19 Mar 2025 21:59:12 +0000 Message-ID: <20250319215924.19387-9-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 122 ++++++++++++----------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpi= b/fmh_gpib/fmh_gpib.c index 3e8ad8aa332f..f6bf127441f8 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -32,19 +32,21 @@ MODULE_DESCRIPTION("GPIB Driver for fmh_gpib_core"); MODULE_AUTHOR("Frank Mori Hess "); =20 static irqreturn_t fmh_gpib_interrupt(int irq, void *arg); -static int fmh_gpib_attach_holdoff_all(gpib_board_t *board, const gpib_boa= rd_config_t *config); -static int fmh_gpib_attach_holdoff_end(gpib_board_t *board, const gpib_boa= rd_config_t *config); -static void fmh_gpib_detach(gpib_board_t *board); -static int fmh_gpib_pci_attach_holdoff_all(gpib_board_t *board, const gpib= _board_config_t *config); -static int fmh_gpib_pci_attach_holdoff_end(gpib_board_t *board, const gpib= _board_config_t *config); -static void fmh_gpib_pci_detach(gpib_board_t *board); -static int fmh_gpib_config_dma(gpib_board_t *board, int output); -static irqreturn_t fmh_gpib_internal_interrupt(gpib_board_t *board); +static int fmh_gpib_attach_holdoff_all(struct gpib_board *board, const gpi= b_board_config_t *config); +static int fmh_gpib_attach_holdoff_end(struct gpib_board *board, const gpi= b_board_config_t *config); +static void fmh_gpib_detach(struct gpib_board *board); +static int fmh_gpib_pci_attach_holdoff_all(struct gpib_board *board, + const gpib_board_config_t *config); +static int fmh_gpib_pci_attach_holdoff_end(struct gpib_board *board, + const gpib_board_config_t *config); +static void fmh_gpib_pci_detach(struct gpib_board *board); +static int fmh_gpib_config_dma(struct gpib_board *board, int output); +static irqreturn_t fmh_gpib_internal_interrupt(struct gpib_board *board); static struct platform_driver fmh_gpib_platform_driver; static struct pci_driver fmh_gpib_pci_driver; =20 // wrappers for interface functions -static int fmh_gpib_read(gpib_board_t *board, uint8_t *buffer, size_t leng= th, +static int fmh_gpib_read(struct gpib_board *board, uint8_t *buffer, size_t= length, int *end, size_t *bytes_read) { struct fmh_priv *priv =3D board->private_data; @@ -52,7 +54,7 @@ static int fmh_gpib_read(gpib_board_t *board, uint8_t *bu= ffer, size_t length, return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, byte= s_read); } =20 -static int fmh_gpib_write(gpib_board_t *board, uint8_t *buffer, size_t len= gth, +static int fmh_gpib_write(struct gpib_board *board, uint8_t *buffer, size_= t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *priv =3D board->private_data; @@ -60,7 +62,7 @@ static int fmh_gpib_write(gpib_board_t *board, uint8_t *b= uffer, size_t length, return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int fmh_gpib_command(gpib_board_t *board, uint8_t *buffer, size_t l= ength, +static int fmh_gpib_command(struct gpib_board *board, uint8_t *buffer, siz= e_t length, size_t *bytes_written) { struct fmh_priv *priv =3D board->private_data; @@ -68,21 +70,21 @@ static int fmh_gpib_command(gpib_board_t *board, uint8_= t *buffer, size_t length, return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_= written); } =20 -static int fmh_gpib_take_control(gpib_board_t *board, int synchronous) +static int fmh_gpib_take_control(struct gpib_board *board, int synchronous) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } =20 -static int fmh_gpib_go_to_standby(gpib_board_t *board) +static int fmh_gpib_go_to_standby(struct gpib_board *board) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_go_to_standby(board, &priv->nec7210_priv); } =20 -static void fmh_gpib_request_system_control(gpib_board_t *board, int reque= st_control) +static void fmh_gpib_request_system_control(struct gpib_board *board, int = request_control) { struct fmh_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -90,77 +92,77 @@ static void fmh_gpib_request_system_control(gpib_board_= t *board, int request_con nec7210_request_system_control(board, nec_priv, request_control); } =20 -static void fmh_gpib_interface_clear(gpib_board_t *board, int assert) +static void fmh_gpib_interface_clear(struct gpib_board *board, int assert) { struct fmh_priv *priv =3D board->private_data; =20 nec7210_interface_clear(board, &priv->nec7210_priv, assert); } =20 -static void fmh_gpib_remote_enable(gpib_board_t *board, int enable) +static void fmh_gpib_remote_enable(struct gpib_board *board, int enable) { struct fmh_priv *priv =3D board->private_data; =20 nec7210_remote_enable(board, &priv->nec7210_priv, enable); } =20 -static int fmh_gpib_enable_eos(gpib_board_t *board, uint8_t eos_byte, int = compare_8_bits) +static int fmh_gpib_enable_eos(struct gpib_board *board, uint8_t eos_byte,= int compare_8_bits) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8= _bits); } =20 -static void fmh_gpib_disable_eos(gpib_board_t *board) +static void fmh_gpib_disable_eos(struct gpib_board *board) { struct fmh_priv *priv =3D board->private_data; =20 nec7210_disable_eos(board, &priv->nec7210_priv); } =20 -static unsigned int fmh_gpib_update_status(gpib_board_t *board, unsigned i= nt clear_mask) +static unsigned int fmh_gpib_update_status(struct gpib_board *board, unsig= ned int clear_mask) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } =20 -static int fmh_gpib_primary_address(gpib_board_t *board, unsigned int addr= ess) +static int fmh_gpib_primary_address(struct gpib_board *board, unsigned int= address) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_primary_address(board, &priv->nec7210_priv, address); } =20 -static int fmh_gpib_secondary_address(gpib_board_t *board, unsigned int ad= dress, int enable) +static int fmh_gpib_secondary_address(struct gpib_board *board, unsigned i= nt address, int enable) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_secondary_address(board, &priv->nec7210_priv, address, ena= ble); } =20 -static int fmh_gpib_parallel_poll(gpib_board_t *board, uint8_t *result) +static int fmh_gpib_parallel_poll(struct gpib_board *board, uint8_t *resul= t) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } =20 -static void fmh_gpib_parallel_poll_configure(gpib_board_t *board, uint8_t = configuration) +static void fmh_gpib_parallel_poll_configure(struct gpib_board *board, uin= t8_t configuration) { struct fmh_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_configure(board, &priv->nec7210_priv, configuration= ); } =20 -static void fmh_gpib_parallel_poll_response(gpib_board_t *board, int ist) +static void fmh_gpib_parallel_poll_response(struct gpib_board *board, int = ist) { struct fmh_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } =20 -static void fmh_gpib_local_parallel_poll_mode(gpib_board_t *board, int loc= al) +static void fmh_gpib_local_parallel_poll_mode(struct gpib_board *board, in= t local) { struct fmh_priv *priv =3D board->private_data; =20 @@ -175,7 +177,7 @@ static void fmh_gpib_local_parallel_poll_mode(gpib_boar= d_t *board, int local) } } =20 -static void fmh_gpib_serial_poll_response2(gpib_board_t *board, uint8_t st= atus, +static void fmh_gpib_serial_poll_response2(struct gpib_board *board, uint8= _t status, int new_reason_for_service) { struct fmh_priv *priv =3D board->private_data; @@ -210,14 +212,14 @@ static void fmh_gpib_serial_poll_response2(gpib_board= _t *board, uint8_t status, spin_unlock_irqrestore(&board->spinlock, flags); } =20 -static uint8_t fmh_gpib_serial_poll_status(gpib_board_t *board) +static uint8_t fmh_gpib_serial_poll_status(struct gpib_board *board) { struct fmh_priv *priv =3D board->private_data; =20 return nec7210_serial_poll_status(board, &priv->nec7210_priv); } =20 -static void fmh_gpib_return_to_local(gpib_board_t *board) +static void fmh_gpib_return_to_local(struct gpib_board *board) { struct fmh_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -227,7 +229,7 @@ static void fmh_gpib_return_to_local(gpib_board_t *boar= d) write_byte(nec_priv, AUX_RTL, AUXMR); } =20 -static int fmh_gpib_line_status(const gpib_board_t *board) +static int fmh_gpib_line_status(const struct gpib_board *board) { int status =3D VALID_ALL; int bsr_bits; @@ -259,7 +261,7 @@ static int fmh_gpib_line_status(const gpib_board_t *boa= rd) return status; } =20 -static unsigned int fmh_gpib_t1_delay(gpib_board_t *board, unsigned int na= no_sec) +static unsigned int fmh_gpib_t1_delay(struct gpib_board *board, unsigned i= nt nano_sec) { struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -276,7 +278,7 @@ static unsigned int fmh_gpib_t1_delay(gpib_board_t *boa= rd, unsigned int nano_sec return retval; } =20 -static int lacs_or_read_ready(gpib_board_t *board) +static int lacs_or_read_ready(struct gpib_board *board) { const struct fmh_priv *e_priv =3D board->private_data; const struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -291,7 +293,7 @@ static int lacs_or_read_ready(gpib_board_t *board) return retval; } =20 -static int wait_for_read(gpib_board_t *board) +static int wait_for_read(struct gpib_board *board) { struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -310,7 +312,7 @@ static int wait_for_read(gpib_board_t *board) return retval; } =20 -static int wait_for_rx_fifo_half_full_or_end(gpib_board_t *board) +static int wait_for_rx_fifo_half_full_or_end(struct gpib_board *board) { struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -333,7 +335,7 @@ static int wait_for_rx_fifo_half_full_or_end(gpib_board= _t *board) =20 /* Wait until the gpib chip is ready to accept a data out byte. */ -static int wait_for_data_out_ready(gpib_board_t *board) +static int wait_for_data_out_ready(struct gpib_board *board) { struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -357,7 +359,7 @@ static int wait_for_data_out_ready(gpib_board_t *board) =20 static void fmh_gpib_dma_callback(void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; unsigned long flags; @@ -389,7 +391,7 @@ static int fmh_gpib_all_bytes_are_sent(struct fmh_priv = *e_priv) return 1; } =20 -static int fmh_gpib_dma_write(gpib_board_t *board, uint8_t *buffer, size_t= length, +static int fmh_gpib_dma_write(struct gpib_board *board, uint8_t *buffer, s= ize_t length, size_t *bytes_written) { struct fmh_priv *e_priv =3D board->private_data; @@ -467,7 +469,7 @@ static int fmh_gpib_dma_write(gpib_board_t *board, uint= 8_t *buffer, size_t lengt return retval; } =20 -static int fmh_gpib_accel_write(gpib_board_t *board, uint8_t *buffer, +static int fmh_gpib_accel_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *e_priv =3D board->private_data; @@ -557,7 +559,7 @@ static int fmh_gpib_get_dma_residue(struct dma_chan *ch= an, dma_cookie_t cookie) return state.residue; } =20 -static int wait_for_tx_fifo_half_empty(gpib_board_t *board) +static int wait_for_tx_fifo_half_empty(struct gpib_board *board) { struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; @@ -582,7 +584,7 @@ static int wait_for_tx_fifo_half_empty(gpib_board_t *bo= ard) /* supports writing a chunk of data whose length must fit into the hardwar= e'd xfer counter, * called in a loop by fmh_gpib_fifo_write() */ -static int fmh_gpib_fifo_write_countable(gpib_board_t *board, uint8_t *buf= fer, +static int fmh_gpib_fifo_write_countable(struct gpib_board *board, uint8_t= *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *e_priv =3D board->private_data; @@ -648,7 +650,7 @@ static int fmh_gpib_fifo_write_countable(gpib_board_t *= board, uint8_t *buffer, return retval; } =20 -static int fmh_gpib_fifo_write(gpib_board_t *board, uint8_t *buffer, size_= t length, +static int fmh_gpib_fifo_write(struct gpib_board *board, uint8_t *buffer, = size_t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *e_priv =3D board->private_data; @@ -695,7 +697,7 @@ static int fmh_gpib_fifo_write(gpib_board_t *board, uin= t8_t *buffer, size_t leng return retval; } =20 -static int fmh_gpib_dma_read(gpib_board_t *board, uint8_t *buffer, +static int fmh_gpib_dma_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv =3D board->private_data; @@ -807,7 +809,7 @@ static int fmh_gpib_dma_read(gpib_board_t *board, uint8= _t *buffer, return retval; } =20 -static void fmh_gpib_release_rfd_holdoff(gpib_board_t *board, struct fmh_p= riv *e_priv) +static void fmh_gpib_release_rfd_holdoff(struct gpib_board *board, struct = fmh_priv *e_priv) { struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; unsigned int ext_status_1; @@ -844,7 +846,7 @@ static void fmh_gpib_release_rfd_holdoff(gpib_board_t *= board, struct fmh_priv *e spin_unlock_irqrestore(&board->spinlock, flags); } =20 -static int fmh_gpib_accel_read(gpib_board_t *board, uint8_t *buffer, size_= t length, +static int fmh_gpib_accel_read(struct gpib_board *board, uint8_t *buffer, = size_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv =3D board->private_data; @@ -894,7 +896,7 @@ static int fmh_gpib_accel_read(gpib_board_t *board, uin= t8_t *buffer, size_t leng /* Read a chunk of data whose length is within the limits of the hardware's * xfer counter. Called in a loop from fmh_gpib_fifo_read(). */ -static int fmh_gpib_fifo_read_countable(gpib_board_t *board, uint8_t *buff= er, +static int fmh_gpib_fifo_read_countable(struct gpib_board *board, uint8_t = *buffer, size_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv =3D board->private_data; @@ -952,7 +954,7 @@ static int fmh_gpib_fifo_read_countable(gpib_board_t *b= oard, uint8_t *buffer, return retval; } =20 -static int fmh_gpib_fifo_read(gpib_board_t *board, uint8_t *buffer, size_t= length, +static int fmh_gpib_fifo_read(struct gpib_board *board, uint8_t *buffer, s= ize_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv =3D board->private_data; @@ -1121,7 +1123,7 @@ static gpib_interface_t fmh_gpib_pci_unaccel_interfac= e =3D { .return_to_local =3D fmh_gpib_return_to_local, }; =20 -irqreturn_t fmh_gpib_internal_interrupt(gpib_board_t *board) +irqreturn_t fmh_gpib_internal_interrupt(struct gpib_board *board) { unsigned int status0, status1, status2, ext_status_1, fifo_status; struct fmh_priv *priv =3D board->private_data; @@ -1211,7 +1213,7 @@ irqreturn_t fmh_gpib_internal_interrupt(gpib_board_t = *board) =20 irqreturn_t fmh_gpib_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; unsigned long flags; irqreturn_t retval; =20 @@ -1221,7 +1223,7 @@ irqreturn_t fmh_gpib_interrupt(int irq, void *arg) return retval; } =20 -static int fmh_gpib_allocate_private(gpib_board_t *board) +static int fmh_gpib_allocate_private(struct gpib_board *board) { struct fmh_priv *priv; =20 @@ -1238,7 +1240,7 @@ static int fmh_gpib_allocate_private(gpib_board_t *bo= ard) return 0; } =20 -static void fmh_gpib_generic_detach(gpib_board_t *board) +static void fmh_gpib_generic_detach(struct gpib_board *board) { if (board->private_data) { struct fmh_priv *e_priv =3D board->private_data; @@ -1252,7 +1254,7 @@ static void fmh_gpib_generic_detach(gpib_board_t *boa= rd) } =20 // generic part of attach functions -static int fmh_gpib_generic_attach(gpib_board_t *board) +static int fmh_gpib_generic_attach(struct gpib_board *board) { struct fmh_priv *e_priv; struct nec7210_priv *nec_priv; @@ -1272,7 +1274,7 @@ static int fmh_gpib_generic_attach(gpib_board_t *boar= d) return 0; } =20 -static int fmh_gpib_config_dma(gpib_board_t *board, int output) +static int fmh_gpib_config_dma(struct gpib_board *board, int output) { struct fmh_priv *e_priv =3D board->private_data; struct dma_slave_config config; @@ -1302,7 +1304,7 @@ static int fmh_gpib_config_dma(gpib_board_t *board, i= nt output) return dmaengine_slave_config(e_priv->dma_channel, &config); } =20 -static int fmh_gpib_init(struct fmh_priv *e_priv, gpib_board_t *board, int= handshake_mode) +static int fmh_gpib_init(struct fmh_priv *e_priv, struct gpib_board *board= , int handshake_mode) { struct nec7210_priv *nec_priv =3D &e_priv->nec7210_priv; unsigned long flags; @@ -1349,7 +1351,7 @@ static int fmh_gpib_device_match(struct device *dev, = const void *data) return 1; } =20 -static int fmh_gpib_attach_impl(gpib_board_t *board, const gpib_board_conf= ig_t *config, +static int fmh_gpib_attach_impl(struct gpib_board *board, const gpib_board= _config_t *config, unsigned int handshake_mode, int acquire_dma) { struct fmh_priv *e_priv; @@ -1452,17 +1454,17 @@ static int fmh_gpib_attach_impl(gpib_board_t *board= , const gpib_board_config_t * return fmh_gpib_init(e_priv, board, handshake_mode); } =20 -int fmh_gpib_attach_holdoff_all(gpib_board_t *board, const gpib_board_conf= ig_t *config) +int fmh_gpib_attach_holdoff_all(struct gpib_board *board, const gpib_board= _config_t *config) { return fmh_gpib_attach_impl(board, config, HR_HLDA, 0); } =20 -int fmh_gpib_attach_holdoff_end(gpib_board_t *board, const gpib_board_conf= ig_t *config) +int fmh_gpib_attach_holdoff_end(struct gpib_board *board, const gpib_board= _config_t *config) { return fmh_gpib_attach_impl(board, config, HR_HLDE, 1); } =20 -void fmh_gpib_detach(gpib_board_t *board) +void fmh_gpib_detach(struct gpib_board *board) { struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -1495,7 +1497,7 @@ void fmh_gpib_detach(gpib_board_t *board) fmh_gpib_generic_detach(board); } =20 -static int fmh_gpib_pci_attach_impl(gpib_board_t *board, const gpib_board_= config_t *config, +static int fmh_gpib_pci_attach_impl(struct gpib_board *board, const gpib_b= oard_config_t *config, unsigned int handshake_mode) { struct fmh_priv *e_priv; @@ -1568,12 +1570,12 @@ static int fmh_gpib_pci_attach_impl(gpib_board_t *b= oard, const gpib_board_config return fmh_gpib_init(e_priv, board, handshake_mode); } =20 -int fmh_gpib_pci_attach_holdoff_all(gpib_board_t *board, const gpib_board_= config_t *config) +int fmh_gpib_pci_attach_holdoff_all(struct gpib_board *board, const gpib_b= oard_config_t *config) { return fmh_gpib_pci_attach_impl(board, config, HR_HLDA); } =20 -int fmh_gpib_pci_attach_holdoff_end(gpib_board_t *board, const gpib_board_= config_t *config) +int fmh_gpib_pci_attach_holdoff_end(struct gpib_board *board, const gpib_b= oard_config_t *config) { int retval; struct fmh_priv *e_priv; @@ -1587,7 +1589,7 @@ int fmh_gpib_pci_attach_holdoff_end(gpib_board_t *boa= rd, const gpib_board_config return retval; } =20 -void fmh_gpib_pci_detach(gpib_board_t *board) +void fmh_gpib_pci_detach(struct gpib_board *board) { struct fmh_priv *e_priv =3D board->private_data; struct nec7210_priv *nec_priv; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 D138E21CFFD for ; Wed, 19 Mar 2025 21:59:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421590; cv=none; b=jhwzxh3+bKPLL0C5sjLB/DlZoYPIbWRXGrvxQoM95zdJYzueYTX0XKi5x93eDc9s0xcI6ZU2j3YuylgwP1gJyCugC8fwyJuFmmvVqtySzvoUVXCpf0AT1nWHKSw2o8BKkfmm8Gzw+wDiuI/d2PUIxSt5XGwuXN22CLngPSTRimY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421590; c=relaxed/simple; bh=L1k/19t8nOGN9eeO0Lyxg8wQ4e+VVpMLI+yb4PhnN0w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oNFNid4O7+3hR1mPshZI/j40QJMVWGgktpw3Z3Hxa7w8C88D2FboSM4Hm1QBfKaQWkxt7Ew02ci9+CFMwkT28U8PM3LSwa7EYJu8CQ2S9m4Ki6aRTzj9gflXBcoUWNsuisvcw91GXU/DnZ2Odd3DrCAC5iN1HwSDEFutE/ozox0= 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=hgA83e9Z; arc=none smtp.client-ip=209.85.216.54 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="hgA83e9Z" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-300fefb8e06so307228a91.0 for ; Wed, 19 Mar 2025 14:59:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421588; x=1743026388; 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=04dsU5r0BWGVu2eJZSpZaOZV/2vvvf2HMuy5ZIcz5Xc=; b=hgA83e9ZrGmDv37GYpIzAoI5/1lNEtf3iZLLl/zjYXAqtgMS8op96wahjxYvZ/xdCf A83R+P1LGGib92l1eS8VQqc8t96WuiOgtj0L4AUhs47iF2/8m/+spTNKg18SQEUj9kFg ZcQhAvKa7KfHft2pWk0e18TI1uKDgcr86metTXBLWlyBDS4qNIT1Hmtlq256tP2Q5uTz q9qucBlWNoyWVk3gU/BpCpgNj/fytYYP7tXxszHEYRwV+IQds6x5L0FtLbT5Q5l+nY1K CqL3yWgbvk7kGSnRDTCiZ1mkTZw9wMer36l/B5fhk5c3lXzKWRglYNzTvSewXOhJJPrF zTpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421588; x=1743026388; 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=04dsU5r0BWGVu2eJZSpZaOZV/2vvvf2HMuy5ZIcz5Xc=; b=fvK8zbGbCU/8U3fW3a4JheXrkDAdiunWUrpG0YsH0vepM6pqlM698f89xxv/VHogev MyUieMvVv0NQOi4St4VIsA9pQeFwwR/kLqJuqOhS4X9HIlDS5PewBE4TdsN2iDL/5TQz qMHLLQAeIQVoNSQUK8R6JZfItPs/vLGsHQNCE3gtQYneaNRQBKc8bA+vEWFG5KSwG8/C dTFOkbQbxKBY8BhP5h3tAhQtevwUwdrDKKyGt/zATM6vf6b7HIrDbxNAwHK/jRTLDZAY sQpo9iG0CqpguhfFuPKE57f0yU7RZ+SuxM6bpjk9lZOr+E1/GhUWv+2JP8WzrTpreiPP lQcw== X-Forwarded-Encrypted: i=1; AJvYcCVrcRgTh3l92SvZybj5dHAbIEMwPKWU8EUuncw5QfqHN42KimfyIISyINQgSHGosYp3G5T8eUYdh1RN9Jo=@vger.kernel.org X-Gm-Message-State: AOJu0YwqhIv5+wamY1NDmsg9r2XqPvv5qVFzCF68eFDzzBwYEq73Je00 nt4+C4EbyfOpU1BcUca3Vf0JKJlkAggMKAkzwLWJ+F3Kghm8kC8OzcCC9W3fgA== X-Gm-Gg: ASbGncuZnBkbZx93VO/sfG3Mb1yfm6zUeR5EA3anPmdY5LmJSYMPUcXh9TxbMA9COTF k49dfzxUtUaqepepnBr0tH8Pb2RIPW/dW088eKEwWsOj1/MQF9V+P57gkl/DW0wp9RbOqe4AQqJ 9HKrHKvw6y5D/vm8lUZOW6i6mDS3Aiej3Y2dnkWE5EnkOgBcSNsQznc/NvbLOZ3gUGQzTrfhpBI jVS0FQOhwsBBSLDx78eiaX6I2tJ8zxy9OCSmTlhgyuN11WytlXQvjfDQ1dMvN/KLs0YRGTS3v9d 5s5kGVSFs4GvFQ/6tlZB2bJIIS3+bWsF0GQ2eGNZhYB9+dkgQPNXT+wbl72c/7Qqs7fzwkVq75a gBAevFltaMg== X-Google-Smtp-Source: AGHT+IHLofUZ1rdmRG30wTO7kU+S2DZQ8/Ihke9Nxn15kz1d/0kKljZkCgMGUa6bmwmbQ+PkGAdBQg== X-Received: by 2002:a17:90b:1650:b0:2f6:dcc9:38e0 with SMTP id 98e67ed59e1d1-301bdca2101mr7427254a91.0.1742421588171; Wed, 19 Mar 2025 14:59:48 -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 98e67ed59e1d1-301bf576884sm2247505a91.1.2025.03.19.14.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:47 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 09/20] staging: gpib: gpio: struct gpib_board Date: Wed, 19 Mar 2025 21:59:13 +0000 Message-ID: <20250319215924.19387-10-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/gpio/gpib_bitbang.c | 72 ++++++++++++------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpi= b/gpio/gpib_bitbang.c index 28c5fa9b81ab..611ff58b94ca 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -318,14 +318,14 @@ struct bb_priv { }; =20 static inline long usec_diff(struct timespec64 *a, struct timespec64 *b); -static void bb_buffer_print(gpib_board_t *board, unsigned char *buffer, si= ze_t length, +static void bb_buffer_print(struct gpib_board *board, unsigned char *buffe= r, size_t length, int cmd, int eoi); static void set_data_lines(u8 byte); static u8 get_data_lines(void); static void set_data_lines_input(void); static void set_data_lines_output(void); static inline int check_for_eos(struct bb_priv *priv, uint8_t byte); -static void set_atn(gpib_board_t *board, int atn_asserted); +static void set_atn(struct gpib_board *board, int atn_asserted); =20 static inline void SET_DIR_WRITE(struct bb_priv *priv); static inline void SET_DIR_READ(struct bb_priv *priv); @@ -353,7 +353,7 @@ static char printable(char x) * * *************************************************************************= **/ =20 -static int bb_read(gpib_board_t *board, uint8_t *buffer, size_t length, +static int bb_read(struct gpib_board *board, uint8_t *buffer, size_t lengt= h, int *end, size_t *bytes_read) { struct bb_priv *priv =3D board->private_data; @@ -425,7 +425,7 @@ static int bb_read(gpib_board_t *board, uint8_t *buffer= , size_t length, =20 static irqreturn_t bb_DAV_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct bb_priv *priv =3D board->private_data; int val; unsigned long flags; @@ -491,7 +491,7 @@ static irqreturn_t bb_DAV_interrupt(int irq, void *arg) * * *************************************************************************= **/ =20 -static int bb_write(gpib_board_t *board, uint8_t *buffer, size_t length, +static int bb_write(struct gpib_board *board, uint8_t *buffer, size_t leng= th, int send_eoi, size_t *bytes_written) { unsigned long flags; @@ -580,7 +580,7 @@ static int bb_write(gpib_board_t *board, uint8_t *buffe= r, size_t length, =20 static irqreturn_t bb_NRFD_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct bb_priv *priv =3D board->private_data; unsigned long flags; int nrfd; @@ -653,7 +653,7 @@ static irqreturn_t bb_NRFD_interrupt(int irq, void *arg) =20 static irqreturn_t bb_NDAC_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct bb_priv *priv =3D board->private_data; unsigned long flags; int ndac; @@ -714,7 +714,7 @@ static irqreturn_t bb_NDAC_interrupt(int irq, void *arg) =20 static irqreturn_t bb_SRQ_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; =20 int val =3D gpiod_get_value(SRQ); =20 @@ -728,7 +728,7 @@ static irqreturn_t bb_SRQ_interrupt(int irq, void *arg) return IRQ_HANDLED; } =20 -static int bb_command(gpib_board_t *board, uint8_t *buffer, +static int bb_command(struct gpib_board *board, uint8_t *buffer, size_t length, size_t *bytes_written) { size_t ret; @@ -809,7 +809,7 @@ static char *cmd_string[32] =3D { "CFE" // 0x1f }; =20 -static void bb_buffer_print(gpib_board_t *board, unsigned char *buffer, si= ze_t length, +static void bb_buffer_print(struct gpib_board *board, unsigned char *buffe= r, size_t length, int cmd, int eoi) { int i; @@ -842,7 +842,7 @@ static void bb_buffer_print(gpib_board_t *board, unsign= ed char *buffer, size_t l * STATUS Management * * * *************************************************************************= **/ -static void set_atn(gpib_board_t *board, int atn_asserted) +static void set_atn(struct gpib_board *board, int atn_asserted) { struct bb_priv *priv =3D board->private_data; =20 @@ -867,7 +867,7 @@ static void set_atn(gpib_board_t *board, int atn_assert= ed) priv->atn_asserted =3D atn_asserted; } =20 -static int bb_take_control(gpib_board_t *board, int synchronous) +static int bb_take_control(struct gpib_board *board, int synchronous) { dbg_printk(2, "%d\n", synchronous); set_atn(board, 1); @@ -875,14 +875,14 @@ static int bb_take_control(gpib_board_t *board, int s= ynchronous) return 0; } =20 -static int bb_go_to_standby(gpib_board_t *board) +static int bb_go_to_standby(struct gpib_board *board) { dbg_printk(2, "\n"); set_atn(board, 0); return 0; } =20 -static void bb_request_system_control(gpib_board_t *board, int request_con= trol) +static void bb_request_system_control(struct gpib_board *board, int reques= t_control) { dbg_printk(2, "%d\n", request_control); if (request_control) { @@ -894,7 +894,7 @@ static void bb_request_system_control(gpib_board_t *boa= rd, int request_control) } } =20 -static void bb_interface_clear(gpib_board_t *board, int assert) +static void bb_interface_clear(struct gpib_board *board, int assert) { struct bb_priv *priv =3D board->private_data; =20 @@ -908,7 +908,7 @@ static void bb_interface_clear(gpib_board_t *board, int= assert) } } =20 -static void bb_remote_enable(gpib_board_t *board, int enable) +static void bb_remote_enable(struct gpib_board *board, int enable) { dbg_printk(2, "%d\n", enable); if (enable) { @@ -920,7 +920,7 @@ static void bb_remote_enable(gpib_board_t *board, int e= nable) } } =20 -static int bb_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compar= e_8_bits) +static int bb_enable_eos(struct gpib_board *board, uint8_t eos_byte, int c= ompare_8_bits) { struct bb_priv *priv =3D board->private_data; =20 @@ -933,7 +933,7 @@ static int bb_enable_eos(gpib_board_t *board, uint8_t e= os_byte, int compare_8_bi return 0; } =20 -static void bb_disable_eos(gpib_board_t *board) +static void bb_disable_eos(struct gpib_board *board) { struct bb_priv *priv =3D board->private_data; =20 @@ -941,7 +941,7 @@ static void bb_disable_eos(gpib_board_t *board) priv->eos_flags &=3D ~REOS; } =20 -static unsigned int bb_update_status(gpib_board_t *board, unsigned int cle= ar_mask) +static unsigned int bb_update_status(struct gpib_board *board, unsigned in= t clear_mask) { struct bb_priv *priv =3D board->private_data; =20 @@ -972,14 +972,14 @@ static unsigned int bb_update_status(gpib_board_t *bo= ard, unsigned int clear_mas return board->status; } =20 -static int bb_primary_address(gpib_board_t *board, unsigned int address) +static int bb_primary_address(struct gpib_board *board, unsigned int addre= ss) { dbg_printk(2, "%d\n", address); board->pad =3D address; return 0; } =20 -static int bb_secondary_address(gpib_board_t *board, unsigned int address,= int enable) +static int bb_secondary_address(struct gpib_board *board, unsigned int add= ress, int enable) { dbg_printk(2, "%d %d\n", address, enable); if (enable) @@ -987,29 +987,29 @@ static int bb_secondary_address(gpib_board_t *board, = unsigned int address, int e return 0; } =20 -static int bb_parallel_poll(gpib_board_t *board, uint8_t *result) +static int bb_parallel_poll(struct gpib_board *board, uint8_t *result) { return -ENOENT; } =20 -static void bb_parallel_poll_configure(gpib_board_t *board, uint8_t config) +static void bb_parallel_poll_configure(struct gpib_board *board, uint8_t c= onfig) { } =20 -static void bb_parallel_poll_response(gpib_board_t *board, int ist) +static void bb_parallel_poll_response(struct gpib_board *board, int ist) { } =20 -static void bb_serial_poll_response(gpib_board_t *board, uint8_t status) +static void bb_serial_poll_response(struct gpib_board *board, uint8_t stat= us) { } =20 -static uint8_t bb_serial_poll_status(gpib_board_t *board) +static uint8_t bb_serial_poll_status(struct gpib_board *board) { return 0; // -ENOENT; } =20 -static unsigned int bb_t1_delay(gpib_board_t *board, unsigned int nano_se= c) +static unsigned int bb_t1_delay(struct gpib_board *board, unsigned int na= no_sec) { struct bb_priv *priv =3D board->private_data; =20 @@ -1025,11 +1025,11 @@ static unsigned int bb_t1_delay(gpib_board_t *board= , unsigned int nano_sec) return priv->t1_delay; } =20 -static void bb_return_to_local(gpib_board_t *board) +static void bb_return_to_local(struct gpib_board *board) { } =20 -static int bb_line_status(const gpib_board_t *board) +static int bb_line_status(const struct gpib_board *board) { int line_status =3D VALID_ALL; =20 @@ -1061,7 +1061,7 @@ static int bb_line_status(const gpib_board_t *board) * * *************************************************************************= **/ =20 -static int allocate_private(gpib_board_t *board) +static int allocate_private(struct gpib_board *board) { board->private_data =3D kzalloc(sizeof(struct bb_priv), GFP_KERNEL); if (!board->private_data) @@ -1069,13 +1069,13 @@ static int allocate_private(gpib_board_t *board) return 0; } =20 -static void free_private(gpib_board_t *board) +static void free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 -static int bb_get_irq(gpib_board_t *board, char *name, +static int bb_get_irq(struct gpib_board *board, char *name, struct gpio_desc *gpio, int *irq, irq_handler_t handler, irq_handler_t thread_fn, unsigned long flag= s) { @@ -1097,7 +1097,7 @@ static int bb_get_irq(gpib_board_t *board, char *name, return 0; } =20 -static void bb_free_irq(gpib_board_t *board, int *irq, char *name) +static void bb_free_irq(struct gpib_board *board, int *irq, char *name) { if (*irq) { free_irq(*irq, board); @@ -1118,7 +1118,7 @@ static void release_gpios(void) } } =20 -static int allocate_gpios(gpib_board_t *board) +static int allocate_gpios(struct gpib_board *board) { int j, retval =3D 0; bool error =3D false; @@ -1176,7 +1176,7 @@ static int allocate_gpios(gpib_board_t *board) return retval; } =20 -static void bb_detach(gpib_board_t *board) +static void bb_detach(struct gpib_board *board) { struct bb_priv *priv =3D board->private_data; =20 @@ -1206,7 +1206,7 @@ static void bb_detach(gpib_board_t *board) free_private(board); } =20 -static int bb_attach(gpib_board_t *board, const gpib_board_config_t *confi= g) +static int bb_attach(struct gpib_board *board, const gpib_board_config_t *= config) { struct bb_priv *priv; int retval =3D 0; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 4A0D0219A7E for ; Wed, 19 Mar 2025 21:59:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421592; cv=none; b=AR2pX60Ud9mnWcip7Y+YoFOtXtQ4SphidM54tOVqLAnSxFikII3YDbEFb9L8LKgWI/D/kQb2P6fulkJRG6cLBJu41mBEAcRRRsMkXW0ZP/T9v8UeooIqocxatezARWqJI9FEgirprq2fbjTSbhp7kr2lrYsMMmX3SQ1fsao8kbI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421592; c=relaxed/simple; bh=Fw4a9mlnKOTNcdiM0fswp36qHY5x+EfCvi/48WgyqWY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RhIytUu0k1nlyewb+OR7YUIHrr+FB60lkM5N9r3z1Leg/gu8hliIHmpAwUfNYLr8JbXTJQAdtf0LDAvsNa17J+3ZJf3usPu+ergzbM15GQM8c9b7IqE7HOIBzan/j4giiJ5CwqnbnRnF1iThrdovwJaLNoneCeTcaf79N5MD9wo= 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=XEYVTidn; arc=none smtp.client-ip=209.85.214.169 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="XEYVTidn" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-22548a28d0cso1160955ad.3 for ; Wed, 19 Mar 2025 14:59:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421589; x=1743026389; 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=Uy7IplSbVwpQnJVRuVqNjgdWMp+XadaNyfeEyd6Aua4=; b=XEYVTidn/zxmNRnDySYNqmJNZtmRb7PCHaEgH8APCVbZ2vSpJxqDMq5vzYc18zA5uT 1v9WmuCxXYmpRQd7Pfk/g3L+WeWEePw6yKPf/iJotm3hvzLP5YgM9VFeZ+RtcGUUwNQI OBc518oM8GEbdkTr/ny348Puugp2Ln5pGKv43a+GBGIoNriOZfHFXTFkEAB6hmEiS9Zh U80dLMOUaQjzTUiU/dA0coX9rKZuKycyWZzs2XwygXBiLl+on6D5GRvzxhONoB7aokpF Khe6NoxkYtMOf81Frfp5oEwvgaqUzNYPLgGVEU4kSf8E5m6iEcanKgGjG3E7TmM6drMM bxxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421589; x=1743026389; 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=Uy7IplSbVwpQnJVRuVqNjgdWMp+XadaNyfeEyd6Aua4=; b=qAkfURvlBp8EouU1JgBDxPxnQxBFc4p4+EFaEwKEDXFgmf1EIFZQg5vDTEH1AIKred 0b0XXxUtwQuCEsu4MWhXeGQdKdFMjh3SJThB/qTi1rWrivBuxCDmIE4a0PW+D5xaEdGu Y4A1RLgcZblCybu5xsEFCWsMfT8lZ+8ZZJHDpJtULSSSfAa8zIWfI1lOM2S9RkGNcR0j DrphFvIU5q9e+cXn4lDfvaYilgXBc0ZYJTqHxa4ByxJ6DBGRo7Z/UxtjBjN73D3JAmO+ K4ZMeyDvCR6xu1zMtb1CoVKklyGEKmfKW0AvzIDkR2N1JuE3KobZnDrKdtroGa0jYKq9 Dreg== X-Forwarded-Encrypted: i=1; AJvYcCUrjFXcvX2oT5IT9+UxP3jiQ3vIrAUvb3g3XIE91v25FKMAC1mccqOiNd9qNYsG58W0XQu/o6XB4ZzjspA=@vger.kernel.org X-Gm-Message-State: AOJu0YyC7xcRPZ6xmSgAlLPXbxK2g8Y+wcogZYZiaI5HxGmw44Vgilfj Mydkdi4hOu2eV7AsREDLbXmJZ2BfQcgXiTRnv/L/YjFAiBTUuF7BMgRLZ51ltA== X-Gm-Gg: ASbGncsEB3jy45k88xuJAn+nRFhzUIopLbRSfPgdrQsliKqyKPg90ZcBrSO4IvroqeR YpBrhc1k+ysSh63dYIFqzflfUZsnB5SwVCeezFdGyQgFjVz4prx8xRU6Sa02MYShjL+mrste9n9 LF1ZJ6227gkHqoNxTNlVOUuERXUj4odALiLleo8v2GbDTGM5B/Fc9ITe2UJocyp76JVt+ZlhKlu Oe0K3sW7sI4R4axh5F1+/euiSe4LMXklLIYL6rewjhGSw84miZ/NOwH8us99X8HKvW3N+mXIvN0 YhSUip3R2Ov36hYPGn8F8Og7IvNa7pS4o0m4GK7qTE9U473k9ShBIkmvNTJylpRbmCmy2aLBm7K ETQ3WhibDiA== X-Google-Smtp-Source: AGHT+IGlGp+Tgp4LzxeXuHM5RYUmkEn3xQFe8FyDBR/GUioIdO+tPqN9bQ5tM2rVodSFNkYenoFTDA== X-Received: by 2002:a05:6a20:914b:b0:1f5:8eb1:d5d2 with SMTP id adf61e73a8af0-1fd117fd115mr1298491637.13.1742421589459; Wed, 19 Mar 2025 14:59:49 -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-af56ea93c84sm11463587a12.64.2025.03.19.14.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:49 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 10/20] staging: gpib: hp2335: struct gpib_board Date: Wed, 19 Mar 2025 21:59:14 +0000 Message-ID: <20250319215924.19387-11-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/hp_82335/hp82335.c | 56 ++++++++++++------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib= /hp_82335/hp82335.c index 982544d1b382..368e60c6ecd2 100644 --- a/drivers/staging/gpib/hp_82335/hp82335.c +++ b/drivers/staging/gpib/hp_82335/hp82335.c @@ -24,12 +24,12 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for HP 82335 interface cards"); =20 -static int hp82335_attach(gpib_board_t *board, const gpib_board_config_t *= config); -static void hp82335_detach(gpib_board_t *board); +static int hp82335_attach(struct gpib_board *board, const gpib_board_confi= g_t *config); +static void hp82335_detach(struct gpib_board *board); static irqreturn_t hp82335_interrupt(int irq, void *arg); =20 // wrappers for interface functions -static int hp82335_read(gpib_board_t *board, uint8_t *buffer, size_t lengt= h, +static int hp82335_read(struct gpib_board *board, uint8_t *buffer, size_t = length, int *end, size_t *bytes_read) { struct hp82335_priv *priv =3D board->private_data; @@ -37,7 +37,7 @@ static int hp82335_read(gpib_board_t *board, uint8_t *buf= fer, size_t length, return tms9914_read(board, &priv->tms9914_priv, buffer, length, end, byte= s_read); } =20 -static int hp82335_write(gpib_board_t *board, uint8_t *buffer, size_t leng= th, int send_eoi, +static int hp82335_write(struct gpib_board *board, uint8_t *buffer, size_t= length, int send_eoi, size_t *bytes_written) { struct hp82335_priv *priv =3D board->private_data; @@ -45,7 +45,7 @@ static int hp82335_write(gpib_board_t *board, uint8_t *bu= ffer, size_t length, in return tms9914_write(board, &priv->tms9914_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int hp82335_command(gpib_board_t *board, uint8_t *buffer, size_t le= ngth, +static int hp82335_command(struct gpib_board *board, uint8_t *buffer, size= _t length, size_t *bytes_written) { struct hp82335_priv *priv =3D board->private_data; @@ -53,126 +53,126 @@ static int hp82335_command(gpib_board_t *board, uint8= _t *buffer, size_t length, return tms9914_command(board, &priv->tms9914_priv, buffer, length, bytes_= written); } =20 -static int hp82335_take_control(gpib_board_t *board, int synchronous) +static int hp82335_take_control(struct gpib_board *board, int synchronous) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_take_control(board, &priv->tms9914_priv, synchronous); } =20 -static int hp82335_go_to_standby(gpib_board_t *board) +static int hp82335_go_to_standby(struct gpib_board *board) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_go_to_standby(board, &priv->tms9914_priv); } =20 -static void hp82335_request_system_control(gpib_board_t *board, int reques= t_control) +static void hp82335_request_system_control(struct gpib_board *board, int r= equest_control) { struct hp82335_priv *priv =3D board->private_data; =20 tms9914_request_system_control(board, &priv->tms9914_priv, request_contro= l); } =20 -static void hp82335_interface_clear(gpib_board_t *board, int assert) +static void hp82335_interface_clear(struct gpib_board *board, int assert) { struct hp82335_priv *priv =3D board->private_data; =20 tms9914_interface_clear(board, &priv->tms9914_priv, assert); } =20 -static void hp82335_remote_enable(gpib_board_t *board, int enable) +static void hp82335_remote_enable(struct gpib_board *board, int enable) { struct hp82335_priv *priv =3D board->private_data; =20 tms9914_remote_enable(board, &priv->tms9914_priv, enable); } =20 -static int hp82335_enable_eos(gpib_board_t *board, uint8_t eos_byte, int c= ompare_8_bits) +static int hp82335_enable_eos(struct gpib_board *board, uint8_t eos_byte, = int compare_8_bits) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_enable_eos(board, &priv->tms9914_priv, eos_byte, compare_8= _bits); } =20 -static void hp82335_disable_eos(gpib_board_t *board) +static void hp82335_disable_eos(struct gpib_board *board) { struct hp82335_priv *priv =3D board->private_data; =20 tms9914_disable_eos(board, &priv->tms9914_priv); } =20 -static unsigned int hp82335_update_status(gpib_board_t *board, unsigned in= t clear_mask) +static unsigned int hp82335_update_status(struct gpib_board *board, unsign= ed int clear_mask) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_update_status(board, &priv->tms9914_priv, clear_mask); } =20 -static int hp82335_primary_address(gpib_board_t *board, unsigned int addre= ss) +static int hp82335_primary_address(struct gpib_board *board, unsigned int = address) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_primary_address(board, &priv->tms9914_priv, address); } =20 -static int hp82335_secondary_address(gpib_board_t *board, unsigned int add= ress, int enable) +static int hp82335_secondary_address(struct gpib_board *board, unsigned in= t address, int enable) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_secondary_address(board, &priv->tms9914_priv, address, ena= ble); } =20 -static int hp82335_parallel_poll(gpib_board_t *board, uint8_t *result) +static int hp82335_parallel_poll(struct gpib_board *board, uint8_t *result) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_parallel_poll(board, &priv->tms9914_priv, result); } =20 -static void hp82335_parallel_poll_configure(gpib_board_t *board, uint8_t c= onfig) +static void hp82335_parallel_poll_configure(struct gpib_board *board, uint= 8_t config) { struct hp82335_priv *priv =3D board->private_data; =20 tms9914_parallel_poll_configure(board, &priv->tms9914_priv, config); } =20 -static void hp82335_parallel_poll_response(gpib_board_t *board, int ist) +static void hp82335_parallel_poll_response(struct gpib_board *board, int i= st) { struct hp82335_priv *priv =3D board->private_data; =20 tms9914_parallel_poll_response(board, &priv->tms9914_priv, ist); } =20 -static void hp82335_serial_poll_response(gpib_board_t *board, uint8_t stat= us) +static void hp82335_serial_poll_response(struct gpib_board *board, uint8_t= status) { struct hp82335_priv *priv =3D board->private_data; =20 tms9914_serial_poll_response(board, &priv->tms9914_priv, status); } =20 -static uint8_t hp82335_serial_poll_status(gpib_board_t *board) +static uint8_t hp82335_serial_poll_status(struct gpib_board *board) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_serial_poll_status(board, &priv->tms9914_priv); } =20 -static int hp82335_line_status(const gpib_board_t *board) +static int hp82335_line_status(const struct gpib_board *board) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_line_status(board, &priv->tms9914_priv); } =20 -static unsigned int hp82335_t1_delay(gpib_board_t *board, unsigned int nan= o_sec) +static unsigned int hp82335_t1_delay(struct gpib_board *board, unsigned in= t nano_sec) { struct hp82335_priv *priv =3D board->private_data; =20 return tms9914_t1_delay(board, &priv->tms9914_priv, nano_sec); } =20 -static void hp82335_return_to_local(gpib_board_t *board) +static void hp82335_return_to_local(struct gpib_board *board) { struct hp82335_priv *priv =3D board->private_data; =20 @@ -207,7 +207,7 @@ static gpib_interface_t hp82335_interface =3D { .return_to_local =3D hp82335_return_to_local, }; =20 -static int hp82335_allocate_private(gpib_board_t *board) +static int hp82335_allocate_private(struct gpib_board *board) { board->private_data =3D kzalloc(sizeof(struct hp82335_priv), GFP_KERNEL); if (!board->private_data) @@ -215,7 +215,7 @@ static int hp82335_allocate_private(gpib_board_t *board) return 0; } =20 -static void hp82335_free_private(gpib_board_t *board) +static void hp82335_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; @@ -243,7 +243,7 @@ static void hp82335_clear_interrupt(struct hp82335_priv= *hp_priv) writeb(0, tms_priv->mmiobase + HPREG_INTR_CLEAR); } =20 -static int hp82335_attach(gpib_board_t *board, const gpib_board_config_t *= config) +static int hp82335_attach(struct gpib_board *board, const gpib_board_confi= g_t *config) { struct hp82335_priv *hp_priv; struct tms9914_priv *tms_priv; @@ -307,7 +307,7 @@ static int hp82335_attach(gpib_board_t *board, const gp= ib_board_config_t *config return 0; } =20 -static void hp82335_detach(gpib_board_t *board) +static void hp82335_detach(struct gpib_board *board) { struct hp82335_priv *hp_priv =3D board->private_data; struct tms9914_priv *tms_priv; @@ -354,7 +354,7 @@ module_exit(hp82335_exit_module); static irqreturn_t hp82335_interrupt(int irq, void *arg) { int status1, status2; - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct hp82335_priv *priv =3D board->private_data; unsigned long flags; irqreturn_t retval; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 59B3421D3FB for ; Wed, 19 Mar 2025 21:59:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421593; cv=none; b=lwGImBgpRPYe4kUu43U+aZxxQTglM9chmq/cktNAp4snsscam72HAI98RrHJqGhfsicVEnIxpzm2WGwAisEurGITuVz+bpH24vjFtFTX4vW53P/T8BWild+NBQCUDyFUSCl6E32+u8eTHlkgdKpTwb1iBTYP1x7BJ/DK/yKhaDE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421593; c=relaxed/simple; bh=5g6Sf9NfdjsJXmBKh3KyKHB2SZ0lFQ4s2X27bBr8Nf8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SQ73fxKNj5/rEoINgRWrnFJ0Ze4xJT7zXkEVZBDsragMAmJbhitozgk6GxbV81gdb6JOZbcJMRZ8i/2cBqZde/jPUYFTRQJlau8NYrrV72hxqGlgfpFoMv0+CHOtHLVCeoCaZLsMVMvXr/ZREr1Yrw0nLiCugmYvE//g5tSydP8= 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=RGPUBWRB; arc=none smtp.client-ip=209.85.214.172 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="RGPUBWRB" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-224100e9a5cso813635ad.2 for ; Wed, 19 Mar 2025 14:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421591; x=1743026391; 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=YCKQI0r92oVQIbs5KyOZNss6g7qyyut7zIXJ7n3pDuY=; b=RGPUBWRBEm16GSUokoJPv3SpdhwFenOGzeUntjA2ed+CAq5Toyn6RNhHgV+ixkrSRX 0ot2wykU2G/1jqRZczO+aLFk182geMm5g+zf6w3MxITBQjGkENL7yM7+fLNL2Ff4ZNLe zcACLTFnzT2vDARi0fuAMc66yhlYMpPxzvJ/m3IPRv0l8tsgwFMzlx07aXQt798/mMAp gWWN0uQ0C+NZiDJoNrjPNqAj4ugGvr8rxGgZyjtpw2L+yC0iS0u9qVAMxMor8rHHjkQn QcPupmgD0biyDhs5CrNbRQMCCq8LRjMbLx/PVCtb/1pZc7ByclU9xTymnBigzFrj6AWe tmQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421591; x=1743026391; 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=YCKQI0r92oVQIbs5KyOZNss6g7qyyut7zIXJ7n3pDuY=; b=u6zHRc9t7A7Ls+9OkwCe+lgtKJpM2TxNzcH5pnjeZLYW3sb0f/WGLCBFomMxk6IR74 bRE23Dj9qNj6/rE3k20AOrFYiwDd7QLZGKyQL62kQcrLH1TfDB9nXCDoFzAeaj63Pd3i WrP3DD1D3yV5Xwu+cEha7ylQOFLNDqy0VFUHjqjRHnzcGq7+Oh/q/ZIxb55BbhQK1E3V PV12FSmiNYLibxDnONcBsT6+dCQlcEbbSqTU/rjGPT9Mx6ei3RC9BIAKYAzmTL0ERnSz sd8Lktj+g/+1du4mAgxPdaBseXvHaM2mUtyCSSrU9/pzQ2PYh/wLGGlCkQwNxcjvKMj9 uMbQ== X-Forwarded-Encrypted: i=1; AJvYcCWqcruOI/g+9yNXglD0kjpQKRoMc5OHQOCQy3FYz8XxE0xYIMgeRIVSR+VfbfBx0CkhuQwFi5uwzgphivI=@vger.kernel.org X-Gm-Message-State: AOJu0YzCFuwz2QEgNxccajMn4bCwOsfBwIWJecUQhDJ0Fb35qI0d2Jd2 nO4ZOvd4xpaTB8+k8Kr3IO8RGuRFmFpTx7rKjENXV95jVbQLakTqpjEC8MalwQ== X-Gm-Gg: ASbGnctR9Z1s9KWPeZJOCZYvzKDR7JMBj9xjERJXbWeuTzFibpXoFYNQNAKH2YccSbs fIZKlWyL2P9fJ0+4pnwMmGC8EbppGvZLc+Y9Z8qhPyM7E1AVJZ5Gr5grzdMD8Je+WWzOk5e1WhH CRfE4eel6mC5Wtp0IiH1s9N19LlTGM9Ay0Fj5Z/zUlD47qTAZ2y4+Jm5zUWwIUInTbKUtuTHYwe 2SDDmuwS7NrcCgPHKtCgPVJJXOrhqvMibHGChd9usxme1QM01e012RmMmy4ftoTMOkzKUYg6c9v LkW6EtAGja1utPQUnDpYu6yfwK//iJBv6S8El893wLJ242kNPRc+RO/dYbmXCUx13byQ0ZpT9MK HdXKXGSSo0A== X-Google-Smtp-Source: AGHT+IFTiK8x2fcvrZXLg62+gdhgLJz5U20mtxdUaGkDEbQpSHldyrbVZlFFWhyEut4dlmT+Y/VOWw== X-Received: by 2002:a17:902:fc4e:b0:223:f9a4:3f9c with SMTP id d9443c01a7336-2265ed68d2emr13999275ad.9.1742421590710; Wed, 19 Mar 2025 14:59:50 -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-225c6bbcdd2sm120315285ad.172.2025.03.19.14.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:50 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 11/20] staging: gpib: hp_82341: struct gpib_board Date: Wed, 19 Mar 2025 21:59:15 +0000 Message-ID: <20250319215924.19387-12-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/hp_82341/hp_82341.c | 68 ++++++++++++------------ 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpi= b/hp_82341/hp_82341.c index b5d79ae519e7..5d76d01f6b32 100644 --- a/drivers/staging/gpib/hp_82341/hp_82341.c +++ b/drivers/staging/gpib/hp_82341/hp_82341.c @@ -22,14 +22,14 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for hp 82341a/b/c/d boards"); =20 -static unsigned short read_and_clear_event_status(gpib_board_t *board); +static unsigned short read_and_clear_event_status(struct gpib_board *board= ); static void set_transfer_counter(struct hp_82341_priv *hp_priv, int count); static int read_transfer_counter(struct hp_82341_priv *hp_priv); -static int hp_82341_write(gpib_board_t *board, uint8_t *buffer, size_t len= gth, int send_eoi, +static int hp_82341_write(struct gpib_board *board, uint8_t *buffer, size_= t length, int send_eoi, size_t *bytes_written); static irqreturn_t hp_82341_interrupt(int irq, void *arg); =20 -static int hp_82341_accel_read(gpib_board_t *board, uint8_t *buffer, size_= t length, int *end, +static int hp_82341_accel_read(struct gpib_board *board, uint8_t *buffer, = size_t length, int *end, size_t *bytes_read) { struct hp_82341_priv *hp_priv =3D board->private_data; @@ -147,7 +147,7 @@ static int hp_82341_accel_read(gpib_board_t *board, uin= t8_t *buffer, size_t leng return 0; } =20 -static int restart_write_fifo(gpib_board_t *board, struct hp_82341_priv *h= p_priv) +static int restart_write_fifo(struct gpib_board *board, struct hp_82341_pr= iv *hp_priv) { struct tms9914_priv *tms_priv =3D &hp_priv->tms9914_priv; =20 @@ -172,7 +172,7 @@ static int restart_write_fifo(gpib_board_t *board, stru= ct hp_82341_priv *hp_priv return 0; } =20 -static int hp_82341_accel_write(gpib_board_t *board, uint8_t *buffer, size= _t length, +static int hp_82341_accel_write(struct gpib_board *board, uint8_t *buffer,= size_t length, int send_eoi, size_t *bytes_written) { struct hp_82341_priv *hp_priv =3D board->private_data; @@ -250,12 +250,12 @@ static int hp_82341_accel_write(gpib_board_t *board, = uint8_t *buffer, size_t len return 0; } =20 -static int hp_82341_attach(gpib_board_t *board, const gpib_board_config_t = *config); +static int hp_82341_attach(struct gpib_board *board, const gpib_board_conf= ig_t *config); =20 -static void hp_82341_detach(gpib_board_t *board); +static void hp_82341_detach(struct gpib_board *board); =20 // wrappers for interface functions -static int hp_82341_read(gpib_board_t *board, uint8_t *buffer, size_t leng= th, int *end, +static int hp_82341_read(struct gpib_board *board, uint8_t *buffer, size_t= length, int *end, size_t *bytes_read) { struct hp_82341_priv *priv =3D board->private_data; @@ -263,7 +263,7 @@ static int hp_82341_read(gpib_board_t *board, uint8_t *= buffer, size_t length, in return tms9914_read(board, &priv->tms9914_priv, buffer, length, end, byte= s_read); } =20 -static int hp_82341_write(gpib_board_t *board, uint8_t *buffer, size_t len= gth, int send_eoi, +static int hp_82341_write(struct gpib_board *board, uint8_t *buffer, size_= t length, int send_eoi, size_t *bytes_written) { struct hp_82341_priv *priv =3D board->private_data; @@ -271,7 +271,7 @@ static int hp_82341_write(gpib_board_t *board, uint8_t = *buffer, size_t length, i return tms9914_write(board, &priv->tms9914_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int hp_82341_command(gpib_board_t *board, uint8_t *buffer, size_t l= ength, +static int hp_82341_command(struct gpib_board *board, uint8_t *buffer, siz= e_t length, size_t *bytes_written) { struct hp_82341_priv *priv =3D board->private_data; @@ -279,21 +279,21 @@ static int hp_82341_command(gpib_board_t *board, uint= 8_t *buffer, size_t length, return tms9914_command(board, &priv->tms9914_priv, buffer, length, bytes_= written); } =20 -static int hp_82341_take_control(gpib_board_t *board, int synchronous) +static int hp_82341_take_control(struct gpib_board *board, int synchronous) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_take_control(board, &priv->tms9914_priv, synchronous); } =20 -static int hp_82341_go_to_standby(gpib_board_t *board) +static int hp_82341_go_to_standby(struct gpib_board *board) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_go_to_standby(board, &priv->tms9914_priv); } =20 -static void hp_82341_request_system_control(gpib_board_t *board, int reque= st_control) +static void hp_82341_request_system_control(struct gpib_board *board, int = request_control) { struct hp_82341_priv *priv =3D board->private_data; =20 @@ -305,105 +305,105 @@ static void hp_82341_request_system_control(gpib_bo= ard_t *board, int request_con tms9914_request_system_control(board, &priv->tms9914_priv, request_contro= l); } =20 -static void hp_82341_interface_clear(gpib_board_t *board, int assert) +static void hp_82341_interface_clear(struct gpib_board *board, int assert) { struct hp_82341_priv *priv =3D board->private_data; =20 tms9914_interface_clear(board, &priv->tms9914_priv, assert); } =20 -static void hp_82341_remote_enable(gpib_board_t *board, int enable) +static void hp_82341_remote_enable(struct gpib_board *board, int enable) { struct hp_82341_priv *priv =3D board->private_data; =20 tms9914_remote_enable(board, &priv->tms9914_priv, enable); } =20 -static int hp_82341_enable_eos(gpib_board_t *board, uint8_t eos_byte, int = compare_8_bits) +static int hp_82341_enable_eos(struct gpib_board *board, uint8_t eos_byte,= int compare_8_bits) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_enable_eos(board, &priv->tms9914_priv, eos_byte, compare_8= _bits); } =20 -static void hp_82341_disable_eos(gpib_board_t *board) +static void hp_82341_disable_eos(struct gpib_board *board) { struct hp_82341_priv *priv =3D board->private_data; =20 tms9914_disable_eos(board, &priv->tms9914_priv); } =20 -static unsigned int hp_82341_update_status(gpib_board_t *board, unsigned i= nt clear_mask) +static unsigned int hp_82341_update_status(struct gpib_board *board, unsig= ned int clear_mask) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_update_status(board, &priv->tms9914_priv, clear_mask); } =20 -static int hp_82341_primary_address(gpib_board_t *board, unsigned int addr= ess) +static int hp_82341_primary_address(struct gpib_board *board, unsigned int= address) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_primary_address(board, &priv->tms9914_priv, address); } =20 -static int hp_82341_secondary_address(gpib_board_t *board, unsigned int ad= dress, int enable) +static int hp_82341_secondary_address(struct gpib_board *board, unsigned i= nt address, int enable) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_secondary_address(board, &priv->tms9914_priv, address, ena= ble); } =20 -static int hp_82341_parallel_poll(gpib_board_t *board, uint8_t *result) +static int hp_82341_parallel_poll(struct gpib_board *board, uint8_t *resul= t) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_parallel_poll(board, &priv->tms9914_priv, result); } =20 -static void hp_82341_parallel_poll_configure(gpib_board_t *board, uint8_t = config) +static void hp_82341_parallel_poll_configure(struct gpib_board *board, uin= t8_t config) { struct hp_82341_priv *priv =3D board->private_data; =20 tms9914_parallel_poll_configure(board, &priv->tms9914_priv, config); } =20 -static void hp_82341_parallel_poll_response(gpib_board_t *board, int ist) +static void hp_82341_parallel_poll_response(struct gpib_board *board, int = ist) { struct hp_82341_priv *priv =3D board->private_data; =20 tms9914_parallel_poll_response(board, &priv->tms9914_priv, ist); } =20 -static void hp_82341_serial_poll_response(gpib_board_t *board, uint8_t sta= tus) +static void hp_82341_serial_poll_response(struct gpib_board *board, uint8_= t status) { struct hp_82341_priv *priv =3D board->private_data; =20 tms9914_serial_poll_response(board, &priv->tms9914_priv, status); } =20 -static uint8_t hp_82341_serial_poll_status(gpib_board_t *board) +static uint8_t hp_82341_serial_poll_status(struct gpib_board *board) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_serial_poll_status(board, &priv->tms9914_priv); } =20 -static int hp_82341_line_status(const gpib_board_t *board) +static int hp_82341_line_status(const struct gpib_board *board) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_line_status(board, &priv->tms9914_priv); } =20 -static unsigned int hp_82341_t1_delay(gpib_board_t *board, unsigned int na= no_sec) +static unsigned int hp_82341_t1_delay(struct gpib_board *board, unsigned i= nt nano_sec) { struct hp_82341_priv *priv =3D board->private_data; =20 return tms9914_t1_delay(board, &priv->tms9914_priv, nano_sec); } =20 -static void hp_82341_return_to_local(gpib_board_t *board) +static void hp_82341_return_to_local(struct gpib_board *board) { struct hp_82341_priv *priv =3D board->private_data; =20 @@ -465,7 +465,7 @@ static gpib_interface_t hp_82341_interface =3D { .return_to_local =3D hp_82341_return_to_local, }; =20 -static int hp_82341_allocate_private(gpib_board_t *board) +static int hp_82341_allocate_private(struct gpib_board *board) { board->private_data =3D kzalloc(sizeof(struct hp_82341_priv), GFP_KERNEL); if (!board->private_data) @@ -473,7 +473,7 @@ static int hp_82341_allocate_private(gpib_board_t *boar= d) return 0; } =20 -static void hp_82341_free_private(gpib_board_t *board) +static void hp_82341_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; @@ -686,7 +686,7 @@ static int clear_xilinx(struct hp_82341_priv *hp_priv) return 0; } =20 -static int hp_82341_attach(gpib_board_t *board, const gpib_board_config_t = *config) +static int hp_82341_attach(struct gpib_board *board, const gpib_board_conf= ig_t *config) { struct hp_82341_priv *hp_priv; struct tms9914_priv *tms_priv; @@ -778,7 +778,7 @@ static int hp_82341_attach(gpib_board_t *board, const g= pib_board_config_t *confi return 0; } =20 -static void hp_82341_detach(gpib_board_t *board) +static void hp_82341_detach(struct gpib_board *board) { struct hp_82341_priv *hp_priv =3D board->private_data; struct tms9914_priv *tms_priv; @@ -844,7 +844,7 @@ module_exit(hp_82341_exit_module); /* * GPIB interrupt service routines */ -static unsigned short read_and_clear_event_status(gpib_board_t *board) +static unsigned short read_and_clear_event_status(struct gpib_board *board) { struct hp_82341_priv *hp_priv =3D board->private_data; unsigned long flags; @@ -860,7 +860,7 @@ static unsigned short read_and_clear_event_status(gpib_= board_t *board) static irqreturn_t hp_82341_interrupt(int irq, void *arg) { int status1, status2; - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct hp_82341_priv *hp_priv =3D board->private_data; struct tms9914_priv *tms_priv =3D &hp_priv->tms9914_priv; unsigned long flags; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 B701321E0A6 for ; Wed, 19 Mar 2025 21:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421595; cv=none; b=msla10i4JL67jkfi3iBtbNIMKNSZyfnKRJTTJ5zUBL42jAbNLPU2rVMICVLcwTwOmR5ypIg6dUdZEnSm4M4d3NlvTVk8CwYbaLxik4ayvuYrv0X9WHWn+NWLaVqzU3sCokZ4Q11pup563Qs+zun9qAouZQqxTJurqERM78gbndQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421595; c=relaxed/simple; bh=6SFwaD3VXeajob+zXsjPJdnfDCKu68LZeFZCb/1qp40=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OSxAPMegVGj+I+2meMBL2MfrW5+K9c6s69XELVUOEXqFQ0Jmlba8TyoTb5tQOss/mIW1GQYC0bZjGwxHVS+TrXGBeMAQss/gWQgIbnCrZEw/lA+VPdJP8vwr28hPbOu+WpILRyic5fA+veo1gspiGomtw7MkkRPWXS47AieB76E= 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=EV8CwBhz; arc=none smtp.client-ip=209.85.214.171 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="EV8CwBhz" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-22548a28d0cso1161705ad.3 for ; Wed, 19 Mar 2025 14:59:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421592; x=1743026392; 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=BaaCH6MBSo5YdbXkpTr1qkIrj3X76/oKWszsy2HvHAI=; b=EV8CwBhzrYh14taWC9CCsOt/dP5wmrxEQBcMNUCQcib4mOVeQp2m7NSTcYMyYrDcDY xcQ5dsW0gFcePQVTdQNsWYNBFDY5C7+JyqjxuJyV5HgPU/gm34sJ51KBL1n430r/hLge rJ8q3uY8qCxmhnJ2EsE3oT1SM7j+Sy4azwsDHG+hy0EWAC/8EiVXNEL2gLzy0TZc7quR mHpbHFR99/0Ip6xAbhStQsCARdIG7OSL0LRdF9KaFeL0oo6vT4LEMLUwORpIJp1x3BBb uvgyRuRfiyWTyXj5KCfW+dIxgydVewFSl4ldIDJsFuBwyuSW/vTxEHmhcI3nt6AO5W+G 7JhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421592; x=1743026392; 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=BaaCH6MBSo5YdbXkpTr1qkIrj3X76/oKWszsy2HvHAI=; b=f0rFCbMDp1njapAP9bYC8Lz1aIHh23AESM7PXIYfFPRUtV4RqgF21zED8pkryAuaoq 91dJmW291oWcNg2eT/IV2QWmRxWtoxPc8RkbiJy8TbBbvLwoKKhdgxeqliM3jaHw81Rz flAa+PV/L/kA6lgG3Lvz1uf6WFVux8uBEbcWspDacPB42YD2bytF24ATVhs1LmYTEkLC 78FTi3ynpjX2TcvURIFbsgTMgO+oHs+Lq0QkAre/7gXtwCCJSF8SmP+UpHriehBI19Ww WB4wUelzFXgf+kxlIOsp/F0fka8u+mJ0HKCBalIWfkh7M7t1uFzKiSsZJkNtjeC02wXk E4iQ== X-Forwarded-Encrypted: i=1; AJvYcCVFmnJ36oRr1u3N+TJdONGi69JaxRvNZ+AP1gpOBuj2YpHuOQc3qaCloVt4CeCeT+06AmDwV4n30WRShCY=@vger.kernel.org X-Gm-Message-State: AOJu0YylYu6VxJATeugCI7w9Kf9qmeUgii+eWqWiRdsU1VqbzG2cAwBM 3g1/BW9bgvN0CzGJYVbecD+5T6aLGBnqEMomdsM6NjOab5IDxwUrr3iMkhcWrA== X-Gm-Gg: ASbGncteMKXwUDOZ3HLkB1yd26miJX10fQbDHE2oQjdI8Vb/W+QMcNccBt7LAlMOqY6 iYNolrhw+n1iDG3yB8Kx8U2HqUolzqLoLZF5otUGqLKdPgpO0a/Q8mEOVHnFUpRF+I8Xhop3VN2 yGiqWx46BHMgxKe3Nl9TyQ47G2WE1HDrfo+UykAoEic6mUMWJg8zLyFEYsYFqQy8Lk5dKFuLeY1 AE/XW4Uj+CJX+kUtZe24D8dhUpStwddH0Pa9IhgVqxDz1GHpDqux6MomuuGKz45QaHBU+AWOFYO 8zxI287aAdRJQ7rasxy5qGXswpcTSvGHkHpLPO9NnBcj72K/ML4DhGApElxnxeCszkmfmtD5t+c xW85u43dZU90BQ7o6XL7V X-Google-Smtp-Source: AGHT+IFq8TurdVYIPBHrecz1HX/ktXdqL1rALa29iGZXxOFSxa3sI9tZ58g5nbjf6vFwFNXnEg7f4Q== X-Received: by 2002:a05:6a20:7f90:b0:1f5:67e2:7790 with SMTP id adf61e73a8af0-1fd118010abmr1316116637.17.1742421591991; Wed, 19 Mar 2025 14:59:51 -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-7371167dfa2sm12656414b3a.107.2025.03.19.14.59.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:51 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 12/20] staging: gpib: ines: struct gpib_board Date: Wed, 19 Mar 2025 21:59:16 +0000 Message-ID: <20250319215924.19387-13-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/ines/ines.h | 54 ++++++------- drivers/staging/gpib/ines/ines_gpib.c | 111 +++++++++++++------------- 2 files changed, 83 insertions(+), 82 deletions(-) diff --git a/drivers/staging/gpib/ines/ines.h b/drivers/staging/gpib/ines/i= nes.h index 3918737fa21a..b17475aed046 100644 --- a/drivers/staging/gpib/ines/ines.h +++ b/drivers/staging/gpib/ines/ines.h @@ -36,41 +36,41 @@ struct ines_priv { }; =20 // interface functions -int ines_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *en= d, size_t *bytes_read); -int ines_write(gpib_board_t *board, uint8_t *buffer, size_t length, +int ines_read(struct gpib_board *board, uint8_t *buffer, size_t length, in= t *end, size_t *bytes_read); +int ines_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, size_t *bytes_written); -int ines_accel_read(gpib_board_t *board, uint8_t *buffer, size_t length, +int ines_accel_read(struct gpib_board *board, uint8_t *buffer, size_t leng= th, int *end, size_t *bytes_read); -int ines_accel_write(gpib_board_t *board, uint8_t *buffer, size_t length, +int ines_accel_write(struct gpib_board *board, uint8_t *buffer, size_t len= gth, int send_eoi, size_t *bytes_written); -int ines_command(gpib_board_t *board, uint8_t *buffer, size_t length, size= _t *bytes_written); -int ines_take_control(gpib_board_t *board, int synchronous); -int ines_go_to_standby(gpib_board_t *board); -void ines_request_system_control(gpib_board_t *board, int request_control); -void ines_interface_clear(gpib_board_t *board, int assert); -void ines_remote_enable(gpib_board_t *board, int enable); -int ines_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compare_8_b= its); -void ines_disable_eos(gpib_board_t *board); -unsigned int ines_update_status(gpib_board_t *board, unsigned int clear_ma= sk); -int ines_primary_address(gpib_board_t *board, unsigned int address); -int ines_secondary_address(gpib_board_t *board, unsigned int address, int = enable); -int ines_parallel_poll(gpib_board_t *board, uint8_t *result); -void ines_parallel_poll_configure(gpib_board_t *board, uint8_t config); -void ines_parallel_poll_response(gpib_board_t *board, int ist); -void ines_serial_poll_response(gpib_board_t *board, uint8_t status); -uint8_t ines_serial_poll_status(gpib_board_t *board); -int ines_line_status(const gpib_board_t *board); -unsigned int ines_t1_delay(gpib_board_t *board, unsigned int nano_sec); -void ines_return_to_local(gpib_board_t *board); +int ines_command(struct gpib_board *board, uint8_t *buffer, size_t length,= size_t *bytes_written); +int ines_take_control(struct gpib_board *board, int synchronous); +int ines_go_to_standby(struct gpib_board *board); +void ines_request_system_control(struct gpib_board *board, int request_con= trol); +void ines_interface_clear(struct gpib_board *board, int assert); +void ines_remote_enable(struct gpib_board *board, int enable); +int ines_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compar= e_8_bits); +void ines_disable_eos(struct gpib_board *board); +unsigned int ines_update_status(struct gpib_board *board, unsigned int cle= ar_mask); +int ines_primary_address(struct gpib_board *board, unsigned int address); +int ines_secondary_address(struct gpib_board *board, unsigned int address,= int enable); +int ines_parallel_poll(struct gpib_board *board, uint8_t *result); +void ines_parallel_poll_configure(struct gpib_board *board, uint8_t config= ); +void ines_parallel_poll_response(struct gpib_board *board, int ist); +void ines_serial_poll_response(struct gpib_board *board, uint8_t status); +uint8_t ines_serial_poll_status(struct gpib_board *board); +int ines_line_status(const struct gpib_board *board); +unsigned int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec= ); +void ines_return_to_local(struct gpib_board *board); =20 // interrupt service routines irqreturn_t ines_pci_interrupt(int irq, void *arg); -irqreturn_t ines_interrupt(gpib_board_t *board); +irqreturn_t ines_interrupt(struct gpib_board *board); =20 // utility functions -void ines_free_private(gpib_board_t *board); -int ines_generic_attach(gpib_board_t *board); -void ines_online(struct ines_priv *priv, const gpib_board_t *board, int us= e_accel); +void ines_free_private(struct gpib_board *board); +int ines_generic_attach(struct gpib_board *board); +void ines_online(struct ines_priv *priv, const struct gpib_board *board, i= nt use_accel); void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count); =20 /* inb/outb wrappers */ diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/i= nes/ines_gpib.c index d31eab1a05e4..983bb88a4376 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -25,7 +25,7 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for Ines iGPIB 72010"); =20 -int ines_line_status(const gpib_board_t *board) +int ines_line_status(const struct gpib_board *board) { int status =3D VALID_ALL; int bcm_bits; @@ -65,7 +65,7 @@ void ines_set_xfer_counter(struct ines_priv *priv, unsign= ed int count) ines_outb(priv, count & 0xff, XFER_COUNT_LOWER); } =20 -unsigned int ines_t1_delay(gpib_board_t *board, unsigned int nano_sec) +unsigned int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec) { struct ines_priv *ines_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &ines_priv->nec7210_priv; @@ -95,7 +95,7 @@ static inline unsigned short num_in_fifo_bytes(struct ine= s_priv *ines_priv) return ines_inb(ines_priv, IN_FIFO_COUNT); } =20 -static ssize_t pio_read(gpib_board_t *board, struct ines_priv *ines_priv, = uint8_t *buffer, +static ssize_t pio_read(struct gpib_board *board, struct ines_priv *ines_p= riv, uint8_t *buffer, size_t length, size_t *nbytes) { ssize_t retval =3D 0; @@ -133,7 +133,7 @@ static ssize_t pio_read(gpib_board_t *board, struct ine= s_priv *ines_priv, uint8_ return retval; } =20 -int ines_accel_read(gpib_board_t *board, uint8_t *buffer, +int ines_accel_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval =3D 0; @@ -190,7 +190,7 @@ static inline unsigned short num_out_fifo_bytes(struct = ines_priv *ines_priv) return ines_inb(ines_priv, OUT_FIFO_COUNT); } =20 -static int ines_write_wait(gpib_board_t *board, struct ines_priv *ines_pri= v, +static int ines_write_wait(struct gpib_board *board, struct ines_priv *ine= s_priv, unsigned int fifo_threshold) { struct nec7210_priv *nec_priv =3D &ines_priv->nec7210_priv; @@ -213,7 +213,7 @@ static int ines_write_wait(gpib_board_t *board, struct = ines_priv *ines_priv, return 0; } =20 -int ines_accel_write(gpib_board_t *board, uint8_t *buffer, size_t length, +int ines_accel_write(struct gpib_board *board, uint8_t *buffer, size_t len= gth, int send_eoi, size_t *bytes_written) { size_t count =3D 0; @@ -266,7 +266,7 @@ int ines_accel_write(gpib_board_t *board, uint8_t *buff= er, size_t length, =20 irqreturn_t ines_pci_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct ines_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; =20 @@ -281,7 +281,7 @@ irqreturn_t ines_pci_interrupt(int irq, void *arg) return ines_interrupt(board); } =20 -irqreturn_t ines_interrupt(gpib_board_t *board) +irqreturn_t ines_interrupt(struct gpib_board *board) { struct ines_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -313,12 +313,12 @@ irqreturn_t ines_interrupt(gpib_board_t *board) return IRQ_HANDLED; } =20 -static int ines_pci_attach(gpib_board_t *board, const gpib_board_config_t = *config); -static int ines_pci_accel_attach(gpib_board_t *board, const gpib_board_con= fig_t *config); -static int ines_isa_attach(gpib_board_t *board, const gpib_board_config_t = *config); +static int ines_pci_attach(struct gpib_board *board, const gpib_board_conf= ig_t *config); +static int ines_pci_accel_attach(struct gpib_board *board, const gpib_boar= d_config_t *config); +static int ines_isa_attach(struct gpib_board *board, const gpib_board_conf= ig_t *config); =20 -static void ines_pci_detach(gpib_board_t *board); -static void ines_isa_detach(gpib_board_t *board); +static void ines_pci_detach(struct gpib_board *board); +static void ines_isa_detach(struct gpib_board *board); =20 enum ines_pci_vendor_ids { PCI_VENDOR_ID_INES_QUICKLOGIC =3D 0x16da @@ -393,7 +393,8 @@ static struct ines_pci_id pci_ids[] =3D { static const int num_pci_chips =3D ARRAY_SIZE(pci_ids); =20 // wrappers for interface functions -int ines_read(gpib_board_t *board, uint8_t *buffer, size_t length, int *en= d, size_t *bytes_read) +int ines_read(struct gpib_board *board, uint8_t *buffer, size_t length, + int *end, size_t *bytes_read) { struct ines_priv *priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &priv->nec7210_priv; @@ -411,7 +412,7 @@ int ines_read(gpib_board_t *board, uint8_t *buffer, siz= e_t length, int *end, siz return retval; } =20 -int ines_write(gpib_board_t *board, uint8_t *buffer, size_t length, int se= nd_eoi, +int ines_write(struct gpib_board *board, uint8_t *buffer, size_t length, i= nt send_eoi, size_t *bytes_written) { struct ines_priv *priv =3D board->private_data; @@ -419,119 +420,119 @@ int ines_write(gpib_board_t *board, uint8_t *buffer= , size_t length, int send_eoi return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi= , bytes_written); } =20 -int ines_command(gpib_board_t *board, uint8_t *buffer, size_t length, size= _t *bytes_written) +int ines_command(struct gpib_board *board, uint8_t *buffer, size_t length,= size_t *bytes_written) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_= written); } =20 -int ines_take_control(gpib_board_t *board, int synchronous) +int ines_take_control(struct gpib_board *board, int synchronous) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } =20 -int ines_go_to_standby(gpib_board_t *board) +int ines_go_to_standby(struct gpib_board *board) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_go_to_standby(board, &priv->nec7210_priv); } =20 -void ines_request_system_control(gpib_board_t *board, int request_control) +void ines_request_system_control(struct gpib_board *board, int request_con= trol) { struct ines_priv *priv =3D board->private_data; =20 nec7210_request_system_control(board, &priv->nec7210_priv, request_contro= l); } =20 -void ines_interface_clear(gpib_board_t *board, int assert) +void ines_interface_clear(struct gpib_board *board, int assert) { struct ines_priv *priv =3D board->private_data; =20 nec7210_interface_clear(board, &priv->nec7210_priv, assert); } =20 -void ines_remote_enable(gpib_board_t *board, int enable) +void ines_remote_enable(struct gpib_board *board, int enable) { struct ines_priv *priv =3D board->private_data; =20 nec7210_remote_enable(board, &priv->nec7210_priv, enable); } =20 -int ines_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compare_8_b= its) +int ines_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compar= e_8_bits) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8= _bits); } =20 -void ines_disable_eos(gpib_board_t *board) +void ines_disable_eos(struct gpib_board *board) { struct ines_priv *priv =3D board->private_data; =20 nec7210_disable_eos(board, &priv->nec7210_priv); } =20 -unsigned int ines_update_status(gpib_board_t *board, unsigned int clear_ma= sk) +unsigned int ines_update_status(struct gpib_board *board, unsigned int cle= ar_mask) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } =20 -int ines_primary_address(gpib_board_t *board, unsigned int address) +int ines_primary_address(struct gpib_board *board, unsigned int address) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_primary_address(board, &priv->nec7210_priv, address); } =20 -int ines_secondary_address(gpib_board_t *board, unsigned int address, int = enable) +int ines_secondary_address(struct gpib_board *board, unsigned int address,= int enable) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_secondary_address(board, &priv->nec7210_priv, address, ena= ble); } =20 -int ines_parallel_poll(gpib_board_t *board, uint8_t *result) +int ines_parallel_poll(struct gpib_board *board, uint8_t *result) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } =20 -void ines_parallel_poll_configure(gpib_board_t *board, uint8_t config) +void ines_parallel_poll_configure(struct gpib_board *board, uint8_t config) { struct ines_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config); } =20 -void ines_parallel_poll_response(gpib_board_t *board, int ist) +void ines_parallel_poll_response(struct gpib_board *board, int ist) { struct ines_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } =20 -void ines_serial_poll_response(gpib_board_t *board, uint8_t status) +void ines_serial_poll_response(struct gpib_board *board, uint8_t status) { struct ines_priv *priv =3D board->private_data; =20 nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } =20 -uint8_t ines_serial_poll_status(gpib_board_t *board) +uint8_t ines_serial_poll_status(struct gpib_board *board) { struct ines_priv *priv =3D board->private_data; =20 return nec7210_serial_poll_status(board, &priv->nec7210_priv); } =20 -void ines_return_to_local(gpib_board_t *board) +void ines_return_to_local(struct gpib_board *board) { struct ines_priv *priv =3D board->private_data; =20 @@ -650,7 +651,7 @@ static gpib_interface_t ines_isa_interface =3D { .return_to_local =3D ines_return_to_local, }; =20 -static int ines_allocate_private(gpib_board_t *board) +static int ines_allocate_private(struct gpib_board *board) { struct ines_priv *priv; =20 @@ -663,13 +664,13 @@ static int ines_allocate_private(gpib_board_t *board) return 0; } =20 -void ines_free_private(gpib_board_t *board) +void ines_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 -int ines_generic_attach(gpib_board_t *board) +int ines_generic_attach(struct gpib_board *board) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -689,7 +690,7 @@ int ines_generic_attach(gpib_board_t *board) return 0; } =20 -void ines_online(struct ines_priv *ines_priv, const gpib_board_t *board, i= nt use_accel) +void ines_online(struct ines_priv *ines_priv, const struct gpib_board *boa= rd, int use_accel) { struct nec7210_priv *nec_priv =3D &ines_priv->nec7210_priv; =20 @@ -723,7 +724,7 @@ void ines_online(struct ines_priv *ines_priv, const gpi= b_board_t *board, int use nec7210_set_reg_bits(nec_priv, IMR1, HR_DOIE | HR_DIIE, 0); } =20 -static int ines_common_pci_attach(gpib_board_t *board, const gpib_board_co= nfig_t *config) +static int ines_common_pci_attach(struct gpib_board *board, const gpib_boa= rd_config_t *config) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -851,7 +852,7 @@ static int ines_common_pci_attach(gpib_board_t *board, = const gpib_board_config_t return 0; } =20 -int ines_pci_attach(gpib_board_t *board, const gpib_board_config_t *config) +int ines_pci_attach(struct gpib_board *board, const gpib_board_config_t *c= onfig) { struct ines_priv *ines_priv; int retval; @@ -866,7 +867,7 @@ int ines_pci_attach(gpib_board_t *board, const gpib_boa= rd_config_t *config) return 0; } =20 -int ines_pci_accel_attach(gpib_board_t *board, const gpib_board_config_t *= config) +int ines_pci_accel_attach(struct gpib_board *board, const gpib_board_confi= g_t *config) { struct ines_priv *ines_priv; int retval; @@ -883,7 +884,7 @@ int ines_pci_accel_attach(gpib_board_t *board, const gp= ib_board_config_t *config =20 static const int ines_isa_iosize =3D 0x20; =20 -int ines_isa_attach(gpib_board_t *board, const gpib_board_config_t *config) +int ines_isa_attach(struct gpib_board *board, const gpib_board_config_t *c= onfig) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -914,7 +915,7 @@ int ines_isa_attach(gpib_board_t *board, const gpib_boa= rd_config_t *config) return 0; } =20 -void ines_pci_detach(gpib_board_t *board) +void ines_pci_detach(struct gpib_board *board) { struct ines_priv *ines_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -948,7 +949,7 @@ void ines_pci_detach(gpib_board_t *board) ines_free_private(board); } =20 -void ines_isa_detach(gpib_board_t *board) +void ines_isa_detach(struct gpib_board *board) { struct ines_priv *ines_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -999,11 +1000,11 @@ static const int ines_pcmcia_iosize =3D 0x20; =20 static int ines_gpib_config(struct pcmcia_device *link); static void ines_gpib_release(struct pcmcia_device *link); -static int ines_pcmcia_attach(gpib_board_t *board, const gpib_board_config= _t *config); -static int ines_pcmcia_accel_attach(gpib_board_t *board, const gpib_board_= config_t *config); -static void ines_pcmcia_detach(gpib_board_t *board); +static int ines_pcmcia_attach(struct gpib_board *board, const gpib_board_c= onfig_t *config); +static int ines_pcmcia_accel_attach(struct gpib_board *board, const gpib_b= oard_config_t *config); +static void ines_pcmcia_detach(struct gpib_board *board); static irqreturn_t ines_pcmcia_interrupt(int irq, void *arg); -static int ines_common_pcmcia_attach(gpib_board_t *board); +static int ines_common_pcmcia_attach(struct gpib_board *board); /* * A linked list of "instances" of the gpib device. Each actual * PCMCIA card corresponds to one device instance, and is described @@ -1035,7 +1036,7 @@ static struct pcmcia_device *curr_dev; =20 struct local_info { struct pcmcia_device *p_dev; - gpib_board_t *dev; + struct gpib_board *dev; u_short manfid; u_short cardid; }; @@ -1086,7 +1087,7 @@ static int ines_gpib_probe(struct pcmcia_device *link) static void ines_gpib_remove(struct pcmcia_device *link) { struct local_info *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 if (info->dev) ines_pcmcia_detach(info->dev); @@ -1171,7 +1172,7 @@ static void ines_gpib_release(struct pcmcia_device *l= ink) static int ines_gpib_suspend(struct pcmcia_device *link) { //struct local_info *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 if (link->open) dev_err(&link->dev, "Device still open\n"); @@ -1183,7 +1184,7 @@ static int ines_gpib_suspend(struct pcmcia_device *li= nk) static int ines_gpib_resume(struct pcmcia_device *link) { //struct local_info_t *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 /*if (link->open) { * ni_gpib_probe(dev); / really? @@ -1300,12 +1301,12 @@ static gpib_interface_t ines_pcmcia_interface =3D { =20 irqreturn_t ines_pcmcia_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; =20 return ines_interrupt(board); } =20 -int ines_common_pcmcia_attach(gpib_board_t *board) +int ines_common_pcmcia_attach(struct gpib_board *board) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -1344,7 +1345,7 @@ int ines_common_pcmcia_attach(gpib_board_t *board) return 0; } =20 -int ines_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t *con= fig) +int ines_pcmcia_attach(struct gpib_board *board, const gpib_board_config_t= *config) { struct ines_priv *ines_priv; int retval; @@ -1359,7 +1360,7 @@ int ines_pcmcia_attach(gpib_board_t *board, const gpi= b_board_config_t *config) return 0; } =20 -int ines_pcmcia_accel_attach(gpib_board_t *board, const gpib_board_config_= t *config) +int ines_pcmcia_accel_attach(struct gpib_board *board, const gpib_board_co= nfig_t *config) { struct ines_priv *ines_priv; int retval; @@ -1374,7 +1375,7 @@ int ines_pcmcia_accel_attach(gpib_board_t *board, con= st gpib_board_config_t *con return 0; } =20 -void ines_pcmcia_detach(gpib_board_t *board) +void ines_pcmcia_detach(struct gpib_board *board) { struct ines_priv *ines_priv =3D board->private_data; struct nec7210_priv *nec_priv; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 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 322A72206B9 for ; Wed, 19 Mar 2025 21:59:53 +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=1742421596; cv=none; b=qU0xQJGMVkfT4XmpNrwrNiYg2MjbAWtrU4PTsPoAa7S8T3coceqXRlvjIzam2VZlO1VQMJzbHxJHvAfasycmTjvZiFwF8k/11oFu5DTAKrpdu75WxugbCFCtctUMwt8P8U5qZ/j/cYrZ9UCbyrsuIk2xjpr2VDiwRg0mTvp90Ls= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421596; c=relaxed/simple; bh=D9jHv4F3beF/tfaKVhG+ozyOsdkV+NSWO9RfknO2eDY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TiWmyyKF+HmtrH78tgVpSNPBN1YLciiwk2N+DHC3IgDTYdIr8eTYs7lo09EGXuf+JdPi5ZctpcxemGZMNSavjpLtj1DtQCgqe/Eb8F4+GIMHLqvWP4NjuSHchsgI4MCYPvIwqITyFPZwR9WuI80y7bq6zqwCEqBJ2EHn8G82aNU= 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=EZXlB+5e; 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="EZXlB+5e" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-223594b3c6dso848315ad.2 for ; Wed, 19 Mar 2025 14:59:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421593; x=1743026393; 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=DdZGZ77wjlRTZO+CcfVmzyPhMaV94Mgkkl1OdMTPEqo=; b=EZXlB+5elVvSXmJrWQGbD0qvyp6BDkONT0NbTS2480VUkyhw8LsGIt7ff52kiFPnVN UgXU29vl58TuU2+oYP5B1ZatF11qV6WijBajG2WKpYv93I2hriOztYrl5+aI6HfL9Pje PEcSQhg7NZvyHRT+4WXXHZUkvL9p0U3WA2uY0qhxgvOikNK0dPh2g8rGEaD1TeDdV7as vQB7d/YtCsmv9Y135KyPKM0adBQIHZ4N6RS60VbxvFzGOjnI/uL9yJK2wVT+e3deOece 6mS/IXjRzvYglkNPHUT1bmRhwnavPgFMRvluR4iMoslbF555oKjgathB2waxx54rd1OU tP+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421593; x=1743026393; 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=DdZGZ77wjlRTZO+CcfVmzyPhMaV94Mgkkl1OdMTPEqo=; b=Pj/bIFkeSnOb2Y71XWBxNjoPIT9WNoB6XbfXogxcfraYuQxpwWa8bLFuyfnhDcmK4u jyta0rh7S1Y2LNnT6xhdUJdHrHBZYBGBHdxSI776UuoSAUBulE4jwcOuY7Co17hYC7OE yfdiDql4Yp0M2haUVPbSs8QjS2BSaRWX3arXtNThmh1a4NAYCvALI6IsfuUlnY3zsC79 LOIrIGh1M4Rfi0jv3iwTZAmcgAQVo8FkrqNXWm15tj1FRpKr2A+N/oYEi7ZnjmRxtsin y/dXGUnzVo7AwPBioDWKs5zExFARYBSmjT6KjK2gx5yL59987GGArElOipa+7/7yC/w8 gGZw== X-Forwarded-Encrypted: i=1; AJvYcCUKpdYmi0roujIgvQHijY53zBJDnnD4omAapfbGVcr0FQbuyvlYasT6iu2+cNqY4pACrrK/0z0rAqQ+CeI=@vger.kernel.org X-Gm-Message-State: AOJu0YziVxk7d8EKPSk9tLN9fd8qqY8b3tk5owB+PsmixaC+HyV+CwW1 w14AA1thLcf/bgSHAxht040kJRSYMq/+nnxhBERL0u1vPFpekmWNTfHlH3T2vw== X-Gm-Gg: ASbGncvSsDp6nPQH/FmEeYL5AA4pU9n8CeGCasvkGT1sR73+EGEyRcumcjmnQGyXSho 0P1Q9kRKXJUmrgXbTXTm5ndWaXromjbPr/IyBJ2jd6O+IRze5EdlyPsX8ljnYvNuUNL1WF1h0Z2 HvzfMeZF36aoF1CAx0CyTO/acDu+lVOM6kzr2BAPm5GzUIgangTGwG40gJXZAtpKjvvzpwNiHYM LjqJWIXYSfzn9RmYjlsdgtC6vZBzgowlWQ4WDD2uoz69j0/fAYJ77IYMpJHEL2MUw4DDu6JmtLm +QEBaMp8SOICWkIAvC+oNd1gK83mQ7OittgBy8NyKdvzAe5oUF43zD5ZDlXI3ws41so0KQO+K4A lAYTRZ61YWw== X-Google-Smtp-Source: AGHT+IGOzwauxkMf+TqYgZvWJWEnbL8FWR8n0Uw8+339Ig3NLlSoKeZMkib7RehvHJZdxWTjd71CYQ== X-Received: by 2002:a05:6a00:851:b0:736:5725:59b4 with SMTP id d2e1a72fcca58-7376d5e2d98mr7107523b3a.3.1742421593231; Wed, 19 Mar 2025 14:59:53 -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-af56e9c94cesm11657944a12.6.2025.03.19.14.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:52 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 13/20] staging: gpib: lpvo_usb_gpib: struct gpib_board Date: Wed, 19 Mar 2025 21:59:17 +0000 Message-ID: <20250319215924.19387-14-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/s= taging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 011096ece7d6..1675aa2aff6c 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -146,7 +146,7 @@ struct usb_gpib_priv { /* private data to the device */ =20 #define GPIB_DEV (((struct usb_gpib_priv *)board->private_data)->dev) =20 -static void show_status(gpib_board_t *board) +static void show_status(struct gpib_board *board) { DIA_LOG(2, "# - buffer_length %d\n", board->buffer_length); DIA_LOG(2, "# - status %lx\n", board->status); @@ -184,8 +184,8 @@ static struct mutex minors_lock; /* operations on u= sb_minors are to be prote struct usb_skel; static ssize_t skel_do_write(struct usb_skel *, const char *, size_t); static ssize_t skel_do_read(struct usb_skel *, char *, size_t); -static int skel_do_open(gpib_board_t *, int); -static int skel_do_release(gpib_board_t *); +static int skel_do_open(struct gpib_board *, int); +static int skel_do_release(struct gpib_board *); =20 /* * usec_diff : take difference in MICROsec between two 'timespec' @@ -237,7 +237,7 @@ static int write_loop(void *dev, char *msg, int leng) * it has to be given explicitly. */ =20 -static int send_command(gpib_board_t *board, char *msg, int leng) +static int send_command(struct gpib_board *board, char *msg, int leng) { char buffer[64]; int nchar; @@ -278,7 +278,7 @@ static int send_command(gpib_board_t *board, char *msg,= int leng) * */ =20 -static int set_control_line(gpib_board_t *board, int line, int value) +static int set_control_line(struct gpib_board *board, int line, int value) { char msg[] =3D USB_GPIB_SET_LINES; int retval; @@ -309,7 +309,7 @@ static int set_control_line(gpib_board_t *board, int li= ne, int value) * @char_buf: the routine private data structure */ =20 -static int one_char(gpib_board_t *board, struct char_buf *b) +static int one_char(struct gpib_board *board, struct char_buf *b) { struct timespec64 before, after; =20 @@ -343,7 +343,7 @@ static int one_char(gpib_board_t *board, struct char_bu= f *b) * not supported. */ =20 -static void set_timeout(gpib_board_t *board) +static void set_timeout(struct gpib_board *board) { int n, val; char command[sizeof(USB_GPIB_TTMO) + 6]; @@ -391,7 +391,7 @@ static void set_timeout(gpib_board_t *board) * detach() will be called. Always. */ =20 -static int usb_gpib_attach(gpib_board_t *board, const gpib_board_config_t = *config) +static int usb_gpib_attach(struct gpib_board *board, const gpib_board_conf= ig_t *config) { int retval, j; u32 base =3D config->ibbase; @@ -510,7 +510,7 @@ static int usb_gpib_attach(gpib_board_t *board, const g= pib_board_config_t *confi * */ =20 -static void usb_gpib_detach(gpib_board_t *board) +static void usb_gpib_detach(struct gpib_board *board) { int retval; =20 @@ -537,7 +537,7 @@ static void usb_gpib_detach(gpib_board_t *board) * Other functions follow in alphabetical order */ /* command */ -static int usb_gpib_command(gpib_board_t *board, +static int usb_gpib_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) @@ -570,7 +570,7 @@ static int usb_gpib_command(gpib_board_t *board, * Cannot do nothing here, but remember for future use. */ =20 -static void usb_gpib_disable_eos(gpib_board_t *board) +static void usb_gpib_disable_eos(struct gpib_board *board) { ((struct usb_gpib_priv *)board->private_data)->eos_flags &=3D ~REOS; DIA_LOG(1, "done: %x\n", @@ -586,7 +586,7 @@ static void usb_gpib_disable_eos(gpib_board_t *board) * */ =20 -static int usb_gpib_enable_eos(gpib_board_t *board, +static int usb_gpib_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { @@ -606,7 +606,7 @@ static int usb_gpib_enable_eos(gpib_board_t *board, * @board: the gpib_board data area for this gpib interface */ =20 -static int usb_gpib_go_to_standby(gpib_board_t *board) +static int usb_gpib_go_to_standby(struct gpib_board *board) { int retval =3D set_control_line(board, IB_BUS_ATN, 0); =20 @@ -628,7 +628,7 @@ static int usb_gpib_go_to_standby(gpib_board_t *board) * the de-assert request. */ =20 -static void usb_gpib_interface_clear(gpib_board_t *board, int assert) +static void usb_gpib_interface_clear(struct gpib_board *board, int assert) { int retval =3D 0; =20 @@ -655,7 +655,7 @@ static void usb_gpib_interface_clear(gpib_board_t *boar= d, int assert) #define WQH head #define WQE entry =20 -static int usb_gpib_line_status(const gpib_board_t *board) +static int usb_gpib_line_status(const struct gpib_board *board) { int buffer; int line_status =3D VALID_ALL; /* all lines will be read */ @@ -686,7 +686,7 @@ static int usb_gpib_line_status(const gpib_board_t *boa= rd) msleep(sleep); } =20 - buffer =3D send_command((gpib_board_t *)board, USB_GPIB_STATUS, 0); + buffer =3D send_command((struct gpib_board *)board, USB_GPIB_STATUS, 0); =20 if (buffer < 0) { dev_err(board->gpib_dev, "line status read failed with %d\n", buffer); @@ -717,7 +717,7 @@ static int usb_gpib_line_status(const gpib_board_t *boa= rd) =20 /* parallel_poll */ =20 -static int usb_gpib_parallel_poll(gpib_board_t *board, uint8_t *result) +static int usb_gpib_parallel_poll(struct gpib_board *board, uint8_t *resul= t) { /* request parallel poll asserting ATN | EOI; * we suppose ATN already asserted @@ -744,7 +744,7 @@ static int usb_gpib_parallel_poll(gpib_board_t *board, = uint8_t *result) =20 /* read */ =20 -static int usb_gpib_read(gpib_board_t *board, +static int usb_gpib_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, @@ -908,7 +908,7 @@ static int usb_gpib_read(gpib_board_t *board, =20 /* remote_enable */ =20 -static void usb_gpib_remote_enable(gpib_board_t *board, int enable) +static void usb_gpib_remote_enable(struct gpib_board *board, int enable) { int retval; =20 @@ -921,7 +921,7 @@ static void usb_gpib_remote_enable(gpib_board_t *board,= int enable) =20 /* request_system_control */ =20 -static void usb_gpib_request_system_control(gpib_board_t *board, +static void usb_gpib_request_system_control(struct gpib_board *board, int request_control) { if (request_control) @@ -935,7 +935,7 @@ static void usb_gpib_request_system_control(gpib_board_= t *board, /* take_control */ /* beware: the sync flag is ignored; what is its real meaning? */ =20 -static int usb_gpib_take_control(gpib_board_t *board, int sync) +static int usb_gpib_take_control(struct gpib_board *board, int sync) { int retval; =20 @@ -950,7 +950,7 @@ static int usb_gpib_take_control(gpib_board_t *board, i= nt sync) =20 /* update_status */ =20 -static unsigned int usb_gpib_update_status(gpib_board_t *board, +static unsigned int usb_gpib_update_status(struct gpib_board *board, unsigned int clear_mask) { /* There is nothing we can do here, I guess */ @@ -965,7 +965,7 @@ static unsigned int usb_gpib_update_status(gpib_board_t= *board, /* write */ /* beware: DLE characters are not escaped - can only send ASCII data */ =20 -static int usb_gpib_write(gpib_board_t *board, +static int usb_gpib_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, @@ -1008,33 +1008,33 @@ static int usb_gpib_write(gpib_board_t *board, =20 /* parallel_poll configure */ =20 -static void usb_gpib_parallel_poll_configure(gpib_board_t *board, +static void usb_gpib_parallel_poll_configure(struct gpib_board *board, uint8_t configuration) { } =20 /* parallel_poll_response */ =20 -static void usb_gpib_parallel_poll_response(gpib_board_t *board, int ist) +static void usb_gpib_parallel_poll_response(struct gpib_board *board, int = ist) { } =20 /* primary_address */ =20 -static int usb_gpib_primary_address(gpib_board_t *board, unsigned int add= ress) +static int usb_gpib_primary_address(struct gpib_board *board, unsigned in= t address) { return 0; } =20 /* return_to_local */ =20 -static void usb_gpib_return_to_local(gpib_board_t *board) +static void usb_gpib_return_to_local(struct gpib_board *board) { } =20 /* secondary_address */ =20 -static int usb_gpib_secondary_address(gpib_board_t *board, +static int usb_gpib_secondary_address(struct gpib_board *board, unsigned int address, int enable) { @@ -1043,20 +1043,20 @@ static int usb_gpib_secondary_address(gpib_board_t = *board, =20 /* serial_poll_response */ =20 -static void usb_gpib_serial_poll_response(gpib_board_t *board, uint8_t sta= tus) +static void usb_gpib_serial_poll_response(struct gpib_board *board, uint8_= t status) { } =20 /* serial_poll_status */ =20 -static uint8_t usb_gpib_serial_poll_status(gpib_board_t *board) +static uint8_t usb_gpib_serial_poll_status(struct gpib_board *board) { return 0; } =20 /* t1_delay */ =20 -static unsigned int usb_gpib_t1_delay(gpib_board_t *board, unsigned int na= no_sec) +static unsigned int usb_gpib_t1_delay(struct gpib_board *board, unsigned i= nt nano_sec) { return 0; } @@ -1295,7 +1295,7 @@ static void skel_delete(struct kref *kref) * skel_do_open() - to be called by usb_gpib_attach */ =20 -static int skel_do_open(gpib_board_t *board, int subminor) +static int skel_do_open(struct gpib_board *board, int subminor) { struct usb_skel *dev; struct usb_interface *interface; @@ -1332,7 +1332,7 @@ static int skel_do_open(gpib_board_t *board, int subm= inor) * skel_do_release() - to be called by usb_gpib_detach */ =20 -static int skel_do_release(gpib_board_t *board) +static int skel_do_release(struct gpib_board *board) { struct usb_skel *dev; =20 --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 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 3EB6C221572 for ; Wed, 19 Mar 2025 21:59:55 +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=1742421597; cv=none; b=cXg42at2toPfQaazSGtuzIoHyvXBrJcUeVIKd8O/xRLsddQB8SwQUNczOt4VID0e0AN2y7dY7KVDzasah/oDWwP8eqcE+ArSrn6BRRWReyctT/i9WIgA6B2rj4DhPY/GxNnKmu3KWuu3QmvCD9a6ft4++LSzsUyKuOga/TQhMx4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421597; c=relaxed/simple; bh=PXFbG5O/nfvHW1QzJUbSW3+qHxjDhuJAY/1zhSCjGiA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N4p8vVv+IE/W3HqzXTp2PzljdoblW8G2t+X3PJPagPTQrWltwlmEN3Na3ytO+W90c5yT413OdkIj1oZ0R0n6OVLYSF89V6ZWf7JNc0wGium/w8LZIWmfpG9m2yxdfGr3BjCAX0nxshn2gAdF/bC/qXNaTgXm6uACoBr6btniXuQ= 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=ZPADH/pw; 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="ZPADH/pw" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-2241053582dso1176265ad.1 for ; Wed, 19 Mar 2025 14:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421594; x=1743026394; 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=oa+0Pt1V4+SqMSbsbweCkzQQ9zLDOIiBj8exlzrjjFY=; b=ZPADH/pw9/qAIujrm3Mdth1RmEZB49JBywQ2560I1yXkzCe/x9Bu6TUjswZ+sUNCQr +pK2KclSBA4Hz5dp3g9BTbcaRhhZ2bU4LtkqZBj43lGXnh1ScGCOIsqsxCwKvn9WwB1q EhN8n0SDSqTgw5t9+n0PfnUUjwqiGGPheHhsAIe4qigkJzEkvauyqwBh3qChCnAi2FsQ exX7WO5GeTqWr8wfJIx5gZvmMKUEzkzrFf3gluQaBXP3J4cmAOtFZDBnAqzAZ23p66c+ dobKAQCGhzDyomYRKFKpF1vI+QIQ4PRhs6gBoT17g+SqetdWP27cqMwgeI6j1rPltjoJ 4czg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421594; x=1743026394; 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=oa+0Pt1V4+SqMSbsbweCkzQQ9zLDOIiBj8exlzrjjFY=; b=cuGZT1SWVNd0MhPLAlwN6w+Vb/BqMnJEGdzyoLRKQnj9j5gsym8D1MjdnXyA+zgfZd AKl2xkKwEs+bz3jEsnYIuzQt1XOOMgYCKu1GnWMU3XEHaO3oTtNBRY9CvOTcPqZr359b i0+oGvDImZgwxfY4EhevQnUpHl29erkZCSZor1+pvQUydlE0VEVQtQ5MCXSitD6+xj0a W61nCUIEfqbIyAZeoXRIxJI7pseW88EJsAgw9ATf5gvvYtkvpOt+zE+dHsEwN9cQ0Zo/ NiMV9JFGe2LvGF0eYBLCZ4D+53pya2ujDRRkK5TQdWREr49jBZ4RxLpae4yDxLL57lzA nlug== X-Forwarded-Encrypted: i=1; AJvYcCVAysK8aGp142UtCOvAklljElzti45Coz/KPNyLzT5vTJzSfkPbgnOdjYq6gwAhKRJJpq6Q2QqfJDUYPxI=@vger.kernel.org X-Gm-Message-State: AOJu0YzNRQV7BtwDGhoP+JDLwR/i8nyPaf8bIPyAr9VDrXk4ZB2Mrk9l 6WPCgtHKW+ZwMEz1XaOb3hlXWKonXDAoWRbKrjPyxheeuJl4aZm++kJbVo1pDQ== X-Gm-Gg: ASbGncv4uQc1IK23lE6UdfcfdeegP5UVqPa6DH0HxIAm/xk7o9l4WpWVuO2/8aj7yGH UMPO6hmgAthwCSGxj/gan1getscMDBf+1zyeCsrR0+Pbg5eRSrx+org7pQuEVxm7pYCQf76JeWb WNI57w2XcBHZcXZ2y0ciUYo++1WN5NMSpaeqBKPG39AjgUFpC6K5XrQ88LwesY4s2RtyjhT1dgD pT10dXscACu0azfFPBUp0k4Al5oYndHLcWrjMDjwYleL8JkfscSd9s1lY4QrCWbrLcd7K9LCDPd brDF02vBPzCcvXS0+GP9gXL5iVXPMeuHisfSE8TJGRq/YxEJ3VIsl7l8fFyVonb8i8jzVjLreqh 6aqnlkqiM+w== X-Google-Smtp-Source: AGHT+IFr4kp9t3TFnrrNqlwiKDZtLS8gq+a1DwiAWOWfX/zxf6y66YjdjOLGxC55fcS/6b0iLtY1Uw== X-Received: by 2002:a17:903:228f:b0:216:3c36:69a7 with SMTP id d9443c01a7336-22649a803bcmr54470095ad.45.1742421594533; Wed, 19 Mar 2025 14:59:54 -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-225c6bd5488sm120624775ad.245.2025.03.19.14.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:54 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 14/20] staging: gpib: nec7210 struct gpib_board Date: Wed, 19 Mar 2025 21:59:18 +0000 Message-ID: <20250319215924.19387-15-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/include/nec7210.h | 58 ++++++++++---------- drivers/staging/gpib/nec7210/nec7210.c | 76 +++++++++++++------------- 2 files changed, 68 insertions(+), 66 deletions(-) diff --git a/drivers/staging/gpib/include/nec7210.h b/drivers/staging/gpib/= include/nec7210.h index ca998c4a84bf..6c49283bd139 100644 --- a/drivers/staging/gpib/include/nec7210.h +++ b/drivers/staging/gpib/include/nec7210.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +//* SPDX-License-Identifier: GPL-2.0 */ =20 /*************************************************************************= ** * copyright : (C) 2002 by Frank Mori Hess @@ -78,48 +78,48 @@ enum { }; =20 // interface functions -int nec7210_read(gpib_board_t *board, struct nec7210_priv *priv, uint8_t *= buffer, +int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, uint= 8_t *buffer, size_t length, int *end, size_t *bytes_read); -int nec7210_write(gpib_board_t *board, struct nec7210_priv *priv, uint8_t = *buffer, +int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, uin= t8_t *buffer, size_t length, int send_eoi, size_t *bytes_written); -int nec7210_command(gpib_board_t *board, struct nec7210_priv *priv, uint8_= t *buffer, +int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, u= int8_t *buffer, size_t length, size_t *bytes_written); -int nec7210_take_control(gpib_board_t *board, struct nec7210_priv *priv, i= nt syncronous); -int nec7210_go_to_standby(gpib_board_t *board, struct nec7210_priv *priv); -void nec7210_request_system_control(gpib_board_t *board, +int nec7210_take_control(struct gpib_board *board, struct nec7210_priv *pr= iv, int syncronous); +int nec7210_go_to_standby(struct gpib_board *board, struct nec7210_priv *p= riv); +void nec7210_request_system_control(struct gpib_board *board, struct nec7210_priv *priv, int request_control); -void nec7210_interface_clear(gpib_board_t *board, struct nec7210_priv *pri= v, int assert); -void nec7210_remote_enable(gpib_board_t *board, struct nec7210_priv *priv,= int enable); -int nec7210_enable_eos(gpib_board_t *board, struct nec7210_priv *priv, uin= t8_t eos_bytes, +void nec7210_interface_clear(struct gpib_board *board, struct nec7210_priv= *priv, int assert); +void nec7210_remote_enable(struct gpib_board *board, struct nec7210_priv *= priv, int enable); +int nec7210_enable_eos(struct gpib_board *board, struct nec7210_priv *priv= , uint8_t eos_bytes, int compare_8_bits); -void nec7210_disable_eos(gpib_board_t *board, struct nec7210_priv *priv); -unsigned int nec7210_update_status(gpib_board_t *board, struct nec7210_pri= v *priv, +void nec7210_disable_eos(struct gpib_board *board, struct nec7210_priv *pr= iv); +unsigned int nec7210_update_status(struct gpib_board *board, struct nec721= 0_priv *priv, unsigned int clear_mask); -unsigned int nec7210_update_status_nolock(gpib_board_t *board, struct nec7= 210_priv *priv); -int nec7210_primary_address(const gpib_board_t *board, +unsigned int nec7210_update_status_nolock(struct gpib_board *board, struct= nec7210_priv *priv); +int nec7210_primary_address(const struct gpib_board *board, struct nec7210_priv *priv, unsigned int address); -int nec7210_secondary_address(const gpib_board_t *board, struct nec7210_pr= iv *priv, +int nec7210_secondary_address(const struct gpib_board *board, struct nec72= 10_priv *priv, unsigned int address, int enable); -int nec7210_parallel_poll(gpib_board_t *board, struct nec7210_priv *priv, = uint8_t *result); -void nec7210_serial_poll_response(gpib_board_t *board, struct nec7210_priv= *priv, uint8_t status); -void nec7210_parallel_poll_configure(gpib_board_t *board, +int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *p= riv, uint8_t *result); +void nec7210_serial_poll_response(struct gpib_board *board, struct nec7210= _priv *priv, uint8_t status); +void nec7210_parallel_poll_configure(struct gpib_board *board, struct nec7210_priv *priv, unsigned int configuration); -void nec7210_parallel_poll_response(gpib_board_t *board, +void nec7210_parallel_poll_response(struct gpib_board *board, struct nec7210_priv *priv, int ist); -uint8_t nec7210_serial_poll_status(gpib_board_t *board, +uint8_t nec7210_serial_poll_status(struct gpib_board *board, struct nec7210_priv *priv); -unsigned int nec7210_t1_delay(gpib_board_t *board, +unsigned int nec7210_t1_delay(struct gpib_board *board, struct nec7210_priv *priv, unsigned int nano_sec); -void nec7210_return_to_local(const gpib_board_t *board, struct nec7210_pri= v *priv); +void nec7210_return_to_local(const struct gpib_board *board, struct nec721= 0_priv *priv); =20 // utility functions -void nec7210_board_reset(struct nec7210_priv *priv, const gpib_board_t *bo= ard); -void nec7210_board_online(struct nec7210_priv *priv, const gpib_board_t *b= oard); +void nec7210_board_reset(struct nec7210_priv *priv, const struct gpib_boar= d *board); +void nec7210_board_online(struct nec7210_priv *priv, const struct gpib_boa= rd *board); unsigned int nec7210_set_reg_bits(struct nec7210_priv *priv, unsigned int = reg, unsigned int mask, unsigned int bits); -void nec7210_set_handshake_mode(gpib_board_t *board, struct nec7210_priv *= priv, int mode); -void nec7210_release_rfd_holdoff(gpib_board_t *board, struct nec7210_priv = *priv); -uint8_t nec7210_read_data_in(gpib_board_t *board, struct nec7210_priv *pri= v, int *end); +void nec7210_set_handshake_mode(struct gpib_board *board, struct nec7210_p= riv *priv, int mode); +void nec7210_release_rfd_holdoff(struct gpib_board *board, struct nec7210_= priv *priv); +uint8_t nec7210_read_data_in(struct gpib_board *board, struct nec7210_priv= *priv, int *end); =20 // wrappers for io functions uint8_t nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int r= egister_num); @@ -134,8 +134,8 @@ void nec7210_locking_iomem_write_byte(struct nec7210_pr= iv *priv, uint8_t data, unsigned int register_num); =20 // interrupt service routine -irqreturn_t nec7210_interrupt(gpib_board_t *board, struct nec7210_priv *pr= iv); -irqreturn_t nec7210_interrupt_have_status(gpib_board_t *board, +irqreturn_t nec7210_interrupt(struct gpib_board *board, struct nec7210_pri= v *priv); +irqreturn_t nec7210_interrupt_have_status(struct gpib_board *board, struct nec7210_priv *priv, int status1, int status2); =20 #endif //_NEC7210_H diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/= nec7210/nec7210.c index 85f1e79d658a..773495cde9d8 100644 --- a/drivers/staging/gpib/nec7210/nec7210.c +++ b/drivers/staging/gpib/nec7210/nec7210.c @@ -23,7 +23,7 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB library code for NEC uPD7210"); =20 -int nec7210_enable_eos(gpib_board_t *board, struct nec7210_priv *priv, uin= t8_t eos_byte, +int nec7210_enable_eos(struct gpib_board *board, struct nec7210_priv *priv= , uint8_t eos_byte, int compare_8_bits) { write_byte(priv, eos_byte, EOSR); @@ -37,14 +37,14 @@ int nec7210_enable_eos(gpib_board_t *board, struct nec7= 210_priv *priv, uint8_t e } EXPORT_SYMBOL(nec7210_enable_eos); =20 -void nec7210_disable_eos(gpib_board_t *board, struct nec7210_priv *priv) +void nec7210_disable_eos(struct gpib_board *board, struct nec7210_priv *pr= iv) { priv->auxa_bits &=3D ~HR_REOS; write_byte(priv, priv->auxa_bits, AUXMR); } EXPORT_SYMBOL(nec7210_disable_eos); =20 -int nec7210_parallel_poll(gpib_board_t *board, struct nec7210_priv *priv, = uint8_t *result) +int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *p= riv, uint8_t *result) { int ret; =20 @@ -64,14 +64,14 @@ int nec7210_parallel_poll(gpib_board_t *board, struct n= ec7210_priv *priv, uint8_ } EXPORT_SYMBOL(nec7210_parallel_poll); =20 -void nec7210_parallel_poll_configure(gpib_board_t *board, +void nec7210_parallel_poll_configure(struct gpib_board *board, struct nec7210_priv *priv, unsigned int configuration) { write_byte(priv, PPR | configuration, AUXMR); } EXPORT_SYMBOL(nec7210_parallel_poll_configure); =20 -void nec7210_parallel_poll_response(gpib_board_t *board, struct nec7210_pr= iv *priv, int ist) +void nec7210_parallel_poll_response(struct gpib_board *board, struct nec72= 10_priv *priv, int ist) { if (ist) write_byte(priv, AUX_SPPF, AUXMR); @@ -85,7 +85,8 @@ EXPORT_SYMBOL(nec7210_parallel_poll_response); * the 488.2 capability (for example with NI chips), or we need to impleme= nt the * 488.2 set srv state machine in the driver (if that is even viable). */ -void nec7210_serial_poll_response(gpib_board_t *board, struct nec7210_priv= *priv, uint8_t status) +void nec7210_serial_poll_response(struct gpib_board *board, + struct nec7210_priv *priv, uint8_t status) { unsigned long flags; =20 @@ -102,13 +103,13 @@ void nec7210_serial_poll_response(gpib_board_t *board= , struct nec7210_priv *priv } EXPORT_SYMBOL(nec7210_serial_poll_response); =20 -uint8_t nec7210_serial_poll_status(gpib_board_t *board, struct nec7210_pri= v *priv) +uint8_t nec7210_serial_poll_status(struct gpib_board *board, struct nec721= 0_priv *priv) { return read_byte(priv, SPSR); } EXPORT_SYMBOL(nec7210_serial_poll_status); =20 -int nec7210_primary_address(const gpib_board_t *board, struct nec7210_priv= *priv, +int nec7210_primary_address(const struct gpib_board *board, struct nec7210= _priv *priv, unsigned int address) { // put primary address in address0 @@ -117,7 +118,7 @@ int nec7210_primary_address(const gpib_board_t *board, = struct nec7210_priv *priv } EXPORT_SYMBOL(nec7210_primary_address); =20 -int nec7210_secondary_address(const gpib_board_t *board, struct nec7210_pr= iv *priv, +int nec7210_secondary_address(const struct gpib_board *board, struct nec72= 10_priv *priv, unsigned int address, int enable) { if (enable) { @@ -166,7 +167,7 @@ static void update_listener_state(struct nec7210_priv *= priv, unsigned int addres } } =20 -unsigned int nec7210_update_status_nolock(gpib_board_t *board, struct nec7= 210_priv *priv) +unsigned int nec7210_update_status_nolock(struct gpib_board *board, struct= nec7210_priv *priv) { int address_status_bits; u8 spoll_status; @@ -209,7 +210,7 @@ unsigned int nec7210_update_status_nolock(gpib_board_t = *board, struct nec7210_pr } EXPORT_SYMBOL(nec7210_update_status_nolock); =20 -unsigned int nec7210_update_status(gpib_board_t *board, struct nec7210_pri= v *priv, +unsigned int nec7210_update_status(struct gpib_board *board, struct nec721= 0_priv *priv, unsigned int clear_mask) { unsigned long flags; @@ -234,7 +235,7 @@ unsigned int nec7210_set_reg_bits(struct nec7210_priv *= priv, unsigned int reg, } EXPORT_SYMBOL(nec7210_set_reg_bits); =20 -void nec7210_set_handshake_mode(gpib_board_t *board, struct nec7210_priv *= priv, int mode) +void nec7210_set_handshake_mode(struct gpib_board *board, struct nec7210_p= riv *priv, int mode) { unsigned long flags; =20 @@ -250,7 +251,7 @@ void nec7210_set_handshake_mode(gpib_board_t *board, st= ruct nec7210_priv *priv, } EXPORT_SYMBOL(nec7210_set_handshake_mode); =20 -uint8_t nec7210_read_data_in(gpib_board_t *board, struct nec7210_priv *pri= v, int *end) +uint8_t nec7210_read_data_in(struct gpib_board *board, struct nec7210_priv= *priv, int *end) { unsigned long flags; u8 data; @@ -268,7 +269,7 @@ uint8_t nec7210_read_data_in(gpib_board_t *board, struc= t nec7210_priv *priv, int } EXPORT_SYMBOL(nec7210_read_data_in); =20 -int nec7210_take_control(gpib_board_t *board, struct nec7210_priv *priv, i= nt syncronous) +int nec7210_take_control(struct gpib_board *board, struct nec7210_priv *pr= iv, int syncronous) { int i; const int timeout =3D 100; @@ -295,7 +296,7 @@ int nec7210_take_control(gpib_board_t *board, struct ne= c7210_priv *priv, int syn } EXPORT_SYMBOL(nec7210_take_control); =20 -int nec7210_go_to_standby(gpib_board_t *board, struct nec7210_priv *priv) +int nec7210_go_to_standby(struct gpib_board *board, struct nec7210_priv *p= riv) { int i; const int timeout =3D 1000; @@ -329,7 +330,7 @@ int nec7210_go_to_standby(gpib_board_t *board, struct n= ec7210_priv *priv) } EXPORT_SYMBOL(nec7210_go_to_standby); =20 -void nec7210_request_system_control(gpib_board_t *board, struct nec7210_pr= iv *priv, +void nec7210_request_system_control(struct gpib_board *board, struct nec72= 10_priv *priv, int request_control) { if (request_control =3D=3D 0) { @@ -340,7 +341,7 @@ void nec7210_request_system_control(gpib_board_t *board= , struct nec7210_priv *pr } EXPORT_SYMBOL(nec7210_request_system_control); =20 -void nec7210_interface_clear(gpib_board_t *board, struct nec7210_priv *pri= v, int assert) +void nec7210_interface_clear(struct gpib_board *board, struct nec7210_priv= *priv, int assert) { if (assert) write_byte(priv, AUX_SIFC, AUXMR); @@ -349,7 +350,7 @@ void nec7210_interface_clear(gpib_board_t *board, struc= t nec7210_priv *priv, int } EXPORT_SYMBOL(nec7210_interface_clear); =20 -void nec7210_remote_enable(gpib_board_t *board, struct nec7210_priv *priv,= int enable) +void nec7210_remote_enable(struct gpib_board *board, struct nec7210_priv *= priv, int enable) { if (enable) write_byte(priv, AUX_SREN, AUXMR); @@ -358,7 +359,7 @@ void nec7210_remote_enable(gpib_board_t *board, struct = nec7210_priv *priv, int e } EXPORT_SYMBOL(nec7210_remote_enable); =20 -void nec7210_release_rfd_holdoff(gpib_board_t *board, struct nec7210_priv = *priv) +void nec7210_release_rfd_holdoff(struct gpib_board *board, struct nec7210_= priv *priv) { unsigned long flags; =20 @@ -372,7 +373,7 @@ void nec7210_release_rfd_holdoff(gpib_board_t *board, s= truct nec7210_priv *priv) } EXPORT_SYMBOL(nec7210_release_rfd_holdoff); =20 -unsigned int nec7210_t1_delay(gpib_board_t *board, struct nec7210_priv *pr= iv, +unsigned int nec7210_t1_delay(struct gpib_board *board, struct nec7210_pri= v *priv, unsigned int nano_sec) { unsigned int retval; @@ -390,13 +391,13 @@ unsigned int nec7210_t1_delay(gpib_board_t *board, st= ruct nec7210_priv *priv, } EXPORT_SYMBOL(nec7210_t1_delay); =20 -void nec7210_return_to_local(const gpib_board_t *board, struct nec7210_pri= v *priv) +void nec7210_return_to_local(const struct gpib_board *board, struct nec721= 0_priv *priv) { write_byte(priv, AUX_RTL, AUXMR); } EXPORT_SYMBOL(nec7210_return_to_local); =20 -static inline short nec7210_atn_has_changed(gpib_board_t *board, struct ne= c7210_priv *priv) +static inline short nec7210_atn_has_changed(struct gpib_board *board, stru= ct nec7210_priv *priv) { short address_status_bits =3D read_byte(priv, ADSR); =20 @@ -414,7 +415,7 @@ static inline short nec7210_atn_has_changed(gpib_board_= t *board, struct nec7210_ return -1; } =20 -int nec7210_command(gpib_board_t *board, struct nec7210_priv *priv, uint8_t +int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, u= int8_t *buffer, size_t length, size_t *bytes_written) { int retval =3D 0; @@ -463,7 +464,7 @@ int nec7210_command(gpib_board_t *board, struct nec7210= _priv *priv, uint8_t } EXPORT_SYMBOL(nec7210_command); =20 -static int pio_read(gpib_board_t *board, struct nec7210_priv *priv, uint8_= t *buffer, +static int pio_read(struct gpib_board *board, struct nec7210_priv *priv, u= int8_t *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval =3D 0; @@ -512,7 +513,7 @@ static int pio_read(gpib_board_t *board, struct nec7210= _priv *priv, uint8_t *buf } =20 #ifdef NEC_DMA -static ssize_t __dma_read(gpib_board_t *board, struct nec7210_priv *priv, = size_t length) +static ssize_t __dma_read(struct gpib_board *board, struct nec7210_priv *p= riv, size_t length) { ssize_t retval =3D 0; size_t count =3D 0; @@ -567,7 +568,7 @@ static ssize_t __dma_read(gpib_board_t *board, struct n= ec7210_priv *priv, size_t return retval ? retval : count; } =20 -static ssize_t dma_read(gpib_board_t *board, struct nec7210_priv *priv, ui= nt8_t *buffer, +static ssize_t dma_read(struct gpib_board *board, struct nec7210_priv *pri= v, uint8_t *buffer, size_t length) { size_t remain =3D length; @@ -594,7 +595,7 @@ static ssize_t dma_read(gpib_board_t *board, struct nec= 7210_priv *priv, uint8_t } #endif =20 -int nec7210_read(gpib_board_t *board, struct nec7210_priv *priv, uint8_t *= buffer, +int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, uint= 8_t *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval =3D 0; @@ -615,7 +616,7 @@ int nec7210_read(gpib_board_t *board, struct nec7210_pr= iv *priv, uint8_t *buffer } EXPORT_SYMBOL(nec7210_read); =20 -static int pio_write_wait(gpib_board_t *board, struct nec7210_priv *priv, +static int pio_write_wait(struct gpib_board *board, struct nec7210_priv *p= riv, short wake_on_lacs, short wake_on_atn, short wake_on_bus_error) { // wait until byte is ready to be sent @@ -641,7 +642,7 @@ static int pio_write_wait(gpib_board_t *board, struct n= ec7210_priv *priv, return 0; } =20 -static int pio_write(gpib_board_t *board, struct nec7210_priv *priv, uint8= _t *buffer, +static int pio_write(struct gpib_board *board, struct nec7210_priv *priv, = uint8_t *buffer, size_t length, size_t *bytes_written) { size_t last_count =3D 0; @@ -684,7 +685,7 @@ static int pio_write(gpib_board_t *board, struct nec721= 0_priv *priv, uint8_t *bu } =20 #ifdef NEC_DMA -static ssize_t __dma_write(gpib_board_t *board, struct nec7210_priv *priv,= dma_addr_t address, +static ssize_t __dma_write(struct gpib_board *board, struct nec7210_priv *= priv, dma_addr_t address, size_t length) { unsigned long flags, dma_irq_flags; @@ -741,7 +742,7 @@ static ssize_t __dma_write(gpib_board_t *board, struct = nec7210_priv *priv, dma_a return retval ? retval : length; } =20 -static ssize_t dma_write(gpib_board_t *board, struct nec7210_priv *priv, u= int8_t *buffer, +static ssize_t dma_write(struct gpib_board *board, struct nec7210_priv *pr= iv, uint8_t *buffer, size_t length) { size_t remain =3D length; @@ -765,8 +766,9 @@ static ssize_t dma_write(gpib_board_t *board, struct ne= c7210_priv *priv, uint8_t return length - remain; } #endif -int nec7210_write(gpib_board_t *board, struct nec7210_priv *priv, uint8_t = *buffer, size_t length, - int send_eoi, size_t *bytes_written) +int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, + uint8_t *buffer, size_t length, int send_eoi, + size_t *bytes_written) { int retval =3D 0; =20 @@ -827,7 +829,7 @@ EXPORT_SYMBOL(nec7210_write); /* * interrupt service routine */ -irqreturn_t nec7210_interrupt(gpib_board_t *board, struct nec7210_priv *pr= iv) +irqreturn_t nec7210_interrupt(struct gpib_board *board, struct nec7210_pri= v *priv) { int status1, status2; =20 @@ -839,7 +841,7 @@ irqreturn_t nec7210_interrupt(gpib_board_t *board, stru= ct nec7210_priv *priv) } EXPORT_SYMBOL(nec7210_interrupt); =20 -irqreturn_t nec7210_interrupt_have_status(gpib_board_t *board, +irqreturn_t nec7210_interrupt_have_status(struct gpib_board *board, struct nec7210_priv *priv, int status1, int status2) { #ifdef NEC_DMA @@ -957,7 +959,7 @@ irqreturn_t nec7210_interrupt_have_status(gpib_board_t = *board, } EXPORT_SYMBOL(nec7210_interrupt_have_status); =20 -void nec7210_board_reset(struct nec7210_priv *priv, const gpib_board_t *bo= ard) +void nec7210_board_reset(struct nec7210_priv *priv, const struct gpib_boar= d *board) { /* 7210 chip reset */ write_byte(priv, AUX_CR, AUXMR); @@ -991,7 +993,7 @@ void nec7210_board_reset(struct nec7210_priv *priv, con= st gpib_board_t *board) } EXPORT_SYMBOL(nec7210_board_reset); =20 -void nec7210_board_online(struct nec7210_priv *priv, const gpib_board_t *b= oard) +void nec7210_board_online(struct nec7210_priv *priv, const struct gpib_boa= rd *board) { /* set GPIB address */ nec7210_primary_address(board, priv, board->pad); --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 755CD21A453 for ; Wed, 19 Mar 2025 21:59:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421598; cv=none; b=C4Mf27QACZKQ942+blEL4xQp3gZ3Gq1OIhXprs+2/2nB/mXAyvuibTIbdK0Au1NhXKqMQ/lQTZ+kUJ8rPR2+TRRtFzc0tjOZ5hyu1PWqhZqfwBsxJAJ2yGyayQ85RvGJHG3yKkgdM2nAbdS/jS3MjP4xUqrIs2IA9zEZTtJXtjI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421598; c=relaxed/simple; bh=K9XEcDg3hFUt+pgsnVKVSSxsUV1vpFe8NvGNg5vUA8w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ixZqC8zA7ZoJFWjsui3CLZGQxZfbgCyOCE1PjH9/YwsktibkEJRwOkAChhwZbmtTOTW798ZBssoQYbRBILb3k0gHdKA5TbqUM7XxyX8iYDecXTjFV+NPT9q9XzU7ZpTmtkqDBUYqbztrSOBLkDu2HETzZ0tA/7zfI71KRD0KbBk= 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=CqWGGp59; arc=none smtp.client-ip=209.85.214.170 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="CqWGGp59" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-226185948ffso1114735ad.0 for ; Wed, 19 Mar 2025 14:59:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421596; x=1743026396; 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=2yfNRF3mQsaB00u+qKr9nR2gyjzf9iruSXW29YkGkzo=; b=CqWGGp59TinA+C4AHxNZIKTs/yaEA1V2t9h11B4wb8jtl1L+n7MI4M+deAHm6lOLmW VeA3QjTjmTuy0ZLKObeklhozjVvuPxQWqYdo067kpREIgg3qp+b9YO/NslctjQj1+1mP SyPIbxcYeiCV9ROiGhzkEzEIfcYhoHh/BK9jmqUv/g8LUGiq9QyC6nQE9PZdyYUI1RLb 7OkLSgV3BEj7rtI/OSEaQZhr2uitI2OODpJOwXfe75SZA1Xl1Lmkm+HJsOpw6v1mKyHh NHOHVm4S3EhENUqQ3l09kUl6TA67oj0J9tfS1XZjr+5lAgPGpoSEX2g11SC7RjEVdmXy +aFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421596; x=1743026396; 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=2yfNRF3mQsaB00u+qKr9nR2gyjzf9iruSXW29YkGkzo=; b=Kss8eLlIeIWSIyUJazZGBoCFeUzzSOmq31Io52hAY+uaYnSXvZIrhSMETKHl0R3KoT kJSKDFGrI5awnTeES/8h9Kr95MsJgIk+NK1HyqNAhB6DzQnk28VxYA3GUntubZ/5vvkE mOq2/Ckg2j0B/JnUjJGX68Wtyh41ADGrrI3d8IDPFByFw4c2hzZxmBSnOr5Lq4FYm6X5 zuQ49zN6B5XqgnreRpTol3VHRAqv2wq+DgrLwvrmCI5sNqarkBW5LTPi6/es6R/X8QQ/ pZq8DLmgpJOcwN56UU3VjqBeX4e2cFn9XM+qx6kNC9tbi0jOhFgLO9aUMqyQBKgQQglE Jatw== X-Forwarded-Encrypted: i=1; AJvYcCXbLA0/pMMpikJ8MS/CSWHx08MFW0qNRJmZrFizsHxVWfUFTy2BGdByFfyXaFLqgnWzqXQsKP661yAx9Es=@vger.kernel.org X-Gm-Message-State: AOJu0YwX5FBnTS7JN+HEjceOCH26mXa3GUQl99NmvhKwqMrQTGYJcYmb 3hieDC60mzHsBwVo+10B4hxkz+lCZF5hz/kgJHpgw1MExUYn5lC3zhW7j1Aoyg== X-Gm-Gg: ASbGnctTmxQBjCGIaQJ0M0pyCWPx/1KiXzbSbmThXId1P9lvTpx1fYRYj6DcUHIUvm5 aSvtmAKnySaNTkZTcmZf/XftRsmwfaxrgblO+yaggTL3IWf8NUX9jEH1lMAkz+4SKfgy8C4MJl+ EIPAJQPUsdMeJ+tcp8ajexr2CDyQcj35ULc9FksQB/u3tYNm6lM4I87qiDbfqbNZMjQQ+XumYxu dU7rBy0rVi1rE5QvmAJc9rfwX/yzbHAWVJWPcpZ7Ag2G0WeaHSu0fNrkPasNw4YGb9gDxm8IUAt CmiZMqmoOsU5bx+mjpULh1Jv/n66bEKttiYGQ43FsuZ7n96gcCHQEf8oljikcy3sL2t5z2HKwlf 8EkNWimDM5Xgic4BH0RHN X-Google-Smtp-Source: AGHT+IHJAmkOQVHJEvYU1V5eaB5TXQD28ZTaEAxRa6QR0hq7JP7erp4VdnpMG0oIBzYFAPpuG6LTbA== X-Received: by 2002:a05:6a00:2d95:b0:736:51a6:78b1 with SMTP id d2e1a72fcca58-7376d62b6b0mr6549394b3a.11.1742421595717; Wed, 19 Mar 2025 14:59:55 -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-73711694e69sm12615549b3a.141.2025.03.19.14.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:55 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 15/20] staging: gpib: ni_usb_gpib: struct gpib_board Date: Wed, 19 Mar 2025 21:59:19 +0000 Message-ID: <20250319215924.19387-16-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 70 +++++++++++------------ 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gp= ib/ni_usb/ni_usb_gpib.c index 1f72abe9f2e4..2da5a580c6cc 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -24,7 +24,7 @@ MODULE_DESCRIPTION("GPIB driver for National Instruments = USB devices"); static struct usb_interface *ni_usb_driver_interfaces[MAX_NUM_NI_USB_INTER= FACES]; =20 static int ni_usb_parse_status_block(const u8 *buffer, struct ni_usb_statu= s_block *status); -static int ni_usb_set_interrupt_monitor(gpib_board_t *board, unsigned int = monitored_bits); +static int ni_usb_set_interrupt_monitor(struct gpib_board *board, unsigned= int monitored_bits); static void ni_usb_stop(struct ni_usb_priv *ni_priv); =20 static DEFINE_MUTEX(ni_usb_hotplug_lock); @@ -310,7 +310,7 @@ static int ni_usb_receive_control_msg(struct ni_usb_pri= v *ni_priv, __u8 request, return retval; } =20 -static void ni_usb_soft_update_status(gpib_board_t *board, unsigned int ni= _usb_ibsta, +static void ni_usb_soft_update_status(struct gpib_board *board, unsigned i= nt ni_usb_ibsta, unsigned int clear_mask) { static const unsigned int ni_usb_ibsta_mask =3D SRQI | ATN | CIC | REM | = LACS | TACS | LOK; @@ -586,7 +586,7 @@ static int ni_usb_write_registers(struct ni_usb_priv *n= i_priv, } =20 // interface functions -static int ni_usb_read(gpib_board_t *board, uint8_t *buffer, size_t length, +static int ni_usb_read(struct gpib_board *board, uint8_t *buffer, size_t l= ength, int *end, size_t *bytes_read) { int retval, parse_retval; @@ -713,7 +713,7 @@ static int ni_usb_read(gpib_board_t *board, uint8_t *bu= ffer, size_t length, return retval; } =20 -static int ni_usb_write(gpib_board_t *board, uint8_t *buffer, size_t lengt= h, +static int ni_usb_write(struct gpib_board *board, uint8_t *buffer, size_t = length, int send_eoi, size_t *bytes_written) { int retval; @@ -814,7 +814,7 @@ static int ni_usb_write(gpib_board_t *board, uint8_t *b= uffer, size_t length, return retval; } =20 -static int ni_usb_command_chunk(gpib_board_t *board, uint8_t *buffer, size= _t length, +static int ni_usb_command_chunk(struct gpib_board *board, uint8_t *buffer,= size_t length, size_t *command_bytes_written) { int retval; @@ -904,7 +904,7 @@ static int ni_usb_command_chunk(gpib_board_t *board, ui= nt8_t *buffer, size_t len return 0; } =20 -static int ni_usb_command(gpib_board_t *board, uint8_t *buffer, size_t len= gth, +static int ni_usb_command(struct gpib_board *board, uint8_t *buffer, size_= t length, size_t *bytes_written) { size_t count; @@ -921,7 +921,7 @@ static int ni_usb_command(gpib_board_t *board, uint8_t = *buffer, size_t length, return 0; } =20 -static int ni_usb_take_control(gpib_board_t *board, int synchronous) +static int ni_usb_take_control(struct gpib_board *board, int synchronous) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -979,7 +979,7 @@ static int ni_usb_take_control(gpib_board_t *board, int= synchronous) return retval; } =20 -static int ni_usb_go_to_standby(gpib_board_t *board) +static int ni_usb_go_to_standby(struct gpib_board *board) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1035,7 +1035,7 @@ static int ni_usb_go_to_standby(gpib_board_t *board) return 0; } =20 -static void ni_usb_request_system_control(gpib_board_t *board, int request= _control) +static void ni_usb_request_system_control(struct gpib_board *board, int re= quest_control) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1083,7 +1083,7 @@ static void ni_usb_request_system_control(gpib_board_= t *board, int request_contr } =20 //FIXME maybe the interface should have a "pulse interface clear" function= that can return an error? -static void ni_usb_interface_clear(gpib_board_t *board, int assert) +static void ni_usb_interface_clear(struct gpib_board *board, int assert) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1129,7 +1129,7 @@ static void ni_usb_interface_clear(gpib_board_t *boar= d, int assert) ni_usb_soft_update_status(board, status.ibsta, 0); } =20 -static void ni_usb_remote_enable(gpib_board_t *board, int enable) +static void ni_usb_remote_enable(struct gpib_board *board, int enable) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1153,7 +1153,7 @@ static void ni_usb_remote_enable(gpib_board_t *board,= int enable) return;// 0; } =20 -static int ni_usb_enable_eos(gpib_board_t *board, uint8_t eos_byte, int co= mpare_8_bits) +static int ni_usb_enable_eos(struct gpib_board *board, uint8_t eos_byte, i= nt compare_8_bits) { struct ni_usb_priv *ni_priv =3D board->private_data; =20 @@ -1166,7 +1166,7 @@ static int ni_usb_enable_eos(gpib_board_t *board, uin= t8_t eos_byte, int compare_ return 0; } =20 -static void ni_usb_disable_eos(gpib_board_t *board) +static void ni_usb_disable_eos(struct gpib_board *board) { struct ni_usb_priv *ni_priv =3D board->private_data; /* adapter gets unhappy if you don't zero all the bits @@ -1176,7 +1176,7 @@ static void ni_usb_disable_eos(gpib_board_t *board) ni_priv->eos_char =3D 0; } =20 -static unsigned int ni_usb_update_status(gpib_board_t *board, unsigned int= clear_mask) +static unsigned int ni_usb_update_status(struct gpib_board *board, unsigne= d int clear_mask) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1228,7 +1228,7 @@ static void ni_usb_stop(struct ni_usb_priv *ni_priv) kfree(buffer); } =20 -static int ni_usb_primary_address(gpib_board_t *board, unsigned int addres= s) +static int ni_usb_primary_address(struct gpib_board *board, unsigned int a= ddress) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1283,7 +1283,7 @@ static int ni_usb_write_sad(struct ni_usb_register *w= rites, int address, int ena return i; } =20 -static int ni_usb_secondary_address(gpib_board_t *board, unsigned int addr= ess, int enable) +static int ni_usb_secondary_address(struct gpib_board *board, unsigned int= address, int enable) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1302,7 +1302,7 @@ static int ni_usb_secondary_address(gpib_board_t *boa= rd, unsigned int address, i return 0; } =20 -static int ni_usb_parallel_poll(gpib_board_t *board, uint8_t *result) +static int ni_usb_parallel_poll(struct gpib_board *board, uint8_t *result) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1354,7 +1354,7 @@ static int ni_usb_parallel_poll(gpib_board_t *board, = uint8_t *result) return retval; } =20 -static void ni_usb_parallel_poll_configure(gpib_board_t *board, uint8_t co= nfig) +static void ni_usb_parallel_poll_configure(struct gpib_board *board, uint8= _t config) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1376,7 +1376,7 @@ static void ni_usb_parallel_poll_configure(gpib_board= _t *board, uint8_t config) return;// 0; } =20 -static void ni_usb_parallel_poll_response(gpib_board_t *board, int ist) +static void ni_usb_parallel_poll_response(struct gpib_board *board, int is= t) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1401,7 +1401,7 @@ static void ni_usb_parallel_poll_response(gpib_board_= t *board, int ist) return;// 0; } =20 -static void ni_usb_serial_poll_response(gpib_board_t *board, u8 status) +static void ni_usb_serial_poll_response(struct gpib_board *board, u8 statu= s) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1423,12 +1423,12 @@ static void ni_usb_serial_poll_response(gpib_board_= t *board, u8 status) return;// 0; } =20 -static uint8_t ni_usb_serial_poll_status(gpib_board_t *board) +static uint8_t ni_usb_serial_poll_status(struct gpib_board *board) { return 0; } =20 -static void ni_usb_return_to_local(gpib_board_t *board) +static void ni_usb_return_to_local(struct gpib_board *board) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1450,7 +1450,7 @@ static void ni_usb_return_to_local(gpib_board_t *boar= d) return;// 0; } =20 -static int ni_usb_line_status(const gpib_board_t *board) +static int ni_usb_line_status(const struct gpib_board *board) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1566,7 +1566,7 @@ static int ni_usb_setup_t1_delay(struct ni_usb_regist= er *reg, unsigned int nano_ return i; } =20 -static unsigned int ni_usb_t1_delay(gpib_board_t *board, unsigned int nano= _sec) +static unsigned int ni_usb_t1_delay(struct gpib_board *board, unsigned int= nano_sec) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1587,7 +1587,7 @@ static unsigned int ni_usb_t1_delay(gpib_board_t *boa= rd, unsigned int nano_sec) return actual_ns; } =20 -static int ni_usb_allocate_private(gpib_board_t *board) +static int ni_usb_allocate_private(struct gpib_board *board) { struct ni_usb_priv *ni_priv; =20 @@ -1610,7 +1610,7 @@ static void ni_usb_free_private(struct ni_usb_priv *n= i_priv) } =20 #define NUM_INIT_WRITES 26 -static int ni_usb_setup_init(gpib_board_t *board, struct ni_usb_register *= writes) +static int ni_usb_setup_init(struct gpib_board *board, struct ni_usb_regis= ter *writes) { struct ni_usb_priv *ni_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(ni_priv->bus_interface= ); @@ -1717,7 +1717,7 @@ static int ni_usb_setup_init(gpib_board_t *board, str= uct ni_usb_register *writes return i; } =20 -static int ni_usb_init(gpib_board_t *board) +static int ni_usb_init(struct gpib_board *board) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1746,7 +1746,7 @@ static int ni_usb_init(gpib_board_t *board) =20 static void ni_usb_interrupt_complete(struct urb *urb) { - gpib_board_t *board =3D urb->context; + struct gpib_board *board =3D urb->context; struct ni_usb_priv *ni_priv =3D board->private_data; struct usb_device *usb_dev =3D interface_to_usbdev(ni_priv->bus_interface= ); int retval; @@ -1782,7 +1782,7 @@ static void ni_usb_interrupt_complete(struct urb *urb) dev_err(&usb_dev->dev, "failed to resubmit interrupt urb\n"); } =20 -static int ni_usb_set_interrupt_monitor(gpib_board_t *board, unsigned int = monitored_bits) +static int ni_usb_set_interrupt_monitor(struct gpib_board *board, unsigned= int monitored_bits) { int retval; struct ni_usb_priv *ni_priv =3D board->private_data; @@ -1813,7 +1813,7 @@ static int ni_usb_set_interrupt_monitor(gpib_board_t = *board, unsigned int monito return 0; } =20 -static int ni_usb_setup_urbs(gpib_board_t *board) +static int ni_usb_setup_urbs(struct gpib_board *board) { struct ni_usb_priv *ni_priv =3D board->private_data; struct usb_device *usb_dev; @@ -2152,7 +2152,7 @@ static inline int ni_usb_device_match(struct usb_inte= rface *interface, return 1; } =20 -static int ni_usb_attach(gpib_board_t *board, const gpib_board_config_t *c= onfig) +static int ni_usb_attach(struct gpib_board *board, const gpib_board_config= _t *config) { int retval; int i, index; @@ -2285,7 +2285,7 @@ static int ni_usb_shutdown_hardware(struct ni_usb_pri= v *ni_priv) return 0; } =20 -static void ni_usb_detach(gpib_board_t *board) +static void ni_usb_detach(struct gpib_board *board) { struct ni_usb_priv *ni_priv; =20 @@ -2392,7 +2392,7 @@ static void ni_usb_driver_disconnect(struct usb_inter= face *interface) mutex_lock(&ni_usb_hotplug_lock); for (i =3D 0; i < MAX_NUM_NI_USB_INTERFACES; i++) { if (ni_usb_driver_interfaces[i] =3D=3D interface) { - gpib_board_t *board =3D usb_get_intfdata(interface); + struct gpib_board *board =3D usb_get_intfdata(interface); =20 if (board) { struct ni_usb_priv *ni_priv =3D board->private_data; @@ -2421,7 +2421,7 @@ static void ni_usb_driver_disconnect(struct usb_inter= face *interface) static int ni_usb_driver_suspend(struct usb_interface *interface, pm_messa= ge_t message) { struct usb_device *usb_dev =3D interface_to_usbdev(interface); - gpib_board_t *board; + struct gpib_board *board; int i, retval; =20 mutex_lock(&ni_usb_hotplug_lock); @@ -2465,7 +2465,7 @@ static int ni_usb_driver_resume(struct usb_interface = *interface) { struct usb_device *usb_dev =3D interface_to_usbdev(interface); =20 - gpib_board_t *board; + struct gpib_board *board; int i, retval; =20 mutex_lock(&ni_usb_hotplug_lock); --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 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 AD1E4221DA0 for ; Wed, 19 Mar 2025 21:59:57 +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=1742421599; cv=none; b=M7ivIVyQAxEyE7qWVODMQqIkIh8Ps9NhNu4KgRVFcit0Qe5VH0WRZSOdBgYHePBZreO0/h6L9ws1dE5g22IVTFLztPAhplz7IAOzkuhhn0dj9DhRcESPo3Z88DLAqXxeZnUWknExggSJZqEo61tYW7fizl4Yk64XWmJBQdgcrAk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421599; c=relaxed/simple; bh=e4dbAKaOnBk95nGbq3xaWlhEEnq7lytyehXJ34fFCcQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ikXxTtFmmNUwz3TR7O7ZfSUcnI3npACvoUlOBNuWB2jBMkGIa1ZtWS7muS4UOwBfg3fi8sbl2qMzY2VUPtHM9FQOauzR4+nsMZ39jZowU4Swtn1QLMNSN1HQn8CAk5Nw5xouJL5SWyZ1bvFh5NBXcxzx+Oqf13Ots8xYKls1M/w= 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=YkNKSKLs; 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="YkNKSKLs" Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-3015001f862so165205a91.3 for ; Wed, 19 Mar 2025 14:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421597; x=1743026397; 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=DdrlZfOcjEPmyLhxrYOcoDg7rx+YwK3dt8M5HQJ7Vxc=; b=YkNKSKLs/cSIZrM28f6j9g7Q7v5h5xrlRpIleaZYXD+432dIaxyPLuhe5tNOWPOI6p 4kYhrl9hFixLhYbJHMCrEHO8ulR/2aI5SNLzBH0Uzgdxm+PWPF58PzvyQuVKEfjspDHG LqoEPtsrKhokA0U66pRwnyAp8S74msS+DY2YCzW954TYMiC8maKHnZ5jyYgjauiJdtpf KrvhxTjDPvVj1sMJdmL/j5HC31H1wg414JPo5BsXDg4Vs3npxdq9x7nMdzDykqx5F25t 3VPL4VMm8/S/6ODCxaP+g8SGpmav0ChYAYpJoS85rrCczK7z5vPgEMNc0xQ/ENPrqGUT /VnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421597; x=1743026397; 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=DdrlZfOcjEPmyLhxrYOcoDg7rx+YwK3dt8M5HQJ7Vxc=; b=AThdIHTNgEN2EMbuCoJORKvzqM842aTBL8hWY8+bq3l3ldbutvWztQHGt4xPOYWpS6 8YNHiWJ/M3i1Vq0TAWGnZQNMQHhiFO66+uIe/AhhQ6Sq1pfpOP7lXwowvx/+OugX66x/ cvjJRUA2w73tBeY6NXpK3Bj64vLQAAl0AtYTPIkPT8jUd/EB7nlFHm9To8uSAEkWudQI 0CFlx2IxKqIgEHzKGVuFa//R3N0Qe5GwSFnq2JYVj4zvHmqpCQCNJx/AiM1Q2fF0E5JV VqpKeZlgBM0htfYrkZAZK9T/Y86SLyugDRvu8UCuX5UqlcL6JL1yq8EaAOP0Bu3kxmwj lfpQ== X-Forwarded-Encrypted: i=1; AJvYcCWphVN3YbRhJ2Y2bBXL5dlO/M53op6DsMlUKG0jm/2bg/BSxVKf/GnBm1NacQS/tgK9tD+V28AshOh6ocs=@vger.kernel.org X-Gm-Message-State: AOJu0YyAW2tETJWWJj09OlzdLdAwl618SWdPVeu21M015HjKqM3TiUSR aGOdgytm3p446tGiQoX2lwvDMoZF52QxaQN0w7hotOLbghF4/Pqknsk7zub7YA== X-Gm-Gg: ASbGnctmVbjQbm/1i+QXy1VP1gGRCy9egp8hNmzMmN5tCNt5GaDk6ZgvNh9FI0zXQdT i0sKD2EQZ6Lu9D+TsfHZLJN+0ke8Jk2p5YjEqPnMD9U30tMVqOlv1sPraPE5oQunHWZ+J9tl0Ch R0oFz6OuSl5RvaA+9MDDIi6IoyiVYdIGlH4UTO+VJsiVtpWkyKzYmHfZ5hwF1zVM8Z+fPf8/eur FZG2b/AeHy1OFUjNx/hgCm0iaKRJcbQ9TCV3qq4uJYeTJjyUK4ZMhD49VXr4cH+EEUHn8io105V dl3oDWYZj1tmCk9jMxTXTfInbCEQitqJ00lLNrsIUuqziqOLZKCNI41Iny3cLPMb4kRmeIJGqHC FN/E9RjyEcA== X-Google-Smtp-Source: AGHT+IFqtfzZcIJzqrMS8fVLbpZe4AfElC5e1G6eMy+1t8WREOI4FS/mYUqR+pMxpIN+BBHuiCJhVg== X-Received: by 2002:a17:90b:3c11:b0:2ff:5a9d:937f with SMTP id 98e67ed59e1d1-301be200718mr7480776a91.24.1742421596915; Wed, 19 Mar 2025 14:59:56 -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 98e67ed59e1d1-301bf635929sm2426373a91.40.2025.03.19.14.59.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:56 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 16/20] staging: gpib: pc2: struct gpib_board Date: Wed, 19 Mar 2025 21:59:20 +0000 Message-ID: <20250319215924.19387-17-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/pc2/pc2_gpib.c | 68 ++++++++++++++--------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2= /pc2_gpib.c index 6711851301ec..d8e0733d8ab0 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -58,7 +58,7 @@ MODULE_DESCRIPTION("GPIB driver for PC2/PC2a and compatib= le devices"); =20 irqreturn_t pc2_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct pc2_priv *priv =3D board->private_data; unsigned long flags; irqreturn_t retval; @@ -71,7 +71,7 @@ irqreturn_t pc2_interrupt(int irq, void *arg) =20 irqreturn_t pc2a_interrupt(int irq, void *arg) { - gpib_board_t *board =3D arg; + struct gpib_board *board =3D arg; struct pc2_priv *priv =3D board->private_data; int status1, status2; unsigned long flags; @@ -90,7 +90,7 @@ irqreturn_t pc2a_interrupt(int irq, void *arg) } =20 // wrappers for interface functions -static int pc2_read(gpib_board_t *board, uint8_t *buffer, size_t length, i= nt *end, +static int pc2_read(struct gpib_board *board, uint8_t *buffer, size_t leng= th, int *end, size_t *bytes_read) { struct pc2_priv *priv =3D board->private_data; @@ -98,7 +98,7 @@ static int pc2_read(gpib_board_t *board, uint8_t *buffer,= size_t length, int *en return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, byte= s_read); } =20 -static int pc2_write(gpib_board_t *board, uint8_t *buffer, size_t length, = int send_eoi, +static int pc2_write(struct gpib_board *board, uint8_t *buffer, size_t len= gth, int send_eoi, size_t *bytes_written) { struct pc2_priv *priv =3D board->private_data; @@ -106,133 +106,133 @@ static int pc2_write(gpib_board_t *board, uint8_t *= buffer, size_t length, int se return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int pc2_command(gpib_board_t *board, uint8_t *buffer, size_t length= , size_t *bytes_written) +static int pc2_command(struct gpib_board *board, uint8_t *buffer, size_t l= ength, size_t *bytes_written) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_= written); } =20 -static int pc2_take_control(gpib_board_t *board, int synchronous) +static int pc2_take_control(struct gpib_board *board, int synchronous) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } =20 -static int pc2_go_to_standby(gpib_board_t *board) +static int pc2_go_to_standby(struct gpib_board *board) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_go_to_standby(board, &priv->nec7210_priv); } =20 -static void pc2_request_system_control(gpib_board_t *board, int request_co= ntrol) +static void pc2_request_system_control(struct gpib_board *board, int reque= st_control) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_request_system_control(board, &priv->nec7210_priv, request_contro= l); } =20 -static void pc2_interface_clear(gpib_board_t *board, int assert) +static void pc2_interface_clear(struct gpib_board *board, int assert) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_interface_clear(board, &priv->nec7210_priv, assert); } =20 -static void pc2_remote_enable(gpib_board_t *board, int enable) +static void pc2_remote_enable(struct gpib_board *board, int enable) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_remote_enable(board, &priv->nec7210_priv, enable); } =20 -static int pc2_enable_eos(gpib_board_t *board, uint8_t eos_byte, int compa= re_8_bits) +static int pc2_enable_eos(struct gpib_board *board, uint8_t eos_byte, int = compare_8_bits) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8= _bits); } =20 -static void pc2_disable_eos(gpib_board_t *board) +static void pc2_disable_eos(struct gpib_board *board) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_disable_eos(board, &priv->nec7210_priv); } =20 -static unsigned int pc2_update_status(gpib_board_t *board, unsigned int cl= ear_mask) +static unsigned int pc2_update_status(struct gpib_board *board, unsigned i= nt clear_mask) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } =20 -static int pc2_primary_address(gpib_board_t *board, unsigned int address) +static int pc2_primary_address(struct gpib_board *board, unsigned int addr= ess) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_primary_address(board, &priv->nec7210_priv, address); } =20 -static int pc2_secondary_address(gpib_board_t *board, unsigned int address= , int enable) +static int pc2_secondary_address(struct gpib_board *board, unsigned int ad= dress, int enable) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_secondary_address(board, &priv->nec7210_priv, address, ena= ble); } =20 -static int pc2_parallel_poll(gpib_board_t *board, uint8_t *result) +static int pc2_parallel_poll(struct gpib_board *board, uint8_t *result) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } =20 -static void pc2_parallel_poll_configure(gpib_board_t *board, uint8_t confi= g) +static void pc2_parallel_poll_configure(struct gpib_board *board, uint8_t = config) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config); } =20 -static void pc2_parallel_poll_response(gpib_board_t *board, int ist) +static void pc2_parallel_poll_response(struct gpib_board *board, int ist) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } =20 -static void pc2_serial_poll_response(gpib_board_t *board, uint8_t status) +static void pc2_serial_poll_response(struct gpib_board *board, uint8_t sta= tus) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } =20 -static uint8_t pc2_serial_poll_status(gpib_board_t *board) +static uint8_t pc2_serial_poll_status(struct gpib_board *board) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_serial_poll_status(board, &priv->nec7210_priv); } =20 -static unsigned int pc2_t1_delay(gpib_board_t *board, unsigned int nano_se= c) +static unsigned int pc2_t1_delay(struct gpib_board *board, unsigned int na= no_sec) { struct pc2_priv *priv =3D board->private_data; =20 return nec7210_t1_delay(board, &priv->nec7210_priv, nano_sec); } =20 -static void pc2_return_to_local(gpib_board_t *board) +static void pc2_return_to_local(struct gpib_board *board) { struct pc2_priv *priv =3D board->private_data; =20 nec7210_return_to_local(board, &priv->nec7210_priv); } =20 -static int allocate_private(gpib_board_t *board) +static int allocate_private(struct gpib_board *board) { struct pc2_priv *priv; =20 @@ -245,13 +245,13 @@ static int allocate_private(gpib_board_t *board) return 0; } =20 -static void free_private(gpib_board_t *board) +static void free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 -static int pc2_generic_attach(gpib_board_t *board, const gpib_board_config= _t *config, +static int pc2_generic_attach(struct gpib_board *board, const gpib_board_c= onfig_t *config, enum nec7210_chipset chipset) { struct pc2_priv *pc2_priv; @@ -294,7 +294,7 @@ static int pc2_generic_attach(gpib_board_t *board, cons= t gpib_board_config_t *co return 0; } =20 -static int pc2_attach(gpib_board_t *board, const gpib_board_config_t *conf= ig) +static int pc2_attach(struct gpib_board *board, const gpib_board_config_t = *config) { int isr_flags =3D 0; struct pc2_priv *pc2_priv; @@ -338,7 +338,7 @@ static int pc2_attach(gpib_board_t *board, const gpib_b= oard_config_t *config) return 0; } =20 -static void pc2_detach(gpib_board_t *board) +static void pc2_detach(struct gpib_board *board) { struct pc2_priv *pc2_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -365,7 +365,7 @@ static void pc2_detach(gpib_board_t *board) free_private(board); } =20 -static int pc2a_common_attach(gpib_board_t *board, const gpib_board_config= _t *config, +static int pc2a_common_attach(struct gpib_board *board, const gpib_board_c= onfig_t *config, unsigned int num_registers, enum nec7210_chipset chipset) { unsigned int i, j; @@ -459,22 +459,22 @@ static int pc2a_common_attach(gpib_board_t *board, co= nst gpib_board_config_t *co return 0; } =20 -static int pc2a_attach(gpib_board_t *board, const gpib_board_config_t *con= fig) +static int pc2a_attach(struct gpib_board *board, const gpib_board_config_t= *config) { return pc2a_common_attach(board, config, pc2a_iosize, NEC7210); } =20 -static int pc2a_cb7210_attach(gpib_board_t *board, const gpib_board_config= _t *config) +static int pc2a_cb7210_attach(struct gpib_board *board, const gpib_board_c= onfig_t *config) { return pc2a_common_attach(board, config, pc2a_iosize, CB7210); } =20 -static int pc2_2a_attach(gpib_board_t *board, const gpib_board_config_t *c= onfig) +static int pc2_2a_attach(struct gpib_board *board, const gpib_board_config= _t *config) { return pc2a_common_attach(board, config, pc2_2a_iosize, NAT4882); } =20 -static void pc2a_common_detach(gpib_board_t *board, unsigned int num_regis= ters) +static void pc2a_common_detach(struct gpib_board *board, unsigned int num_= registers) { int i; struct pc2_priv *pc2_priv =3D board->private_data; @@ -507,12 +507,12 @@ static void pc2a_common_detach(gpib_board_t *board, u= nsigned int num_registers) free_private(board); } =20 -static void pc2a_detach(gpib_board_t *board) +static void pc2a_detach(struct gpib_board *board) { pc2a_common_detach(board, pc2a_iosize); } =20 -static void pc2_2a_detach(gpib_board_t *board) +static void pc2_2a_detach(struct gpib_board *board) { pc2a_common_detach(board, pc2_2a_iosize); } --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (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 C901B221F3A for ; Wed, 19 Mar 2025 21:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421601; cv=none; b=ncEA0BBEutW5ck36zf6kmcFiL+Bq87zQVJjT0284WHPTDpYuvxwO7QYK5ZLmw5olb4b0YCmX+cBKWHxB8VpggjRVhJcgZj8KmR/uJxogWskhkj7C0EaBjZS76lERgy/5pzbcPToUNUT8t03RWT6rT8Rha+t98qgKyLv7sfE5ALc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421601; c=relaxed/simple; bh=1RRg6qzGSb0YpVqltZE3Qn9x6p/LJwN2y0RuzoUDpF8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PJbCG3RalruynGWqq2QJyApuNb5wcBS84gutSybC4Wsv6aU6IONNg/u+E1eQHBuSskqwdQrF4wnfY9OqFvvv080w8jafyNWFnX1/JrQwycAGOxseq3crGsDGGjov/94EZS5XPWxQ0LIwDHEeq+O0+q1BsLdQ3ELIIRXquazo1YM= 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=Y30+Pem0; arc=none smtp.client-ip=209.85.216.51 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="Y30+Pem0" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-301cda78d48so242735a91.0 for ; Wed, 19 Mar 2025 14:59:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421598; x=1743026398; 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=MaWeBMilM3QY+XIg7AXsmdsftbfaiK01uF9SVEKysGQ=; b=Y30+Pem0hdTQ7o/lz69vnBN8LL3F/SSofqJ/U/P6C0dhgCOoP+xcL2S+B0k1wLPsjU +B6sNBhitsUHeLg9PHMzoYVuFMKYiWiPXM47Ny3dyIWMUTuZuTjiKAFAhkeAits6TwO0 fQNTcsBHo2JwcOzdFLa9rjoykwcx0kO0LS779rRmfd1Tcxcxe5LNFMdZNUB996c2nccQ xlT1Z8+Pw03TCVo9MxjmQfrM79to6h66Vc8YtLn6TNNh+B6qjxMzYC1WyrOkStR1tvkN 7PddhgNqoWuZ6MZHLa4qV92X8HMyZ+KTLsHSRUpXnp2c9/5TLZKjEClJX1fEJZ0tKTxg IqSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421598; x=1743026398; 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=MaWeBMilM3QY+XIg7AXsmdsftbfaiK01uF9SVEKysGQ=; b=JOrVw7Ciam/nrFKyzcOCYS/z8YwHxhFIwc06EbsA2qBqpcEWEy9MgO39CZiS18tv1m hN9QjWcYCwdT4yPeETkYxovUHxSIHv1/QxtSy6u2XiDfQ99eyJKObuNM23mHEz7yGfpU UZhN08d6nbN3JmokOiiSAn0z4llizu+GqM72Z+0quH4L9aUPFulXZphA/hZZkQxV6uNT LgM7VWcNJ5uIe6nooH3P2pmf5Zq6NLtq4UQWzYgGA6DAdz+5c9ifNHexIJC42Sl8GfQX SFpbHaMaue779md+0Fz5IZocokR9bMsqgb4L3GhvflI7ZxJ2TZY0RR2Ah0y4ExBY0nMH 6eWA== X-Forwarded-Encrypted: i=1; AJvYcCUylnGEWHsY+3vNPWhY/UjJqnLJd0WsndNxjoxk6nY1m8JVvKgPC6tWxdsk+JAUXlpUw/R7S4Y5i2LuGJ4=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+hKzjbd2dO9lmxG1YE6phDkmZIY+uySbpbSU8jgJkhh1MFP7b JEhObPakZPuAHsCOi2t2TTfgZNQ5s/vYqJVEgaODF8K1b/sCyBxr0H521uxQSQ== X-Gm-Gg: ASbGncsLKAdCyl12UpbZTAqlU9gKntzeCRMvd4gvnRRBedb3w9fPW8rcvzHanMmY6G0 8vcKkb0VN04KaZPLcGs+WR+gS0jyhN/HHdHIT3lcHMRSD2x28zx0Vpm5flcb+d3756Pqx8nfhQR zJ576NaUKnGvVBXc1yjeBFLBPyibhziPA7KzzwVzB5mwxZKlltn+QvT2GeyshzgPlCn+EJ2nhjF 0j8oAPM5CBl63F5jovX5Ji+zfYHperOSishak6ztdZqD1iuK2she4Wuw7Ra/4yh5wZhH2VrVU70 rYV3ZkvTqDlFLSkH02U+Lv9OOg5RiYB283eYj6asqCJQLhildv565snP9LcZZBZSc5JvKuv/gVC OAwcVsUN3Ww== X-Google-Smtp-Source: AGHT+IHFLQ+Jd8/iP/8NaD7eyVGRJwo2XoEopxKYcEZQpwjV2Kr8LF9qcLhUhr/mf7zCEMta6D4gqw== X-Received: by 2002:a17:90b:3b42:b0:2ff:62f3:5b31 with SMTP id 98e67ed59e1d1-301d5349fe8mr1011997a91.29.1742421598185; Wed, 19 Mar 2025 14:59:58 -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 98e67ed59e1d1-301bf5a1591sm2213539a91.21.2025.03.19.14.59.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:57 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 17/20] staging: gpib: tms9914: struct gpib_board Date: Wed, 19 Mar 2025 21:59:21 +0000 Message-ID: <20250319215924.19387-18-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/include/tms9914.h | 52 ++++++++++---------- drivers/staging/gpib/tms9914/tms9914.c | 66 +++++++++++++------------- 2 files changed, 59 insertions(+), 59 deletions(-) diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/= include/tms9914.h index d8c8d1c9b131..424c95ad85c6 100644 --- a/drivers/staging/gpib/include/tms9914.h +++ b/drivers/staging/gpib/include/tms9914.h @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 */ +//* SPDX-License-Identifier: GPL-2.0 */ =20 /*************************************************************************= ** * copyright : (C) 2002 by Frank Mori Hess @@ -79,47 +79,47 @@ enum { }; =20 // interface functions -int tms9914_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *= buffer, +int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, uint= 8_t *buffer, size_t length, int *end, size_t *bytes_read); -int tms9914_write(gpib_board_t *board, struct tms9914_priv *priv, uint8_t = *buffer, +int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uin= t8_t *buffer, size_t length, int send_eoi, size_t *bytes_written); -int tms9914_command(gpib_board_t *board, struct tms9914_priv *priv, uint8_= t *buffer, +int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, u= int8_t *buffer, size_t length, size_t *bytes_written); -int tms9914_take_control(gpib_board_t *board, struct tms9914_priv *priv, i= nt syncronous); +int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *pr= iv, int syncronous); /* alternate version of tms9914_take_control which works around buggy tcs * implementation. */ -int tms9914_take_control_workaround(gpib_board_t *board, struct tms9914_pr= iv *priv, +int tms9914_take_control_workaround(struct gpib_board *board, struct tms99= 14_priv *priv, int syncronous); -int tms9914_go_to_standby(gpib_board_t *board, struct tms9914_priv *priv); -void tms9914_request_system_control(gpib_board_t *board, struct tms9914_pr= iv *priv, +int tms9914_go_to_standby(struct gpib_board *board, struct tms9914_priv *p= riv); +void tms9914_request_system_control(struct gpib_board *board, struct tms99= 14_priv *priv, int request_control); -void tms9914_interface_clear(gpib_board_t *board, struct tms9914_priv *pri= v, int assert); -void tms9914_remote_enable(gpib_board_t *board, struct tms9914_priv *priv,= int enable); -int tms9914_enable_eos(gpib_board_t *board, struct tms9914_priv *priv, uin= t8_t eos_bytes, +void tms9914_interface_clear(struct gpib_board *board, struct tms9914_priv= *priv, int assert); +void tms9914_remote_enable(struct gpib_board *board, struct tms9914_priv *= priv, int enable); +int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv= , uint8_t eos_bytes, int compare_8_bits); -void tms9914_disable_eos(gpib_board_t *board, struct tms9914_priv *priv); -unsigned int tms9914_update_status(gpib_board_t *board, struct tms9914_pri= v *priv, +void tms9914_disable_eos(struct gpib_board *board, struct tms9914_priv *pr= iv); +unsigned int tms9914_update_status(struct gpib_board *board, struct tms991= 4_priv *priv, unsigned int clear_mask); -int tms9914_primary_address(gpib_board_t *board, +int tms9914_primary_address(struct gpib_board *board, struct tms9914_priv *priv, unsigned int address); -int tms9914_secondary_address(gpib_board_t *board, struct tms9914_priv *pr= iv, +int tms9914_secondary_address(struct gpib_board *board, struct tms9914_pri= v *priv, unsigned int address, int enable); -int tms9914_parallel_poll(gpib_board_t *board, struct tms9914_priv *priv, = uint8_t *result); -void tms9914_parallel_poll_configure(gpib_board_t *board, +int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *p= riv, uint8_t *result); +void tms9914_parallel_poll_configure(struct gpib_board *board, struct tms9914_priv *priv, uint8_t config); -void tms9914_parallel_poll_response(gpib_board_t *board, +void tms9914_parallel_poll_response(struct gpib_board *board, struct tms9914_priv *priv, int ist); -void tms9914_serial_poll_response(gpib_board_t *board, struct tms9914_priv= *priv, uint8_t status); -uint8_t tms9914_serial_poll_status(gpib_board_t *board, struct tms9914_pri= v *priv); -int tms9914_line_status(const gpib_board_t *board, struct tms9914_priv *pr= iv); -unsigned int tms9914_t1_delay(gpib_board_t *board, struct tms9914_priv *pr= iv, +void tms9914_serial_poll_response(struct gpib_board *board, struct tms9914= _priv *priv, uint8_t status); +uint8_t tms9914_serial_poll_status(struct gpib_board *board, struct tms991= 4_priv *priv); +int tms9914_line_status(const struct gpib_board *board, struct tms9914_pri= v *priv); +unsigned int tms9914_t1_delay(struct gpib_board *board, struct tms9914_pri= v *priv, unsigned int nano_sec); -void tms9914_return_to_local(const gpib_board_t *board, struct tms9914_pri= v *priv); +void tms9914_return_to_local(const struct gpib_board *board, struct tms991= 4_priv *priv); =20 // utility functions void tms9914_board_reset(struct tms9914_priv *priv); -void tms9914_online(gpib_board_t *board, struct tms9914_priv *priv); +void tms9914_online(struct gpib_board *board, struct tms9914_priv *priv); void tms9914_release_holdoff(struct tms9914_priv *priv); void tms9914_set_holdoff_mode(struct tms9914_priv *priv, enum tms9914_hold= off_mode mode); =20 @@ -130,8 +130,8 @@ uint8_t tms9914_iomem_read_byte(struct tms9914_priv *pr= iv, unsigned int register void tms9914_iomem_write_byte(struct tms9914_priv *priv, uint8_t data, uns= igned int register_num); =20 // interrupt service routine -irqreturn_t tms9914_interrupt(gpib_board_t *board, struct tms9914_priv *pr= iv); -irqreturn_t tms9914_interrupt_have_status(gpib_board_t *board, struct tms9= 914_priv *priv, +irqreturn_t tms9914_interrupt(struct gpib_board *board, struct tms9914_pri= v *priv); +irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct= tms9914_priv *priv, int status1, int status2); =20 // tms9914 has 8 registers diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/= tms9914/tms9914.c index c563fcab44fc..2abda9d7dfcb 100644 --- a/drivers/staging/gpib/tms9914/tms9914.c +++ b/drivers/staging/gpib/tms9914/tms9914.c @@ -27,9 +27,9 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB library for tms9914"); =20 -static unsigned int update_status_nolock(gpib_board_t *board, struct tms99= 14_priv *priv); +static unsigned int update_status_nolock(struct gpib_board *board, struct = tms9914_priv *priv); =20 -int tms9914_take_control(gpib_board_t *board, struct tms9914_priv *priv, i= nt synchronous) +int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *pr= iv, int synchronous) { int i; const int timeout =3D 100; @@ -66,7 +66,7 @@ EXPORT_SYMBOL_GPL(tms9914_take_control); * The rest of the tms9914 based drivers still use tms9914_take_control * directly (which does issue tcs). */ -int tms9914_take_control_workaround(gpib_board_t *board, struct tms9914_pr= iv *priv, int synchronous) +int tms9914_take_control_workaround(struct gpib_board *board, struct tms99= 14_priv *priv, int synchronous) { if (synchronous) return -ETIMEDOUT; @@ -74,7 +74,7 @@ int tms9914_take_control_workaround(gpib_board_t *board, = struct tms9914_priv *pr } EXPORT_SYMBOL_GPL(tms9914_take_control_workaround); =20 -int tms9914_go_to_standby(gpib_board_t *board, struct tms9914_priv *priv) +int tms9914_go_to_standby(struct gpib_board *board, struct tms9914_priv *p= riv) { int i; const int timeout =3D 1000; @@ -95,7 +95,7 @@ int tms9914_go_to_standby(gpib_board_t *board, struct tms= 9914_priv *priv) } EXPORT_SYMBOL_GPL(tms9914_go_to_standby); =20 -void tms9914_interface_clear(gpib_board_t *board, struct tms9914_priv *pri= v, int assert) +void tms9914_interface_clear(struct gpib_board *board, struct tms9914_priv= *priv, int assert) { if (assert) { write_byte(priv, AUX_SIC | AUX_CS, AUXCR); @@ -107,7 +107,7 @@ void tms9914_interface_clear(gpib_board_t *board, struc= t tms9914_priv *priv, int } EXPORT_SYMBOL_GPL(tms9914_interface_clear); =20 -void tms9914_remote_enable(gpib_board_t *board, struct tms9914_priv *priv,= int enable) +void tms9914_remote_enable(struct gpib_board *board, struct tms9914_priv *= priv, int enable) { if (enable) write_byte(priv, AUX_SRE | AUX_CS, AUXCR); @@ -116,7 +116,7 @@ void tms9914_remote_enable(gpib_board_t *board, struct = tms9914_priv *priv, int e } EXPORT_SYMBOL_GPL(tms9914_remote_enable); =20 -void tms9914_request_system_control(gpib_board_t *board, struct tms9914_pr= iv *priv, +void tms9914_request_system_control(struct gpib_board *board, struct tms99= 14_priv *priv, int request_control) { if (request_control) { @@ -128,7 +128,7 @@ void tms9914_request_system_control(gpib_board_t *board= , struct tms9914_priv *pr } EXPORT_SYMBOL_GPL(tms9914_request_system_control); =20 -unsigned int tms9914_t1_delay(gpib_board_t *board, struct tms9914_priv *pr= iv, +unsigned int tms9914_t1_delay(struct gpib_board *board, struct tms9914_pri= v *priv, unsigned int nano_sec) { static const int clock_period =3D 200; // assuming 5Mhz input clock @@ -154,7 +154,7 @@ unsigned int tms9914_t1_delay(gpib_board_t *board, stru= ct tms9914_priv *priv, } EXPORT_SYMBOL_GPL(tms9914_t1_delay); =20 -void tms9914_return_to_local(const gpib_board_t *board, struct tms9914_pri= v *priv) +void tms9914_return_to_local(const struct gpib_board *board, struct tms991= 4_priv *priv) { write_byte(priv, AUX_RTL, AUXCR); } @@ -192,7 +192,7 @@ void tms9914_release_holdoff(struct tms9914_priv *priv) } EXPORT_SYMBOL_GPL(tms9914_release_holdoff); =20 -int tms9914_enable_eos(gpib_board_t *board, struct tms9914_priv *priv, uin= t8_t eos_byte, +int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv= , uint8_t eos_byte, int compare_8_bits) { priv->eos =3D eos_byte; @@ -203,13 +203,13 @@ int tms9914_enable_eos(gpib_board_t *board, struct tm= s9914_priv *priv, uint8_t e } EXPORT_SYMBOL(tms9914_enable_eos); =20 -void tms9914_disable_eos(gpib_board_t *board, struct tms9914_priv *priv) +void tms9914_disable_eos(struct gpib_board *board, struct tms9914_priv *pr= iv) { priv->eos_flags &=3D ~REOS; } EXPORT_SYMBOL(tms9914_disable_eos); =20 -int tms9914_parallel_poll(gpib_board_t *board, struct tms9914_priv *priv, = uint8_t *result) +int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *p= riv, uint8_t *result) { // execute parallel poll write_byte(priv, AUX_CS | AUX_RPP, AUXCR); @@ -234,7 +234,7 @@ static void set_ppoll_reg(struct tms9914_priv *priv, in= t enable, } } =20 -void tms9914_parallel_poll_configure(gpib_board_t *board, +void tms9914_parallel_poll_configure(struct gpib_board *board, struct tms9914_priv *priv, uint8_t config) { priv->ppoll_enable =3D (config & PPC_DISABLE) =3D=3D 0; @@ -244,14 +244,14 @@ void tms9914_parallel_poll_configure(gpib_board_t *bo= ard, } EXPORT_SYMBOL(tms9914_parallel_poll_configure); =20 -void tms9914_parallel_poll_response(gpib_board_t *board, +void tms9914_parallel_poll_response(struct gpib_board *board, struct tms9914_priv *priv, int ist) { set_ppoll_reg(priv, priv->ppoll_enable, priv->ppoll_line, priv->ppoll_sen= se, ist); } EXPORT_SYMBOL(tms9914_parallel_poll_response); =20 -void tms9914_serial_poll_response(gpib_board_t *board, struct tms9914_priv= *priv, uint8_t status) +void tms9914_serial_poll_response(struct gpib_board *board, struct tms9914= _priv *priv, uint8_t status) { unsigned long flags; =20 @@ -266,7 +266,7 @@ void tms9914_serial_poll_response(gpib_board_t *board, = struct tms9914_priv *priv } EXPORT_SYMBOL(tms9914_serial_poll_response); =20 -uint8_t tms9914_serial_poll_status(gpib_board_t *board, struct tms9914_pri= v *priv) +uint8_t tms9914_serial_poll_status(struct gpib_board *board, struct tms991= 4_priv *priv) { u8 status; unsigned long flags; @@ -279,7 +279,7 @@ uint8_t tms9914_serial_poll_status(gpib_board_t *board,= struct tms9914_priv *pri } EXPORT_SYMBOL(tms9914_serial_poll_status); =20 -int tms9914_primary_address(gpib_board_t *board, struct tms9914_priv *priv= , unsigned int address) +int tms9914_primary_address(struct gpib_board *board, struct tms9914_priv = *priv, unsigned int address) { // put primary address in address0 write_byte(priv, address & ADDRESS_MASK, ADR); @@ -287,7 +287,7 @@ int tms9914_primary_address(gpib_board_t *board, struct= tms9914_priv *priv, unsi } EXPORT_SYMBOL(tms9914_primary_address); =20 -int tms9914_secondary_address(gpib_board_t *board, struct tms9914_priv *pr= iv, +int tms9914_secondary_address(struct gpib_board *board, struct tms9914_pri= v *priv, unsigned int address, int enable) { if (enable) @@ -300,7 +300,7 @@ int tms9914_secondary_address(gpib_board_t *board, stru= ct tms9914_priv *priv, } EXPORT_SYMBOL(tms9914_secondary_address); =20 -unsigned int tms9914_update_status(gpib_board_t *board, struct tms9914_pri= v *priv, +unsigned int tms9914_update_status(struct gpib_board *board, struct tms991= 4_priv *priv, unsigned int clear_mask) { unsigned long flags; @@ -342,7 +342,7 @@ static void update_listener_state(struct tms9914_priv *= priv, unsigned int addres } } =20 -static unsigned int update_status_nolock(gpib_board_t *board, struct tms99= 14_priv *priv) +static unsigned int update_status_nolock(struct gpib_board *board, struct = tms9914_priv *priv) { int address_status; int bsr_bits; @@ -388,7 +388,7 @@ static unsigned int update_status_nolock(gpib_board_t *= board, struct tms9914_pri return board->status; } =20 -int tms9914_line_status(const gpib_board_t *board, struct tms9914_priv *pr= iv) +int tms9914_line_status(const struct gpib_board *board, struct tms9914_pri= v *priv) { int bsr_bits; int status =3D VALID_ALL; @@ -433,7 +433,7 @@ static int check_for_eos(struct tms9914_priv *priv, uin= t8_t byte) return 0; } =20 -static int wait_for_read_byte(gpib_board_t *board, struct tms9914_priv *pr= iv) +static int wait_for_read_byte(struct gpib_board *board, struct tms9914_pri= v *priv) { if (wait_event_interruptible(board->wait, test_bit(READ_READY_BN, &priv->state) || @@ -449,7 +449,7 @@ static int wait_for_read_byte(gpib_board_t *board, stru= ct tms9914_priv *priv) return 0; } =20 -static inline uint8_t tms9914_read_data_in(gpib_board_t *board, struct tms= 9914_priv *priv, int *end) +static inline uint8_t tms9914_read_data_in(struct gpib_board *board, struc= t tms9914_priv *priv, int *end) { unsigned long flags; u8 data; @@ -480,7 +480,7 @@ static inline uint8_t tms9914_read_data_in(gpib_board_t= *board, struct tms9914_p return data; } =20 -static int pio_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_= t *buffer, +static int pio_read(struct gpib_board *board, struct tms9914_priv *priv, u= int8_t *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval =3D 0; @@ -501,7 +501,7 @@ static int pio_read(gpib_board_t *board, struct tms9914= _priv *priv, uint8_t *buf return retval; } =20 -int tms9914_read(gpib_board_t *board, struct tms9914_priv *priv, uint8_t *= buffer, +int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, uint= 8_t *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval =3D 0; @@ -541,7 +541,7 @@ int tms9914_read(gpib_board_t *board, struct tms9914_pr= iv *priv, uint8_t *buffer } EXPORT_SYMBOL(tms9914_read); =20 -static int pio_write_wait(gpib_board_t *board, struct tms9914_priv *priv) +static int pio_write_wait(struct gpib_board *board, struct tms9914_priv *p= riv) { // wait until next byte is ready to be sent if (wait_event_interruptible(board->wait, @@ -561,7 +561,7 @@ static int pio_write_wait(gpib_board_t *board, struct t= ms9914_priv *priv) return 0; } =20 -static int pio_write(gpib_board_t *board, struct tms9914_priv *priv, uint8= _t *buffer, +static int pio_write(struct gpib_board *board, struct tms9914_priv *priv, = uint8_t *buffer, size_t length, size_t *bytes_written) { ssize_t retval =3D 0; @@ -585,7 +585,7 @@ static int pio_write(gpib_board_t *board, struct tms991= 4_priv *priv, uint8_t *bu return length; } =20 -int tms9914_write(gpib_board_t *board, struct tms9914_priv *priv, uint8_t = *buffer, size_t length, +int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uin= t8_t *buffer, size_t length, int send_eoi, size_t *bytes_written) { ssize_t retval =3D 0; @@ -620,7 +620,7 @@ int tms9914_write(gpib_board_t *board, struct tms9914_p= riv *priv, uint8_t *buffe } EXPORT_SYMBOL(tms9914_write); =20 -static void check_my_address_state(gpib_board_t *board, struct tms9914_pri= v *priv, int cmd_byte) +static void check_my_address_state(struct gpib_board *board, struct tms991= 4_priv *priv, int cmd_byte) { if (cmd_byte =3D=3D MLA(board->pad)) { priv->primary_listen_addressed =3D 1; @@ -655,7 +655,7 @@ static void check_my_address_state(gpib_board_t *board,= struct tms9914_priv *pri } } =20 -int tms9914_command(gpib_board_t *board, struct tms9914_priv *priv, uint8= _t *buffer, +int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, = uint8_t *buffer, size_t length, size_t *bytes_written) { int retval =3D 0; @@ -692,7 +692,7 @@ int tms9914_command(gpib_board_t *board, struct tms9914= _priv *priv, uint8_t *bu } EXPORT_SYMBOL(tms9914_command); =20 -irqreturn_t tms9914_interrupt(gpib_board_t *board, struct tms9914_priv *pr= iv) +irqreturn_t tms9914_interrupt(struct gpib_board *board, struct tms9914_pri= v *priv) { int status0, status1; =20 @@ -703,7 +703,7 @@ irqreturn_t tms9914_interrupt(gpib_board_t *board, stru= ct tms9914_priv *priv) } EXPORT_SYMBOL(tms9914_interrupt); =20 -irqreturn_t tms9914_interrupt_have_status(gpib_board_t *board, struct tms9= 914_priv *priv, +irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct= tms9914_priv *priv, int status0, int status1) { // record reception of END @@ -837,7 +837,7 @@ void tms9914_board_reset(struct tms9914_priv *priv) } EXPORT_SYMBOL_GPL(tms9914_board_reset); =20 -void tms9914_online(gpib_board_t *board, struct tms9914_priv *priv) +void tms9914_online(struct gpib_board *board, struct tms9914_priv *priv) { /* set GPIB address */ tms9914_primary_address(board, priv, board->pad); --=20 2.43.0 From nobody Wed Dec 17 08:56:03 2025 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 4604B21D3FB for ; Wed, 19 Mar 2025 21:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421604; cv=none; b=Tkaji4n5cTYJlN40njLmU54ndkrTvfLSD9sybR9XM4LxQ9pnjjI/vdYruwBjtvyPFdooUqDeQAg9HLw3MVMyDHPw1ZkNsKEfuTwtK3cxUVLhM7qANiOrh+05Wqenw0iA6dAomNV7nQvy65cZ45TI/HO/sOGiJw49vuva9/PVOxc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421604; c=relaxed/simple; bh=oSkyX86WPQ2oy6XZlMfq5KCFag3oWc//ibWpUhjN0YM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pRlHZ/Uf3VWCN0vaSMc+AXnEjGJmeCex7qHXQWZlbgBI7zkscepgb57zL09fmEWDgG4Fv9dQcboUfvsjwPy4UhRefyxcjL9ePmVZ13ZYfRM5GsQkomV2UCYRQhvWcvReJOitp2azYX/5UG1MXiFu06jzaA5tjJcuSmPgGbbVD08= 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=J4bT1kKX; arc=none smtp.client-ip=209.85.214.180 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="J4bT1kKX" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-226185948ffso1115215ad.0 for ; Wed, 19 Mar 2025 14:59:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421599; x=1743026399; 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=7TPShQPwcbR0wWc9GXdkhoktbjVKQjXa4xvDcq95nA8=; b=J4bT1kKX9o1YfJxYhe8LgPTV7hILjHATBhCdtB9N6lMkkFanOtPhcYiYvU9DCCCSVT e36Cn2RRV9gymqMTh+is8D/8NrypV5VVbNYdFGfvsFXFpTpOrHgFzrOdpwioFTJCmIMN SCaLiDPDhLY8KY7jS0LC2Rqx7orV+ae4JPcpkbWI9pwbRaWWSti5Y5YzqPh2qXN78Xkm a6gpqGzXuP6uRct+emnK2PrHEylVNuj1ieUDa5olzXmbpY6AB6s4zArbirz62LrVXYCU OQjhPExcXdwi1hJTBWrqOKByAqpBfqcWKJijQsQQbvFQR8VTY4Yb76478Lzs9kSqaLQ+ L6Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421599; x=1743026399; 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=7TPShQPwcbR0wWc9GXdkhoktbjVKQjXa4xvDcq95nA8=; b=EE9b/4umDd6Ro8OYBg3nQoPwoQ9P2VqsTnZAFpberuVGb08f9dEhNBRo0FHzWHZZBo 9r+OBOk1kIFW68ddZ/fReDWi7t5b1GMH3ImgRuZg04ajwLMer/zlzf034eWzDatRDlmP o5y19Q8oWa1vcJHs7FMNYV/VEGE7fWt0/SNONPkhB6nHpznbXbzqZmPeSxgWvpfn2IYK DxGXLvAYcK8bI9R2lWmdCNpmQKDsMVbQMhmiN7XCEGXMHjndW4I/L3ETiqj0s7yEhhS1 d1Na6y4y5Upj8DHm+R10BR+ry++awdHx5TOujOVMCpTNFTJXdEoUej8nm2iphUujXy7X 8sFw== X-Forwarded-Encrypted: i=1; AJvYcCVK8iYOT9dn6DJOUiCElF5sPChCet6gy83P29DjEBNh5NKSCoRA2MDuAx9CtQJqqPuupFEgoddR/h3UyLI=@vger.kernel.org X-Gm-Message-State: AOJu0YzNO5o81arkAFy/+j2cF3j8CMe8H73yt30xWBlVwv/4O/w951Yi Owa/8rOlwg2F5XvD46r+SFkHW0c/nERKklIb20y91H9mvzll+qGTbGqzJsUgdCDJmRTigZscRfY = X-Gm-Gg: ASbGncvK9HvU6Nr5Sz8UFOah8IZTKZHKl7JQmViCP85ugwp/O3kO8eAyGM9FfPlkNaY zRWZncHP1uhIaxRYeOC+RoXBKwAccfBaMsNraQyH6TVaB4qBgBXFqknpIw0/dj4pBCqxDjZMAlC 05wUddwZLGYioo9CzjL/Ql/7aYc4pnTUM6UStxftJ6+H0BBBxO4c7IGjAokCLZkfWA1XKpn5RmE lfVEkLJmAvueNA+Y1TLdR8Ih0adrpx0fkxPgWRtYMWcFnMl/T9q8szDwpINgsCyjVY1EEgeX83l u/V9H+HNjG7Pr58N6P/IAwNOEDfrYWOfQr3LiUlbkS+xdq+IUfHxw4RDBCyCVBw52fRlCBTmqQB maBwGt2n7gg== X-Google-Smtp-Source: AGHT+IEIBsS2sRRMto4uxP3LsqFbJegXJQ1nGuGajJIP6ekBcJ4imrhcf5G77VNk+z4ZU3Vy7EtcVg== X-Received: by 2002:a17:902:f652:b0:220:fe50:5b44 with SMTP id d9443c01a7336-22649928095mr62806625ad.31.1742421599396; Wed, 19 Mar 2025 14:59:59 -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-225c68bedd4sm120331005ad.105.2025.03.19.14.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 14:59:59 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 18/20] staging: gpib: tnt4882: struct gpib_board Date: Wed, 19 Mar 2025 21:59:22 +0000 Message-ID: <20250319215924.19387-19-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for struct gpib_board. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 100 ++++++++++---------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/= gpib/tnt4882/tnt4882_gpib.c index e62f3424ca20..bc99526f2d0c 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -51,7 +51,7 @@ struct tnt4882_priv { unsigned short auxg_bits; // bits written to auxiliary register G }; =20 -static irqreturn_t tnt4882_internal_interrupt(gpib_board_t *board); +static irqreturn_t tnt4882_internal_interrupt(struct gpib_board *board); =20 // register offset for nec7210 compatible registers static const int atgpib_reg_offset =3D 2; @@ -148,7 +148,7 @@ static inline void tnt_writeb(struct tnt4882_priv *priv= , unsigned short value, u MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for National Instruments boards using tnt4= 882 or compatible chips"); =20 -static int tnt4882_line_status(const gpib_board_t *board) +static int tnt4882_line_status(const struct gpib_board *board) { int status =3D VALID_ALL; int bcsr_bits; @@ -178,7 +178,7 @@ static int tnt4882_line_status(const gpib_board_t *boar= d) return status; } =20 -static unsigned int tnt4882_t1_delay(gpib_board_t *board, unsigned int nan= o_sec) +static unsigned int tnt4882_t1_delay(struct gpib_board *board, unsigned in= t nano_sec) { struct tnt4882_priv *tnt_priv =3D board->private_data; struct nec7210_priv *nec_priv =3D &tnt_priv->nec7210_priv; @@ -251,7 +251,7 @@ static int drain_fifo_words(struct tnt4882_priv *tnt_pr= iv, uint8_t *buffer, int return count; } =20 -static void tnt4882_release_holdoff(gpib_board_t *board, struct tnt4882_pr= iv *tnt_priv) +static void tnt4882_release_holdoff(struct gpib_board *board, struct tnt48= 82_priv *tnt_priv) { struct nec7210_priv *nec_priv =3D &tnt_priv->nec7210_priv; unsigned short sasr_bits; @@ -274,7 +274,7 @@ static void tnt4882_release_holdoff(gpib_board_t *board= , struct tnt4882_priv *tn } } =20 -static int tnt4882_accel_read(gpib_board_t *board, uint8_t *buffer, size_t= length, int *end, +static int tnt4882_accel_read(struct gpib_board *board, uint8_t *buffer, s= ize_t length, int *end, size_t *bytes_read) { size_t count =3D 0; @@ -426,7 +426,7 @@ static unsigned int tnt_transfer_count(struct tnt4882_p= riv *tnt_priv) return -count; }; =20 -static int write_wait(gpib_board_t *board, struct tnt4882_priv *tnt_priv, +static int write_wait(struct gpib_board *board, struct tnt4882_priv *tnt_p= riv, int wait_for_done, int send_commands) { struct nec7210_priv *nec_priv =3D &tnt_priv->nec7210_priv; @@ -448,7 +448,7 @@ static int write_wait(gpib_board_t *board, struct tnt48= 82_priv *tnt_priv, return 0; } =20 -static int generic_write(gpib_board_t *board, uint8_t *buffer, size_t leng= th, +static int generic_write(struct gpib_board *board, uint8_t *buffer, size_t= length, int send_eoi, int send_commands, size_t *bytes_written) { size_t count =3D 0; @@ -539,19 +539,19 @@ static int generic_write(gpib_board_t *board, uint8_t= *buffer, size_t length, return retval; } =20 -static int tnt4882_accel_write(gpib_board_t *board, uint8_t *buffer, size_= t length, int send_eoi, +static int tnt4882_accel_write(struct gpib_board *board, uint8_t *buffer, = size_t length, int send_eoi, size_t *bytes_written) { return generic_write(board, buffer, length, send_eoi, 0, bytes_written); } =20 -static int tnt4882_command(gpib_board_t *board, uint8_t *buffer, size_t le= ngth, +static int tnt4882_command(struct gpib_board *board, uint8_t *buffer, size= _t length, size_t *bytes_written) { return generic_write(board, buffer, length, 0, 1, bytes_written); } =20 -static irqreturn_t tnt4882_internal_interrupt(gpib_board_t *board) +static irqreturn_t tnt4882_internal_interrupt(struct gpib_board *board) { struct tnt4882_priv *priv =3D board->private_data; int isr0_bits, isr3_bits, imr3_bits; @@ -592,7 +592,7 @@ static irqreturn_t tnt4882_interrupt(int irq, void *arg) } =20 // wrappers for interface functions -static int tnt4882_read(gpib_board_t *board, uint8_t *buffer, size_t lengt= h, int *end, +static int tnt4882_read(struct gpib_board *board, uint8_t *buffer, size_t = length, int *end, size_t *bytes_read) { struct tnt4882_priv *priv =3D board->private_data; @@ -612,7 +612,7 @@ static int tnt4882_read(gpib_board_t *board, uint8_t *b= uffer, size_t length, int return retval; } =20 -static int tnt4882_write(gpib_board_t *board, uint8_t *buffer, size_t leng= th, int send_eoi, +static int tnt4882_write(struct gpib_board *board, uint8_t *buffer, size_t= length, int send_eoi, size_t *bytes_written) { struct tnt4882_priv *priv =3D board->private_data; @@ -620,7 +620,7 @@ static int tnt4882_write(gpib_board_t *board, uint8_t *= buffer, size_t length, in return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi= , bytes_written); } =20 -static int tnt4882_command_unaccel(gpib_board_t *board, uint8_t *buffer, +static int tnt4882_command_unaccel(struct gpib_board *board, uint8_t *buff= er, size_t length, size_t *bytes_written) { struct tnt4882_priv *priv =3D board->private_data; @@ -628,21 +628,21 @@ static int tnt4882_command_unaccel(gpib_board_t *boar= d, uint8_t *buffer, return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_= written); } =20 -static int tnt4882_take_control(gpib_board_t *board, int synchronous) +static int tnt4882_take_control(struct gpib_board *board, int synchronous) { struct tnt4882_priv *priv =3D board->private_data; =20 return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } =20 -static int tnt4882_go_to_standby(gpib_board_t *board) +static int tnt4882_go_to_standby(struct gpib_board *board) { struct tnt4882_priv *priv =3D board->private_data; =20 return nec7210_go_to_standby(board, &priv->nec7210_priv); } =20 -static void tnt4882_request_system_control(gpib_board_t *board, int reques= t_control) +static void tnt4882_request_system_control(struct gpib_board *board, int r= equest_control) { struct tnt4882_priv *priv =3D board->private_data; =20 @@ -657,35 +657,35 @@ static void tnt4882_request_system_control(gpib_board= _t *board, int request_cont } } =20 -static void tnt4882_interface_clear(gpib_board_t *board, int assert) +static void tnt4882_interface_clear(struct gpib_board *board, int assert) { struct tnt4882_priv *priv =3D board->private_data; =20 nec7210_interface_clear(board, &priv->nec7210_priv, assert); } =20 -static void tnt4882_remote_enable(gpib_board_t *board, int enable) +static void tnt4882_remote_enable(struct gpib_board *board, int enable) { struct tnt4882_priv *priv =3D board->private_data; =20 nec7210_remote_enable(board, &priv->nec7210_priv, enable); } =20 -static int tnt4882_enable_eos(gpib_board_t *board, uint8_t eos_byte, int c= ompare_8_bits) +static int tnt4882_enable_eos(struct gpib_board *board, uint8_t eos_byte, = int compare_8_bits) { struct tnt4882_priv *priv =3D board->private_data; =20 return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8= _bits); } =20 -static void tnt4882_disable_eos(gpib_board_t *board) +static void tnt4882_disable_eos(struct gpib_board *board) { struct tnt4882_priv *priv =3D board->private_data; =20 nec7210_disable_eos(board, &priv->nec7210_priv); } =20 -static unsigned int tnt4882_update_status(gpib_board_t *board, unsigned in= t clear_mask) +static unsigned int tnt4882_update_status(struct gpib_board *board, unsign= ed int clear_mask) { unsigned long flags; u8 line_status; @@ -704,21 +704,21 @@ static unsigned int tnt4882_update_status(gpib_board_= t *board, unsigned int clea return board->status; } =20 -static int tnt4882_primary_address(gpib_board_t *board, unsigned int addre= ss) +static int tnt4882_primary_address(struct gpib_board *board, unsigned int = address) { struct tnt4882_priv *priv =3D board->private_data; =20 return nec7210_primary_address(board, &priv->nec7210_priv, address); } =20 -static int tnt4882_secondary_address(gpib_board_t *board, unsigned int add= ress, int enable) +static int tnt4882_secondary_address(struct gpib_board *board, unsigned in= t address, int enable) { struct tnt4882_priv *priv =3D board->private_data; =20 return nec7210_secondary_address(board, &priv->nec7210_priv, address, ena= ble); } =20 -static int tnt4882_parallel_poll(gpib_board_t *board, uint8_t *result) +static int tnt4882_parallel_poll(struct gpib_board *board, uint8_t *result) { struct tnt4882_priv *tnt_priv =3D board->private_data; =20 @@ -735,7 +735,7 @@ static int tnt4882_parallel_poll(gpib_board_t *board, u= int8_t *result) } } =20 -static void tnt4882_parallel_poll_configure(gpib_board_t *board, uint8_t c= onfig) +static void tnt4882_parallel_poll_configure(struct gpib_board *board, uint= 8_t config) { struct tnt4882_priv *priv =3D board->private_data; =20 @@ -753,7 +753,7 @@ static void tnt4882_parallel_poll_configure(gpib_board_= t *board, uint8_t config) } } =20 -static void tnt4882_parallel_poll_response(gpib_board_t *board, int ist) +static void tnt4882_parallel_poll_response(struct gpib_board *board, int i= st) { struct tnt4882_priv *priv =3D board->private_data; =20 @@ -763,14 +763,14 @@ static void tnt4882_parallel_poll_response(gpib_board= _t *board, int ist) /* this is just used by the old nec7210 isa interfaces, the newer * boards use tnt4882_serial_poll_response2 */ -static void tnt4882_serial_poll_response(gpib_board_t *board, uint8_t stat= us) +static void tnt4882_serial_poll_response(struct gpib_board *board, uint8_t= status) { struct tnt4882_priv *priv =3D board->private_data; =20 nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } =20 -static void tnt4882_serial_poll_response2(gpib_board_t *board, uint8_t sta= tus, +static void tnt4882_serial_poll_response2(struct gpib_board *board, uint8_= t status, int new_reason_for_service) { struct tnt4882_priv *priv =3D board->private_data; @@ -804,21 +804,21 @@ static void tnt4882_serial_poll_response2(gpib_board_= t *board, uint8_t status, spin_unlock_irqrestore(&board->spinlock, flags); } =20 -static uint8_t tnt4882_serial_poll_status(gpib_board_t *board) +static uint8_t tnt4882_serial_poll_status(struct gpib_board *board) { struct tnt4882_priv *priv =3D board->private_data; =20 return nec7210_serial_poll_status(board, &priv->nec7210_priv); } =20 -static void tnt4882_return_to_local(gpib_board_t *board) +static void tnt4882_return_to_local(struct gpib_board *board) { struct tnt4882_priv *priv =3D board->private_data; =20 nec7210_return_to_local(board, &priv->nec7210_priv); } =20 -static void tnt4882_board_reset(struct tnt4882_priv *tnt_priv, gpib_board_= t *board) +static void tnt4882_board_reset(struct tnt4882_priv *tnt_priv, struct gpib= _board *board) { struct nec7210_priv *nec_priv =3D &tnt_priv->nec7210_priv; =20 @@ -831,7 +831,7 @@ static void tnt4882_board_reset(struct tnt4882_priv *tn= t_priv, gpib_board_t *boa nec7210_board_reset(nec_priv, board); } =20 -static int tnt4882_allocate_private(gpib_board_t *board) +static int tnt4882_allocate_private(struct gpib_board *board) { struct tnt4882_priv *tnt_priv; =20 @@ -844,13 +844,13 @@ static int tnt4882_allocate_private(gpib_board_t *boa= rd) return 0; } =20 -static void tnt4882_free_private(gpib_board_t *board) +static void tnt4882_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data =3D NULL; } =20 -static void tnt4882_init(struct tnt4882_priv *tnt_priv, const gpib_board_t= *board) +static void tnt4882_init(struct tnt4882_priv *tnt_priv, const struct gpib_= board *board) { struct nec7210_priv *nec_priv =3D &tnt_priv->nec7210_priv; =20 @@ -898,7 +898,7 @@ static void tnt4882_init(struct tnt4882_priv *tnt_priv,= const gpib_board_t *boar tnt_writeb(tnt_priv, tnt_priv->imr0_bits, IMR0); } =20 -static int ni_pci_attach(gpib_board_t *board, const gpib_board_config_t *c= onfig) +static int ni_pci_attach(struct gpib_board *board, const gpib_board_config= _t *config) { struct tnt4882_priv *tnt_priv; struct nec7210_priv *nec_priv; @@ -982,7 +982,7 @@ static int ni_pci_attach(gpib_board_t *board, const gpi= b_board_config_t *config) return 0; } =20 -static void ni_pci_detach(gpib_board_t *board) +static void ni_pci_detach(struct gpib_board *board) { struct tnt4882_priv *tnt_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -1019,7 +1019,7 @@ static int ni_isapnp_find(struct pnp_dev **dev) return 0; } =20 -static int ni_isa_attach_common(gpib_board_t *board, const gpib_board_conf= ig_t *config, +static int ni_isa_attach_common(struct gpib_board *board, const gpib_board= _config_t *config, enum nec7210_chipset chipset) { struct tnt4882_priv *tnt_priv; @@ -1075,22 +1075,22 @@ static int ni_isa_attach_common(gpib_board_t *board= , const gpib_board_config_t * return 0; } =20 -static int ni_tnt_isa_attach(gpib_board_t *board, const gpib_board_config_= t *config) +static int ni_tnt_isa_attach(struct gpib_board *board, const gpib_board_co= nfig_t *config) { return ni_isa_attach_common(board, config, TNT4882); } =20 -static int ni_nat4882_isa_attach(gpib_board_t *board, const gpib_board_con= fig_t *config) +static int ni_nat4882_isa_attach(struct gpib_board *board, const gpib_boar= d_config_t *config) { return ni_isa_attach_common(board, config, NAT4882); } =20 -static int ni_nec_isa_attach(gpib_board_t *board, const gpib_board_config_= t *config) +static int ni_nec_isa_attach(struct gpib_board *board, const gpib_board_co= nfig_t *config) { return ni_isa_attach_common(board, config, NEC7210); } =20 -static void ni_isa_detach(gpib_board_t *board) +static void ni_isa_detach(struct gpib_board *board) { struct tnt4882_priv *tnt_priv =3D board->private_data; struct nec7210_priv *nec_priv; @@ -1523,7 +1523,7 @@ static void __exit tnt4882_exit_module(void) =20 static int ni_gpib_config(struct pcmcia_device *link); static void ni_gpib_release(struct pcmcia_device *link); -static void ni_pcmcia_detach(gpib_board_t *board); +static void ni_pcmcia_detach(struct gpib_board *board); =20 /* * A linked list of "instances" of the dummy device. Each actual @@ -1542,7 +1542,7 @@ static struct pcmcia_device *curr_dev; =20 struct local_info_t { struct pcmcia_device *p_dev; - gpib_board_t *dev; + struct gpib_board *dev; int stop; struct bus_operations *bus; }; @@ -1556,7 +1556,7 @@ struct local_info_t { static int ni_gpib_probe(struct pcmcia_device *link) { struct local_info_t *info; - //struct gpib_board_t *dev; + //struct struct gpib_board *dev; =20 /* Allocate space for private device-specific data */ info =3D kzalloc(sizeof(*info), GFP_KERNEL); @@ -1589,7 +1589,7 @@ static int ni_gpib_probe(struct pcmcia_device *link) static void ni_gpib_remove(struct pcmcia_device *link) { struct local_info_t *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 if (info->dev) ni_pcmcia_detach(info->dev); @@ -1618,7 +1618,7 @@ static int ni_gpib_config_iteration(struct pcmcia_dev= ice *link, void *priv_data) static int ni_gpib_config(struct pcmcia_device *link) { //struct local_info_t *info =3D link->priv; - //gpib_board_t *dev =3D info->dev; + //struct gpib_board *dev =3D info->dev; int last_ret; =20 last_ret =3D pcmcia_loop_config(link, &ni_gpib_config_iteration, NULL); @@ -1649,7 +1649,7 @@ static void ni_gpib_release(struct pcmcia_device *lin= k) static int ni_gpib_suspend(struct pcmcia_device *link) { //struct local_info_t *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 if (link->open) dev_warn(&link->dev, "Device still open\n"); @@ -1661,7 +1661,7 @@ static int ni_gpib_suspend(struct pcmcia_device *link) static int ni_gpib_resume(struct pcmcia_device *link) { //struct local_info_t *info =3D link->priv; - //struct gpib_board_t *dev =3D info->dev; + //struct struct gpib_board *dev =3D info->dev; =20 /*if (link->open) { * ni_gpib_probe(dev); / really? @@ -1702,7 +1702,7 @@ static void __exit exit_ni_gpib_cs(void) =20 static const int pcmcia_gpib_iosize =3D 32; =20 -static int ni_pcmcia_attach(gpib_board_t *board, const gpib_board_config_t= *config) +static int ni_pcmcia_attach(struct gpib_board *board, const gpib_board_con= fig_t *config) { struct local_info_t *info; struct tnt4882_priv *tnt_priv; @@ -1750,7 +1750,7 @@ static int ni_pcmcia_attach(gpib_board_t *board, cons= t gpib_board_config_t *conf return 0; } =20 -static void ni_pcmcia_detach(gpib_board_t *board) +static void ni_pcmcia_detach(struct gpib_board *board) { struct tnt4882_priv *tnt_priv =3D board->private_data; struct nec7210_priv *nec_priv; --=20 2.43.0 From nobody Wed Dec 17 08:56:03 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 4F23F223327 for ; Wed, 19 Mar 2025 22:00:01 +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=1742421604; cv=none; b=Azh/HzPBZ1YQkCKgGiQiJHLbYTKXeGN3Q94ghzZw+/oP1umwXJnwVbnt29jHjLVyPO77zq0CdbrLeLDmEWczYWS5uqQPpLdkg+eaqQgl7v1E2GU/WzU5kHdsq/LxbMyZ/1utmisaY1NMkhy98sxmQwBNix3pR3LwhqtbNiGeY8k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421604; c=relaxed/simple; bh=PJo7XY5iWYWccY43koXbM0vrT5sgu9no9HG2zsYlarQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pjedtHQEWAYKZfT4lvsSkvGO41GA7m9LrFxDfnehF6G++haAIYSDcDYTW3BYllEUdIekjIFfXaFpmQWcivB2EbzSpX0UKCaZw0SX7YnA4C/iNWu+P7S/6b1+lKdoPH1qxHH9aGuZR+Lge0YlAkyvcPmKSWnqRGrqJNP6svhVSoM= 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=nB3hqVUo; arc=none smtp.client-ip=209.85.214.179 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="nB3hqVUo" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2254e0b4b79so1152025ad.2 for ; Wed, 19 Mar 2025 15:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421601; x=1743026401; 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=x0yppVfKOM5irPIoqhzoyPGWYGuyd2GLb5kDS1Y/XIs=; b=nB3hqVUoK5Ta4rlozmcV1gE60vLJcLz6+bHHPzOthDEKm2a9hgx2eyF1fwgebz84FZ 4YZf8SgJN+vXGf3iUXd0Uvp5C/vuTes+YX4wvSzQX0yMO45cwyUmr+oy1txubA+CVZGB 78NA27W/vv2nHSXomgyCPHjkttwIE5NFGCJANPLW+RPxdEy2CDL7ciPdmKDvkXyayB3S TFKCf+YuVifrsrn4jjiMfrgGBOw3rmA4gywpA5DAgNhLPQgcJmqd7eE/ZFZM7gzoO9lN BxExGrumpL6g8Yy/QSCfXxPyJzXYrYnOr3fHMCfg9Z8tgoKJX2FZ2gM9QFLrNdjJNSrg SDSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421601; x=1743026401; 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=x0yppVfKOM5irPIoqhzoyPGWYGuyd2GLb5kDS1Y/XIs=; b=uVkWRXIGelK4jEMgkl4xBUmd6MsWnG261xmufSnbJlGz7jsYeQAn6DzOkMaWmJPbPD Fl50mU0uUL5HLNpbdGpglMZQsW4TPDLaVX5sqlgfqFt/lFJGf9wpSA7QRQ9WyRWwc0pQ RAsizqx8SeoaNhK1/Pr2S86+e4HKy2nlthmgXM0RsFCdcurfTghMB1FjZ/XQ1A1UwB7j 2Cw6fWpQzYRaDjxy1lWVQchWkLIGalbRt7TK3uQtfu2q27E6qEcXWELypufI5tnWnIWQ F2CTl4ETK709vivhoGuuuqsZvtHKTDY4fLHbIWyGgcsgTpjBokf8jWZkcRmYyJBrtXwT xSdA== X-Forwarded-Encrypted: i=1; AJvYcCX+N2Q4sG0ApgoXt0xcf8OcM72/ksfzlbnoRcNaGN5vwFazFmBZmBWUcoG7aPNY+sTev9Au01o7rRDAdWI=@vger.kernel.org X-Gm-Message-State: AOJu0Yya9hhxIlrRj2rM4DJUHbHb45dbp/eUle6iMkEmKsrCfahmaEcd Swjmo08QvtSFwMI3xu3BP68FMmrsYyMJ6SAsvsVPPSOUSDNOHnO1ae8xiI+jNw== X-Gm-Gg: ASbGncv6rKpCI8o0lBaVcINW5NjFiBh92BjRF9HKAWnbhW+WveRyZ4y+tvRrN7G0SZM UUr+9HfNvNTzYIHPo2EUbQPuyTj3XLRECC4LfRrZ2PGNNbhMjuw4kyw8hCW0Z0S5s5rcFLrGSqh aDrZb1fXjn/gEkVTwHKlBVZccXEcUsw93PhoKe2GwE+GK7AUULSTdxdIY8IlNQ5c7FAtpAs1+wj WhtiktTdN/p7mRoZLfsiCi/cSboZK9Lu0ZzyUw0h/sL4T8m/m7/KV77YgLYCfYpuVfrfTtjCX/Z 1BivWCJjv+ToVt0kP3M1ydTtsatsZeFXoeSHgBE9JGnc8VH+s1tVOL/M+TdBj+OoTM0ddUPmliq NgINfP0YEAQ== X-Google-Smtp-Source: AGHT+IETgC4crhGhY4O0UlC3TJK9wdI3LrJMMAG9f0yUukPhBWl8iL3gcJ4ZMxwxX3tof2UiABtogg== X-Received: by 2002:a05:6a20:72a3:b0:1f5:6e00:14c9 with SMTP id adf61e73a8af0-1fd11800cb6mr1319219637.15.1742421600650; Wed, 19 Mar 2025 15:00:00 -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-af586a37490sm9642899a12.43.2025.03.19.15.00.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 15:00:00 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 19/20] staging: gpib: struct typing for gpib_gboard_t Date: Wed, 19 Mar 2025 21:59:23 +0000 Message-ID: <20250319215924.19387-20-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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" Using Linux code style for gpib_board struct. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/include/gpibP.h | 10 ++-- drivers/staging/gpib/include/gpib_proto.h | 58 +++++++++++------------ drivers/staging/gpib/include/gpib_types.h | 54 ++++++++++----------- 3 files changed, 61 insertions(+), 61 deletions(-) diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/in= clude/gpibP.h index d35fdd391f7e..0c71a038e444 100644 --- a/drivers/staging/gpib/include/gpibP.h +++ b/drivers/staging/gpib/include/gpibP.h @@ -26,13 +26,13 @@ struct pci_dev *gpib_pci_get_subsys(const gpib_board_co= nfig_t *config, unsigned 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); -int push_gpib_event(gpib_board_t *board, short event_type); -int pop_gpib_event(gpib_board_t *board, gpib_event_queue_t *queue, short *= event_type); -int gpib_request_pseudo_irq(gpib_board_t *board, irqreturn_t (*handler)(in= t, void *)); -void gpib_free_pseudo_irq(gpib_board_t *board); +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 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); =20 -extern gpib_board_t board_array[GPIB_MAX_NUM_BOARDS]; +extern struct gpib_board board_array[GPIB_MAX_NUM_BOARDS]; =20 extern struct list_head registered_drivers; =20 diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gp= ib/include/gpib_proto.h index 1499f954210b..2c7dfc02f517 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -10,11 +10,11 @@ int ibclose(struct inode *inode, struct file *file); long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg); int osInit(void); void osReset(void); -void os_start_timer(gpib_board_t *board, unsigned int usec_timeout); -void os_remove_timer(gpib_board_t *board); +void os_start_timer(struct gpib_board *board, unsigned int usec_timeout); +void os_remove_timer(struct gpib_board *board); void osSendEOI(void); void osSendEOI(void); -void init_gpib_board(gpib_board_t *board); +void init_gpib_board(struct gpib_board *board); static inline unsigned long usec_to_jiffies(unsigned int usec) { unsigned long usec_per_jiffy =3D 1000000 / HZ; @@ -22,35 +22,35 @@ static inline unsigned long usec_to_jiffies(unsigned in= t usec) return 1 + (usec + usec_per_jiffy - 1) / usec_per_jiffy; }; =20 -int serial_poll_all(gpib_board_t *board, unsigned int usec_timeout); +int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); void init_gpib_descriptor(gpib_descriptor_t *desc); -int dvrsp(gpib_board_t *board, unsigned int pad, int sad, +int dvrsp(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *result); -int ibAPWait(gpib_board_t *board, int pad); -int ibAPrsp(gpib_board_t *board, int padsad, char *spb); -void ibAPE(gpib_board_t *board, int pad, int v); -int ibcac(gpib_board_t *board, int sync, int fallback_to_async); -int ibcmd(gpib_board_t *board, uint8_t *buf, size_t length, size_t *bytes_= written); -int ibgts(gpib_board_t *board); -int ibonline(gpib_board_t *board); -int iboffline(gpib_board_t *board); -int iblines(const gpib_board_t *board, short *lines); -int ibrd(gpib_board_t *board, uint8_t *buf, size_t length, int *end_flag, = size_t *bytes_read); -int ibrpp(gpib_board_t *board, uint8_t *buf); -int ibrsv2(gpib_board_t *board, uint8_t status_byte, int new_reason_for_se= rvice); -void ibrsc(gpib_board_t *board, int request_control); -int ibsic(gpib_board_t *board, unsigned int usec_duration); -int ibsre(gpib_board_t *board, int enable); -int ibpad(gpib_board_t *board, unsigned int addr); -int ibsad(gpib_board_t *board, int addr); -int ibeos(gpib_board_t *board, int eos, int eosflags); -int ibwait(gpib_board_t *board, int wait_mask, int clear_mask, int set_mas= k, +int ibAPWait(struct gpib_board *board, int pad); +int ibAPrsp(struct gpib_board *board, int padsad, char *spb); +void ibAPE(struct gpib_board *board, int pad, int v); +int ibcac(struct gpib_board *board, int sync, int fallback_to_async); +int ibcmd(struct gpib_board *board, uint8_t *buf, size_t length, size_t *b= ytes_written); +int ibgts(struct gpib_board *board); +int ibonline(struct gpib_board *board); +int iboffline(struct gpib_board *board); +int iblines(const struct gpib_board *board, short *lines); +int ibrd(struct gpib_board *board, uint8_t *buf, size_t length, int *end_f= lag, size_t *bytes_read); +int ibrpp(struct gpib_board *board, uint8_t *buf); +int ibrsv2(struct gpib_board *board, uint8_t status_byte, int new_reason_f= or_service); +void ibrsc(struct gpib_board *board, int request_control); +int ibsic(struct gpib_board *board, unsigned int usec_duration); +int ibsre(struct gpib_board *board, int enable); +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 ibwrt(gpib_board_t *board, uint8_t *buf, size_t cnt, int send_eoi, siz= e_t *bytes_written); -int ibstatus(gpib_board_t *board); -int general_ibstatus(gpib_board_t *board, const gpib_status_queue_t *devic= e, +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 clear_mask, int set_mask, gpib_descriptor_t *desc); -int io_timed_out(gpib_board_t *board); -int ibppc(gpib_board_t *board, uint8_t configuration); +int io_timed_out(struct gpib_board *board); +int ibppc(struct gpib_board *board, uint8_t configuration); =20 #endif /* GPIB_PROTO_INCLUDED */ diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 7dc5a16e427b..515fdb91d150 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -55,9 +55,9 @@ struct gpib_interface_struct { /* name of board */ char *name; /* attach() initializes board and allocates resources */ - int (*attach)(gpib_board_t *board, const gpib_board_config_t *config); + int (*attach)(struct gpib_board *board, const gpib_board_config_t *config= ); /* detach() shuts down board and frees resources */ - void (*detach)(gpib_board_t *board); + void (*detach)(struct gpib_board *board); /* read() should read at most 'length' bytes from the bus into * 'buffer'. It should return when it fills the buffer or * encounters an END (EOI and or EOS if appropriate). It should set 'end' @@ -68,19 +68,19 @@ struct gpib_interface_struct { * return indicates error. * nbytes returns number of bytes read */ - int (*read)(gpib_board_t *board, uint8_t *buffer, size_t length, int *end, + int (*read)(struct gpib_board *board, uint8_t *buffer, size_t length, int= *end, size_t *bytes_read); /* write() should write 'length' bytes from buffer to the bus. * If the boolean value send_eoi is nonzero, then EOI should * be sent along with the last byte. Returns number of bytes * written or negative value on error. */ - int (*write)(gpib_board_t *board, uint8_t *buffer, size_t length, int sen= d_eoi, + int (*write)(struct gpib_board *board, uint8_t *buffer, size_t length, in= t send_eoi, size_t *bytes_written); /* command() writes the command bytes in 'buffer' to the bus * Returns zero on success or negative value on error. */ - int (*command)(gpib_board_t *board, uint8_t *buffer, size_t length, + int (*command)(struct gpib_board *board, uint8_t *buffer, size_t length, size_t *bytes_written); /* Take control (assert ATN). If 'asyncronous' is nonzero, take * control asyncronously (assert ATN immediately without waiting @@ -88,54 +88,54 @@ struct gpib_interface_struct { * until board becomes controller in charge. Returns zero no success, * nonzero on error. */ - int (*take_control)(gpib_board_t *board, int asyncronous); + int (*take_control)(struct gpib_board *board, int asyncronous); /* De-assert ATN. Returns zero on success, nonzer on error. */ - int (*go_to_standby)(gpib_board_t *board); + int (*go_to_standby)(struct gpib_board *board); /* request/release control of the IFC and REN lines (system controller) */ - void (*request_system_control)(gpib_board_t *board, int request_control); + void (*request_system_control)(struct gpib_board *board, int request_cont= rol); /* Asserts or de-asserts 'interface clear' (IFC) depending on * boolean value of 'assert' */ - void (*interface_clear)(gpib_board_t *board, int assert); + void (*interface_clear)(struct gpib_board *board, int assert); /* Sends remote enable command if 'enable' is nonzero, disables remote mo= de * if 'enable' is zero */ - void (*remote_enable)(gpib_board_t *board, int enable); + void (*remote_enable)(struct gpib_board *board, int enable); /* enable END for reads, when byte 'eos' is received. If * 'compare_8_bits' is nonzero, then all 8 bits are compared * with the eos bytes. Otherwise only the 7 least significant * bits are compared. */ - int (*enable_eos)(gpib_board_t *board, uint8_t eos, int compare_8_bits); + int (*enable_eos)(struct gpib_board *board, uint8_t eos, int compare_8_bi= ts); /* disable END on eos byte (END on EOI only)*/ - void (*disable_eos)(gpib_board_t *board); + void (*disable_eos)(struct gpib_board *board); /* configure parallel poll */ - void (*parallel_poll_configure)(gpib_board_t *board, uint8_t configuratio= n); + void (*parallel_poll_configure)(struct gpib_board *board, uint8_t configu= ration); /* conduct parallel poll */ - int (*parallel_poll)(gpib_board_t *board, uint8_t *result); + int (*parallel_poll)(struct gpib_board *board, uint8_t *result); /* set/clear ist (individual status bit) */ - void (*parallel_poll_response)(gpib_board_t *board, int ist); + void (*parallel_poll_response)(struct gpib_board *board, int ist); /* select local parallel poll configuration mode PP2 versus remote PP1 */ - void (*local_parallel_poll_mode)(gpib_board_t *board, int local); + void (*local_parallel_poll_mode)(struct gpib_board *board, int local); /* Returns current status of the bus lines. Should be set to * NULL if your board does not have the ability to query the * state of the bus lines. */ - int (*line_status)(const gpib_board_t *board); + int (*line_status)(const struct gpib_board *board); /* updates and returns the board's current status. * The meaning of the bits are specified in gpib_user.h * in the IBSTA section. The driver does not need to * worry about setting the CMPL, END, TIMO, or ERR bits. */ - unsigned int (*update_status)(gpib_board_t *board, unsigned int clear_mas= k); + unsigned int (*update_status)(struct gpib_board *board, unsigned int clea= r_mask); /* Sets primary address 0-30 for gpib interface card. */ - int (*primary_address)(gpib_board_t *board, unsigned int address); + int (*primary_address)(struct gpib_board *board, unsigned int address); /* Sets and enables, or disables secondary address 0-30 * for gpib interface card. */ - int (*secondary_address)(gpib_board_t *board, unsigned int address, + int (*secondary_address)(struct gpib_board *board, unsigned int address, int enable); /* Sets the byte the board should send in response to a serial poll. * This function should also start or stop requests for service via @@ -149,7 +149,7 @@ struct gpib_interface_struct { * by IEEE 488.2 section 11.3.3.4.3 "Allowed Coupled Control of * STB, reqt, and reqf". */ - void (*serial_poll_response)(gpib_board_t *board, uint8_t status_byte); + void (*serial_poll_response)(struct gpib_board *board, uint8_t status_byt= e); /* Sets the byte the board should send in response to a serial poll. * This function should also request service via IEEE 488.2 reqt/reqf * based on MSS (bit 6 of the status_byte) and new_reason_for_service. @@ -164,15 +164,15 @@ struct gpib_interface_struct { * If this method is left NULL by the driver, then the user library * function ibrsv2 will not work. */ - void (*serial_poll_response2)(gpib_board_t *board, uint8_t status_byte, + void (*serial_poll_response2)(struct gpib_board *board, uint8_t status_by= te, int new_reason_for_service); /* returns the byte the board will send in response to a serial poll. */ - uint8_t (*serial_poll_status)(gpib_board_t *board); + uint8_t (*serial_poll_status)(struct gpib_board *board); /* adjust T1 delay */ - unsigned int (*t1_delay)(gpib_board_t *board, unsigned int nano_sec); + unsigned int (*t1_delay)(struct gpib_board *board, unsigned int nano_sec); /* go to local mode */ - void (*return_to_local)(gpib_board_t *board); + void (*return_to_local)(struct gpib_board *board); /* board does not support 7 bit eos comparisons */ unsigned no_7_bit_eos : 1; /* skip check for listeners before trying to send command bytes */ @@ -198,7 +198,7 @@ static inline void init_event_queue(gpib_event_queue_t = *queue) struct gpib_pseudo_irq { struct timer_list timer; irqreturn_t (*handler)(int irq, void *arg); - gpib_board_t *board; + struct gpib_board *board; atomic_t active; }; =20 @@ -216,7 +216,7 @@ typedef struct gpib_interface_list_struct { struct module *module; } gpib_interface_list_t; =20 -/* One gpib_board_t is allocated for each physical board in the computer. +/* 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 * functions for performing operations on the board */ --=20 2.43.0 From nobody Wed Dec 17 08:56:03 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 922712236FB for ; Wed, 19 Mar 2025 22:00:02 +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=1742421604; cv=none; b=cIbx7XWmHq0snn9FUUn3pC6tBy5z20YglXNcqnpaIZU4+8Xl7ZDk62C9FdVwGgugDEDi9ld0ojlZN2oNca2fhPYFKrhgkIYj1gE5UxbCu+McKUX+i87DCMqNSvu4yfinjfXfcEWlSWCqWWFQRepXabiQ9sIrEcSr3a3zJmxt8YE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1742421604; c=relaxed/simple; bh=VbdeLRZV9ED0o/Bxs5o9aDMhEvtIGXCWX0egsa7yiVg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ro+WC5WamfNiwOCGNbOh76No82K1qjzvaL+wofDKzl+ZG+nLIRc29jD17KnwzrQzknBMSQg/zl1yRKDROAQbFTaYCgVngzoZb1VkTx2sjsgKQegvZ+Me5pjQAE3506b2NxCIOp7kdK6YIVJyO7DnbLBRrbVHkzNksX2+hOz88CA= 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=WYrPrihl; arc=none smtp.client-ip=209.85.214.179 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="WYrPrihl" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-224100e9a5cso815345ad.2 for ; Wed, 19 Mar 2025 15:00:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neverthere.org; s=google; t=1742421602; x=1743026402; 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=prJ1TM7FQQCq2HQpbJ4AVBwG2iHEDTkPGfRD+WVuSQ0=; b=WYrPrihlIwRQLpfwPnB/JqD0kwu5j2MAjuiwdZAuX5Xvl20gYbFHVKttOT9O9DD491 M6+4rPuiROYjhvUQMvVPn2zau2p+QQ6hmz+X7SrxJitnod5LhMCDbYdhHV5tKMrtUHmO 0OcXIi/wR3NY4P53UdGYhGPE3v2jaj9a0t2n4ZxTqE5Z1oph4hDqDootI254kTW+rpUy uPD9ChpNAfn+ofpRo3/+cTMg81I0CwCOqwzlGtJNqk73oZjK9gVrNaFa1d76DCdWl8E6 xP3WBQju66KlJap1KI1X5a5+U0jt1i86kyv3HFciWUQwbn8LxVfGsnZjSJlY1+IjDPjm vNTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742421602; x=1743026402; 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=prJ1TM7FQQCq2HQpbJ4AVBwG2iHEDTkPGfRD+WVuSQ0=; b=bPB46mWX3+VM6y8KHf7Duy4u8atTKQc+UGRoyHPH8TkiyteqKlRnq79R9h7CJNOUI5 48024QCDCQp+UvVrLOTVZMnjHF3Kcp3mncnZkobR/3WwNHUb0J2DOlXMglD10JsVd9BA BjE4d+21509Sne98ykFcWwEEoMXQjHN/fEKL8INHHD0EHEQuf4oC7iWlVxtBGDmK4dRM o8w0bQU+4aIzPESYL0NCfnEbS9zx8nAtVx5v+gS6b+Do9R57V5JNW6rk4EtCtIErZbtU Iuq7Gyae5SI7Iha2vHlVbTCYGRMrB5bHXgMeAJU4HB19/fRp/uLM51hTFxhT0CZILgvl 3qTg== X-Forwarded-Encrypted: i=1; AJvYcCXOfoiaeQfQBhvQClWhykNOq9sZBbN0OCrApQHI3rsLxGqmnSl7HePmuv9iI4BM8ExoPRlCMYIu8IoSGtU=@vger.kernel.org X-Gm-Message-State: AOJu0YxZLl6dPLEbNRMDeT8hnVxVG9PxkybGN8i5TutAQDspAO7J/Jlj dAHUWqLqFM7OOThOrJ+iFePQtpymA4oABbAYjwqBIdunjTBCJQEjhWLilX27/Q== X-Gm-Gg: ASbGncu9FpO+ctv/Dw4Xwnp+FaoWtykUeB0XgSFJDe+QzD0G7L0JDD57rZAkxMEWu+K X+GWCzP8ABzlv7EnvR5ndYzW2dv+cRAJWXtX6vo3zy+rDFs1VVQ8DLVbLkMsmcZk4/yQaW9/BlP AU42GmUXjwQWAd3V/2IUtb6q3r2pOh+8pX2+XWD/KRosrppf8uK12xu3+gj91AiKwJktfe3ULc9 BlXaxTBXjiSVeahbhKfB2mc6NQwMXQ2+nkrgKg4ywG2f85AzoN6Lqcgds8uMp9y+Y5GnzelPFNH 82DMXTvnQmYoRLUsCApBGnUrdnpKpU2siTGoR9Jl4FnH6YEwxQibhBWn2SgTKFRI0BAkBJGC398 tTnZGch98UQ== X-Google-Smtp-Source: AGHT+IFibFrspTU/Sa0g0di0JiPnyclzEvmMzIUQgoY1Fmh41qCzcBS8NG7aSZ/+vqVHMo9ZwlrHCQ== X-Received: by 2002:a17:903:1d0:b0:224:216e:3342 with SMTP id d9443c01a7336-2265ee8f6c6mr13197075ad.43.1742421601806; Wed, 19 Mar 2025 15:00:01 -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-225c6bbe884sm120346345ad.185.2025.03.19.15.00.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 15:00:01 -0700 (PDT) From: Michael Rubin To: Dave Penkler , Greg Kroah-Hartman Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Michael Rubin Subject: [PATCH v1 20/20] staging: gpib: Removing typedef for gpib_board Date: Wed, 19 Mar 2025 21:59:24 +0000 Message-ID: <20250319215924.19387-21-matchstick@neverthere.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250319215924.19387-1-matchstick@neverthere.org> References: <20250319215924.19387-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 typedef as per Linux code style. Adhering to Linux code style. 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 Acked-By: Dave Penkler --- drivers/staging/gpib/include/gpib_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gp= ib/include/gpib_types.h index 515fdb91d150..31b35f2cb2e1 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -23,7 +23,7 @@ #include =20 typedef struct gpib_interface_struct gpib_interface_t; -typedef struct gpib_board gpib_board_t; +struct gpib_board; =20 /* config parameters that are only used by driver attach functions */ typedef struct { --=20 2.43.0