From 31fce300a1fef7b54ffb98e4cece8589529ca3bf Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Sat, 22 Mar 2025 16:36:53 +0100 Subject: [PATCH 001/203] staging: bcm2835-camera: Modify function call formatting The line is a function call which ends with an opening parenthesis thereby not adhering to the Linux kernel coding style. Modify the function call to include parameters on the same line as the opening parenthesis to improve readability and consistency while adhering to Linux coding styles. Reported by checkpatch: CHECK: Lines should not end with '(' Signed-off-by: Abraham Samuel Adekunle Link: https://lore.kernel.org/r/Z97ZFURPvDcTkjjf@HP-650 Signed-off-by: Greg Kroah-Hartman --- .../vc04_services/bcm2835-camera/controls.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/vc04_services/bcm2835-camera/controls.c b/drivers/staging/vc04_services/bcm2835-camera/controls.c index 6bce45925bf1..e670226f1edf 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/controls.c +++ b/drivers/staging/vc04_services/bcm2835-camera/controls.c @@ -533,17 +533,15 @@ static int ctrl_set_image_effect(struct bcm2835_mmal_dev *dev, control = &dev->component[COMP_CAMERA]->control; - ret = vchiq_mmal_port_parameter_set( - dev->instance, control, - MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS, - &imagefx, sizeof(imagefx)); + ret = vchiq_mmal_port_parameter_set(dev->instance, control, + MMAL_PARAMETER_IMAGE_EFFECT_PARAMETERS, + &imagefx, sizeof(imagefx)); if (ret) goto exit; - ret = vchiq_mmal_port_parameter_set( - dev->instance, control, - MMAL_PARAMETER_COLOUR_EFFECT, - &dev->colourfx, sizeof(dev->colourfx)); + ret = vchiq_mmal_port_parameter_set(dev->instance, control, + MMAL_PARAMETER_COLOUR_EFFECT, + &dev->colourfx, sizeof(dev->colourfx)); } exit: From b0c3d42658a89a09bcd51d0013444d608b45836a Mon Sep 17 00:00:00 2001 From: Justin Cromer Date: Sun, 23 Mar 2025 15:46:27 -0700 Subject: [PATCH 002/203] staging: sm750fb: fix casing style on getDeviceID Fixes camel casing for getDeviceID function. This includes an update to the internal function variable 'deviceID' as it's relevant, needs updating, and is clearly scoped to the small function. Signed-off-by: Justin Cromer Link: https://lore.kernel.org/r/Z-CPQ7dGuTBZ3sWv@fedora Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 12 ++++++------ drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 8b81e8642f9e..3fb14eff2de1 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -16,7 +16,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { { .init = sii164_init_chip, .get_vendor_id = sii164_get_vendor_id, - .get_device_id = sii164GetDeviceID, + .get_device_id = sii164_get_device_id, #ifdef SII164_FULL_FUNCTIONS .reset_chip = sii164ResetChip, .get_chip_string = sii164GetChipString, diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 2532b60245ac..d50c71824321 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -48,22 +48,22 @@ unsigned short sii164_get_vendor_id(void) } /* - * sii164GetDeviceID + * sii164_get_device_id * This function gets the device ID of the DVI controller chip. * * Output: * Device ID */ -unsigned short sii164GetDeviceID(void) +unsigned short sii164_get_device_id(void) { - unsigned short deviceID; + unsigned short device_id; - deviceID = ((unsigned short)i2cReadReg(SII164_I2C_ADDRESS, + device_id = ((unsigned short)i2cReadReg(SII164_I2C_ADDRESS, SII164_DEVICE_ID_HIGH) << 8) | (unsigned short)i2cReadReg(SII164_I2C_ADDRESS, SII164_DEVICE_ID_LOW); - return deviceID; + return device_id; } /* @@ -141,7 +141,7 @@ long sii164_init_chip(unsigned char edge_select, /* Check if SII164 Chip exists */ if ((sii164_get_vendor_id() == SII164_VENDOR_ID) && - (sii164GetDeviceID() == SII164_DEVICE_ID)) { + (sii164_get_device_id() == SII164_DEVICE_ID)) { /* * Initialize SII164 controller chip. */ diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index 71a7c1cb42c4..a76091f6622b 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -28,7 +28,7 @@ long sii164_init_chip(unsigned char edgeSelect, unsigned char pllFilterValue); unsigned short sii164_get_vendor_id(void); -unsigned short sii164GetDeviceID(void); +unsigned short sii164_get_device_id(void); #ifdef SII164_FULL_FUNCTIONS void sii164ResetChip(void); From 5771897aed7b24ff8c2acc5f38d1337024a7e82b Mon Sep 17 00:00:00 2001 From: Erick Karanja Date: Sat, 22 Mar 2025 09:58:00 +0300 Subject: [PATCH 003/203] staging: greybus: camera: fix code alignment warning Correct the alignment of the parameters to match the open parenthesis. Reported by checkpatch: CHECK: Alignment should match open parenthesis Signed-off-by: Erick Karanja Reviewed-by: Alex Elder Link: https://lore.kernel.org/r/20250322065800.21361-1-karanja99erick@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/camera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c index 5d80ace41d8e..ec9fddfc0b14 100644 --- a/drivers/staging/greybus/camera.c +++ b/drivers/staging/greybus/camera.c @@ -1165,8 +1165,8 @@ static int gb_camera_debugfs_init(struct gb_camera *gcam) gcam->debugfs.buffers[i].length = 0; debugfs_create_file_aux(entry->name, entry->mask, - gcam->debugfs.root, gcam, entry, - &gb_camera_debugfs_ops); + gcam->debugfs.root, gcam, entry, + &gb_camera_debugfs_ops); } return 0; From 7fc3a367b2f51004e4c0bd7b215502b7be6a042b Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Tue, 25 Mar 2025 14:11:04 +0100 Subject: [PATCH 004/203] staging: rtl8723bs: simplify if-else block by removing unnecessary braces The if-else block contained braces around single statements, which are unnecessary according to the Linux kernel coding style. Remove the redundant braces to improve code readability and maintain consistency with the rest of the codebase. Reported by checkpatch: WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: Abraham Samuel Adekunle Reviewed-by: Julia Lawall Link: https://lore.kernel.org/r/Z+KraOo2DfmH5zMX@HP-650 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_ieee80211.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c index 0ed420f3d096..53d4c113b19c 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ieee80211.c +++ b/drivers/staging/rtl8723bs/core/rtw_ieee80211.c @@ -988,11 +988,10 @@ void rtw_macaddr_cfg(struct device *dev, u8 *mac_addr) if (is_broadcast_ether_addr(mac) || is_zero_ether_addr(mac)) { addr = of_get_property(np, "local-mac-address", &len); - if (addr && len == ETH_ALEN) { + if (addr && len == ETH_ALEN) ether_addr_copy(mac_addr, addr); - } else { + else eth_random_addr(mac_addr); - } } } From f6d1d0ac1735ff4fccf84d08eadf291123b8e310 Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Tue, 25 Mar 2025 15:42:33 +0100 Subject: [PATCH 005/203] staging: rtl8723bs: remove unnecessary else block after return The else block after the return statement is unnecessary since execution does not continue past the return statement. Remove the else block while preserving logic making the code cleaner and more readable. reported by checkpatch: WARNING: else is not generally useful after a break or return Signed-off-by: Abraham Samuel Adekunle Reviewed-by: Julia Lawall Link: https://lore.kernel.org/r/Z+LA2eeFRL+K0KCy@HP-650 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c index 58de0c2fdd68..1d23ea7d6f59 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c @@ -2022,12 +2022,12 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u } iEntry = SecIsInPMKIDList(adapter, pmlmepriv->assoc_bssid); - if (iEntry < 0) { + if (iEntry < 0) return ielength; - } else { - if (authmode == WLAN_EID_RSN) - ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength); - } + + if (authmode == WLAN_EID_RSN) + ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength); + return ielength; } From 9f61589a8b50715fb7c11f4d899c9689ae6674bc Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Wed, 26 Mar 2025 13:40:05 +0100 Subject: [PATCH 006/203] staging: rtl8723bs: remove braces around single statements The code contains braces around single statements in the if blocks which are unnecessary according to the Linux kernel coding style. Remove the braces to improve readability and maintain consistency. Reported by checkpatch: WARNING: braces {} are not necessary for single statement blocks Signed-off-by: Abraham Samuel Adekunle Link: https://lore.kernel.org/r/Z+P1pfLSKpiRtpaF@HP-650 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index c60e179bb2e1..74a8fcf18e84 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -56,9 +56,8 @@ int _ips_leave(struct adapter *padapter) pwrpriv->ips_leave_cnts++; result = rtw_ips_pwr_up(padapter); - if (result == _SUCCESS) { + if (result == _SUCCESS) pwrpriv->rf_pwrstate = rf_on; - } pwrpriv->bips_processing = false; pwrpriv->bkeepfwalive = false; @@ -549,9 +548,8 @@ void LeaveAllPowerSaveMode(struct adapter *Adapter) LPS_Leave_check(Adapter); } else { - if (adapter_to_pwrctl(Adapter)->rf_pwrstate == rf_off) { + if (adapter_to_pwrctl(Adapter)->rf_pwrstate == rf_off) ips_leave(Adapter); - } } } From d486f2e07836fd8435c2ec0512b5d81cfc00781c Mon Sep 17 00:00:00 2001 From: Erick Karanja Date: Wed, 26 Mar 2025 16:26:49 +0300 Subject: [PATCH 007/203] staging: rtl8723bs: Rename variables Rename the variable `mediaStatus` to `media_status` and variable `lpsVal` to `lps_val` to adhere to Linux kernel coding standards by using snake_case instead of CamelCase. Fixes checkpatch.pl warning: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: Signed-off-by: Erick Karanja Link: https://lore.kernel.org/r/20250326132649.22055-1-karanja99erick@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_btcoex.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_btcoex.c b/drivers/staging/rtl8723bs/core/rtw_btcoex.c index d54095f50113..f4b19ef7b341 100644 --- a/drivers/staging/rtl8723bs/core/rtw_btcoex.c +++ b/drivers/staging/rtl8723bs/core/rtw_btcoex.c @@ -8,14 +8,14 @@ #include #include -void rtw_btcoex_MediaStatusNotify(struct adapter *padapter, u8 mediaStatus) +void rtw_btcoex_MediaStatusNotify(struct adapter *padapter, u8 media_status) { - if ((mediaStatus == RT_MEDIA_CONNECT) + if ((media_status == RT_MEDIA_CONNECT) && (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == true)) { rtw_hal_set_hwreg(padapter, HW_VAR_DL_RSVD_PAGE, NULL); } - hal_btcoex_MediaStatusNotify(padapter, mediaStatus); + hal_btcoex_MediaStatusNotify(padapter, media_status); } void rtw_btcoex_HaltNotify(struct adapter *padapter) @@ -52,14 +52,14 @@ void rtw_btcoex_RejectApAggregatedPacket(struct adapter *padapter, u8 enable) void rtw_btcoex_LPS_Enter(struct adapter *padapter) { struct pwrctrl_priv *pwrpriv; - u8 lpsVal; + u8 lps_val; pwrpriv = adapter_to_pwrctl(padapter); pwrpriv->bpower_saving = true; - lpsVal = hal_btcoex_LpsVal(padapter); - rtw_set_ps_mode(padapter, PS_MODE_MIN, 0, lpsVal, "BTCOEX"); + lps_val = hal_btcoex_LpsVal(padapter); + rtw_set_ps_mode(padapter, PS_MODE_MIN, 0, lps_val, "BTCOEX"); } void rtw_btcoex_LPS_Leave(struct adapter *padapter) From c511db3f1de6be1690ccbc53e0bb786073eda74a Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Wed, 2 Apr 2025 13:57:54 +0200 Subject: [PATCH 008/203] staging: greybus: Check for string truncation instead of NUL-termination Commit 18f44de63f88 ("staging: greybus: change strncpy() to strscpy_pad()") didn't remove the now unnecessary NUL-termination checks. Unlike strncpy(), strscpy_pad() guarantees that the destination buffer is NUL-terminated, making these checks obsolete. Remove them and check for string truncation instead. Compile-tested only. Signed-off-by: Thorsten Blum Link: https://lore.kernel.org/r/20250402115755.1929043-1-thorsten.blum@linux.dev Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/fw-management.c | 48 +++++++++---------------- 1 file changed, 17 insertions(+), 31 deletions(-) diff --git a/drivers/staging/greybus/fw-management.c b/drivers/staging/greybus/fw-management.c index a47385175582..152949c23d65 100644 --- a/drivers/staging/greybus/fw-management.c +++ b/drivers/staging/greybus/fw-management.c @@ -123,17 +123,11 @@ static int fw_mgmt_interface_fw_version_operation(struct fw_mgmt *fw_mgmt, fw_info->major = le16_to_cpu(response.major); fw_info->minor = le16_to_cpu(response.minor); - strscpy_pad(fw_info->firmware_tag, response.firmware_tag); - - /* - * The firmware-tag should be NULL terminated, otherwise throw error but - * don't fail. - */ - if (fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') { + ret = strscpy_pad(fw_info->firmware_tag, response.firmware_tag); + if (ret == -E2BIG) dev_err(fw_mgmt->parent, - "fw-version: firmware-tag is not NULL terminated\n"); - fw_info->firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] = '\0'; - } + "fw-version: truncated firmware tag: %s\n", + fw_info->firmware_tag); return 0; } @@ -152,14 +146,12 @@ static int fw_mgmt_load_and_validate_operation(struct fw_mgmt *fw_mgmt, } request.load_method = load_method; - strscpy_pad(request.firmware_tag, tag); - /* - * The firmware-tag should be NULL terminated, otherwise throw error and - * fail. - */ - if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') { - dev_err(fw_mgmt->parent, "load-and-validate: firmware-tag is not NULL terminated\n"); + ret = strscpy_pad(request.firmware_tag, tag); + if (ret == -E2BIG) { + dev_err(fw_mgmt->parent, + "load-and-validate: truncated firmware tag: %s\n", + request.firmware_tag); return -EINVAL; } @@ -248,14 +240,11 @@ static int fw_mgmt_backend_fw_version_operation(struct fw_mgmt *fw_mgmt, struct gb_fw_mgmt_backend_fw_version_response response; int ret; - strscpy_pad(request.firmware_tag, fw_info->firmware_tag); - - /* - * The firmware-tag should be NULL terminated, otherwise throw error and - * fail. - */ - if (request.firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE - 1] != '\0') { - dev_err(fw_mgmt->parent, "backend-version: firmware-tag is not NULL terminated\n"); + ret = strscpy_pad(request.firmware_tag, fw_info->firmware_tag); + if (ret == -E2BIG) { + dev_err(fw_mgmt->parent, + "backend-fw-version: truncated firmware tag: %s\n", + request.firmware_tag); return -EINVAL; } @@ -302,13 +291,10 @@ static int fw_mgmt_backend_fw_update_operation(struct fw_mgmt *fw_mgmt, int ret; ret = strscpy_pad(request.firmware_tag, tag); - - /* - * The firmware-tag should be NULL terminated, otherwise throw error and - * fail. - */ if (ret == -E2BIG) { - dev_err(fw_mgmt->parent, "backend-update: firmware-tag is not NULL terminated\n"); + dev_err(fw_mgmt->parent, + "backend-fw-update: truncated firmware tag: %s\n", + request.firmware_tag); return -EINVAL; } From 90bccdb4821c6b94214b33984113ecea00ac0e67 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 7 Apr 2025 09:14:52 +0200 Subject: [PATCH 009/203] staging: greybus: use new GPIO line value setter callbacks struct gpio_chip now has callbacks for setting line values that return an integer, allowing to indicate failures. Convert the driver to using them. Signed-off-by: Bartosz Golaszewski Reviewed-by: Alex Elder Reviewed-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20250407-gpiochip-set-rv-greybus-v1-1-9d4f721db7ca@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/gpio.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/greybus/gpio.c b/drivers/staging/greybus/gpio.c index 16bcf7fc8158..f81c34160f72 100644 --- a/drivers/staging/greybus/gpio.c +++ b/drivers/staging/greybus/gpio.c @@ -185,8 +185,8 @@ static int gb_gpio_get_value_operation(struct gb_gpio_controller *ggc, return 0; } -static void gb_gpio_set_value_operation(struct gb_gpio_controller *ggc, - u8 which, bool value_high) +static int gb_gpio_set_value_operation(struct gb_gpio_controller *ggc, + u8 which, bool value_high) { struct device *dev = &ggc->gbphy_dev->dev; struct gb_gpio_set_value_request request; @@ -195,7 +195,7 @@ static void gb_gpio_set_value_operation(struct gb_gpio_controller *ggc, if (ggc->lines[which].direction == 1) { dev_warn(dev, "refusing to set value of input gpio %u\n", which); - return; + return -EPERM; } request.which = which; @@ -204,10 +204,12 @@ static void gb_gpio_set_value_operation(struct gb_gpio_controller *ggc, &request, sizeof(request), NULL, 0); if (ret) { dev_err(dev, "failed to set value of gpio %u\n", which); - return; + return ret; } ggc->lines[which].value = request.value; + + return 0; } static int gb_gpio_set_debounce_operation(struct gb_gpio_controller *ggc, @@ -457,11 +459,11 @@ static int gb_gpio_get(struct gpio_chip *chip, unsigned int offset) return ggc->lines[which].value; } -static void gb_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) +static int gb_gpio_set(struct gpio_chip *chip, unsigned int offset, int value) { struct gb_gpio_controller *ggc = gpiochip_get_data(chip); - gb_gpio_set_value_operation(ggc, (u8)offset, !!value); + return gb_gpio_set_value_operation(ggc, (u8)offset, !!value); } static int gb_gpio_set_config(struct gpio_chip *chip, unsigned int offset, @@ -555,7 +557,7 @@ static int gb_gpio_probe(struct gbphy_device *gbphy_dev, gpio->direction_input = gb_gpio_direction_input; gpio->direction_output = gb_gpio_direction_output; gpio->get = gb_gpio_get; - gpio->set = gb_gpio_set; + gpio->set_rv = gb_gpio_set; gpio->set_config = gb_gpio_set_config; gpio->base = -1; /* Allocate base dynamically */ gpio->ngpio = ggc->line_max + 1; From c994aa4db445d5af7c8c5c8bf82dea544eebfd1f Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Fri, 4 Apr 2025 09:20:39 +0100 Subject: [PATCH 010/203] staging: rtl8723bs: modify struct field to use standard bool type The struct sta_info field ieee8021x_blocked uses the uint values 0 and 1 to represent false and true values respectively. Convert cases to use the bool type instead to ensure consistency with other parts of the containing code where true or false have been used. This change causes the struct field to change size from a 32bit to an 8bit. However, the change is safe to make because the sta_info struct is not read from the hardware. Reported by Coccinelle. Signed-off-by: Abraham Samuel Adekunle Link: https://lore.kernel.org/r/Z++WV1132FCULn+0@HP-650 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_ap.c | 2 +- drivers/staging/rtl8723bs/include/sta_info.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_ap.c b/drivers/staging/rtl8723bs/core/rtw_ap.c index 50022bb5911e..383a6f7c06f4 100644 --- a/drivers/staging/rtl8723bs/core/rtw_ap.c +++ b/drivers/staging/rtl8723bs/core/rtw_ap.c @@ -389,7 +389,7 @@ void update_bmc_sta(struct adapter *padapter) psta->qos_option = 0; psta->htpriv.ht_option = false; - psta->ieee8021x_blocked = 0; + psta->ieee8021x_blocked = false; memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); diff --git a/drivers/staging/rtl8723bs/include/sta_info.h b/drivers/staging/rtl8723bs/include/sta_info.h index b3535fed3de7..63343998266a 100644 --- a/drivers/staging/rtl8723bs/include/sta_info.h +++ b/drivers/staging/rtl8723bs/include/sta_info.h @@ -86,7 +86,7 @@ struct sta_info { uint qos_option; u8 hwaddr[ETH_ALEN]; - uint ieee8021x_blocked; /* 0: allowed, 1:blocked */ + bool ieee8021x_blocked; uint dot118021XPrivacy; /* aes, tkip... */ union Keytype dot11tkiptxmickey; union Keytype dot11tkiprxmickey; From 7b4cd0853cd038a6b8c99985ce219dfcd00d7dc9 Mon Sep 17 00:00:00 2001 From: Bryant Boatright Date: Fri, 4 Apr 2025 13:35:11 +0000 Subject: [PATCH 011/203] Staging: rtl8723bs: Fix unbalanced braces in conditional Only one branch of conditional statement is a single statement thus both branches should use braces to adhere to the Linux coding style. Reported by checkpatch: CHECK: Unbalanced braces around else statement Signed-off-by: Bryant Boatright Link: https://lore.kernel.org/r/Z-_gC8XOVoiXsC8i@ubuntu-desk Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 1c9e8b01d9d8..946511793c08 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -273,9 +273,9 @@ struct cmd_obj *_rtw_dequeue_cmd(struct __queue *queue) /* spin_lock_bh(&(queue->lock)); */ spin_lock_irqsave(&queue->lock, irqL); - if (list_empty(&queue->queue)) + if (list_empty(&queue->queue)) { obj = NULL; - else { + } else { obj = container_of(get_next(&queue->queue), struct cmd_obj, list); list_del_init(&obj->list); } From f668575bb604a967f5939ab8c37cd2722c9f9f70 Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Sat, 5 Apr 2025 00:15:42 +0000 Subject: [PATCH 012/203] staging: rtl8723bs: Place constants on right side of comparison Modify comparisons to place constants on the right hand side of expression thereby following Linux kernel coding conventions. Found and transformed by Coccinelle. Semantic patch used for matching and transformation: @@ constant K; expression E; @@ - K == E + E == K Signed-off-by: Abraham Samuel Adekunle Link: https://lore.kernel.org/r/Z/B2LjtshZU6AX2f@ubuntu Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723bs/hal/HalBtc8723b2Ant.c | 68 +++++++++---------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c index c1c7b5cc17a7..d32dbf94858f 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b2Ant.c @@ -1100,7 +1100,7 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) bCommon = true; } else { - if (BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE == pCoexDm->btStatus) { + if (pCoexDm->btStatus == BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE) { bLowPwrDisable = false; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); halbtc8723b2ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x8); @@ -1115,7 +1115,7 @@ static bool halbtc8723b2ant_IsCommonAction(struct btc_coexist *pBtCoexist) halbtc8723b2ant_SwMechanism2(pBtCoexist, false, false, false, 0x18); bCommon = true; - } else if (BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE == pCoexDm->btStatus) { + } else if (pCoexDm->btStatus == BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE) { bLowPwrDisable = true; pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable); @@ -1605,7 +1605,7 @@ static void halbtc8723b2ant_ActionSco(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_LEGACY == wifiBw) /* for SCO quality at 11b/g mode */ + if (wifiBw == BTC_WIFI_BW_LEGACY) /* for SCO quality at 11b/g mode */ halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); else /* for SCO quality & wifi performance balance at 11n mode */ halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 8); @@ -1613,7 +1613,7 @@ static void halbtc8723b2ant_ActionSco(struct btc_coexist *pBtCoexist) halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); /* for voice quality */ /* sw mechanism */ - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -1660,7 +1660,7 @@ static void halbtc8723b2ant_ActionHid(struct btc_coexist *pBtCoexist) pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_LEGACY == wifiBw) /* for HID at 11b/g mode */ + if (wifiBw == BTC_WIFI_BW_LEGACY) /* for HID at 11b/g mode */ halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); else /* for HID quality & wifi performance balance at 11n mode */ halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 9); @@ -1674,7 +1674,7 @@ static void halbtc8723b2ant_ActionHid(struct btc_coexist *pBtCoexist) halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 13); /* sw mechanism */ - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -1723,7 +1723,7 @@ static void halbtc8723b2ant_ActionA2dp(struct btc_coexist *pBtCoexist) /* sw mechanism */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { halbtc8723b2ant_SwMechanism1(pBtCoexist, true, false, false, false); halbtc8723b2ant_SwMechanism2(pBtCoexist, true, false, true, 0x18); } else { @@ -1755,7 +1755,7 @@ static void halbtc8723b2ant_ActionA2dp(struct btc_coexist *pBtCoexist) /* sw mechanism */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -1805,7 +1805,7 @@ static void halbtc8723b2ant_ActionA2dpPanHs(struct btc_coexist *pBtCoexist) /* sw mechanism */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -1861,7 +1861,7 @@ static void halbtc8723b2ant_ActionPanEdr(struct btc_coexist *pBtCoexist) /* sw mechanism */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -1912,7 +1912,7 @@ static void halbtc8723b2ant_ActionPanHs(struct btc_coexist *pBtCoexist) halbtc8723b2ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 1); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -1964,7 +1964,7 @@ static void halbtc8723b2ant_ActionPanEdrA2dp(struct btc_coexist *pBtCoexist) (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 12); - if (BTC_WIFI_BW_HT40 == wifiBw) + if (wifiBw == BTC_WIFI_BW_HT40) halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, false, true, 3); else halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, false, false, 3); @@ -1974,7 +1974,7 @@ static void halbtc8723b2ant_ActionPanEdrA2dp(struct btc_coexist *pBtCoexist) } /* sw mechanism */ - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -2019,7 +2019,7 @@ static void halbtc8723b2ant_ActionPanEdrHid(struct btc_coexist *pBtCoexist) (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 3); halbtc8723b2ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 11); pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); @@ -2037,7 +2037,7 @@ static void halbtc8723b2ant_ActionPanEdrHid(struct btc_coexist *pBtCoexist) } /* sw mechanism */ - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -2090,7 +2090,7 @@ static void halbtc8723b2ant_ActionHidA2dpPanEdr(struct btc_coexist *pBtCoexist) (btRssiState == BTC_RSSI_STATE_HIGH) || (btRssiState == BTC_RSSI_STATE_STAY_HIGH) ) { - if (BTC_WIFI_BW_HT40 == wifiBw) + if (wifiBw == BTC_WIFI_BW_HT40) halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, true, true, 2); else halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, true, false, 3); @@ -2098,7 +2098,7 @@ static void halbtc8723b2ant_ActionHidA2dpPanEdr(struct btc_coexist *pBtCoexist) halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, true, true, 3); /* sw mechanism */ - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -2140,7 +2140,7 @@ static void halbtc8723b2ant_ActionHidA2dp(struct btc_coexist *pBtCoexist) halbtc8723b2ant_FwDacSwingLvl(pBtCoexist, NORMAL_EXEC, 6); pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_LEGACY == wifiBw) { + if (wifiBw == BTC_WIFI_BW_LEGACY) { if (BTC_RSSI_HIGH(btRssiState)) halbtc8723b2ant_DecBtPwr(pBtCoexist, NORMAL_EXEC, 2); else if (BTC_RSSI_MEDIUM(btRssiState)) @@ -2173,7 +2173,7 @@ static void halbtc8723b2ant_ActionHidA2dp(struct btc_coexist *pBtCoexist) halbtc8723b2ant_TdmaDurationAdjust(pBtCoexist, true, true, 2); /* sw mechanism */ - if (BTC_WIFI_BW_HT40 == wifiBw) { + if (wifiBw == BTC_WIFI_BW_HT40) { if ( (wifiRssiState == BTC_RSSI_STATE_HIGH) || (wifiRssiState == BTC_RSSI_STATE_STAY_HIGH) @@ -2391,12 +2391,12 @@ void EXhalbtc8723b2ant_InitCoexDm(struct btc_coexist *pBtCoexist) void EXhalbtc8723b2ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) { - if (BTC_IPS_ENTER == type) { + if (type == BTC_IPS_ENTER) { pCoexSta->bUnderIps = true; halbtc8723b2ant_WifiOffHwCfg(pBtCoexist); halbtc8723b2ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true); halbtc8723b2ant_CoexAllOff(pBtCoexist); - } else if (BTC_IPS_LEAVE == type) { + } else if (type == BTC_IPS_LEAVE) { pCoexSta->bUnderIps = false; halbtc8723b2ant_InitHwConfig(pBtCoexist, false); halbtc8723b2ant_InitCoexDm(pBtCoexist); @@ -2406,24 +2406,24 @@ void EXhalbtc8723b2ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) void EXhalbtc8723b2ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) { - if (BTC_LPS_ENABLE == type) { + if (type == BTC_LPS_ENABLE) { pCoexSta->bUnderLps = true; - } else if (BTC_LPS_DISABLE == type) { + } else if (type == BTC_LPS_DISABLE) { pCoexSta->bUnderLps = false; } } void EXhalbtc8723b2ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) { - if (BTC_SCAN_START == type) { - } else if (BTC_SCAN_FINISH == type) { + if (type == BTC_SCAN_START) { + } else if (type == BTC_SCAN_FINISH) { } } void EXhalbtc8723b2ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) { - if (BTC_ASSOCIATE_START == type) { - } else if (BTC_ASSOCIATE_FINISH == type) { + if (type == BTC_ASSOCIATE_START) { + } else if (type == BTC_ASSOCIATE_FINISH) { } } @@ -2436,11 +2436,11 @@ void EXhalbtc8723b2ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type /* only 2.4G we need to inform bt the chnl mask */ pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); - if ((BTC_MEDIA_CONNECT == type) && (wifiCentralChnl <= 14)) { + if ((type == BTC_MEDIA_CONNECT) && (wifiCentralChnl <= 14)) { H2C_Parameter[0] = 0x1; H2C_Parameter[1] = wifiCentralChnl; pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); - if (BTC_WIFI_BW_HT40 == wifiBw) + if (wifiBw == BTC_WIFI_BW_HT40) H2C_Parameter[2] = 0x30; else { pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_AP_NUM, &apNum); @@ -2573,9 +2573,9 @@ void EXhalbtc8723b2ant_BtInfoNotify( } if ( - (BT_8723B_2ANT_BT_STATUS_ACL_BUSY == pCoexDm->btStatus) || - (BT_8723B_2ANT_BT_STATUS_SCO_BUSY == pCoexDm->btStatus) || - (BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY == pCoexDm->btStatus) + (pCoexDm->btStatus == BT_8723B_2ANT_BT_STATUS_ACL_BUSY) || + (pCoexDm->btStatus == BT_8723B_2ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY) ) { bBtBusy = true; bLimitedDig = true; @@ -2603,8 +2603,8 @@ void EXhalbtc8723b2ant_HaltNotify(struct btc_coexist *pBtCoexist) void EXhalbtc8723b2ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) { - if (BTC_WIFI_PNP_SLEEP == pnpState) { - } else if (BTC_WIFI_PNP_WAKE_UP == pnpState) { + if (pnpState == BTC_WIFI_PNP_SLEEP) { + } else if (pnpState == BTC_WIFI_PNP_WAKE_UP) { halbtc8723b2ant_InitHwConfig(pBtCoexist, false); halbtc8723b2ant_InitCoexDm(pBtCoexist); halbtc8723b2ant_QueryBtInfo(pBtCoexist); From c0c64f7b6d05a31f3d4f1ad5cdddd8407956b54f Mon Sep 17 00:00:00 2001 From: Erick Karanja Date: Sat, 5 Apr 2025 14:26:04 +0300 Subject: [PATCH 013/203] staging: rtl8723bs: add spaces between ternary and binary operators Fix spacing around binary arithmetic (`+`, `-`) and shift (`>>`) operators to improve readability and adhere to the Linux kernel coding style. Reported by checkpatch: CHECK: spaces needed around 'operator' Signed-off-by: Erick Karanja Link: https://lore.kernel.org/r/ff993a669699e902909063aed03bb6183122c9a7.1743851473.git.karanja99erick@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_CfoTracking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c index 928c58be6c9b..666a9f44012d 100644 --- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c +++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c @@ -155,9 +155,9 @@ void ODM_CfoTracking(void *pDM_VOID) /* 4 1.6 Big jump */ if (pCfoTrack->bAdjust) { if (CFO_ave > CFO_TH_XTAL_LOW) - Adjust_Xtal = Adjust_Xtal+((CFO_ave-CFO_TH_XTAL_LOW)>>2); + Adjust_Xtal = Adjust_Xtal + ((CFO_ave - CFO_TH_XTAL_LOW) >> 2); else if (CFO_ave < (-CFO_TH_XTAL_LOW)) - Adjust_Xtal = Adjust_Xtal+((CFO_TH_XTAL_LOW-CFO_ave)>>2); + Adjust_Xtal = Adjust_Xtal + ((CFO_TH_XTAL_LOW - CFO_ave) >> 2); } /* 4 1.7 Adjust Crystal Cap. */ From fe1f8eefe19bba3ac995e316dac7f312ef6ec84e Mon Sep 17 00:00:00 2001 From: Erick Karanja Date: Sat, 5 Apr 2025 14:26:05 +0300 Subject: [PATCH 014/203] staging: rtl8723bs: use preferred comparison order Refactor conditions check to follow the Linux kernel coding style, which prefers placing the variable on the left side of the comparison. Reported by checkpatch: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Erick Karanja Link: https://lore.kernel.org/r/3534b660142c78e800e369c31df091625e61f844.1743851473.git.karanja99erick@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index b72cf520d576..9105594d2dde 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -91,7 +91,7 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist) stime = jiffies; do { ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE); - if (_SUCCESS == ready) + if (ready == _SUCCESS) break; utime = jiffies_to_msecs(jiffies - stime); @@ -668,7 +668,7 @@ static void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 D struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; struct adapter *Adapter = pBtCoexist->Adapter; - if (BTC_INTF_SDIO == pBtCoexist->chipInterface) + if (pBtCoexist->chipInterface == BTC_INTF_SDIO) rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data); else rtw_write8(Adapter, RegAddr, Data); @@ -894,7 +894,7 @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl) return; - if (IPS_NONE == type) + if (type == IPS_NONE) ipsType = BTC_IPS_LEAVE; else ipsType = BTC_IPS_ENTER; @@ -922,7 +922,7 @@ void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl) return; - if (PS_MODE_ACTIVE == type) + if (type == PS_MODE_ACTIVE) lpsType = BTC_LPS_DISABLE; else lpsType = BTC_LPS_ENABLE; @@ -1000,7 +1000,7 @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum if (pBtCoexist->bManualControl) return; - if (RT_MEDIA_CONNECT == mediaStatus) + if (mediaStatus == RT_MEDIA_CONNECT) mStatus = BTC_MEDIA_CONNECT; else mStatus = BTC_MEDIA_DISCONNECT; @@ -1026,11 +1026,11 @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy if (pBtCoexist->bManualControl) return; - if (PACKET_DHCP == pktType) { + if (pktType == PACKET_DHCP) { packetType = BTC_PACKET_DHCP; - } else if (PACKET_EAPOL == pktType) { + } else if (pktType == PACKET_EAPOL) { packetType = BTC_PACKET_EAPOL; - } else if (PACKET_ARP == pktType) { + } else if (pktType == PACKET_ARP) { packetType = BTC_PACKET_ARP; } else { return; @@ -1114,13 +1114,13 @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist) void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) { - if (BT_COEX_ANT_TYPE_PG == type) { + if (type == BT_COEX_ANT_TYPE_PG) { GLBtCoexist.boardInfo.pgAntNum = antNum; GLBtCoexist.boardInfo.btdmAntNum = antNum; - } else if (BT_COEX_ANT_TYPE_ANTDIV == type) { + } else if (type == BT_COEX_ANT_TYPE_ANTDIV) { GLBtCoexist.boardInfo.btdmAntNum = antNum; /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ - } else if (BT_COEX_ANT_TYPE_DETECTED == type) { + } else if (type == BT_COEX_ANT_TYPE_DETECTED) { GLBtCoexist.boardInfo.btdmAntNum = antNum; /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ } From baf39931560f10f643a0c6e89e1b4c811bbeab76 Mon Sep 17 00:00:00 2001 From: Gabriel Shahrouzi Date: Sat, 5 Apr 2025 17:02:40 -0400 Subject: [PATCH 015/203] staging: rtl8723bs: Remove trailing whitespace Remove trailing whitespace to comply with kernel coding style. Signed-off-by: Gabriel Shahrouzi Link: https://lore.kernel.org/r/20250405210240.584821-1-gshahrouzi@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/include/hal_pwr_seq.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/include/hal_pwr_seq.h b/drivers/staging/rtl8723bs/include/hal_pwr_seq.h index b93d74a5b9a5..48bf7f66a06e 100644 --- a/drivers/staging/rtl8723bs/include/hal_pwr_seq.h +++ b/drivers/staging/rtl8723bs/include/hal_pwr_seq.h @@ -209,7 +209,7 @@ #define RTL8723B_TRANS_END \ /* format */ \ /* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \ - {0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 0, PWR_CMD_END, 0, 0}, + {0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, 0, PWR_CMD_END, 0, 0}, extern struct wlan_pwr_cfg rtl8723B_power_on_flow[RTL8723B_TRANS_CARDEMU_TO_ACT_STEPS+RTL8723B_TRANS_END_STEPS]; From 0eb3d8c1ff1bcc5e31c7787d183406c27c72e6de Mon Sep 17 00:00:00 2001 From: Erick Karanja Date: Thu, 10 Apr 2025 10:11:50 +0300 Subject: [PATCH 016/203] staging: rtl8723bs: Initialize variables at declaration in rtl8723bs_xmit.c Make the code more readable by moving trivial initializations up with the declarations instead of wasting a line on that. Signed-off-by: Erick Karanja Link: https://lore.kernel.org/r/0a2165d8135d2b4de6b9c05fdc56fe5d7408e7c8.1744268316.git.karanja99erick@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723bs/hal/rtl8723bs_xmit.c | 33 +++++-------------- 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c index 5dc1c12fe03e..842e19b53421 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723bs_xmit.c @@ -120,13 +120,10 @@ static s32 rtl8723_dequeue_writeport(struct adapter *padapter) */ s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter) { - struct xmit_priv *pxmitpriv; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; u8 queue_empty, queue_pending; s32 ret; - - pxmitpriv = &padapter->xmitpriv; - if (wait_for_completion_interruptible(&pxmitpriv->xmit_comp)) { netdev_emerg(padapter->pnetdev, "%s: down SdioXmitBufSema fail!\n", __func__); @@ -357,12 +354,9 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv */ static s32 rtl8723bs_xmit_handler(struct adapter *padapter) { - struct xmit_priv *pxmitpriv; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; s32 ret; - - pxmitpriv = &padapter->xmitpriv; - if (wait_for_completion_interruptible(&pxmitpriv->SdioXmitStart)) { netdev_emerg(padapter->pnetdev, "%s: SdioXmitStart fail!\n", __func__); @@ -408,13 +402,9 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter) int rtl8723bs_xmit_thread(void *context) { - s32 ret; - struct adapter *padapter; - struct xmit_priv *pxmitpriv; - - ret = _SUCCESS; - padapter = context; - pxmitpriv = &padapter->xmitpriv; + s32 ret = _SUCCESS; + struct adapter *padapter = context; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; allow_signal(SIGTERM); @@ -435,16 +425,13 @@ s32 rtl8723bs_mgnt_xmit( ) { s32 ret = _SUCCESS; - struct pkt_attrib *pattrib; - struct xmit_buf *pxmitbuf; + struct pkt_attrib *pattrib = &pmgntframe->attrib; + struct xmit_buf *pxmitbuf = pmgntframe->pxmitbuf; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); u8 *pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; u8 txdesc_size = TXDESC_SIZE; - pattrib = &pmgntframe->attrib; - pxmitbuf = pmgntframe->pxmitbuf; - rtl8723b_update_txdesc(pmgntframe, pmgntframe->buf_addr); pxmitbuf->len = txdesc_size + pattrib->last_txcmdsz; @@ -557,15 +544,13 @@ s32 rtl8723bs_init_xmit_priv(struct adapter *padapter) void rtl8723bs_free_xmit_priv(struct adapter *padapter) { - struct xmit_priv *pxmitpriv; + struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_buf *pxmitbuf; - struct __queue *pqueue; + struct __queue *pqueue = &pxmitpriv->pending_xmitbuf_queue; struct list_head *plist, *phead; struct list_head tmplist; - pxmitpriv = &padapter->xmitpriv; - pqueue = &pxmitpriv->pending_xmitbuf_queue; phead = get_list_head(pqueue); INIT_LIST_HEAD(&tmplist); From 12ad640a04aa33961954be66c604a969a2dc9391 Mon Sep 17 00:00:00 2001 From: Erick Karanja Date: Thu, 10 Apr 2025 10:11:51 +0300 Subject: [PATCH 017/203] staging: rtl8723bs: Initialize variables at declaration in rtl8723b_hal_init.c Make the code more concise and readable by integrating the initialization directly into the variable declaration in cases where the initialization is simple and doesn't depend on other variables or complex expressions. Signed-off-by: Erick Karanja Link: https://lore.kernel.org/r/4d52a207eadd99ad998214aa8eb059f725c94802.1744268316.git.karanja99erick@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../staging/rtl8723bs/hal/rtl8723b_hal_init.c | 81 ++++++------------- 1 file changed, 24 insertions(+), 57 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c index e15ec6452fd0..893cab0532ed 100644 --- a/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c +++ b/drivers/staging/rtl8723bs/hal/rtl8723b_hal_init.c @@ -501,8 +501,7 @@ void Hal_GetEfuseDefinition( switch (type) { case TYPE_EFUSE_MAX_SECTION: { - u8 *pMax_section; - pMax_section = pOut; + u8 *pMax_section = pOut; if (efuseType == EFUSE_WIFI) *pMax_section = EFUSE_MAX_SECTION_8723B; @@ -513,8 +512,7 @@ void Hal_GetEfuseDefinition( case TYPE_EFUSE_REAL_CONTENT_LEN: { - u16 *pu2Tmp; - pu2Tmp = pOut; + u16 *pu2Tmp = pOut; if (efuseType == EFUSE_WIFI) *pu2Tmp = EFUSE_REAL_CONTENT_LEN_8723B; @@ -525,8 +523,7 @@ void Hal_GetEfuseDefinition( case TYPE_AVAILABLE_EFUSE_BYTES_BANK: { - u16 *pu2Tmp; - pu2Tmp = pOut; + u16 *pu2Tmp = pOut; if (efuseType == EFUSE_WIFI) *pu2Tmp = (EFUSE_REAL_CONTENT_LEN_8723B-EFUSE_OOB_PROTECT_BYTES); @@ -537,8 +534,7 @@ void Hal_GetEfuseDefinition( case TYPE_AVAILABLE_EFUSE_BYTES_TOTAL: { - u16 *pu2Tmp; - pu2Tmp = pOut; + u16 *pu2Tmp = pOut; if (efuseType == EFUSE_WIFI) *pu2Tmp = (EFUSE_REAL_CONTENT_LEN_8723B-EFUSE_OOB_PROTECT_BYTES); @@ -549,8 +545,7 @@ void Hal_GetEfuseDefinition( case TYPE_EFUSE_MAP_LEN: { - u16 *pu2Tmp; - pu2Tmp = pOut; + u16 *pu2Tmp = pOut; if (efuseType == EFUSE_WIFI) *pu2Tmp = EFUSE_MAX_MAP_LEN; @@ -561,8 +556,7 @@ void Hal_GetEfuseDefinition( case TYPE_EFUSE_PROTECT_BYTES_BANK: { - u8 *pu1Tmp; - pu1Tmp = pOut; + u8 *pu1Tmp = pOut; if (efuseType == EFUSE_WIFI) *pu1Tmp = EFUSE_OOB_PROTECT_BYTES; @@ -573,8 +567,7 @@ void Hal_GetEfuseDefinition( case TYPE_EFUSE_CONTENT_LEN_BANK: { - u16 *pu2Tmp; - pu2Tmp = pOut; + u16 *pu2Tmp = pOut; if (efuseType == EFUSE_WIFI) *pu2Tmp = EFUSE_REAL_CONTENT_LEN_8723B; @@ -585,8 +578,7 @@ void Hal_GetEfuseDefinition( default: { - u8 *pu1Tmp; - pu1Tmp = pOut; + u8 *pu1Tmp = pOut; *pu1Tmp = 0; } break; @@ -835,9 +827,8 @@ static void hal_ReadEFuse_BT( } if (offset < EFUSE_BT_MAX_SECTION) { - u16 addr; + u16 addr = offset * PGPKT_DATA_SIZE; - addr = offset * PGPKT_DATA_SIZE; for (i = 0; i < EFUSE_MAX_WORD_UNIT; i++) { /* Check word enable condition in the section */ if (!(wden & (0x01<securitypriv.dot11PrivacyAlgrthm; - EncAlg = padapter->securitypriv.dot11PrivacyAlgrthm; switch (EncAlg) { case _NO_PRIVACY_: SET_TX_DESC_SEC_TYPE_8723B(pDesc, 0x0); @@ -2378,9 +2364,7 @@ static void hw_var_set_opmode(struct adapter *padapter, u8 variable, u8 *val) static void hw_var_set_macaddr(struct adapter *padapter, u8 variable, u8 *val) { u8 idx = 0; - u32 reg_macid; - - reg_macid = REG_MACID; + u32 reg_macid = REG_MACID; for (idx = 0 ; idx < 6; idx++) rtw_write8(GET_PRIMARY_ADAPTER(padapter), (reg_macid+idx), val[idx]); @@ -2389,9 +2373,7 @@ static void hw_var_set_macaddr(struct adapter *padapter, u8 variable, u8 *val) static void hw_var_set_bssid(struct adapter *padapter, u8 variable, u8 *val) { u8 idx = 0; - u32 reg_bssid; - - reg_bssid = REG_BSSID; + u32 reg_bssid = REG_BSSID; for (idx = 0 ; idx < 6; idx++) rtw_write8(padapter, (reg_bssid+idx), val[idx]); @@ -2399,9 +2381,7 @@ static void hw_var_set_bssid(struct adapter *padapter, u8 variable, u8 *val) static void hw_var_set_bcn_func(struct adapter *padapter, u8 variable, u8 *val) { - u32 bcn_ctrl_reg; - - bcn_ctrl_reg = REG_BCN_CTRL; + u32 bcn_ctrl_reg = REG_BCN_CTRL; if (*(u8 *)val) rtw_write8(padapter, bcn_ctrl_reg, (EN_BCN_FUNCTION | EN_TXBCN_RPT)); @@ -2422,12 +2402,8 @@ static void hw_var_set_correct_tsf(struct adapter *padapter, u8 variable, u8 *va { u8 val8; u64 tsf; - struct mlme_ext_priv *pmlmeext; - struct mlme_ext_info *pmlmeinfo; - - - pmlmeext = &padapter->mlmeextpriv; - pmlmeinfo = &pmlmeext->mlmext_info; + struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; + struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info; tsf = pmlmeext->TSFValue-do_div(pmlmeext->TSFValue, (pmlmeinfo->bcn_interval*1024))-1024; /* us */ @@ -2543,15 +2519,12 @@ static void hw_var_set_mlme_join(struct adapter *padapter, u8 variable, u8 *val) u8 val8; u16 val16; u32 val32; - u8 RetryLimit; - u8 type; - struct mlme_priv *pmlmepriv; + u8 RetryLimit = 0x30; + u8 type = *(u8 *)val; + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; struct eeprom_priv *pEEPROM; - RetryLimit = 0x30; - type = *(u8 *)val; - pmlmepriv = &padapter->mlmepriv; pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter); if (type == 0) { /* prepare to join */ @@ -2850,12 +2823,11 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val) case HW_VAR_ACK_PREAMBLE: { - u8 regTmp; + u8 regTmp = 0; u8 bShortPreamble = *val; /* Joseph marked out for Netgear 3500 TKIP channel 7 issue.(Temporarily) */ /* regTmp = (pHalData->nCur40MhzPrimeSC)<<5; */ - regTmp = 0; if (bShortPreamble) regTmp |= 0x80; rtw_write8(padapter, REG_RRSR+2, regTmp); @@ -3226,9 +3198,7 @@ void GetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val) */ u8 SetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, void *pval) { - u8 bResult; - - bResult = _SUCCESS; + u8 bResult = _SUCCESS; switch (variable) { default: @@ -3244,9 +3214,7 @@ u8 SetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, v */ u8 GetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, void *pval) { - u8 bResult; - - bResult = _SUCCESS; + u8 bResult = _SUCCESS; switch (variable) { case HAL_DEF_MAX_RECVBUF_SZ: @@ -3281,9 +3249,8 @@ u8 GetHalDefVar8723B(struct adapter *padapter, enum hal_def_variable variable, v case HW_DEF_RA_INFO_DUMP: { u8 mac_id = *(u8 *)pval; - u32 cmd; + u32 cmd = 0x40000100 | mac_id; - cmd = 0x40000100 | mac_id; rtw_write32(padapter, REG_HMEBOX_DBG_2_8723B, cmd); msleep(10); rtw_read32(padapter, 0x2F0); // info 1 From 89d571794f795b626c67dc93bc148af161630a48 Mon Sep 17 00:00:00 2001 From: Erick Karanja Date: Fri, 11 Apr 2025 11:54:25 +0300 Subject: [PATCH 018/203] staging: rtl8723bs: Use boolean false instead of integer 0 In the struct definition, adaptivity_flag is defined as type 'bool'. This change replaces the integer literal 0 with the boolean constant false to match the declared type. It ensures semantic correctness, and aligns with kernel coding conventions that prefer true/false over 1/0 for bool types. found by coccinelle Signed-off-by: Erick Karanja Link: https://lore.kernel.org/r/20250411085425.44177-1-karanja99erick@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/hal/odm_DIG.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_DIG.c b/drivers/staging/rtl8723bs/hal/odm_DIG.c index 97a51546463a..1e2946a23beb 100644 --- a/drivers/staging/rtl8723bs/hal/odm_DIG.c +++ b/drivers/staging/rtl8723bs/hal/odm_DIG.c @@ -56,7 +56,7 @@ void odm_NHMBBInit(void *pDM_VOID) { struct dm_odm_t *pDM_Odm = (struct dm_odm_t *)pDM_VOID; - pDM_Odm->adaptivity_flag = 0; + pDM_Odm->adaptivity_flag = false; pDM_Odm->tolerance_cnt = 3; pDM_Odm->NHMLastTxOkcnt = 0; pDM_Odm->NHMLastRxOkcnt = 0; From c215f0b5b858f59ddf0e5dde012099739f10d05d Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 15 Apr 2025 12:10:19 +0300 Subject: [PATCH 019/203] staging: rtl8723bs: Fix compilation errors for W=1 build When building a kernel with Clang 19 the couple of warnings become the errors (due to CONFIG_WERROR=y by default). .../rtl8723bs/core/rtw_xmit.c:1939:13: error: variable 'drop_cnt' set but not used [-Werror,-Wunused-but-set-variable] .../rtl8723bs/hal/hal_com.c:893:6: error: variable 'res' set but not used [-Werror,-Wunused-but-set-variable] Fix them accordingly. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20250415091019.545905-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_xmit.c | 9 ++------- drivers/staging/rtl8723bs/hal/hal_com.c | 11 ++++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index 297c93d65315..e2f7b2415524 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -1936,7 +1936,6 @@ static void do_queue_select(struct adapter *padapter, struct pkt_attrib *pattrib s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt) { static unsigned long start; - static u32 drop_cnt; struct xmit_priv *pxmitpriv = &padapter->xmitpriv; struct xmit_frame *pxmitframe = NULL; @@ -1948,15 +1947,11 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt) pxmitframe = rtw_alloc_xmitframe(pxmitpriv); - if (jiffies_to_msecs(jiffies - start) > 2000) { + if (jiffies_to_msecs(jiffies - start) > 2000) start = jiffies; - drop_cnt = 0; - } - if (!pxmitframe) { - drop_cnt++; + if (!pxmitframe) return -1; - } res = update_attrib(padapter, *ppkt, &pxmitframe->attrib); diff --git a/drivers/staging/rtl8723bs/hal/hal_com.c b/drivers/staging/rtl8723bs/hal/hal_com.c index 1213a91cffff..d91e2461fd7e 100644 --- a/drivers/staging/rtl8723bs/hal/hal_com.c +++ b/drivers/staging/rtl8723bs/hal/hal_com.c @@ -890,15 +890,14 @@ static u32 Array_kfreemap[] = { void rtw_bb_rf_gain_offset(struct adapter *padapter) { u8 value = padapter->eeprompriv.EEPROMRFGainOffset; - u32 res, i = 0; u32 *Array = Array_kfreemap; u32 v1 = 0, v2 = 0, target = 0; + u32 i = 0; if (value & BIT4) { if (padapter->eeprompriv.EEPROMRFGainVal != 0xff) { - res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); - res &= 0xfff87fff; - /* res &= 0xfff87fff; */ + rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); + for (i = 0; i < ARRAY_SIZE(Array_kfreemap); i += 2) { v1 = Array[i]; v2 = Array[i+1]; @@ -909,9 +908,7 @@ void rtw_bb_rf_gain_offset(struct adapter *padapter) } PHY_SetRFReg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, BIT18|BIT17|BIT16|BIT15, target); - /* res |= (padapter->eeprompriv.EEPROMRFGainVal & 0x0f)<< 15; */ - /* rtw_hal_write_rfreg(padapter, RF_PATH_A, REG_RF_BB_GAIN_OFFSET, RF_GAIN_OFFSET_MASK, res); */ - res = rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); + rtw_hal_read_rfreg(padapter, RF_PATH_A, 0x7f, 0xffffffff); } } } From c96e16dfbfc54e9752b1fc780400348e0926d215 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 15 Apr 2025 14:31:51 +0100 Subject: [PATCH 020/203] staging: bcm2835-audio: Validate values written to controls The bcm2835-audio driver makes no effort to validate the values it accepts from userspace, causing it to accept invalid values: # # PCM Playback Switch.0 Invalid boolean value 2 # not ok 5 write_invalid.Headphones.1 # # PCM Playback Volume.0 value -10240 less than minimum -10239 # # PCM Playback Volume.0 value 401 more than maximum 400 # not ok 12 write_invalid.Headphones.0 Add validation. Signed-off-by: Mark Brown Link: https://lore.kernel.org/r/20250415-staging-bcm2835-alsa-limit-v1-1-4ed816e9c0fc@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c index 1c1f040122d7..7d0ddd5c8cce 100644 --- a/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c +++ b/drivers/staging/vc04_services/bcm2835-audio/bcm2835-ctl.c @@ -71,6 +71,7 @@ static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct bcm2835_chip *chip = snd_kcontrol_chip(kcontrol); + struct snd_ctl_elem_info info; int val, *valp; int changed = 0; @@ -84,6 +85,11 @@ static int snd_bcm2835_ctl_put(struct snd_kcontrol *kcontrol, return -EINVAL; val = ucontrol->value.integer.value[0]; + + snd_bcm2835_ctl_info(kcontrol, &info); + if (val < info.value.integer.min || val > info.value.integer.max) + return -EINVAL; + mutex_lock(&chip->audio_mutex); if (val != *valp) { *valp = val; From 7057ad8e860ceecea9d5dba5b114b79e4beaf677 Mon Sep 17 00:00:00 2001 From: Richard Akintola Date: Tue, 8 Apr 2025 11:20:34 +0100 Subject: [PATCH 021/203] staging: sm750fb: change sii164ResetChip to snake_case Change camelCase function name sii164ResetChip to sii164_reset_chip to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid camelCase: Signed-off-by: Richard Akintola Link: https://lore.kernel.org/r/0974eb17fa67b707e8d2972668da4d8a692a9702.1744105388.git.princerichard17a@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 4 ++-- drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 3fb14eff2de1..6dee95e60a6e 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -18,7 +18,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { .get_vendor_id = sii164_get_vendor_id, .get_device_id = sii164_get_device_id, #ifdef SII164_FULL_FUNCTIONS - .reset_chip = sii164ResetChip, + .reset_chip = sii164_reset_chip, .get_chip_string = sii164GetChipString, .set_power = sii164SetPower, .enable_hot_plug_detection = sii164EnableHotPlugDetection, diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index d50c71824321..9e304e7eae9b 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -250,10 +250,10 @@ long sii164_init_chip(unsigned char edge_select, #ifdef SII164_FULL_FUNCTIONS /* - * sii164ResetChip + * sii164_reset_chip * This function resets the DVI Controller Chip. */ -void sii164ResetChip(void) +void sii164_reset_chip(void) { /* Power down */ sii164SetPower(0); diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index a76091f6622b..7a71f94a1e9b 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -31,7 +31,7 @@ unsigned short sii164_get_vendor_id(void); unsigned short sii164_get_device_id(void); #ifdef SII164_FULL_FUNCTIONS -void sii164ResetChip(void); +void sii164_reset_chip(void); char *sii164GetChipString(void); void sii164SetPower(unsigned char powerUp); void sii164EnableHotPlugDetection(unsigned char enableHotPlug); From 0933207fb03b719f6a9c9a730072d3695e47268e Mon Sep 17 00:00:00 2001 From: Richard Akintola Date: Tue, 8 Apr 2025 11:20:35 +0100 Subject: [PATCH 022/203] staging: sm750fb: change sii164SetPower to snake_case Change camelCase function name sii164SetPower to sii164_set_power to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid camelCase: Signed-off-by: Richard Akintola Link: https://lore.kernel.org/r/90f9842254eb83c2dc19abcf5072aab9549026a9.1744105389.git.princerichard17a@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 8 ++++---- drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 6dee95e60a6e..bb7538682b7d 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -20,7 +20,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { #ifdef SII164_FULL_FUNCTIONS .reset_chip = sii164_reset_chip, .get_chip_string = sii164GetChipString, - .set_power = sii164SetPower, + .set_power = sii164_set_power, .enable_hot_plug_detection = sii164EnableHotPlugDetection, .is_connected = sii164IsConnected, .check_interrupt = sii164CheckInterrupt, diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 9e304e7eae9b..36738d435684 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -256,8 +256,8 @@ long sii164_init_chip(unsigned char edge_select, void sii164_reset_chip(void) { /* Power down */ - sii164SetPower(0); - sii164SetPower(1); + sii164_set_power(0); + sii164_set_power(1); } /* @@ -273,13 +273,13 @@ char *sii164GetChipString(void) } /* - * sii164SetPower + * sii164_set_power * This function sets the power configuration of the DVI Controller Chip. * * Input: * powerUp - Flag to set the power down or up */ -void sii164SetPower(unsigned char powerUp) +void sii164_set_power(unsigned char powerUp) { unsigned char config; diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index 7a71f94a1e9b..45a90489c95c 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -33,7 +33,7 @@ unsigned short sii164_get_device_id(void); #ifdef SII164_FULL_FUNCTIONS void sii164_reset_chip(void); char *sii164GetChipString(void); -void sii164SetPower(unsigned char powerUp); +void sii164_set_power(unsigned char powerUp); void sii164EnableHotPlugDetection(unsigned char enableHotPlug); unsigned char sii164IsConnected(void); unsigned char sii164CheckInterrupt(void); From 7d253fd8451228104ad5bfb3684fb1ae394ae142 Mon Sep 17 00:00:00 2001 From: Richard Akintola Date: Tue, 8 Apr 2025 11:20:36 +0100 Subject: [PATCH 023/203] staging: sm750fb: change sii164GetChipString to snake_case Change camelCase function name sii164GetChipString to sii164_get_chip_string to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid camelCase: Signed-off-by: Richard Akintola Link: https://lore.kernel.org/r/08eb6104c7b82aea32796163421a7e795d3d8964.1744105389.git.princerichard17a@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 4 ++-- drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index bb7538682b7d..c12df1f9fb00 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -19,7 +19,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { .get_device_id = sii164_get_device_id, #ifdef SII164_FULL_FUNCTIONS .reset_chip = sii164_reset_chip, - .get_chip_string = sii164GetChipString, + .get_chip_string = sii164_get_chip_string, .set_power = sii164_set_power, .enable_hot_plug_detection = sii164EnableHotPlugDetection, .is_connected = sii164IsConnected, diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 36738d435684..4ab49c1ff4c7 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -261,13 +261,13 @@ void sii164_reset_chip(void) } /* - * sii164GetChipString + * sii164_get_chip_string * This function returns a char string name of the current DVI Controller * chip. * * It's convenient for application need to display the chip name. */ -char *sii164GetChipString(void) +char *sii164_get_chip_string(void) { return gDviCtrlChipName; } diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index 45a90489c95c..c15cd6a5d53b 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -32,7 +32,7 @@ unsigned short sii164_get_device_id(void); #ifdef SII164_FULL_FUNCTIONS void sii164_reset_chip(void); -char *sii164GetChipString(void); +char *sii164_get_chip_string(void); void sii164_set_power(unsigned char powerUp); void sii164EnableHotPlugDetection(unsigned char enableHotPlug); unsigned char sii164IsConnected(void); From bbb8a8a3ade7e56e3c817939d0adbb3183bee6b8 Mon Sep 17 00:00:00 2001 From: Richard Akintola Date: Tue, 8 Apr 2025 11:20:37 +0100 Subject: [PATCH 024/203] staging: sm750fb: change sii164EnableHotPlugDetection to snake_case Change camelCase function name sii164EnableHotPlugDetection to sii164_enable_hot_plug_detection and it's parameter enableHotPlug to enable_hot_plug to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid camelCase: Signed-off-by: Richard Akintola Link: https://lore.kernel.org/r/04907f753bc0d1a2b2095ffba1d066516520fbb8.1744105389.git.princerichard17a@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 8 ++++---- drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index c12df1f9fb00..1ce44c50617a 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -21,7 +21,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { .reset_chip = sii164_reset_chip, .get_chip_string = sii164_get_chip_string, .set_power = sii164_set_power, - .enable_hot_plug_detection = sii164EnableHotPlugDetection, + .enable_hot_plug_detection = sii164_enable_hot_plug_detection, .is_connected = sii164IsConnected, .check_interrupt = sii164CheckInterrupt, .clear_interrupt = sii164ClearInterrupt, diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 4ab49c1ff4c7..fc82b9743767 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -329,12 +329,12 @@ void sii164SelectHotPlugDetectionMode(enum sii164_hot_plug_mode hotPlugMode) } /* - * sii164EnableHotPlugDetection + * sii164_enable_hot_plug_detection * This function enables the Hot Plug detection. * - * enableHotPlug - Enable (=1) / disable (=0) Hot Plug detection + * enable_hot_plug - Enable (=1) / disable (=0) Hot Plug detection */ -void sii164EnableHotPlugDetection(unsigned char enableHotPlug) +void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug) { unsigned char detectReg; @@ -343,7 +343,7 @@ void sii164EnableHotPlugDetection(unsigned char enableHotPlug) /* Depending on each DVI controller, need to enable the hot plug based * on each individual chip design. */ - if (enableHotPlug != 0) + if (enable_hot_plug != 0) sii164SelectHotPlugDetectionMode(SII164_HOTPLUG_USE_MDI); else sii164SelectHotPlugDetectionMode(SII164_HOTPLUG_DISABLE); diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index c15cd6a5d53b..9e289bf4a78e 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -34,7 +34,7 @@ unsigned short sii164_get_device_id(void); void sii164_reset_chip(void); char *sii164_get_chip_string(void); void sii164_set_power(unsigned char powerUp); -void sii164EnableHotPlugDetection(unsigned char enableHotPlug); +void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug); unsigned char sii164IsConnected(void); unsigned char sii164CheckInterrupt(void); void sii164ClearInterrupt(void); From 4018883b3238be1f4314679535f8a497445bc2a1 Mon Sep 17 00:00:00 2001 From: Richard Akintola Date: Tue, 8 Apr 2025 11:20:38 +0100 Subject: [PATCH 025/203] staging: sm750fb: change sii164IsConnected to snake_case Change camelCase function name sii164IsConnected to sii164_is_connected to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid camelCase: Signed-off-by: Richard Akintola Link: https://lore.kernel.org/r/05de0fb87ed53015cd01ef9460996597ef1e09c8.1744105389.git.princerichard17a@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 4 ++-- drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 1ce44c50617a..ac1aab77da28 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -22,7 +22,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { .get_chip_string = sii164_get_chip_string, .set_power = sii164_set_power, .enable_hot_plug_detection = sii164_enable_hot_plug_detection, - .is_connected = sii164IsConnected, + .is_connected = sii164_is_connected, .check_interrupt = sii164CheckInterrupt, .clear_interrupt = sii164ClearInterrupt, #endif diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index fc82b9743767..9c563992ba3c 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -350,14 +350,14 @@ void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug) } /* - * sii164IsConnected + * sii164_is_connected * Check if the DVI Monitor is connected. * * Output: * 0 - Not Connected * 1 - Connected */ -unsigned char sii164IsConnected(void) +unsigned char sii164_is_connected(void) { unsigned char hotPlugValue; diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index 9e289bf4a78e..90b7ae823a10 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -35,7 +35,7 @@ void sii164_reset_chip(void); char *sii164_get_chip_string(void); void sii164_set_power(unsigned char powerUp); void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug); -unsigned char sii164IsConnected(void); +unsigned char sii164_is_connected(void); unsigned char sii164CheckInterrupt(void); void sii164ClearInterrupt(void); #endif From e22071a33a57658a6d3625f5b60529a92db0cfa8 Mon Sep 17 00:00:00 2001 From: Richard Akintola Date: Tue, 8 Apr 2025 11:20:39 +0100 Subject: [PATCH 026/203] staging: sm750fb: change sii164CheckInterrupt to snake_case Change camelCase function name sii164CheckInterrupt to sii164_check_interrupt in order to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid camelCase: Signed-off-by: Richard Akintola Link: https://lore.kernel.org/r/c5c01f1840ca37c24fcca7bff4b09adba37c3a7f.1744105389.git.princerichard17a@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 4 ++-- drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index ac1aab77da28..1def02be4cce 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -23,7 +23,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { .set_power = sii164_set_power, .enable_hot_plug_detection = sii164_enable_hot_plug_detection, .is_connected = sii164_is_connected, - .check_interrupt = sii164CheckInterrupt, + .check_interrupt = sii164_check_interrupt, .clear_interrupt = sii164ClearInterrupt, #endif }, diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 9c563992ba3c..84d9aa247d80 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -370,14 +370,14 @@ unsigned char sii164_is_connected(void) } /* - * sii164CheckInterrupt + * sii164_check_interrupt * Checks if interrupt has occurred. * * Output: * 0 - No interrupt * 1 - Interrupt occurs */ -unsigned char sii164CheckInterrupt(void) +unsigned char sii164_check_interrupt(void) { unsigned char detectReg; diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index 90b7ae823a10..aa3f34c13979 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -36,7 +36,7 @@ char *sii164_get_chip_string(void); void sii164_set_power(unsigned char powerUp); void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug); unsigned char sii164_is_connected(void); -unsigned char sii164CheckInterrupt(void); +unsigned char sii164_check_interrupt(void); void sii164ClearInterrupt(void); #endif /* From e86e07d4c26dd68eef462d3389bf3d68a4d4c91c Mon Sep 17 00:00:00 2001 From: Richard Akintola Date: Tue, 8 Apr 2025 11:20:40 +0100 Subject: [PATCH 027/203] staging: sm750fb: change sii164ClearInterrupt to snake_case Change camelCase function name sii164ClearInterrupt to sii164_clear_interrupt in order to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid camelCase: Signed-off-by: Richard Akintola Link: https://lore.kernel.org/r/549b645b265edcb793458a534427f75f0ea343c4.1744105389.git.princerichard17a@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_dvi.c | 2 +- drivers/staging/sm750fb/ddk750_sii164.c | 4 ++-- drivers/staging/sm750fb/ddk750_sii164.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 1def02be4cce..6fef1ab484c1 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -24,7 +24,7 @@ static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { .enable_hot_plug_detection = sii164_enable_hot_plug_detection, .is_connected = sii164_is_connected, .check_interrupt = sii164_check_interrupt, - .clear_interrupt = sii164ClearInterrupt, + .clear_interrupt = sii164_clear_interrupt, #endif }, #endif diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c index 84d9aa247d80..89700fc5dd2e 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ b/drivers/staging/sm750fb/ddk750_sii164.c @@ -390,10 +390,10 @@ unsigned char sii164_check_interrupt(void) } /* - * sii164ClearInterrupt + * sii164_clear_interrupt * Clear the hot plug interrupt. */ -void sii164ClearInterrupt(void) +void sii164_clear_interrupt(void) { unsigned char detectReg; diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h index aa3f34c13979..ebc173658f0e 100644 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ b/drivers/staging/sm750fb/ddk750_sii164.h @@ -37,7 +37,7 @@ void sii164_set_power(unsigned char powerUp); void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug); unsigned char sii164_is_connected(void); unsigned char sii164_check_interrupt(void); -void sii164ClearInterrupt(void); +void sii164_clear_interrupt(void); #endif /* * below register definition is used for From 436627df7fe59fb35dd984114b1eb0f671977f7a Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 8 Apr 2025 17:22:25 +0300 Subject: [PATCH 028/203] fbtft: Unorphan the driver Let's maintain occasional fixes to the fbtft driver. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20250408142554.1366319-2-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- MAINTAINERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 96b827049501..28c9100bc240 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -9006,9 +9006,10 @@ F: lib/fault-inject.c F: tools/testing/fault-injection/ FBTFT Framebuffer drivers +M: Andy Shevchenko L: dri-devel@lists.freedesktop.org L: linux-fbdev@vger.kernel.org -S: Orphan +S: Odd fixes F: drivers/staging/fbtft/ FC0011 TUNER DRIVER From f7093aaebe6d07e3c85f08b3c77b5b0303c7a432 Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Tue, 8 Apr 2025 17:22:26 +0300 Subject: [PATCH 029/203] fbtft: Replace 'depends on FB_TFT' by 'if FB_TFT ... endif' Replace 'depends on FB_TFT' by 'if FB_TFT ... endif' for the sake of deduplication. Signed-off-by: Andy Shevchenko Reviewed-by: Randy Dunlap Link: https://lore.kernel.org/r/20250408142554.1366319-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fbtft/Kconfig | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/drivers/staging/fbtft/Kconfig b/drivers/staging/fbtft/Kconfig index dcf6a70455cc..c2655768209a 100644 --- a/drivers/staging/fbtft/Kconfig +++ b/drivers/staging/fbtft/Kconfig @@ -8,160 +8,136 @@ menuconfig FB_TFT select FB_BACKLIGHT select FB_SYSMEM_HELPERS_DEFERRED +if FB_TFT + config FB_TFT_AGM1264K_FL tristate "FB driver for the AGM1264K-FL LCD display" - depends on FB_TFT help Framebuffer support for the AGM1264K-FL LCD display (two Samsung KS0108 compatible chips) config FB_TFT_BD663474 tristate "FB driver for the BD663474 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for BD663474 config FB_TFT_HX8340BN tristate "FB driver for the HX8340BN LCD Controller" - depends on FB_TFT help Generic Framebuffer support for HX8340BN config FB_TFT_HX8347D tristate "FB driver for the HX8347D LCD Controller" - depends on FB_TFT help Generic Framebuffer support for HX8347D config FB_TFT_HX8353D tristate "FB driver for the HX8353D LCD Controller" - depends on FB_TFT help Generic Framebuffer support for HX8353D config FB_TFT_HX8357D tristate "FB driver for the HX8357D LCD Controller" - depends on FB_TFT help Generic Framebuffer support for HX8357D config FB_TFT_ILI9163 tristate "FB driver for the ILI9163 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ILI9163 config FB_TFT_ILI9320 tristate "FB driver for the ILI9320 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ILI9320 config FB_TFT_ILI9325 tristate "FB driver for the ILI9325 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ILI9325 config FB_TFT_ILI9340 tristate "FB driver for the ILI9340 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ILI9340 config FB_TFT_ILI9341 tristate "FB driver for the ILI9341 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ILI9341 config FB_TFT_ILI9481 tristate "FB driver for the ILI9481 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ILI9481 config FB_TFT_ILI9486 tristate "FB driver for the ILI9486 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ILI9486 config FB_TFT_PCD8544 tristate "FB driver for the PCD8544 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for PCD8544 config FB_TFT_RA8875 tristate "FB driver for the RA8875 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for RA8875 config FB_TFT_S6D02A1 tristate "FB driver for the S6D02A1 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for S6D02A1 config FB_TFT_S6D1121 tristate "FB driver for the S6D1211 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for S6D1121 config FB_TFT_SEPS525 tristate "FB driver for the SEPS525 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for SEPS525 Say Y if you have such a display that utilizes this controller. config FB_TFT_SH1106 tristate "FB driver for the SH1106 OLED Controller" - depends on FB_TFT help Framebuffer support for SH1106 config FB_TFT_SSD1289 tristate "FB driver for the SSD1289 LCD Controller" - depends on FB_TFT help Framebuffer support for SSD1289 config FB_TFT_SSD1305 tristate "FB driver for the SSD1305 OLED Controller" - depends on FB_TFT help Framebuffer support for SSD1305 config FB_TFT_SSD1306 tristate "FB driver for the SSD1306 OLED Controller" - depends on FB_TFT help Framebuffer support for SSD1306 config FB_TFT_SSD1331 tristate "FB driver for the SSD1331 LCD Controller" - depends on FB_TFT help Framebuffer support for SSD1331 config FB_TFT_SSD1351 tristate "FB driver for the SSD1351 LCD Controller" - depends on FB_TFT help Framebuffer support for SSD1351 config FB_TFT_ST7735R tristate "FB driver for the ST7735R LCD Controller" - depends on FB_TFT help Generic Framebuffer support for ST7735R config FB_TFT_ST7789V tristate "FB driver for the ST7789V LCD Controller" - depends on FB_TFT help This enables generic framebuffer support for the Sitronix ST7789V display controller. The controller is intended for small color @@ -171,30 +147,27 @@ config FB_TFT_ST7789V config FB_TFT_TINYLCD tristate "FB driver for tinylcd.com display" - depends on FB_TFT help Custom Framebuffer support for tinylcd.com display config FB_TFT_TLS8204 tristate "FB driver for the TLS8204 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for TLS8204 config FB_TFT_UC1611 tristate "FB driver for the UC1611 LCD controller" - depends on FB_TFT help Generic Framebuffer support for UC1611 config FB_TFT_UC1701 tristate "FB driver for the UC1701 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for UC1701 config FB_TFT_UPD161704 tristate "FB driver for the uPD161704 LCD Controller" - depends on FB_TFT help Generic Framebuffer support for uPD161704 + +endif From fdbb60074f40b7161a87e6fdd139b6980ecdc0b6 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:27 +0000 Subject: [PATCH 030/203] staging: gpib: Correct CamelCase for EVENT enums Adhere to Linux kernel coding style. Reported by checkpatch CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 6 +++--- drivers/staging/gpib/eastwood/fluke_gpib.c | 2 +- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 2 +- drivers/staging/gpib/ines/ines_gpib.c | 2 +- drivers/staging/gpib/nec7210/nec7210.c | 4 ++-- drivers/staging/gpib/tms9914/tms9914.c | 6 +++--- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 2 +- drivers/staging/gpib/uapi/gpib_user.h | 8 ++++---- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 8456b97290b8..fdc4f6266f07 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1888,9 +1888,9 @@ int push_gpib_event(struct gpib_board *board, short event_type) retval = push_gpib_event_nolock(board, event_type); spin_unlock_irqrestore(&board->event_queue.lock, flags); - if (event_type == EventDevTrg) + if (event_type == EVENT_DEV_TRG) board->status |= DTAS; - if (event_type == EventDevClr) + if (event_type == EVENT_DEV_CLR) board->status |= DCAS; return retval; @@ -1904,7 +1904,7 @@ static int pop_gpib_event_nolock(struct gpib_board *board, gpib_event_queue_t *q gpib_event_t *event; if (num_gpib_events(queue) == 0) { - *event_type = EventNone; + *event_type = EVENT_NONE; return 0; } diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c index a6b1ac169f94..d289c321c153 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -802,7 +802,7 @@ irqreturn_t fluke_gpib_internal_interrupt(struct gpib_board *board) status2 = read_byte(nec_priv, ISR2); if (status0 & FLUKE_IFCI_BIT) { - push_gpib_event(board, EventIFC); + push_gpib_event(board, EVENT_IFC); retval = IRQ_HANDLED; } diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index 53f4b3fccc3c..733433d7fc3f 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -1136,7 +1136,7 @@ irqreturn_t fmh_gpib_internal_interrupt(struct gpib_board *board) fifo_status = fifos_read(priv, FIFO_CONTROL_STATUS_REG); if (status0 & IFC_INTERRUPT_BIT) { - push_gpib_event(board, EventIFC); + push_gpib_event(board, EVENT_IFC); retval = IRQ_HANDLED; } diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index d93eb05dab90..93897088f6f2 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -295,7 +295,7 @@ irqreturn_t ines_interrupt(struct gpib_board *board) isr3_bits = ines_inb(priv, ISR3); isr4_bits = ines_inb(priv, ISR4); if (isr3_bits & IFC_ACTIVE_BIT) { - push_gpib_event(board, EventIFC); + push_gpib_event(board, EVENT_IFC); wake++; } if (isr3_bits & FIFO_ERROR_BIT) diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/nec7210/nec7210.c index 846c0a3fa1dc..9b4870f1b421 100644 --- a/drivers/staging/gpib/nec7210/nec7210.c +++ b/drivers/staging/gpib/nec7210/nec7210.c @@ -932,13 +932,13 @@ irqreturn_t nec7210_interrupt_have_status(struct gpib_board *board, // ignore device clear events if we are controller in charge if ((address_status_bits & HR_CIC) == 0) { - push_gpib_event(board, EventDevClr); + push_gpib_event(board, EVENT_DEV_CLR); set_bit(DEV_CLEAR_BN, &priv->state); } } if (status1 & HR_DET) - push_gpib_event(board, EventDevTrg); + push_gpib_event(board, EVENT_DEV_TRG); // Addressing status has changed if (status2 & HR_ADSC) diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c index 2abda9d7dfcb..f7ad0b47ebb8 100644 --- a/drivers/staging/gpib/tms9914/tms9914.c +++ b/drivers/staging/gpib/tms9914/tms9914.c @@ -774,18 +774,18 @@ irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct tms99 } if (status1 & HR_IFC) { - push_gpib_event(board, EventIFC); + push_gpib_event(board, EVENT_IFC); clear_bit(CIC_NUM, &board->status); } if (status1 & HR_GET) { - push_gpib_event(board, EventDevTrg); + push_gpib_event(board, EVENT_DEV_TRG); // clear dac holdoff write_byte(priv, AUX_VAL, AUXCR); } if (status1 & HR_DCAS) { - push_gpib_event(board, EventDevClr); + push_gpib_event(board, EVENT_DEV_CLR); // clear dac holdoff write_byte(priv, AUX_VAL, AUXCR); set_bit(DEV_CLEAR_BN, &priv->state); diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c index c35b084b6fd0..caf53f8ded2e 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -566,7 +566,7 @@ static irqreturn_t tnt4882_internal_interrupt(struct gpib_board *board) imr3_bits = priv->imr3_bits; if (isr0_bits & TNT_IFCI_BIT) - push_gpib_event(board, EventIFC); + push_gpib_event(board, EVENT_IFC); //XXX don't need this wakeup, one below should do? // wake_up_interruptible(&board->wait); diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index 5ff4588686fd..b0c131196a00 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -335,10 +335,10 @@ enum { }; enum gpib_events { - EventNone = 0, - EventDevTrg = 1, - EventDevClr = 2, - EventIFC = 3 + EVENT_NONE = 0, + EVENT_DEV_TRG = 1, + EVENT_DEV_CLR = 2, + EVENT_IFC = 3 }; enum gpib_stb { From 77fd6ceabd19d56a2db21399e2f76b156c6a9a43 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:28 +0000 Subject: [PATCH 031/203] staging: gpib: Correct CamelCase for PPConfig Adhere to Linux kernel coding style. Reported by checkpatch CHECK: Avoid CamelCase: Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/tms9914/tms9914.c | 4 ++-- drivers/staging/gpib/uapi/gpib_user.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c index f7ad0b47ebb8..5f167c518c7b 100644 --- a/drivers/staging/gpib/tms9914/tms9914.c +++ b/drivers/staging/gpib/tms9914/tms9914.c @@ -736,7 +736,7 @@ irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct tms99 unsigned short command_byte = read_byte(priv, CPTR) & gpib_command_mask; switch (command_byte) { - case PPConfig: + case PP_CONFIG: priv->ppoll_configure_state = 1; /* AUX_PTS generates another UNC interrupt on the next command byte * if it is in the secondary address group (such as PPE and PPD). @@ -764,7 +764,7 @@ irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct tms99 break; } - if (in_primary_command_group(command_byte) && command_byte != PPConfig) + if (in_primary_command_group(command_byte) && command_byte != PP_CONFIG) priv->ppoll_configure_state = 0; } diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index b0c131196a00..ff5a257f9a01 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -130,9 +130,9 @@ enum bus_control_line { enum cmd_byte { GTL = 0x1, /* go to local */ SDC = 0x4, /* selected device clear */ - PPConfig = 0x5, + PP_CONFIG = 0x5, #ifndef PPC - PPC = PPConfig, /* parallel poll configure */ + PPC = PP_CONFIG, /* parallel poll configure */ #endif GET = 0x8, /* group execute trigger */ TCT = 0x9, /* take control */ From 787191eb82e91c4df2c462ea6d51107ce0c1e372 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:29 +0000 Subject: [PATCH 032/203] staging: gbip: Alignment should match open parens Adhere to Linux kernel coding style. Reported by checkpatch CHECK: Alignment should match open parenthesis Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/agilent_82357a/agilent_82357a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index da229965d98e..64780062c9fe 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -26,7 +26,7 @@ static struct usb_interface *agilent_82357a_driver_interfaces[MAX_NUM_82357A_INT static DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board insertion and removal static unsigned int agilent_82357a_update_status(struct gpib_board *board, - unsigned int clear_mask); + unsigned int clear_mask); static int agilent_82357a_take_control_internal(struct gpib_board *board, int synchronous); From 5d3df08d30b49745d7c77c2496999902f1ff1318 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:30 +0000 Subject: [PATCH 033/203] staging: gpib: common: lines exceeded 100 columns Adhere to Linux kernel coding style. CHECK: line length exceeds 100 columns Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index fdc4f6266f07..ded3bdab9a21 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -26,7 +26,8 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB base support"); MODULE_ALIAS_CHARDEV_MAJOR(GPIB_CODE); -static int board_type_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, unsigned long arg); +static int board_type_ioctl(gpib_file_private_t *file_priv, + struct gpib_board *board, unsigned long arg); static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, unsigned long arg); static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, @@ -72,7 +73,8 @@ static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg); static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpib_board *board); -static int pop_gpib_event_nolock(struct gpib_board *board, gpib_event_queue_t *queue, short *event_type); +static int pop_gpib_event_nolock(struct gpib_board *board, + gpib_event_queue_t *queue, short *event_type); /* * Timer functions @@ -258,8 +260,8 @@ gpib_status_queue_t *get_gpib_status_queue(struct gpib_board *board, unsigned in return NULL; } -int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, - uint8_t *poll_byte) +int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int sad, + unsigned int usec_timeout, uint8_t *poll_byte) { gpib_status_queue_t *device; @@ -806,7 +808,8 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) return retval; } -static int board_type_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, unsigned long arg) +static int board_type_ioctl(gpib_file_private_t *file_priv, + struct gpib_board *board, unsigned long arg) { struct list_head *list_ptr; board_type_ioctl_t cmd; @@ -1897,7 +1900,8 @@ int push_gpib_event(struct gpib_board *board, short event_type) } EXPORT_SYMBOL(push_gpib_event); -static int pop_gpib_event_nolock(struct gpib_board *board, gpib_event_queue_t *queue, short *event_type) +static int pop_gpib_event_nolock(struct gpib_board *board, + gpib_event_queue_t *queue, short *event_type) { struct list_head *head = &queue->event_head; struct list_head *front = head->next; From 08a8889429f80856d0582f725fd6483cc6232e9b Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:31 +0000 Subject: [PATCH 034/203] staging: gpib: nec: lines exceeded 100 columns Adhere to Linux kernel coding style. CHECK: line length exceeds 100 columns Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/nec7210.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gpib/include/nec7210.h b/drivers/staging/gpib/include/nec7210.h index 069896456230..4b06ac0408df 100644 --- a/drivers/staging/gpib/include/nec7210.h +++ b/drivers/staging/gpib/include/nec7210.h @@ -101,7 +101,8 @@ int nec7210_primary_address(const struct gpib_board *board, int nec7210_secondary_address(const struct gpib_board *board, struct nec7210_priv *priv, unsigned int address, int enable); int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *result); -void nec7210_serial_poll_response(struct gpib_board *board, struct nec7210_priv *priv, uint8_t status); +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(struct gpib_board *board, From 0b4f98dce24240d3fc73e82a2a3e6e13a1e1287b Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:32 +0000 Subject: [PATCH 035/203] staging: gpib: tms9914: lines exceeded 100 columns Adhere to Linux kernel coding style. CHECK: line length exceeds 100 columns Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/tms9914.h | 3 ++- drivers/staging/gpib/tms9914/tms9914.c | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/include/tms9914.h index 424c95ad85c6..6cbaf5a041e0 100644 --- a/drivers/staging/gpib/include/tms9914.h +++ b/drivers/staging/gpib/include/tms9914.h @@ -110,7 +110,8 @@ void tms9914_parallel_poll_configure(struct gpib_board *board, struct tms9914_priv *priv, uint8_t config); void tms9914_parallel_poll_response(struct gpib_board *board, struct tms9914_priv *priv, int ist); -void tms9914_serial_poll_response(struct gpib_board *board, struct tms9914_priv *priv, uint8_t status); +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 tms9914_priv *priv); int tms9914_line_status(const struct gpib_board *board, struct tms9914_priv *priv); unsigned int tms9914_t1_delay(struct gpib_board *board, struct tms9914_priv *priv, diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c index 5f167c518c7b..4064320df4c1 100644 --- a/drivers/staging/gpib/tms9914/tms9914.c +++ b/drivers/staging/gpib/tms9914/tms9914.c @@ -66,7 +66,8 @@ 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(struct gpib_board *board, struct tms9914_priv *priv, int synchronous) +int tms9914_take_control_workaround(struct gpib_board *board, + struct tms9914_priv *priv, int synchronous) { if (synchronous) return -ETIMEDOUT; @@ -251,7 +252,8 @@ void tms9914_parallel_poll_response(struct gpib_board *board, } EXPORT_SYMBOL(tms9914_parallel_poll_response); -void tms9914_serial_poll_response(struct gpib_board *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; @@ -279,7 +281,8 @@ uint8_t tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv } EXPORT_SYMBOL(tms9914_serial_poll_status); -int tms9914_primary_address(struct gpib_board *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); @@ -449,7 +452,8 @@ static int wait_for_read_byte(struct gpib_board *board, struct tms9914_priv *pri return 0; } -static inline uint8_t tms9914_read_data_in(struct gpib_board *board, struct tms9914_priv *priv, int *end) +static inline uint8_t tms9914_read_data_in(struct gpib_board *board, + struct tms9914_priv *priv, int *end) { unsigned long flags; u8 data; @@ -585,8 +589,8 @@ static int pio_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_ return length; } -int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, size_t length, - int send_eoi, size_t *bytes_written) +int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, + uint8_t *buffer, size_t length, int send_eoi, size_t *bytes_written) { ssize_t retval = 0; @@ -620,7 +624,8 @@ int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t * } EXPORT_SYMBOL(tms9914_write); -static void check_my_address_state(struct gpib_board *board, struct tms9914_priv *priv, int cmd_byte) +static void check_my_address_state(struct gpib_board *board, + struct tms9914_priv *priv, int cmd_byte) { if (cmd_byte == MLA(board->pad)) { priv->primary_listen_addressed = 1; From fa4dad5de56474043069edc524ce0898d05e92b7 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:33 +0000 Subject: [PATCH 036/203] staging: gpib: ines: lines exceeded 100 columns Adhere to Linux kernel coding style. CHECK: line length exceeds 100 columns Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-8-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gpib/ines/ines.h b/drivers/staging/gpib/ines/ines.h index ff27f055a0ff..abe977f8f961 100644 --- a/drivers/staging/gpib/ines/ines.h +++ b/drivers/staging/gpib/ines/ines.h @@ -36,7 +36,8 @@ struct ines_priv { }; // interface functions -int ines_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, size_t *bytes_read); +int ines_read(struct gpib_board *board, uint8_t *buffer, size_t length, + int *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(struct gpib_board *board, uint8_t *buffer, size_t length, From e4b6bf7bb6f611c0ff4a53b318bb8487141348a4 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:34 +0000 Subject: [PATCH 037/203] staging: gpib: pc2: lines exceeded 100 columns Adhere to Linux kernel coding style. CHECK: line length exceeds 100 columns Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-9-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/pc2/pc2_gpib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c index 96d3c09f2273..5ff1d52c14e3 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -106,7 +106,8 @@ static int pc2_write(struct gpib_board *board, uint8_t *buffer, size_t length, i return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -static int pc2_command(struct gpib_board *board, uint8_t *buffer, size_t length, size_t *bytes_written) +static int pc2_command(struct gpib_board *board, uint8_t *buffer, + size_t length, size_t *bytes_written) { struct pc2_priv *priv = board->private_data; From c948413e56757339ffce7f92436d5dd739caf4cf Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:35 +0000 Subject: [PATCH 038/203] staging: gpib: tnt4882: lines exceeded 100 columns Adhere to Linux kernel coding style. CHECK: line length exceeds 100 columns Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-10-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c index caf53f8ded2e..3b29f541fd49 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -539,8 +539,8 @@ static int generic_write(struct gpib_board *board, uint8_t *buffer, size_t lengt return retval; } -static int tnt4882_accel_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, - size_t *bytes_written) +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); } From df75d32ab7eb5e447eb7c0206d3eb3f26edf50e4 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:36 +0000 Subject: [PATCH 039/203] staging: gpib: uapi: Fix CamelCase and IBA Dup Resolved duplicate entry for IbaSPollBit vs IbaSpollBit. Correct CamelCase for IBA enums Adhere to Linux kernel coding style. Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-11-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_user.h | 65 +++++++++++++-------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index ff5a257f9a01..e02323508245 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -253,40 +253,39 @@ static inline int gpib_address_equal(unsigned int pad1, int sad1, unsigned int p } enum ibask_option { - IbaPAD = 0x1, - IbaSAD = 0x2, - IbaTMO = 0x3, - IbaEOT = 0x4, - IbaPPC = 0x5, /* board only */ - IbaREADDR = 0x6, /* device only */ - IbaAUTOPOLL = 0x7, /* board only */ - IbaCICPROT = 0x8, /* board only */ - IbaIRQ = 0x9, /* board only */ - IbaSC = 0xa, /* board only */ - IbaSRE = 0xb, /* board only */ - IbaEOSrd = 0xc, - IbaEOSwrt = 0xd, - IbaEOScmp = 0xe, - IbaEOSchar = 0xf, - IbaPP2 = 0x10, /* board only */ - IbaTIMING = 0x11, /* board only */ - IbaDMA = 0x12, /* board only */ - IbaReadAdjust = 0x13, - IbaWriteAdjust = 0x14, - IbaEventQueue = 0x15, /* board only */ - IbaSPollBit = 0x16, /* board only */ - IbaSpollBit = 0x16, /* board only */ - IbaSendLLO = 0x17, /* board only */ - IbaSPollTime = 0x18, /* device only */ - IbaPPollTime = 0x19, /* board only */ - IbaEndBitIsNormal = 0x1a, - IbaUnAddr = 0x1b, /* device only */ - IbaHSCableLength = 0x1f, /* board only */ - IbaIst = 0x20, /* board only */ - IbaRsv = 0x21, /* board only */ - IbaBNA = 0x200, /* device only */ + IBA_PAD = 0x1, + IBA_SAD = 0x2, + IBA_TMO = 0x3, + IBA_EOT = 0x4, + IBA_PPC = 0x5, /* board only */ + IBA_READ_DR = 0x6, /* device only */ + IBA_AUTOPOLL = 0x7, /* board only */ + IBA_CICPROT = 0x8, /* board only */ + IBA_IRQ = 0x9, /* board only */ + IBA_SC = 0xa, /* board only */ + IBA_SRE = 0xb, /* board only */ + IBA_EOS_RD = 0xc, + IBA_EOS_WRT = 0xd, + IBA_EOS_CMP = 0xe, + IBA_EOS_CHAR = 0xf, + IBA_PP2 = 0x10, /* board only */ + IBA_TIMING = 0x11, /* board only */ + IBA_DMA = 0x12, /* board only */ + IBA_READ_ADJUST = 0x13, + IBA_WRITE_ADJUST = 0x14, + IBA_EVENT_QUEUE = 0x15, /* board only */ + IBA_SPOLL_BIT = 0x16, /* board only */ + IBA_SEND_LLO = 0x17, /* board only */ + IBA_SPOLL_TIME = 0x18, /* device only */ + IBA_PPOLL_TIME = 0x19, /* board only */ + IBA_END_BIT_IS_NORMAL = 0x1a, + IBA_UN_ADDR = 0x1b, /* device only */ + IBA_HS_CABLE_LENGTH = 0x1f, /* board only */ + IBA_IST = 0x20, /* board only */ + IBA_RSV = 0x21, /* board only */ + IBA_BNA = 0x200, /* device only */ /* linux-gpib extensions */ - Iba7BitEOS = 0x1000 /* board only. Returns 1 if board supports 7 bit eos compares*/ + IBA_7BitEOS = 0x1000 /* board only. Returns 1 if board supports 7 bit eos compares*/ }; enum ibconfig_option { From 5b3cfa2df14e5185881175113d69444e4c219d48 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:37 +0000 Subject: [PATCH 040/203] staging: gpib: uapi: Fix CamelCase and IBC Dup Resolved duplicate entry for IbcSPollBit vs IbcSpollBit. Correct CamelCase for IBC enums Adhere to Linux kernel coding style. Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-12-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_user.h | 63 +++++++++++++-------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index e02323508245..7f343256c110 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -289,38 +289,37 @@ enum ibask_option { }; enum ibconfig_option { - IbcPAD = 0x1, - IbcSAD = 0x2, - IbcTMO = 0x3, - IbcEOT = 0x4, - IbcPPC = 0x5, /* board only */ - IbcREADDR = 0x6, /* device only */ - IbcAUTOPOLL = 0x7, /* board only */ - IbcCICPROT = 0x8, /* board only */ - IbcIRQ = 0x9, /* board only */ - IbcSC = 0xa, /* board only */ - IbcSRE = 0xb, /* board only */ - IbcEOSrd = 0xc, - IbcEOSwrt = 0xd, - IbcEOScmp = 0xe, - IbcEOSchar = 0xf, - IbcPP2 = 0x10, /* board only */ - IbcTIMING = 0x11, /* board only */ - IbcDMA = 0x12, /* board only */ - IbcReadAdjust = 0x13, - IbcWriteAdjust = 0x14, - IbcEventQueue = 0x15, /* board only */ - IbcSPollBit = 0x16, /* board only */ - IbcSpollBit = 0x16, /* board only */ - IbcSendLLO = 0x17, /* board only */ - IbcSPollTime = 0x18, /* device only */ - IbcPPollTime = 0x19, /* board only */ - IbcEndBitIsNormal = 0x1a, - IbcUnAddr = 0x1b, /* device only */ - IbcHSCableLength = 0x1f, /* board only */ - IbcIst = 0x20, /* board only */ - IbcRsv = 0x21, /* board only */ - IbcBNA = 0x200 /* device only */ + IBC_PAD = 0x1, + IBC_SAD = 0x2, + IBC_TMO = 0x3, + IBC_EOT = 0x4, + IBC_PPC = 0x5, /* board only */ + IBC_READDR = 0x6, /* device only */ + IBC_AUTOPOLL = 0x7, /* board only */ + IBC_CICPROT = 0x8, /* board only */ + IBC_IRQ = 0x9, /* board only */ + IBC_SC = 0xa, /* board only */ + IBC_SRE = 0xb, /* board only */ + IBC_EOS_RD = 0xc, + IBC_EOS_WRT = 0xd, + IBC_EOS_CMP = 0xe, + IBC_EOS_CHAR = 0xf, + IBC_PP2 = 0x10, /* board only */ + IBC_TIMING = 0x11, /* board only */ + IBC_DMA = 0x12, /* board only */ + IBC_READ_ADJUST = 0x13, + IBC_WRITE_ADJUST = 0x14, + IBC_EVENT_QUEUE = 0x15, /* board only */ + IBC_SPOLL_BIT = 0x16, /* board only */ + IBC_SEND_LLO = 0x17, /* board only */ + IBC_SPOLL_TIME = 0x18, /* device only */ + IBC_PPOLL_TIME = 0x19, /* board only */ + IBC_END_BIT_IS_NORMAL = 0x1a, + IBC_UN_ADDR = 0x1b, /* device only */ + IBC_HS_CABLE_LENGTH = 0x1f, /* board only */ + IBC_IST = 0x20, /* board only */ + IBC_RSV = 0x21, /* board only */ + IBC_BNA = 0x200 /* device only */ }; enum t1_delays { From d40ee5b5329d97c89dde167098f93594f0262887 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:38 +0000 Subject: [PATCH 041/203] staging: gpib: uapi: Fix CamelCase and IB_STB Correct CamelCase for IB_STB enums Adhere to Linux kernel coding style. Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-13-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_user.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index 7f343256c110..301083f287ad 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -340,9 +340,9 @@ enum gpib_events { }; enum gpib_stb { - IbStbRQS = 0x40, /* IEEE 488.1 & 2 */ - IbStbESB = 0x20, /* IEEE 488.2 only */ - IbStbMAV = 0x10 /* IEEE 488.2 only */ + IB_STB_RQS = 0x40, /* IEEE 488.1 & 2 */ + IB_STB_ESB = 0x20, /* IEEE 488.2 only */ + IB_STB_MAV = 0x10 /* IEEE 488.2 only */ }; #endif /* _GPIB_USER_H */ From 5ad47130b0936caa6803af0873435318f5d1b1ad Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:39 +0000 Subject: [PATCH 042/203] staging: gpib: nec: Fix Improper SPDX comment. Correct Improper SPDX comment style. Adhere to Linux kernel coding style. Reported by checkpatch WARNING: Improper SPDX comment style .../nec7210.h', please use '/*' instead Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-14-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/nec7210.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/include/nec7210.h b/drivers/staging/gpib/include/nec7210.h index 4b06ac0408df..5c57fbffb9d0 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 */ /*************************************************************************** * copyright : (C) 2002 by Frank Mori Hess From 8a3961396b1ca7aeeb35a26087de660f839b2d8e Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:20:40 +0000 Subject: [PATCH 043/203] staging: gpib: tms9914: Fix Improper SPDX comment. Correct Improper SPDX comment style. Adhere to Linux kernel coding style. Reported by checkpatch WARNING: Improper SPDX comment style .../tms9914.h', please use '/*' instead Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408222040.186881-15-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/tms9914.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/include/tms9914.h index 6cbaf5a041e0..08a40d84825f 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 */ /*************************************************************************** * copyright : (C) 2002 by Frank Mori Hess From 9f0ca07f075017351fde2c9fd575cdf957cef043 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:41 +0000 Subject: [PATCH 044/203] staing: gpib: struct typing for gpib_board_config Using Linux code style for gpib_board_config struct in .h to allow drivers to migrate. 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. Reported by CheckPatch WARNING: do not add new typedefs Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_types.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 2d9b9be683f8..9af5fdd1497f 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -24,9 +24,10 @@ typedef struct gpib_interface_struct gpib_interface_t; struct gpib_board; +typedef struct gpib_board_config gpib_board_config_t; /* config parameters that are only used by driver attach functions */ -typedef struct { +struct gpib_board_config { /* firmware blob */ void *init_data; int init_data_length; @@ -49,7 +50,7 @@ typedef struct { char *device_path; /* serial number of hardware to attach */ char *serial_number; -} gpib_board_config_t; +}; struct gpib_interface_struct { /* name of board */ From b43426121307801d93bf51f0bcb05ff5237e5fa8 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:42 +0000 Subject: [PATCH 045/203] staging: gpib: agilent_82350b: gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/agilent_82350b/agilent_82350b.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c index 445b9380ff98..97717afbb214 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c @@ -492,7 +492,7 @@ static void agilent_82350b_free_private(struct gpib_board *board) } static int init_82350a_hardware(struct gpib_board *board, - const gpib_board_config_t *config) + const struct gpib_board_config *config) { struct agilent_82350b_priv *a_priv = board->private_data; static const unsigned int firmware_length = 5302; @@ -587,7 +587,7 @@ static int test_sram(struct gpib_board *board) } static int agilent_82350b_generic_attach(struct gpib_board *board, - const gpib_board_config_t *config, + const struct gpib_board_config *config, int use_fifos) { @@ -730,13 +730,13 @@ static int agilent_82350b_generic_attach(struct gpib_board *board, } static int agilent_82350b_unaccel_attach(struct gpib_board *board, - const gpib_board_config_t *config) + const struct gpib_board_config *config) { return agilent_82350b_generic_attach(board, config, 0); } static int agilent_82350b_accel_attach(struct gpib_board *board, - const gpib_board_config_t *config) + const struct gpib_board_config *config) { return agilent_82350b_generic_attach(board, config, 1); } From f068d5173dbd90d16899634d1cae65862610660f Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:43 +0000 Subject: [PATCH 046/203] staging: gpib: agilent_82357a: gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/agilent_82357a/agilent_82357a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index 64780062c9fe..1be21b6c12e2 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -1292,7 +1292,7 @@ static int agilent_82357a_init(struct gpib_board *board) } static inline int agilent_82357a_device_match(struct usb_interface *interface, - const gpib_board_config_t *config) + const struct gpib_board_config *config) { struct usb_device * const usbdev = interface_to_usbdev(interface); @@ -1305,7 +1305,7 @@ static inline int agilent_82357a_device_match(struct usb_interface *interface, return 1; } -static int agilent_82357a_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int agilent_82357a_attach(struct gpib_board *board, const struct gpib_board_config *config) { int retval; int i; From 6e95efdcd133e057f780e7a9e8c13ea43dda3dfc Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:44 +0000 Subject: [PATCH 047/203] staging: gpib: cb7210: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cb7210/cb7210.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c index 6b22a33a8c4f..957daa837efc 100644 --- a/drivers/staging/gpib/cb7210/cb7210.c +++ b/drivers/staging/gpib/cb7210/cb7210.c @@ -533,8 +533,8 @@ static irqreturn_t cb7210_interrupt(int irq, void *arg) return cb7210_internal_interrupt(arg); } -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); +static int cb_pci_attach(struct gpib_board *board, const struct gpib_board_config *config); +static int cb_isa_attach(struct gpib_board *board, const struct gpib_board_config *config); static void cb_pci_detach(struct gpib_board *board); static void cb_isa_detach(struct gpib_board *board); @@ -926,7 +926,7 @@ static int cb7210_init(struct cb7210_priv *cb_priv, struct gpib_board *board) return 0; } -static int cb_pci_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int cb_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct cb7210_priv *cb_priv; struct nec7210_priv *nec_priv; @@ -1031,7 +1031,7 @@ static void cb_pci_detach(struct gpib_board *board) cb7210_generic_detach(board); } -static int cb_isa_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int cb_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) { int isr_flags = 0; struct cb7210_priv *cb_priv; @@ -1133,7 +1133,7 @@ static struct pci_driver cb7210_pci_driver = { static int cb_gpib_config(struct pcmcia_device *link); static void cb_gpib_release(struct pcmcia_device *link); -static int cb_pcmcia_attach(struct gpib_board *board, const gpib_board_config_t *config); +static int cb_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config); static void cb_pcmcia_detach(struct gpib_board *board); /* @@ -1417,7 +1417,7 @@ static gpib_interface_t cb_pcmcia_accel_interface = { .return_to_local = cb7210_return_to_local, }; -static int cb_pcmcia_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int cb_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct cb7210_priv *cb_priv; struct nec7210_priv *nec_priv; From b6d27a345f9d12fb80d61a1b1801ced9c1d6178a Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:45 +0000 Subject: [PATCH 048/203] staging: gpib: cec: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cec/cec_gpib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec/cec_gpib.c index a822fa428cd0..03d5b6c4fd8c 100644 --- a/drivers/staging/gpib/cec/cec_gpib.c +++ b/drivers/staging/gpib/cec/cec_gpib.c @@ -40,7 +40,7 @@ static irqreturn_t cec_interrupt(int irq, void *arg) #define CEC_DEV_ID 0x5cec #define CEC_SUBID 0x9050 -static int cec_pci_attach(struct gpib_board *board, const gpib_board_config_t *config); +static int cec_pci_attach(struct gpib_board *board, const struct gpib_board_config *config); static void cec_pci_detach(struct gpib_board *board); @@ -265,7 +265,7 @@ static void cec_init(struct cec_priv *cec_priv, const struct gpib_board *board) nec7210_board_online(nec_priv, board); } -static int cec_pci_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int cec_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct cec_priv *cec_priv; struct nec7210_priv *nec_priv; From 9edf551529de556474940a074af37dbe236349a4 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:46 +0000 Subject: [PATCH 049/203] staging: gpib: common: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index ded3bdab9a21..e97e8f8a62f9 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -50,9 +50,9 @@ static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, static int eos_ioctl(struct gpib_board *board, unsigned long arg); static int request_service_ioctl(struct gpib_board *board, unsigned long arg); 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 iobase_ioctl(struct gpib_board_config *config, unsigned long arg); +static int irq_ioctl(struct gpib_board_config *config, unsigned long arg); +static int dma_ioctl(struct gpib_board_config *config, unsigned long arg); static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, unsigned long arg); static int mutex_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, @@ -65,8 +65,8 @@ static int set_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned long ar static int get_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned long arg); static int query_board_rsv_ioctl(struct gpib_board *board, unsigned long arg); static int interface_clear_ioctl(struct gpib_board *board, unsigned long arg); -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 select_pci_ioctl(struct gpib_board_config *config, unsigned long arg); +static int select_device_path_ioctl(struct gpib_board_config *config, 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); @@ -1542,7 +1542,7 @@ static int request_service2_ioctl(struct gpib_board *board, unsigned long arg) request_service2_cmd.new_reason_for_service); } -static int iobase_ioctl(gpib_board_config_t *config, unsigned long arg) +static int iobase_ioctl(struct gpib_board_config *config, unsigned long arg) { u64 base_addr; int retval; @@ -1561,7 +1561,7 @@ static int iobase_ioctl(gpib_board_config_t *config, unsigned long arg) return 0; } -static int irq_ioctl(gpib_board_config_t *config, unsigned long arg) +static int irq_ioctl(struct gpib_board_config *config, unsigned long arg) { unsigned int irq; int retval; @@ -1578,7 +1578,7 @@ static int irq_ioctl(gpib_board_config_t *config, unsigned long arg) return 0; } -static int dma_ioctl(gpib_board_config_t *config, unsigned long arg) +static int dma_ioctl(struct gpib_board_config *config, unsigned long arg) { unsigned int dma_channel; int retval; @@ -1793,7 +1793,7 @@ static int interface_clear_ioctl(struct gpib_board *board, unsigned long arg) return ibsic(board, usec_duration); } -static int select_pci_ioctl(gpib_board_config_t *config, unsigned long arg) +static int select_pci_ioctl(struct gpib_board_config *config, unsigned long arg) { select_pci_ioctl_t selection; int retval; @@ -1811,7 +1811,7 @@ static int select_pci_ioctl(gpib_board_config_t *config, unsigned long arg) return 0; } -static int select_device_path_ioctl(gpib_board_config_t *config, unsigned long arg) +static int select_device_path_ioctl(struct gpib_board_config *config, unsigned long arg) { select_device_path_ioctl_t *selection; int retval; @@ -2069,9 +2069,9 @@ void gpib_unregister_driver(gpib_interface_t *interface) } EXPORT_SYMBOL(gpib_unregister_driver); -static void init_gpib_board_config(gpib_board_config_t *config) +static void init_gpib_board_config(struct gpib_board_config *config) { - memset(config, 0, sizeof(gpib_board_config_t)); + memset(config, 0, sizeof(struct gpib_board_config)); config->pci_bus = -1; config->pci_slot = -1; } @@ -2212,7 +2212,7 @@ int gpib_match_device_path(struct device *dev, const char *device_path_in) } EXPORT_SYMBOL(gpib_match_device_path); -struct pci_dev *gpib_pci_get_device(const gpib_board_config_t *config, unsigned int vendor_id, +struct pci_dev *gpib_pci_get_device(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, struct pci_dev *from) { struct pci_dev *pci_device = from; @@ -2231,7 +2231,7 @@ struct pci_dev *gpib_pci_get_device(const gpib_board_config_t *config, unsigned } EXPORT_SYMBOL(gpib_pci_get_device); -struct pci_dev *gpib_pci_get_subsys(const gpib_board_config_t *config, unsigned int vendor_id, +struct pci_dev *gpib_pci_get_subsys(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from) From 4800ec89999049b2fa5944a0496260c008f68dff Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:47 +0000 Subject: [PATCH 050/203] staging: gpib: eastwood: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-8-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/eastwood/fluke_gpib.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c index d289c321c153..53106de06c26 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -24,8 +24,10 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB Driver for Fluke cda devices"); -static int fluke_attach_holdoff_all(struct gpib_board *board, const gpib_board_config_t *config); -static int fluke_attach_holdoff_end(struct gpib_board *board, const gpib_board_config_t *config); +static int fluke_attach_holdoff_all(struct gpib_board *board, + const struct gpib_board_config *config); +static int fluke_attach_holdoff_end(struct gpib_board *board, + const struct gpib_board_config *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); @@ -943,7 +945,7 @@ static bool gpib_dma_channel_filter(struct dma_chan *chan, void *filter_param) return chan->chan_id == 0; } -static int fluke_attach_impl(struct gpib_board *board, const gpib_board_config_t *config, +static int fluke_attach_impl(struct gpib_board *board, const struct gpib_board_config *config, unsigned int handshake_mode) { struct fluke_priv *e_priv; @@ -1049,12 +1051,12 @@ static int fluke_attach_impl(struct gpib_board *board, const gpib_board_config_t return fluke_init(e_priv, board, handshake_mode); } -int fluke_attach_holdoff_all(struct gpib_board *board, const gpib_board_config_t *config) +int fluke_attach_holdoff_all(struct gpib_board *board, const struct gpib_board_config *config) { return fluke_attach_impl(board, config, HR_HLDA); } -int fluke_attach_holdoff_end(struct gpib_board *board, const gpib_board_config_t *config) +int fluke_attach_holdoff_end(struct gpib_board *board, const struct gpib_board_config *config) { return fluke_attach_impl(board, config, HR_HLDE); } From c3c7a472d6f72bfabc9b35bce1f2e64e1690b0fa Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:48 +0000 Subject: [PATCH 051/203] staging: gpib: fmh: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-9-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 27 ++++++++++++++---------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index 733433d7fc3f..11eb45760cfa 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -32,13 +32,15 @@ MODULE_DESCRIPTION("GPIB Driver for fmh_gpib_core"); MODULE_AUTHOR("Frank Mori Hess "); static irqreturn_t fmh_gpib_interrupt(int irq, void *arg); -static int fmh_gpib_attach_holdoff_all(struct gpib_board *board, const gpib_board_config_t *config); -static int fmh_gpib_attach_holdoff_end(struct gpib_board *board, const gpib_board_config_t *config); +static int fmh_gpib_attach_holdoff_all(struct gpib_board *board, + const struct gpib_board_config *config); +static int fmh_gpib_attach_holdoff_end(struct gpib_board *board, + const struct gpib_board_config *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); + const struct gpib_board_config *config); static int fmh_gpib_pci_attach_holdoff_end(struct gpib_board *board, - const gpib_board_config_t *config); + const struct gpib_board_config *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); @@ -1335,7 +1337,7 @@ static int fmh_gpib_init(struct fmh_priv *e_priv, struct gpib_board *board, int /* Match callback for driver_find_device */ static int fmh_gpib_device_match(struct device *dev, const void *data) { - const gpib_board_config_t *config = data; + const struct gpib_board_config *config = data; if (dev_get_drvdata(dev)) return 0; @@ -1351,7 +1353,7 @@ static int fmh_gpib_device_match(struct device *dev, const void *data) return 1; } -static int fmh_gpib_attach_impl(struct gpib_board *board, const gpib_board_config_t *config, +static int fmh_gpib_attach_impl(struct gpib_board *board, const struct gpib_board_config *config, unsigned int handshake_mode, int acquire_dma) { struct fmh_priv *e_priv; @@ -1454,12 +1456,12 @@ static int fmh_gpib_attach_impl(struct gpib_board *board, const gpib_board_confi return fmh_gpib_init(e_priv, board, handshake_mode); } -int fmh_gpib_attach_holdoff_all(struct gpib_board *board, const gpib_board_config_t *config) +int fmh_gpib_attach_holdoff_all(struct gpib_board *board, const struct gpib_board_config *config) { return fmh_gpib_attach_impl(board, config, HR_HLDA, 0); } -int fmh_gpib_attach_holdoff_end(struct gpib_board *board, const gpib_board_config_t *config) +int fmh_gpib_attach_holdoff_end(struct gpib_board *board, const struct gpib_board_config *config) { return fmh_gpib_attach_impl(board, config, HR_HLDE, 1); } @@ -1497,7 +1499,8 @@ void fmh_gpib_detach(struct gpib_board *board) fmh_gpib_generic_detach(board); } -static int fmh_gpib_pci_attach_impl(struct gpib_board *board, const gpib_board_config_t *config, +static int fmh_gpib_pci_attach_impl(struct gpib_board *board, + const struct gpib_board_config *config, unsigned int handshake_mode) { struct fmh_priv *e_priv; @@ -1570,12 +1573,14 @@ static int fmh_gpib_pci_attach_impl(struct gpib_board *board, const gpib_board_c return fmh_gpib_init(e_priv, board, handshake_mode); } -int fmh_gpib_pci_attach_holdoff_all(struct gpib_board *board, const gpib_board_config_t *config) +int fmh_gpib_pci_attach_holdoff_all(struct gpib_board *board, + const struct gpib_board_config *config) { return fmh_gpib_pci_attach_impl(board, config, HR_HLDA); } -int fmh_gpib_pci_attach_holdoff_end(struct gpib_board *board, const gpib_board_config_t *config) +int fmh_gpib_pci_attach_holdoff_end(struct gpib_board *board, + const struct gpib_board_config *config) { int retval; struct fmh_priv *e_priv; From 64af5486451032fa91b2c59b1af59a37341d5e7b Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:49 +0000 Subject: [PATCH 052/203] staging: gpib: gpio: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-10-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 86bdd381472a..7d25ad5c18ca 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -1206,7 +1206,7 @@ static void bb_detach(struct gpib_board *board) free_private(board); } -static int bb_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int bb_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct bb_priv *priv; int retval = 0; From bc528bc436a63136a034adbb670fa9dc626aaae6 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:50 +0000 Subject: [PATCH 053/203] staging: gpib: hp_82335: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-11-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82335/hp82335.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c index fd23b1cb80f9..4ec15ae4c7f4 100644 --- a/drivers/staging/gpib/hp_82335/hp82335.c +++ b/drivers/staging/gpib/hp_82335/hp82335.c @@ -24,7 +24,7 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for HP 82335 interface cards"); -static int hp82335_attach(struct gpib_board *board, const gpib_board_config_t *config); +static int hp82335_attach(struct gpib_board *board, const struct gpib_board_config *config); static void hp82335_detach(struct gpib_board *board); static irqreturn_t hp82335_interrupt(int irq, void *arg); @@ -243,7 +243,7 @@ static void hp82335_clear_interrupt(struct hp82335_priv *hp_priv) writeb(0, tms_priv->mmiobase + HPREG_INTR_CLEAR); } -static int hp82335_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int hp82335_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct hp82335_priv *hp_priv; struct tms9914_priv *tms_priv; From 32ecd08b0d1fa2f6b32f2bf7f32013ecfeb5cf44 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:51 +0000 Subject: [PATCH 054/203] staging: gpib: hp_82341: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-12-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82341/hp_82341.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpib/hp_82341/hp_82341.c index f52e673dc869..a0412c9143b5 100644 --- a/drivers/staging/gpib/hp_82341/hp_82341.c +++ b/drivers/staging/gpib/hp_82341/hp_82341.c @@ -250,7 +250,7 @@ static int hp_82341_accel_write(struct gpib_board *board, uint8_t *buffer, size_ return 0; } -static int hp_82341_attach(struct gpib_board *board, const gpib_board_config_t *config); +static int hp_82341_attach(struct gpib_board *board, const struct gpib_board_config *config); static void hp_82341_detach(struct gpib_board *board); @@ -619,7 +619,8 @@ static int hp_82341_load_firmware_array(struct hp_82341_priv *hp_priv, return 0; } -static int hp_82341_load_firmware(struct hp_82341_priv *hp_priv, const gpib_board_config_t *config) +static int hp_82341_load_firmware(struct hp_82341_priv *hp_priv, + const struct gpib_board_config *config) { if (config->init_data_length == 0) { if (xilinx_done(hp_priv)) @@ -686,7 +687,7 @@ static int clear_xilinx(struct hp_82341_priv *hp_priv) return 0; } -static int hp_82341_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int hp_82341_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct hp_82341_priv *hp_priv; struct tms9914_priv *tms_priv; From b7cdc43c4ab6144931b3a8cd1995728335ba8e9c Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:52 +0000 Subject: [PATCH 055/203] staging: gpib: gpibP: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-13-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpibP.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/include/gpibP.h index 0c71a038e444..0a854697e933 100644 --- a/drivers/staging/gpib/include/gpibP.h +++ b/drivers/staging/gpib/include/gpibP.h @@ -20,9 +20,9 @@ int gpib_register_driver(gpib_interface_t *interface, struct module *mod); void gpib_unregister_driver(gpib_interface_t *interface); -struct pci_dev *gpib_pci_get_device(const gpib_board_config_t *config, unsigned int vendor_id, +struct pci_dev *gpib_pci_get_device(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, struct pci_dev *from); -struct pci_dev *gpib_pci_get_subsys(const gpib_board_config_t *config, unsigned int vendor_id, +struct pci_dev *gpib_pci_get_subsys(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from); unsigned int num_gpib_events(const gpib_event_queue_t *queue); From 1fc037b902d4d115dae08656f92a934f08fb3515 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:53 +0000 Subject: [PATCH 056/203] staging: gpib: ines: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-14-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines_gpib.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index 93897088f6f2..860fa1bf459c 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -313,9 +313,9 @@ irqreturn_t ines_interrupt(struct gpib_board *board) return IRQ_HANDLED; } -static int ines_pci_attach(struct gpib_board *board, const gpib_board_config_t *config); -static int ines_pci_accel_attach(struct gpib_board *board, const gpib_board_config_t *config); -static int ines_isa_attach(struct gpib_board *board, const gpib_board_config_t *config); +static int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config); +static int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config); +static int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config); static void ines_pci_detach(struct gpib_board *board); static void ines_isa_detach(struct gpib_board *board); @@ -724,7 +724,7 @@ void ines_online(struct ines_priv *ines_priv, const struct gpib_board *board, in nec7210_set_reg_bits(nec_priv, IMR1, HR_DOIE | HR_DIIE, 0); } -static int ines_common_pci_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int ines_common_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -852,7 +852,7 @@ static int ines_common_pci_attach(struct gpib_board *board, const gpib_board_con return 0; } -int ines_pci_attach(struct gpib_board *board, const gpib_board_config_t *config) +int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -867,7 +867,7 @@ int ines_pci_attach(struct gpib_board *board, const gpib_board_config_t *config) return 0; } -int ines_pci_accel_attach(struct gpib_board *board, const gpib_board_config_t *config) +int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -884,7 +884,7 @@ int ines_pci_accel_attach(struct gpib_board *board, const gpib_board_config_t *c static const int ines_isa_iosize = 0x20; -int ines_isa_attach(struct gpib_board *board, const gpib_board_config_t *config) +int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -1000,8 +1000,9 @@ static const int ines_pcmcia_iosize = 0x20; static int ines_gpib_config(struct pcmcia_device *link); static void ines_gpib_release(struct pcmcia_device *link); -static int ines_pcmcia_attach(struct gpib_board *board, const gpib_board_config_t *config); -static int ines_pcmcia_accel_attach(struct gpib_board *board, const gpib_board_config_t *config); +static int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config); +static int ines_pcmcia_accel_attach(struct gpib_board *board, + const struct gpib_board_config *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(struct gpib_board *board); @@ -1345,7 +1346,7 @@ int ines_common_pcmcia_attach(struct gpib_board *board) return 0; } -int ines_pcmcia_attach(struct gpib_board *board, const gpib_board_config_t *config) +int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -1360,7 +1361,7 @@ int ines_pcmcia_attach(struct gpib_board *board, const gpib_board_config_t *conf return 0; } -int ines_pcmcia_accel_attach(struct gpib_board *board, const gpib_board_config_t *config) +int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; From 68a28080ab1ccc04f8ea9278e289ffc5b2c86b65 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:54 +0000 Subject: [PATCH 057/203] staging: gpib: lpvo_usb: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-15-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index faf96e9cc4a1..267019bc866f 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -384,7 +384,7 @@ static void set_timeout(struct gpib_board *board) * detach() will be called. Always. */ -static int usb_gpib_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int usb_gpib_attach(struct gpib_board *board, const struct gpib_board_config *config) { int retval, j; u32 base = config->ibbase; From 449878dcbaf37fbd3aaa84a63a692c34e8318172 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:55 +0000 Subject: [PATCH 058/203] staging: gpib: ni_usb: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-16-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c index 9f1b9927f025..f0b64ef1f44c 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -2198,14 +2198,14 @@ static int ni_usb_hs_plus_extra_init(struct ni_usb_priv *ni_priv) } static inline int ni_usb_device_match(struct usb_interface *interface, - const gpib_board_config_t *config) + const struct gpib_board_config *config) { if (gpib_match_device_path(&interface->dev, config->device_path) == 0) return 0; return 1; } -static int ni_usb_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int ni_usb_attach(struct gpib_board *board, const struct gpib_board_config *config) { int retval; int i, index; From ef93e89b7be611c7dd28e3a9c37017b4da2f9fac Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:56 +0000 Subject: [PATCH 059/203] staging: gpib: pc2: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-17-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/pc2/pc2_gpib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c index 5ff1d52c14e3..c3c4fcf091ed 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -252,7 +252,7 @@ static void free_private(struct gpib_board *board) board->private_data = NULL; } -static int pc2_generic_attach(struct gpib_board *board, const gpib_board_config_t *config, +static int pc2_generic_attach(struct gpib_board *board, const struct gpib_board_config *config, enum nec7210_chipset chipset) { struct pc2_priv *pc2_priv; @@ -295,7 +295,7 @@ static int pc2_generic_attach(struct gpib_board *board, const gpib_board_config_ return 0; } -static int pc2_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int pc2_attach(struct gpib_board *board, const struct gpib_board_config *config) { int isr_flags = 0; struct pc2_priv *pc2_priv; @@ -366,7 +366,7 @@ static void pc2_detach(struct gpib_board *board) free_private(board); } -static int pc2a_common_attach(struct gpib_board *board, const gpib_board_config_t *config, +static int pc2a_common_attach(struct gpib_board *board, const struct gpib_board_config *config, unsigned int num_registers, enum nec7210_chipset chipset) { unsigned int i, j; @@ -460,17 +460,17 @@ static int pc2a_common_attach(struct gpib_board *board, const gpib_board_config_ return 0; } -static int pc2a_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int pc2a_attach(struct gpib_board *board, const struct gpib_board_config *config) { return pc2a_common_attach(board, config, pc2a_iosize, NEC7210); } -static int pc2a_cb7210_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int pc2a_cb7210_attach(struct gpib_board *board, const struct gpib_board_config *config) { return pc2a_common_attach(board, config, pc2a_iosize, CB7210); } -static int pc2_2a_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int pc2_2a_attach(struct gpib_board *board, const struct gpib_board_config *config) { return pc2a_common_attach(board, config, pc2_2a_iosize, NAT4882); } From b8a16f6cc987bc86fecbd70d9c6002b9ec109712 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:57 +0000 Subject: [PATCH 060/203] staging: gpib: tnt4882: struct gpib_board_config Using Linux code style for struct gpib_board_config Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-18-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c index 3b29f541fd49..8de0fa0ae837 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -898,7 +898,7 @@ static void tnt4882_init(struct tnt4882_priv *tnt_priv, const struct gpib_board tnt_writeb(tnt_priv, tnt_priv->imr0_bits, IMR0); } -static int ni_pci_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int ni_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct tnt4882_priv *tnt_priv; struct nec7210_priv *nec_priv; @@ -1019,7 +1019,7 @@ static int ni_isapnp_find(struct pnp_dev **dev) return 0; } -static int ni_isa_attach_common(struct gpib_board *board, const gpib_board_config_t *config, +static int ni_isa_attach_common(struct gpib_board *board, const struct gpib_board_config *config, enum nec7210_chipset chipset) { struct tnt4882_priv *tnt_priv; @@ -1075,17 +1075,17 @@ static int ni_isa_attach_common(struct gpib_board *board, const gpib_board_confi return 0; } -static int ni_tnt_isa_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int ni_tnt_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) { return ni_isa_attach_common(board, config, TNT4882); } -static int ni_nat4882_isa_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int ni_nat4882_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) { return ni_isa_attach_common(board, config, NAT4882); } -static int ni_nec_isa_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int ni_nec_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) { return ni_isa_attach_common(board, config, NEC7210); } @@ -1702,7 +1702,7 @@ static void __exit exit_ni_gpib_cs(void) static const int pcmcia_gpib_iosize = 32; -static int ni_pcmcia_attach(struct gpib_board *board, const gpib_board_config_t *config) +static int ni_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct local_info_t *info; struct tnt4882_priv *tnt_priv; From 72ba314072a66774d5a90141ec99128c6bab033a Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:36:58 +0000 Subject: [PATCH 061/203] staging: gpib: Removing typedef gpib_board_config Removing gpib_interface_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408223659.187109-19-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_types.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 9af5fdd1497f..f4cb346b8a02 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -24,7 +24,6 @@ typedef struct gpib_interface_struct gpib_interface_t; struct gpib_board; -typedef struct gpib_board_config gpib_board_config_t; /* config parameters that are only used by driver attach functions */ struct gpib_board_config { @@ -56,7 +55,7 @@ struct gpib_interface_struct { /* name of board */ char *name; /* attach() initializes board and allocates resources */ - int (*attach)(struct gpib_board *board, const gpib_board_config_t *config); + int (*attach)(struct gpib_board *board, const struct gpib_board_config *config); /* detach() shuts down board and frees resources */ void (*detach)(struct gpib_board *board); /* read() should read at most 'length' bytes from the bus into @@ -292,7 +291,7 @@ struct gpib_board { struct gpib_pseudo_irq pseudo_irq; /* error dong autopoll */ atomic_t stuck_srq; - gpib_board_config_t config; + struct gpib_board_config config; /* Flag that indicates whether board is system controller of the bus */ unsigned master : 1; /* individual status bit */ From 94e71cd4f08a606131970aff82c023690c608c64 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 22:56:28 +0000 Subject: [PATCH 062/203] staging: gpib: agilent_82357a uses completion agilent_82357a_send_bulk_msg is a oneshot event where a semphore is meant for synchronizing over counting events. Recommendation is to use a completion instead. Reported by checkpatch. WARNING: consider using a completion Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408225628.187316-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/agilent_82357a/agilent_82357a.c | 12 ++++++------ drivers/staging/gpib/agilent_82357a/agilent_82357a.h | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index 1be21b6c12e2..a4870d53725c 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -34,7 +34,7 @@ static void agilent_82357a_bulk_complete(struct urb *urb) { struct agilent_82357a_urb_ctx *context = urb->context; - up(&context->complete); + complete(&context->complete); } static void agilent_82357a_timeout_handler(struct timer_list *t) @@ -43,7 +43,7 @@ static void agilent_82357a_timeout_handler(struct timer_list *t) struct agilent_82357a_urb_ctx *context = &a_priv->context; context->timed_out = 1; - up(&context->complete); + complete(&context->complete); } static int agilent_82357a_send_bulk_msg(struct agilent_82357a_priv *a_priv, void *data, @@ -74,7 +74,7 @@ static int agilent_82357a_send_bulk_msg(struct agilent_82357a_priv *a_priv, void } usb_dev = interface_to_usbdev(a_priv->bus_interface); out_pipe = usb_sndbulkpipe(usb_dev, a_priv->bulk_out_endpoint); - sema_init(&context->complete, 0); + init_completion(&context->complete); context->timed_out = 0; usb_fill_bulk_urb(a_priv->bulk_urb, usb_dev, out_pipe, data, data_length, &agilent_82357a_bulk_complete, context); @@ -89,7 +89,7 @@ static int agilent_82357a_send_bulk_msg(struct agilent_82357a_priv *a_priv, void goto cleanup; } mutex_unlock(&a_priv->bulk_alloc_lock); - if (down_interruptible(&context->complete)) { + if (wait_for_completion_interruptible(&context->complete)) { retval = -ERESTARTSYS; goto cleanup; } @@ -142,7 +142,7 @@ static int agilent_82357a_receive_bulk_msg(struct agilent_82357a_priv *a_priv, v } usb_dev = interface_to_usbdev(a_priv->bus_interface); in_pipe = usb_rcvbulkpipe(usb_dev, AGILENT_82357_BULK_IN_ENDPOINT); - sema_init(&context->complete, 0); + init_completion(&context->complete); context->timed_out = 0; usb_fill_bulk_urb(a_priv->bulk_urb, usb_dev, in_pipe, data, data_length, &agilent_82357a_bulk_complete, context); @@ -157,7 +157,7 @@ static int agilent_82357a_receive_bulk_msg(struct agilent_82357a_priv *a_priv, v goto cleanup; } mutex_unlock(&a_priv->bulk_alloc_lock); - if (down_interruptible(&context->complete)) { + if (wait_for_completion_interruptible(&context->complete)) { retval = -ERESTARTSYS; goto cleanup; } diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.h b/drivers/staging/gpib/agilent_82357a/agilent_82357a.h index cdbc3ec5d8bd..23aa4799eb86 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.h +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.h @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include @@ -115,7 +115,7 @@ enum xfer_abort_type { #define INTERRUPT_BUF_LEN 8 struct agilent_82357a_urb_ctx { - struct semaphore complete; + struct completion complete; unsigned timed_out : 1; }; From fe68869b30a554860b081e4437a31478b3f284f6 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 06:38:59 +0000 Subject: [PATCH 063/203] staging: gpib: Removing function osInit Reported by checkpatch.pl as CamelCase where function is undefined. CHECK: Avoid CamelCase: Removing undefined function. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409063904.342292-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_proto.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 2c7dfc02f517..330498e55cf4 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -8,7 +8,6 @@ int ibopen(struct inode *inode, struct file *filep); 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(struct gpib_board *board, unsigned int usec_timeout); void os_remove_timer(struct gpib_board *board); From cf6dfd2d7f1b19ac033316984084619f5904972c Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 06:39:00 +0000 Subject: [PATCH 064/203] staging: gpib: Removing function osReset Reported by checkpatch.pl as CamelCase where function is undefined. CHECK: Avoid CamelCase: Removing undefined function. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409063904.342292-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_proto.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 330498e55cf4..37075e612be4 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -8,7 +8,6 @@ int ibopen(struct inode *inode, struct file *filep); int ibclose(struct inode *inode, struct file *file); long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg); -void osReset(void); void os_start_timer(struct gpib_board *board, unsigned int usec_timeout); void os_remove_timer(struct gpib_board *board); void osSendEOI(void); From f5eac8478635baf610ff7faa89cda530ccf367b8 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 06:39:01 +0000 Subject: [PATCH 065/203] staging: gpib: Removing function osSendEOI Reported by checkpatch.pl as CamelCase where function is undefined. CHECK: Avoid CamelCase: Removing undefined function which appears twice. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409063904.342292-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_proto.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 37075e612be4..acfd348d485e 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -10,8 +10,6 @@ int ibclose(struct inode *inode, struct file *file); long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg); 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(struct gpib_board *board); static inline unsigned long usec_to_jiffies(unsigned int usec) { From 7c98e9bf5b2b0c9ecabf5beda998b7bf053938f9 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 06:39:02 +0000 Subject: [PATCH 066/203] staging: gpib: Removing function ibAPWait Reported by checkpatch.pl as CamelCase where function is undefined. CHECK: Avoid CamelCase: Removing undefined function. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409063904.342292-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_proto.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index acfd348d485e..e8f27603f2f6 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -22,7 +22,6 @@ int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); void init_gpib_descriptor(gpib_descriptor_t *desc); int dvrsp(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *result); -int ibAPWait(struct gpib_board *board, int pad); 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); From f6d49a765f523fee18921b979d6995f0be0fd3be Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 06:39:03 +0000 Subject: [PATCH 067/203] staging: gpib: Removing function ibaPrsp Reported by checkpatch.pl as CamelCase where function is undefined. CHECK: Avoid CamelCase: Removing undefined function. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409063904.342292-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_proto.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index e8f27603f2f6..74b0853a18fb 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -22,7 +22,6 @@ int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); void init_gpib_descriptor(gpib_descriptor_t *desc); int dvrsp(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *result); -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 *bytes_written); From 0520805ac264420e741575c347738c9c416e8d2a Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 06:39:04 +0000 Subject: [PATCH 068/203] staging: gpib: Removing function ibAPE Reported by checkpatch.pl as CamelCase where function is undefined. CHECK: Avoid CamelCase: Removing undefined function. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409063904.342292-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_proto.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 74b0853a18fb..6da24eb11b35 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -22,7 +22,6 @@ int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); void init_gpib_descriptor(gpib_descriptor_t *desc); int dvrsp(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *result); -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 *bytes_written); int ibgts(struct gpib_board *board); From 4655562990aaaf5ead545ecea4a30970c679e188 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:29 +0000 Subject: [PATCH 069/203] staging: gpib: Removing typedef gpib_event_queue Removing gpib_event_queue_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408232535.187528-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 10 +++++----- drivers/staging/gpib/include/gpibP.h | 4 ++-- drivers/staging/gpib/include/gpib_types.h | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index e97e8f8a62f9..d78db5dd0150 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -74,7 +74,7 @@ static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg); static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpib_board *board); static int pop_gpib_event_nolock(struct gpib_board *board, - gpib_event_queue_t *queue, short *event_type); + struct gpib_event_queue *queue, short *event_type); /* * Timer functions @@ -1839,14 +1839,14 @@ static int select_device_path_ioctl(struct gpib_board_config *config, unsigned l return 0; } -unsigned int num_gpib_events(const gpib_event_queue_t *queue) +unsigned int num_gpib_events(const struct gpib_event_queue *queue) { return queue->num_events; } static int push_gpib_event_nolock(struct gpib_board *board, short event_type) { - gpib_event_queue_t *queue = &board->event_queue; + struct gpib_event_queue *queue = &board->event_queue; struct list_head *head = &queue->event_head; gpib_event_t *event; static const unsigned int max_num_events = 1024; @@ -1901,7 +1901,7 @@ int push_gpib_event(struct gpib_board *board, short event_type) EXPORT_SYMBOL(push_gpib_event); static int pop_gpib_event_nolock(struct gpib_board *board, - gpib_event_queue_t *queue, short *event_type) + struct gpib_event_queue *queue, short *event_type) { struct list_head *head = &queue->event_head; struct list_head *front = head->next; @@ -1935,7 +1935,7 @@ static int pop_gpib_event_nolock(struct gpib_board *board, } // pop event from front of event queue -int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, short *event_type) +int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queue, short *event_type) { unsigned long flags; int retval; diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/include/gpibP.h index 0a854697e933..3e21bb1a4297 100644 --- a/drivers/staging/gpib/include/gpibP.h +++ b/drivers/staging/gpib/include/gpibP.h @@ -25,9 +25,9 @@ struct pci_dev *gpib_pci_get_device(const struct gpib_board_config *config, unsi struct pci_dev *gpib_pci_get_subsys(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, unsigned int ss_vendor, unsigned int ss_device, struct pci_dev *from); -unsigned int num_gpib_events(const gpib_event_queue_t *queue); +unsigned int num_gpib_events(const struct gpib_event_queue *queue); int push_gpib_event(struct gpib_board *board, short event_type); -int pop_gpib_event(struct gpib_board *board, gpib_event_queue_t *queue, short *event_type); +int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queue, short *event_type); int gpib_request_pseudo_irq(struct gpib_board *board, irqreturn_t (*handler)(int, void *)); void gpib_free_pseudo_irq(struct gpib_board *board); int gpib_match_device_path(struct device *dev, const char *device_path_in); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index f4cb346b8a02..1d14c6a6e29e 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -179,14 +179,14 @@ struct gpib_interface_struct { unsigned skip_check_for_command_acceptors : 1; }; -typedef struct { +struct gpib_event_queue { struct list_head event_head; spinlock_t lock; // for access to event list unsigned int num_events; unsigned dropped_event : 1; -} gpib_event_queue_t; +}; -static inline void init_event_queue(gpib_event_queue_t *queue) +static inline void init_event_queue(struct gpib_event_queue *queue) { INIT_LIST_HEAD(&queue->event_head); queue->num_events = 0; @@ -284,7 +284,7 @@ struct gpib_board { /* autospoll kernel thread */ struct task_struct *autospoll_task; /* queue for recording received trigger/clear/ifc events */ - gpib_event_queue_t event_queue; + struct gpib_event_queue event_queue; /* minor number for this board's device file */ int minor; /* struct to deal with polling mode*/ From 0d01cafdb167f0c723419a05bb38b17c9804b2f1 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:30 +0000 Subject: [PATCH 070/203] staging: gpib: Removing gpib_interface_list_t Removing gpib_interface_list_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408232535.187528-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 10 +++++----- drivers/staging/gpib/include/gpib_types.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index d78db5dd0150..b1fd9261caca 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -826,9 +826,9 @@ static int board_type_ioctl(gpib_file_private_t *file_priv, for (list_ptr = registered_drivers.next; list_ptr != ®istered_drivers; list_ptr = list_ptr->next) { - gpib_interface_list_t *entry; + struct gpib_interface_list *entry; - entry = list_entry(list_ptr, gpib_interface_list_t, list); + entry = list_entry(list_ptr, struct gpib_interface_list, list); if (strcmp(entry->interface->name, cmd.name) == 0) { int i; int had_module = file_priv->got_module; @@ -2026,7 +2026,7 @@ void init_gpib_descriptor(gpib_descriptor_t *desc) int gpib_register_driver(gpib_interface_t *interface, struct module *provider_module) { - struct gpib_interface_list_struct *entry; + struct gpib_interface_list *entry; entry = kmalloc(sizeof(*entry), GFP_KERNEL); if (!entry) @@ -2057,9 +2057,9 @@ void gpib_unregister_driver(gpib_interface_t *interface) } } for (list_ptr = registered_drivers.next; list_ptr != ®istered_drivers;) { - gpib_interface_list_t *entry; + struct gpib_interface_list *entry; - entry = list_entry(list_ptr, gpib_interface_list_t, list); + entry = list_entry(list_ptr, struct gpib_interface_list, list); list_ptr = list_ptr->next; if (entry->interface == interface) { list_del(&entry->list); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 1d14c6a6e29e..4c9a2a043003 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -210,11 +210,11 @@ static inline void init_gpib_pseudo_irq(struct gpib_pseudo_irq *pseudo_irq) } /* list so we can make a linked list of drivers */ -typedef struct gpib_interface_list_struct { +struct gpib_interface_list { struct list_head list; gpib_interface_t *interface; struct module *module; -} gpib_interface_list_t; +}; /* One struct gpib_board is allocated for each physical board in the computer. * It provides storage for variables local to each board, and interface From 8901501d389830f7e79da8de2fa159f44802c235 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:31 +0000 Subject: [PATCH 071/203] staging: gpib: Removing gpib_event_t typedef Removing gpib_event_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408232535.187528-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 8 ++++---- drivers/staging/gpib/include/gpib_types.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index b1fd9261caca..f823c261b393 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1848,7 +1848,7 @@ static int push_gpib_event_nolock(struct gpib_board *board, short event_type) { struct gpib_event_queue *queue = &board->event_queue; struct list_head *head = &queue->event_head; - gpib_event_t *event; + struct gpib_event *event; static const unsigned int max_num_events = 1024; int retval; @@ -1861,7 +1861,7 @@ static int push_gpib_event_nolock(struct gpib_board *board, short event_type) return retval; } - event = kmalloc(sizeof(gpib_event_t), GFP_ATOMIC); + event = kmalloc(sizeof(struct gpib_event), GFP_ATOMIC); if (!event) { queue->dropped_event = 1; dev_err(board->gpib_dev, "failed to allocate memory for event\n"); @@ -1905,7 +1905,7 @@ static int pop_gpib_event_nolock(struct gpib_board *board, { struct list_head *head = &queue->event_head; struct list_head *front = head->next; - gpib_event_t *event; + struct gpib_event *event; if (num_gpib_events(queue) == 0) { *event_type = EVENT_NONE; @@ -1920,7 +1920,7 @@ static int pop_gpib_event_nolock(struct gpib_board *board, return -EPIPE; } - event = list_entry(front, gpib_event_t, list); + event = list_entry(front, struct gpib_event, list); *event_type = event->event_type; list_del(front); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 4c9a2a043003..e45e784ff8e9 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -303,10 +303,10 @@ struct gpib_board { }; /* element of event queue */ -typedef struct { +struct gpib_event { struct list_head list; short event_type; -} gpib_event_t; +}; /* Each board has a list of gpib_status_queue_t to keep track of all open devices * on the bus, so we know what address to poll when we get a service request From f95d88118829b283c2ddbb5f02e014ddfd281d7a Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:32 +0000 Subject: [PATCH 072/203] staging: gpib: Removing typedef gpib_status_queue Removing gpib_status_queue_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408232535.187528-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 34 +++++++++++------------ drivers/staging/gpib/common/iblib.c | 6 ++-- drivers/staging/gpib/common/ibsys.h | 11 +++++--- drivers/staging/gpib/include/gpib_proto.h | 2 +- drivers/staging/gpib/include/gpib_types.h | 8 +++--- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index f823c261b393..1804faa6395f 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -172,7 +172,7 @@ EXPORT_SYMBOL(gpib_free_pseudo_irq); static const unsigned int serial_timeout = 1000000; -unsigned int num_status_bytes(const gpib_status_queue_t *dev) +unsigned int num_status_bytes(const struct gpib_status_queue *dev) { if (!dev) return 0; @@ -180,7 +180,7 @@ unsigned int num_status_bytes(const gpib_status_queue_t *dev) } // push status byte onto back of status byte fifo -int push_status_byte(struct gpib_board *board, gpib_status_queue_t *device, u8 poll_byte) +int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, u8 poll_byte) { struct list_head *head = &device->status_bytes; status_byte_t *status; @@ -214,7 +214,7 @@ int push_status_byte(struct gpib_board *board, gpib_status_queue_t *device, u8 p } // pop status byte from front of status byte fifo -int pop_status_byte(struct gpib_board *board, gpib_status_queue_t *device, u8 *poll_byte) +int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *device, u8 *poll_byte) { struct list_head *head = &device->status_bytes; struct list_head *front = head->next; @@ -245,14 +245,14 @@ int pop_status_byte(struct gpib_board *board, gpib_status_queue_t *device, u8 *p return 0; } -gpib_status_queue_t *get_gpib_status_queue(struct gpib_board *board, unsigned int pad, int sad) +struct gpib_status_queue *get_gpib_status_queue(struct gpib_board *board, unsigned int pad, int sad) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; struct list_head *list_ptr; const struct list_head *head = &board->device_list; for (list_ptr = head->next; list_ptr != head; list_ptr = list_ptr->next) { - device = list_entry(list_ptr, gpib_status_queue_t, list); + device = list_entry(list_ptr, struct gpib_status_queue, list); if (gpib_address_equal(device->pad, device->sad, pad, sad)) return device; } @@ -263,7 +263,7 @@ gpib_status_queue_t *get_gpib_status_queue(struct gpib_board *board, unsigned in int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *poll_byte) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; device = get_gpib_status_queue(board, pad, sad); if (num_status_bytes(device)) @@ -429,7 +429,7 @@ int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout) int retval = 0; struct list_head *cur; const struct list_head *head = NULL; - gpib_status_queue_t *device; + struct gpib_status_queue *device; u8 result; unsigned int num_bytes = 0; @@ -442,7 +442,7 @@ int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout) return retval; for (cur = head->next; cur != head; cur = cur->next) { - device = list_entry(cur, gpib_status_queue_t, list); + device = list_entry(cur, struct gpib_status_queue, list); retval = read_serial_poll_byte(board, device->pad, device->sad, usec_timeout, &result); if (retval < 0) @@ -1092,7 +1092,7 @@ static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; spoll_bytes_ioctl_t cmd; int retval; @@ -1117,13 +1117,13 @@ static int increment_open_device_count(struct gpib_board *board, struct list_hea unsigned int pad, int sad) { struct list_head *list_ptr; - gpib_status_queue_t *device; + struct gpib_status_queue *device; /* first see if address has already been opened, then increment * open count */ for (list_ptr = head->next; list_ptr != head; list_ptr = list_ptr->next) { - device = list_entry(list_ptr, gpib_status_queue_t, list); + device = list_entry(list_ptr, struct gpib_status_queue, list); if (gpib_address_equal(device->pad, device->sad, pad, sad)) { dev_dbg(board->gpib_dev, "incrementing open count for pad %i, sad %i\n", device->pad, device->sad); @@ -1132,8 +1132,8 @@ static int increment_open_device_count(struct gpib_board *board, struct list_hea } } - /* otherwise we need to allocate a new gpib_status_queue_t */ - device = kmalloc(sizeof(gpib_status_queue_t), GFP_ATOMIC); + /* otherwise we need to allocate a new struct gpib_status_queue */ + device = kmalloc(sizeof(struct gpib_status_queue), GFP_ATOMIC); if (!device) return -ENOMEM; init_gpib_status_queue(device); @@ -1151,11 +1151,11 @@ static int increment_open_device_count(struct gpib_board *board, struct list_hea static int subtract_open_device_count(struct gpib_board *board, struct list_head *head, unsigned int pad, int sad, unsigned int count) { - gpib_status_queue_t *device; + struct gpib_status_queue *device; struct list_head *list_ptr; for (list_ptr = head->next; list_ptr != head; list_ptr = list_ptr->next) { - device = list_entry(list_ptr, gpib_status_queue_t, list); + device = list_entry(list_ptr, struct gpib_status_queue, list); if (gpib_address_equal(device->pad, device->sad, pad, sad)) { dev_dbg(board->gpib_dev, "decrementing open count for pad %i, sad %i\n", device->pad, device->sad); @@ -2147,7 +2147,7 @@ static void init_board_array(struct gpib_board *board_array, unsigned int length } } -void init_gpib_status_queue(gpib_status_queue_t *device) +void init_gpib_status_queue(struct gpib_status_queue *device) { INIT_LIST_HEAD(&device->list); INIT_LIST_HEAD(&device->status_bytes); diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/common/iblib.c index b297261818f2..718df9683e7a 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -506,7 +506,7 @@ int ibstatus(struct gpib_board *board) return general_ibstatus(board, NULL, 0, 0, NULL); } -int general_ibstatus(struct gpib_board *board, const gpib_status_queue_t *device, +int general_ibstatus(struct gpib_board *board, const struct gpib_status_queue *device, int clear_mask, int set_mask, gpib_descriptor_t *desc) { int status = 0; @@ -573,7 +573,7 @@ static void init_wait_info(struct wait_info *winfo) timer_setup_on_stack(&winfo->timer, wait_timeout, 0); } -static int wait_satisfied(struct wait_info *winfo, gpib_status_queue_t *status_queue, +static int wait_satisfied(struct wait_info *winfo, struct gpib_status_queue *status_queue, int wait_mask, int *status, gpib_descriptor_t *desc) { struct gpib_board *board = winfo->board; @@ -626,7 +626,7 @@ int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int set_mask int *status, unsigned long usec_timeout, gpib_descriptor_t *desc) { int retval = 0; - gpib_status_queue_t *status_queue; + struct gpib_status_queue *status_queue; struct wait_info winfo; if (desc->is_board) diff --git a/drivers/staging/gpib/common/ibsys.h b/drivers/staging/gpib/common/ibsys.h index 19960af809c2..a9fdf95cfa96 100644 --- a/drivers/staging/gpib/common/ibsys.h +++ b/drivers/staging/gpib/common/ibsys.h @@ -22,10 +22,13 @@ int gpib_allocate_board(struct gpib_board *board); void gpib_deallocate_board(struct gpib_board *board); -unsigned int num_status_bytes(const gpib_status_queue_t *dev); -int push_status_byte(struct gpib_board *board, gpib_status_queue_t *device, uint8_t poll_byte); -int pop_status_byte(struct gpib_board *board, gpib_status_queue_t *device, uint8_t *poll_byte); -gpib_status_queue_t *get_gpib_status_queue(struct gpib_board *board, unsigned int pad, int sad); +unsigned int num_status_bytes(const struct gpib_status_queue *dev); +int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, + uint8_t poll_byte); +int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *device, + uint8_t *poll_byte); +struct gpib_status_queue *get_gpib_status_queue(struct gpib_board *board, + unsigned int pad, int sad); int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *poll_byte); int autopoll_all_devices(struct gpib_board *board); diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 6da24eb11b35..7e890a1d4552 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -41,7 +41,7 @@ int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int set_mask int *status, unsigned long usec_timeout, gpib_descriptor_t *desc); int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi, size_t *bytes_written); int ibstatus(struct gpib_board *board); -int general_ibstatus(struct gpib_board *board, const gpib_status_queue_t *device, +int general_ibstatus(struct gpib_board *board, const struct gpib_status_queue *device, int clear_mask, int set_mask, gpib_descriptor_t *desc); int io_timed_out(struct gpib_board *board); int ibppc(struct gpib_board *board, uint8_t configuration); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index e45e784ff8e9..3be51ee98ef1 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -308,10 +308,10 @@ struct gpib_event { short event_type; }; -/* Each board has a list of gpib_status_queue_t to keep track of all open devices +/* Each board has a list of gpib_status_queue to keep track of all open devices * on the bus, so we know what address to poll when we get a service request */ -typedef struct { +struct gpib_status_queue { /* list_head so we can make a linked list of devices */ struct list_head list; unsigned int pad; /* primary gpib address */ @@ -323,14 +323,14 @@ typedef struct { unsigned int reference_count; /* flags loss of status byte error due to limit on size of queue */ unsigned dropped_byte : 1; -} gpib_status_queue_t; +}; typedef struct { struct list_head list; u8 poll_byte; } status_byte_t; -void init_gpib_status_queue(gpib_status_queue_t *device); +void init_gpib_status_queue(struct gpib_status_queue *device); /* Used to store device-descriptor-specific information */ typedef struct { From 551a1041a2424f0a9f76325c0df8a8c3aaaaf0c2 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:33 +0000 Subject: [PATCH 073/203] staging: gpib: Removing typedef of status_byte Replacing typedef of status_byte_t with struct gpib_status_byte to adhere to Linux coding style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408232535.187528-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 8 ++++---- drivers/staging/gpib/include/gpib_types.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 1804faa6395f..9c943cbea984 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -183,7 +183,7 @@ unsigned int num_status_bytes(const struct gpib_status_queue *dev) int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, u8 poll_byte) { struct list_head *head = &device->status_bytes; - status_byte_t *status; + struct gpib_status_byte *status; static const unsigned int max_num_status_bytes = 1024; int retval; @@ -196,7 +196,7 @@ int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, return retval; } - status = kmalloc(sizeof(status_byte_t), GFP_KERNEL); + status = kmalloc(sizeof(struct gpib_status_byte), GFP_KERNEL); if (!status) return -ENOMEM; @@ -218,7 +218,7 @@ int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *device, { struct list_head *head = &device->status_bytes; struct list_head *front = head->next; - status_byte_t *status; + struct gpib_status_byte *status; if (num_status_bytes(device) == 0) return -EIO; @@ -231,7 +231,7 @@ int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *device, return -EPIPE; } - status = list_entry(front, status_byte_t, list); + status = list_entry(front, struct gpib_status_byte, list); *poll_byte = status->poll_byte; list_del(front); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 3be51ee98ef1..e03f34ecb027 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -325,10 +325,10 @@ struct gpib_status_queue { unsigned dropped_byte : 1; }; -typedef struct { +struct gpib_status_byte { struct list_head list; u8 poll_byte; -} status_byte_t; +}; void init_gpib_status_queue(struct gpib_status_queue *device); From 2a523a9e1bd5a5387c1bd7e5aa5ac6ff1734a987 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:34 +0000 Subject: [PATCH 074/203] staging: gpib: Removing typedef gpib_descriptor_t Removing gpib_descriptor_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408232535.187528-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 26 +++++++++++------------ drivers/staging/gpib/common/iblib.c | 6 +++--- drivers/staging/gpib/include/gpib_proto.h | 6 +++--- drivers/staging/gpib/include/gpib_types.h | 6 +++--- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 9c943cbea984..0e93dcbf8e2e 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -494,7 +494,7 @@ int dvrsp(struct gpib_board *board, unsigned int pad, int sad, return retval; } -static gpib_descriptor_t *handle_to_descriptor(const gpib_file_private_t *file_priv, +static struct gpib_descriptor *handle_to_descriptor(const gpib_file_private_t *file_priv, int handle) { if (handle < 0 || handle >= GPIB_MAX_NUM_DESCRIPTORS) { @@ -509,7 +509,7 @@ static int init_gpib_file_private(gpib_file_private_t *priv) { memset(priv, 0, sizeof(*priv)); atomic_set(&priv->holding_mutex, 0); - priv->descriptors[0] = kmalloc(sizeof(gpib_descriptor_t), GFP_KERNEL); + priv->descriptors[0] = kmalloc(sizeof(struct gpib_descriptor), GFP_KERNEL); if (!priv->descriptors[0]) { pr_err("gpib: failed to allocate default board descriptor\n"); return -ENOMEM; @@ -563,7 +563,7 @@ int ibclose(struct inode *inode, struct file *filep) unsigned int minor = iminor(inode); struct gpib_board *board; gpib_file_private_t *priv = filep->private_data; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; if (minor >= GPIB_MAX_NUM_BOARDS) { pr_err("gpib: invalid minor number of device file\n"); @@ -869,7 +869,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, int end_flag = 0; int retval; ssize_t read_ret = 0; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; size_t nbytes; retval = copy_from_user(&read_cmd, (void __user *)arg, sizeof(read_cmd)); @@ -943,7 +943,7 @@ static int command_ioctl(gpib_file_private_t *file_priv, unsigned long remain; int retval; int fault = 0; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; size_t bytes_written; int no_clear_io_in_prog; @@ -1027,7 +1027,7 @@ static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, unsigned long remain; int retval = 0; int fault; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; fault = copy_from_user(&write_cmd, (void __user *)arg, sizeof(write_cmd)); if (fault) @@ -1189,7 +1189,7 @@ static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpib_boar int i; for (i = 0; i < GPIB_MAX_NUM_DESCRIPTORS; i++) { - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; desc = file_priv->descriptors[i]; if (!desc) @@ -1228,7 +1228,7 @@ static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned mutex_unlock(&file_priv->descriptors_mutex); return -ERANGE; } - file_priv->descriptors[i] = kmalloc(sizeof(gpib_descriptor_t), GFP_KERNEL); + file_priv->descriptors[i] = kmalloc(sizeof(struct gpib_descriptor), GFP_KERNEL); if (!file_priv->descriptors[i]) { mutex_unlock(&file_priv->descriptors_mutex); return -ENOMEM; @@ -1311,7 +1311,7 @@ static int wait_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, { wait_ioctl_t wait_cmd; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; retval = copy_from_user(&wait_cmd, (void __user *)arg, sizeof(wait_cmd)); if (retval) @@ -1438,7 +1438,7 @@ static int pad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, { pad_ioctl_t cmd; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); if (retval) @@ -1474,7 +1474,7 @@ static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, { sad_ioctl_t cmd; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); if (retval) @@ -1600,7 +1600,7 @@ static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *file_p { autospoll_ioctl_t enable; int retval; - gpib_descriptor_t *desc; + struct gpib_descriptor *desc; retval = copy_from_user(&enable, (void __user *)arg, sizeof(enable)); if (retval) @@ -2015,7 +2015,7 @@ struct gpib_board board_array[GPIB_MAX_NUM_BOARDS]; LIST_HEAD(registered_drivers); -void init_gpib_descriptor(gpib_descriptor_t *desc) +void init_gpib_descriptor(struct gpib_descriptor *desc) { desc->pad = 0; desc->sad = -1; diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/common/iblib.c index 718df9683e7a..6c13e3e917e0 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -507,7 +507,7 @@ int ibstatus(struct gpib_board *board) } int general_ibstatus(struct gpib_board *board, const struct gpib_status_queue *device, - int clear_mask, int set_mask, gpib_descriptor_t *desc) + int clear_mask, int set_mask, struct gpib_descriptor *desc) { int status = 0; short line_status; @@ -574,7 +574,7 @@ static void init_wait_info(struct wait_info *winfo) } static int wait_satisfied(struct wait_info *winfo, struct gpib_status_queue *status_queue, - int wait_mask, int *status, gpib_descriptor_t *desc) + int wait_mask, int *status, struct gpib_descriptor *desc) { struct gpib_board *board = winfo->board; int temp_status; @@ -623,7 +623,7 @@ static void remove_wait_timer(struct wait_info *winfo) * no condition is waited for. */ int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int set_mask, - int *status, unsigned long usec_timeout, gpib_descriptor_t *desc) + int *status, unsigned long usec_timeout, struct gpib_descriptor *desc) { int retval = 0; struct gpib_status_queue *status_queue; diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 7e890a1d4552..4c01c436b9a7 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -19,7 +19,7 @@ static inline unsigned long usec_to_jiffies(unsigned int usec) }; int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); -void init_gpib_descriptor(gpib_descriptor_t *desc); +void init_gpib_descriptor(struct gpib_descriptor *desc); int dvrsp(struct gpib_board *board, unsigned int pad, int sad, unsigned int usec_timeout, uint8_t *result); int ibcac(struct gpib_board *board, int sync, int fallback_to_async); @@ -38,11 +38,11 @@ int ibpad(struct gpib_board *board, unsigned int addr); int ibsad(struct gpib_board *board, int addr); int ibeos(struct gpib_board *board, int eos, int eosflags); int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int set_mask, - int *status, unsigned long usec_timeout, gpib_descriptor_t *desc); + int *status, unsigned long usec_timeout, struct gpib_descriptor *desc); int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi, size_t *bytes_written); int ibstatus(struct gpib_board *board); int general_ibstatus(struct gpib_board *board, const struct gpib_status_queue *device, - int clear_mask, int set_mask, gpib_descriptor_t *desc); + int clear_mask, int set_mask, struct gpib_descriptor *desc); int io_timed_out(struct gpib_board *board); int ibppc(struct gpib_board *board, uint8_t configuration); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index e03f34ecb027..041ac796982c 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -333,17 +333,17 @@ struct gpib_status_byte { void init_gpib_status_queue(struct gpib_status_queue *device); /* Used to store device-descriptor-specific information */ -typedef struct { +struct gpib_descriptor { unsigned int pad; /* primary gpib address */ int sad; /* secondary gpib address (negative means disabled) */ atomic_t io_in_progress; unsigned is_board : 1; unsigned autopoll_enabled : 1; -} gpib_descriptor_t; +}; typedef struct { atomic_t holding_mutex; - gpib_descriptor_t *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; + struct gpib_descriptor *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; /* locked while descriptors are being allocated/deallocated */ struct mutex descriptors_mutex; unsigned got_module : 1; From c93577b9d4533af463ca9dc58385bb3d14164955 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Tue, 8 Apr 2025 23:25:35 +0000 Subject: [PATCH 075/203] staging: gpib: Remove typedef gpib_file_private_t Removing gpib_file_private_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250408232535.187528-8-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 61 ++++++++++++----------- drivers/staging/gpib/include/gpib_types.h | 4 +- 2 files changed, 33 insertions(+), 32 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 0e93dcbf8e2e..549a752af950 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -26,26 +26,27 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB base support"); MODULE_ALIAS_CHARDEV_MAJOR(GPIB_CODE); -static int board_type_ioctl(gpib_file_private_t *file_priv, +static int board_type_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg); -static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, +static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg); -static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, +static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg); -static int command_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, +static int command_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg); static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned long arg); static int close_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned 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 *board, unsigned long arg); +static int wait_ioctl(struct gpib_file_private *file_priv, + struct gpib_board *board, unsigned long arg); static int parallel_poll_ioctl(struct gpib_board *board, unsigned long arg); static int online_ioctl(struct gpib_board *board, unsigned long arg); static int remote_enable_ioctl(struct gpib_board *board, unsigned long arg); static int take_control_ioctl(struct gpib_board *board, unsigned long arg); static int line_status_ioctl(struct gpib_board *board, unsigned long arg); -static int pad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int pad_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg); -static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg); static int eos_ioctl(struct gpib_board *board, unsigned long arg); static int request_service_ioctl(struct gpib_board *board, unsigned long arg); @@ -53,9 +54,9 @@ static int request_service2_ioctl(struct gpib_board *board, unsigned long arg); static int iobase_ioctl(struct gpib_board_config *config, unsigned long arg); static int irq_ioctl(struct gpib_board_config *config, unsigned long arg); static int dma_ioctl(struct gpib_board_config *config, unsigned long arg); -static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int autospoll_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg); -static int mutex_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int mutex_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg); static int timeout_ioctl(struct gpib_board *board, unsigned long arg); static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg); @@ -71,7 +72,7 @@ static int event_ioctl(struct gpib_board *board, unsigned long arg); static int request_system_control_ioctl(struct gpib_board *board, unsigned long arg); static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg); -static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpib_board *board); +static int cleanup_open_devices(struct gpib_file_private *file_priv, struct gpib_board *board); static int pop_gpib_event_nolock(struct gpib_board *board, struct gpib_event_queue *queue, short *event_type); @@ -494,8 +495,8 @@ int dvrsp(struct gpib_board *board, unsigned int pad, int sad, return retval; } -static struct gpib_descriptor *handle_to_descriptor(const gpib_file_private_t *file_priv, - int handle) +static struct gpib_descriptor *handle_to_descriptor(const struct gpib_file_private *file_priv, + int handle) { if (handle < 0 || handle >= GPIB_MAX_NUM_DESCRIPTORS) { pr_err("gpib: invalid handle %i\n", handle); @@ -505,7 +506,7 @@ static struct gpib_descriptor *handle_to_descriptor(const gpib_file_private_t *f return file_priv->descriptors[handle]; } -static int init_gpib_file_private(gpib_file_private_t *priv) +static int init_gpib_file_private(struct gpib_file_private *priv) { memset(priv, 0, sizeof(*priv)); atomic_set(&priv->holding_mutex, 0); @@ -524,7 +525,7 @@ int ibopen(struct inode *inode, struct file *filep) { unsigned int minor = iminor(inode); struct gpib_board *board; - gpib_file_private_t *priv; + struct gpib_file_private *priv; if (minor >= GPIB_MAX_NUM_BOARDS) { pr_err("gpib: invalid minor number of device file\n"); @@ -533,12 +534,12 @@ int ibopen(struct inode *inode, struct file *filep) board = &board_array[minor]; - filep->private_data = kmalloc(sizeof(gpib_file_private_t), GFP_KERNEL); + filep->private_data = kmalloc(sizeof(struct gpib_file_private), GFP_KERNEL); if (!filep->private_data) return -ENOMEM; priv = filep->private_data; - init_gpib_file_private((gpib_file_private_t *)filep->private_data); + init_gpib_file_private((struct gpib_file_private *)filep->private_data); if (board->use_count == 0) { int retval; @@ -562,7 +563,7 @@ int ibclose(struct inode *inode, struct file *filep) { unsigned int minor = iminor(inode); struct gpib_board *board; - gpib_file_private_t *priv = filep->private_data; + struct gpib_file_private *priv = filep->private_data; struct gpib_descriptor *desc; if (minor >= GPIB_MAX_NUM_BOARDS) { @@ -608,7 +609,7 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) { unsigned int minor = iminor(filep->f_path.dentry->d_inode); struct gpib_board *board; - gpib_file_private_t *file_priv = filep->private_data; + struct gpib_file_private *file_priv = filep->private_data; long retval = -ENOTTY; if (minor >= GPIB_MAX_NUM_BOARDS) { @@ -808,7 +809,7 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) return retval; } -static int board_type_ioctl(gpib_file_private_t *file_priv, +static int board_type_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { struct list_head *list_ptr; @@ -860,7 +861,7 @@ static int board_type_ioctl(gpib_file_private_t *file_priv, return -EINVAL; } -static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, +static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { read_write_ioctl_t read_cmd; @@ -935,7 +936,7 @@ static int read_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, return read_ret; } -static int command_ioctl(gpib_file_private_t *file_priv, +static int command_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { read_write_ioctl_t cmd; @@ -1019,7 +1020,7 @@ static int command_ioctl(gpib_file_private_t *file_priv, return retval; } -static int write_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, +static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { read_write_ioctl_t write_cmd; @@ -1183,7 +1184,7 @@ static inline int decrement_open_device_count(struct gpib_board *board, struct l return subtract_open_device_count(board, head, pad, sad, 1); } -static int cleanup_open_devices(gpib_file_private_t *file_priv, struct gpib_board *board) +static int cleanup_open_devices(struct gpib_file_private *file_priv, struct gpib_board *board) { int retval = 0; int i; @@ -1212,7 +1213,7 @@ static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned { open_dev_ioctl_t open_dev_cmd; int retval; - gpib_file_private_t *file_priv = filep->private_data; + struct gpib_file_private *file_priv = filep->private_data; int i; retval = copy_from_user(&open_dev_cmd, (void __user *)arg, sizeof(open_dev_cmd)); @@ -1261,7 +1262,7 @@ static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned static int close_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned long arg) { close_dev_ioctl_t cmd; - gpib_file_private_t *file_priv = filep->private_data; + struct gpib_file_private *file_priv = filep->private_data; int retval; retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); @@ -1306,7 +1307,7 @@ static int serial_poll_ioctl(struct gpib_board *board, unsigned long arg) return 0; } -static int wait_ioctl(gpib_file_private_t *file_priv, struct gpib_board *board, +static int wait_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { wait_ioctl_t wait_cmd; @@ -1433,7 +1434,7 @@ static int line_status_ioctl(struct gpib_board *board, unsigned long arg) return 0; } -static int pad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int pad_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg) { pad_ioctl_t cmd; @@ -1469,7 +1470,7 @@ static int pad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, return 0; } -static int sad_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg) { sad_ioctl_t cmd; @@ -1595,7 +1596,7 @@ static int dma_ioctl(struct gpib_board_config *config, unsigned long arg) return 0; } -static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int autospoll_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg) { autospoll_ioctl_t enable; @@ -1633,7 +1634,7 @@ static int autospoll_ioctl(struct gpib_board *board, gpib_file_private_t *file_p return retval; } -static int mutex_ioctl(struct gpib_board *board, gpib_file_private_t *file_priv, +static int mutex_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg) { int retval, lock_mutex; diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 041ac796982c..2d8c05d1fd4a 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -341,13 +341,13 @@ struct gpib_descriptor { unsigned autopoll_enabled : 1; }; -typedef struct { +struct gpib_file_private { atomic_t holding_mutex; struct gpib_descriptor *descriptors[GPIB_MAX_NUM_DESCRIPTORS]; /* locked while descriptors are being allocated/deallocated */ struct mutex descriptors_mutex; unsigned got_module : 1; -} gpib_file_private_t; +}; #endif /* __KERNEL__ */ From e8d9c91abf5ad912f8d74b52c8908079d099ce07 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:31 +0000 Subject: [PATCH 076/203] staging: gpib: cb7210: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cb7210/cb7210.c | 26 +++++++++++++------------- drivers/staging/gpib/cb7210/cb7210.h | 12 ++++++------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c index 957daa837efc..f2163117af17 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"); -static int cb7210_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int cb7210_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read); static inline int have_fifo_word(const struct cb7210_priv *cb_priv) @@ -76,7 +76,7 @@ static inline void input_fifo_enable(struct gpib_board *board, int enable) spin_unlock_irqrestore(&board->spinlock, flags); } -static int fifo_read(struct gpib_board *board, struct cb7210_priv *cb_priv, uint8_t *buffer, +static int fifo_read(struct gpib_board *board, struct cb7210_priv *cb_priv, u8 *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; @@ -170,7 +170,7 @@ static int fifo_read(struct gpib_board *board, struct cb7210_priv *cb_priv, uint return retval; } -static int cb7210_accel_read(struct gpib_board *board, uint8_t *buffer, +static int cb7210_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval; @@ -264,7 +264,7 @@ static inline void output_fifo_enable(struct gpib_board *board, int enable) spin_unlock_irqrestore(&board->spinlock, flags); } -static int fifo_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fifo_write(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { size_t count = 0; @@ -350,7 +350,7 @@ static int fifo_write(struct gpib_board *board, uint8_t *buffer, size_t length, return retval; } -static int cb7210_accel_write(struct gpib_board *board, uint8_t *buffer, +static int cb7210_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct cb7210_priv *cb_priv = board->private_data; @@ -540,7 +540,7 @@ static void cb_pci_detach(struct gpib_board *board); static void cb_isa_detach(struct gpib_board *board); // wrappers for interface functions -static int cb7210_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int cb7210_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct cb7210_priv *priv = board->private_data; @@ -548,7 +548,7 @@ static int cb7210_read(struct gpib_board *board, uint8_t *buffer, size_t length, return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, bytes_read); } -static int cb7210_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int cb7210_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct cb7210_priv *priv = board->private_data; @@ -556,7 +556,7 @@ static int cb7210_write(struct gpib_board *board, uint8_t *buffer, size_t length return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -static int cb7210_command(struct gpib_board *board, uint8_t *buffer, size_t length, +static int cb7210_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct cb7210_priv *priv = board->private_data; @@ -606,7 +606,7 @@ static void cb7210_remote_enable(struct gpib_board *board, int enable) nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -static int cb7210_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int cb7210_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct cb7210_priv *priv = board->private_data; @@ -641,14 +641,14 @@ static int cb7210_secondary_address(struct gpib_board *board, unsigned int addre return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -static int cb7210_parallel_poll(struct gpib_board *board, uint8_t *result) +static int cb7210_parallel_poll(struct gpib_board *board, u8 *result) { struct cb7210_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -static void cb7210_parallel_poll_configure(struct gpib_board *board, uint8_t configuration) +static void cb7210_parallel_poll_configure(struct gpib_board *board, u8 configuration) { struct cb7210_priv *priv = board->private_data; @@ -662,14 +662,14 @@ static void cb7210_parallel_poll_response(struct gpib_board *board, int ist) nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -static void cb7210_serial_poll_response(struct gpib_board *board, uint8_t status) +static void cb7210_serial_poll_response(struct gpib_board *board, u8 status) { struct cb7210_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -static uint8_t cb7210_serial_poll_status(struct gpib_board *board) +static u8 cb7210_serial_poll_status(struct gpib_board *board) { struct cb7210_priv *priv = board->private_data; diff --git a/drivers/staging/gpib/cb7210/cb7210.h b/drivers/staging/gpib/cb7210/cb7210.h index 2108fe7a8ce5..32d8ec5991de 100644 --- a/drivers/staging/gpib/cb7210/cb7210.h +++ b/drivers/staging/gpib/cb7210/cb7210.h @@ -73,8 +73,8 @@ static inline int cb7210_page_in_bits(unsigned int page) return 0x50 | (page & 0xf); } -static inline uint8_t cb7210_paged_read_byte(struct cb7210_priv *cb_priv, - unsigned int register_num, unsigned int page) +static inline u8 cb7210_paged_read_byte(struct cb7210_priv *cb_priv, + unsigned int register_num, unsigned int page) { struct nec7210_priv *nec_priv = &cb_priv->nec7210_priv; u8 retval; @@ -89,8 +89,8 @@ static inline uint8_t cb7210_paged_read_byte(struct cb7210_priv *cb_priv, } // don't use for register_num < 8, since it doesn't lock -static inline uint8_t cb7210_read_byte(const struct cb7210_priv *cb_priv, - enum hs_regs register_num) +static inline u8 cb7210_read_byte(const struct cb7210_priv *cb_priv, + enum hs_regs register_num) { const struct nec7210_priv *nec_priv = &cb_priv->nec7210_priv; u8 retval; @@ -99,7 +99,7 @@ static inline uint8_t cb7210_read_byte(const struct cb7210_priv *cb_priv, return retval; } -static inline void cb7210_paged_write_byte(struct cb7210_priv *cb_priv, uint8_t data, +static inline void cb7210_paged_write_byte(struct cb7210_priv *cb_priv, u8 data, unsigned int register_num, unsigned int page) { struct nec7210_priv *nec_priv = &cb_priv->nec7210_priv; @@ -113,7 +113,7 @@ static inline void cb7210_paged_write_byte(struct cb7210_priv *cb_priv, uint8_t } // don't use for register_num < 8, since it doesn't lock -static inline void cb7210_write_byte(const struct cb7210_priv *cb_priv, uint8_t data, +static inline void cb7210_write_byte(const struct cb7210_priv *cb_priv, u8 data, enum hs_regs register_num) { const struct nec7210_priv *nec_priv = &cb_priv->nec7210_priv; From 6dcc9e9f0ed71876434c8b190f0e9dd268b20a39 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:32 +0000 Subject: [PATCH 077/203] staging: gpib: ibsys: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/iblib.c | 12 ++++++------ drivers/staging/gpib/common/ibsys.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/common/iblib.c index 6c13e3e917e0..632653ea45c7 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -96,7 +96,7 @@ static int check_for_command_acceptors(struct gpib_board *board) * must be called to initialize the GPIB and enable * the interface to leave the controller idle state. */ -int ibcmd(struct gpib_board *board, uint8_t *buf, size_t length, size_t *bytes_written) +int ibcmd(struct gpib_board *board, u8 *buf, size_t length, size_t *bytes_written) { ssize_t ret = 0; int status; @@ -297,7 +297,7 @@ int iblines(const struct gpib_board *board, short *lines) * calling ibcmd. */ -int ibrd(struct gpib_board *board, uint8_t *buf, size_t length, int *end_flag, size_t *nbytes) +int ibrd(struct gpib_board *board, u8 *buf, size_t length, int *end_flag, size_t *nbytes) { ssize_t ret = 0; int retval; @@ -343,7 +343,7 @@ int ibrd(struct gpib_board *board, uint8_t *buf, size_t length, int *end_flag, s * 1. Prior to conducting the poll the interface is placed * in the controller active state. */ -int ibrpp(struct gpib_board *board, uint8_t *result) +int ibrpp(struct gpib_board *board, u8 *result) { int retval = 0; @@ -358,7 +358,7 @@ int ibrpp(struct gpib_board *board, uint8_t *result) return retval; } -int ibppc(struct gpib_board *board, uint8_t configuration) +int ibppc(struct gpib_board *board, u8 configuration) { configuration &= 0x1f; board->interface->parallel_poll_configure(board, configuration); @@ -367,7 +367,7 @@ int ibppc(struct gpib_board *board, uint8_t configuration) return 0; } -int ibrsv2(struct gpib_board *board, uint8_t status_byte, int new_reason_for_service) +int ibrsv2(struct gpib_board *board, u8 status_byte, int new_reason_for_service) { int board_status = ibstatus(board); const unsigned int MSS = status_byte & request_service_bit; @@ -677,7 +677,7 @@ int ibwait(struct gpib_board *board, int wait_mask, int clear_mask, int set_mask * well as the interface board itself must be * addressed by calling ibcmd. */ -int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi, size_t *bytes_written) +int ibwrt(struct gpib_board *board, u8 *buf, size_t cnt, int send_eoi, size_t *bytes_written) { int ret = 0; int retval; diff --git a/drivers/staging/gpib/common/ibsys.h b/drivers/staging/gpib/common/ibsys.h index a9fdf95cfa96..e5a148f513a8 100644 --- a/drivers/staging/gpib/common/ibsys.h +++ b/drivers/staging/gpib/common/ibsys.h @@ -24,11 +24,11 @@ void gpib_deallocate_board(struct gpib_board *board); unsigned int num_status_bytes(const struct gpib_status_queue *dev); int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, - uint8_t poll_byte); + u8 poll_byte); int pop_status_byte(struct gpib_board *board, struct gpib_status_queue *device, - uint8_t *poll_byte); + u8 *poll_byte); struct gpib_status_queue *get_gpib_status_queue(struct gpib_board *board, unsigned int pad, int sad); int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int sad, - unsigned int usec_timeout, uint8_t *poll_byte); + unsigned int usec_timeout, u8 *poll_byte); int autopoll_all_devices(struct gpib_board *board); From 5be401b68961f42cd38427fef9496b3e9e51164a Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:33 +0000 Subject: [PATCH 078/203] staging: gpib: fluke_gpib: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/eastwood/fluke_gpib.c | 28 +++++++++++----------- drivers/staging/gpib/eastwood/fluke_gpib.h | 12 +++++----- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c index 53106de06c26..8e6916cd9a9f 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -34,7 +34,7 @@ static irqreturn_t fluke_gpib_internal_interrupt(struct gpib_board *board); static struct platform_device *fluke_gpib_pdev; -static uint8_t fluke_locking_read_byte(struct nec7210_priv *nec_priv, unsigned int register_number) +static u8 fluke_locking_read_byte(struct nec7210_priv *nec_priv, unsigned int register_number) { u8 retval; unsigned long flags; @@ -45,7 +45,7 @@ static uint8_t fluke_locking_read_byte(struct nec7210_priv *nec_priv, unsigned i return retval; } -static void fluke_locking_write_byte(struct nec7210_priv *nec_priv, uint8_t byte, +static void fluke_locking_write_byte(struct nec7210_priv *nec_priv, u8 byte, unsigned int register_number) { unsigned long flags; @@ -56,7 +56,7 @@ static void fluke_locking_write_byte(struct nec7210_priv *nec_priv, uint8_t byte } // wrappers for interface functions -static int fluke_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int fluke_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fluke_priv *priv = board->private_data; @@ -64,7 +64,7 @@ static int fluke_read(struct gpib_board *board, uint8_t *buffer, size_t length, return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, bytes_read); } -static int fluke_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fluke_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fluke_priv *priv = board->private_data; @@ -72,7 +72,7 @@ static int fluke_write(struct gpib_board *board, uint8_t *buffer, size_t length, return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -static int fluke_command(struct gpib_board *board, uint8_t *buffer, +static int fluke_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct fluke_priv *priv = board->private_data; @@ -116,7 +116,7 @@ static void fluke_remote_enable(struct gpib_board *board, int enable) nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -static int fluke_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int fluke_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct fluke_priv *priv = board->private_data; @@ -151,14 +151,14 @@ static int fluke_secondary_address(struct gpib_board *board, unsigned int addres return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -static int fluke_parallel_poll(struct gpib_board *board, uint8_t *result) +static int fluke_parallel_poll(struct gpib_board *board, u8 *result) { struct fluke_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -static void fluke_parallel_poll_configure(struct gpib_board *board, uint8_t configuration) +static void fluke_parallel_poll_configure(struct gpib_board *board, u8 configuration) { struct fluke_priv *priv = board->private_data; @@ -172,14 +172,14 @@ static void fluke_parallel_poll_response(struct gpib_board *board, int ist) nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -static void fluke_serial_poll_response(struct gpib_board *board, uint8_t status) +static void fluke_serial_poll_response(struct gpib_board *board, u8 status) { struct fluke_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -static uint8_t fluke_serial_poll_status(struct gpib_board *board) +static u8 fluke_serial_poll_status(struct gpib_board *board) { struct fluke_priv *priv = board->private_data; @@ -373,7 +373,7 @@ static void fluke_dma_callback(void *arg) spin_unlock_irqrestore(&board->spinlock, flags); } -static int fluke_dma_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fluke_dma_write(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct fluke_priv *e_priv = board->private_data; @@ -458,7 +458,7 @@ static int fluke_dma_write(struct gpib_board *board, uint8_t *buffer, size_t len return retval; } -static int fluke_accel_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fluke_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fluke_priv *e_priv = board->private_data; @@ -546,7 +546,7 @@ static int fluke_get_dma_residue(struct dma_chan *chan, dma_cookie_t cookie) return state.residue; } -static int fluke_dma_read(struct gpib_board *board, uint8_t *buffer, +static int fluke_dma_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fluke_priv *e_priv = board->private_data; @@ -659,7 +659,7 @@ static int fluke_dma_read(struct gpib_board *board, uint8_t *buffer, return retval; } -static int fluke_accel_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fluke_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fluke_priv *e_priv = board->private_data; diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.h b/drivers/staging/gpib/eastwood/fluke_gpib.h index 3e4348196b42..c721636c6eca 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.h +++ b/drivers/staging/gpib/eastwood/fluke_gpib.h @@ -67,8 +67,8 @@ static inline int cb7210_page_in_bits(unsigned int page) } // don't use without locking nec_priv->register_page_lock -static inline uint8_t fluke_read_byte_nolock(struct nec7210_priv *nec_priv, - int register_num) +static inline u8 fluke_read_byte_nolock(struct nec7210_priv *nec_priv, + int register_num) { u8 retval; @@ -77,14 +77,14 @@ static inline uint8_t fluke_read_byte_nolock(struct nec7210_priv *nec_priv, } // don't use without locking nec_priv->register_page_lock -static inline void fluke_write_byte_nolock(struct nec7210_priv *nec_priv, uint8_t data, +static inline void fluke_write_byte_nolock(struct nec7210_priv *nec_priv, u8 data, int register_num) { writel(data, nec_priv->mmiobase + register_num * nec_priv->offset); } -static inline uint8_t fluke_paged_read_byte(struct fluke_priv *e_priv, - unsigned int register_num, unsigned int page) +static inline u8 fluke_paged_read_byte(struct fluke_priv *e_priv, + unsigned int register_num, unsigned int page) { struct nec7210_priv *nec_priv = &e_priv->nec7210_priv; u8 retval; @@ -99,7 +99,7 @@ static inline uint8_t fluke_paged_read_byte(struct fluke_priv *e_priv, return retval; } -static inline void fluke_paged_write_byte(struct fluke_priv *e_priv, uint8_t data, +static inline void fluke_paged_write_byte(struct fluke_priv *e_priv, u8 data, unsigned int register_num, unsigned int page) { struct nec7210_priv *nec_priv = &e_priv->nec7210_priv; From 366fcc8b657919e06e9ec213b38b3a767aa6abe2 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:34 +0000 Subject: [PATCH 079/203] staging: gpib: fmh_gpib: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 32 ++++++++++++------------ drivers/staging/gpib/fmh_gpib/fmh_gpib.h | 6 ++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index 11eb45760cfa..ef2f91dcf8b6 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -48,7 +48,7 @@ static struct platform_driver fmh_gpib_platform_driver; static struct pci_driver fmh_gpib_pci_driver; // wrappers for interface functions -static int fmh_gpib_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fmh_gpib_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fmh_priv *priv = board->private_data; @@ -56,7 +56,7 @@ static int fmh_gpib_read(struct gpib_board *board, uint8_t *buffer, size_t lengt return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, bytes_read); } -static int fmh_gpib_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fmh_gpib_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *priv = board->private_data; @@ -64,7 +64,7 @@ static int fmh_gpib_write(struct gpib_board *board, uint8_t *buffer, size_t leng return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -static int fmh_gpib_command(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fmh_gpib_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct fmh_priv *priv = board->private_data; @@ -108,7 +108,7 @@ static void fmh_gpib_remote_enable(struct gpib_board *board, int enable) nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -static int fmh_gpib_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int fmh_gpib_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct fmh_priv *priv = board->private_data; @@ -143,14 +143,14 @@ static int fmh_gpib_secondary_address(struct gpib_board *board, unsigned int add return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -static int fmh_gpib_parallel_poll(struct gpib_board *board, uint8_t *result) +static int fmh_gpib_parallel_poll(struct gpib_board *board, u8 *result) { struct fmh_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -static void fmh_gpib_parallel_poll_configure(struct gpib_board *board, uint8_t configuration) +static void fmh_gpib_parallel_poll_configure(struct gpib_board *board, u8 configuration) { struct fmh_priv *priv = board->private_data; @@ -179,7 +179,7 @@ static void fmh_gpib_local_parallel_poll_mode(struct gpib_board *board, int loca } } -static void fmh_gpib_serial_poll_response2(struct gpib_board *board, uint8_t status, +static void fmh_gpib_serial_poll_response2(struct gpib_board *board, u8 status, int new_reason_for_service) { struct fmh_priv *priv = board->private_data; @@ -214,7 +214,7 @@ static void fmh_gpib_serial_poll_response2(struct gpib_board *board, uint8_t sta spin_unlock_irqrestore(&board->spinlock, flags); } -static uint8_t fmh_gpib_serial_poll_status(struct gpib_board *board) +static u8 fmh_gpib_serial_poll_status(struct gpib_board *board) { struct fmh_priv *priv = board->private_data; @@ -393,7 +393,7 @@ static int fmh_gpib_all_bytes_are_sent(struct fmh_priv *e_priv) return 1; } -static int fmh_gpib_dma_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fmh_gpib_dma_write(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct fmh_priv *e_priv = board->private_data; @@ -471,7 +471,7 @@ static int fmh_gpib_dma_write(struct gpib_board *board, uint8_t *buffer, size_t return retval; } -static int fmh_gpib_accel_write(struct gpib_board *board, uint8_t *buffer, +static int fmh_gpib_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *e_priv = board->private_data; @@ -586,7 +586,7 @@ static int wait_for_tx_fifo_half_empty(struct gpib_board *board) /* supports writing a chunk of data whose length must fit into the hardware'd xfer counter, * called in a loop by fmh_gpib_fifo_write() */ -static int fmh_gpib_fifo_write_countable(struct gpib_board *board, uint8_t *buffer, +static int fmh_gpib_fifo_write_countable(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *e_priv = board->private_data; @@ -652,7 +652,7 @@ static int fmh_gpib_fifo_write_countable(struct gpib_board *board, uint8_t *buff return retval; } -static int fmh_gpib_fifo_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fmh_gpib_fifo_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct fmh_priv *e_priv = board->private_data; @@ -699,7 +699,7 @@ static int fmh_gpib_fifo_write(struct gpib_board *board, uint8_t *buffer, size_t return retval; } -static int fmh_gpib_dma_read(struct gpib_board *board, uint8_t *buffer, +static int fmh_gpib_dma_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv = board->private_data; @@ -848,7 +848,7 @@ static void fmh_gpib_release_rfd_holdoff(struct gpib_board *board, struct fmh_pr spin_unlock_irqrestore(&board->spinlock, flags); } -static int fmh_gpib_accel_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fmh_gpib_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv = board->private_data; @@ -898,7 +898,7 @@ static int fmh_gpib_accel_read(struct gpib_board *board, uint8_t *buffer, size_t /* 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(struct gpib_board *board, uint8_t *buffer, +static int fmh_gpib_fifo_read_countable(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv = board->private_data; @@ -956,7 +956,7 @@ static int fmh_gpib_fifo_read_countable(struct gpib_board *board, uint8_t *buffe return retval; } -static int fmh_gpib_fifo_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int fmh_gpib_fifo_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct fmh_priv *e_priv = board->private_data; diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.h b/drivers/staging/gpib/fmh_gpib/fmh_gpib.h index de6fd2164414..e7602d7e1401 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.h +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.h @@ -124,13 +124,13 @@ static const unsigned int fifo_data_mask = 0x00ff; static const unsigned int fifo_xfer_counter_mask = 0x0fff; static const unsigned int fifo_max_burst_length_mask = 0x00ff; -static inline uint8_t gpib_cs_read_byte(struct nec7210_priv *nec_priv, - unsigned int register_num) +static inline u8 gpib_cs_read_byte(struct nec7210_priv *nec_priv, + unsigned int register_num) { return readb(nec_priv->mmiobase + register_num * nec_priv->offset); } -static inline void gpib_cs_write_byte(struct nec7210_priv *nec_priv, uint8_t data, +static inline void gpib_cs_write_byte(struct nec7210_priv *nec_priv, u8 data, unsigned int register_num) { writeb(data, nec_priv->mmiobase + register_num * nec_priv->offset); From 22cc45acb25bd166e0af76d9838a8430f129c38c Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:35 +0000 Subject: [PATCH 080/203] staging: gpib: gpib_proto: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_proto.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 4c01c436b9a7..1c8e5955b9ce 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -21,16 +21,16 @@ static inline unsigned long usec_to_jiffies(unsigned int usec) int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout); void init_gpib_descriptor(struct gpib_descriptor *desc); int dvrsp(struct gpib_board *board, unsigned int pad, int sad, - unsigned int usec_timeout, uint8_t *result); + unsigned int usec_timeout, u8 *result); 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 *bytes_written); +int ibcmd(struct gpib_board *board, u8 *buf, size_t length, size_t *bytes_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_flag, 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_for_service); +int ibrd(struct gpib_board *board, u8 *buf, size_t length, int *end_flag, size_t *bytes_read); +int ibrpp(struct gpib_board *board, u8 *buf); +int ibrsv2(struct gpib_board *board, u8 status_byte, int new_reason_for_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); @@ -39,11 +39,11 @@ 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 set_mask, int *status, unsigned long usec_timeout, struct gpib_descriptor *desc); -int ibwrt(struct gpib_board *board, uint8_t *buf, size_t cnt, int send_eoi, size_t *bytes_written); +int ibwrt(struct gpib_board *board, u8 *buf, size_t cnt, int send_eoi, size_t *bytes_written); int ibstatus(struct gpib_board *board); int general_ibstatus(struct gpib_board *board, const struct gpib_status_queue *device, int clear_mask, int set_mask, struct gpib_descriptor *desc); int io_timed_out(struct gpib_board *board); -int ibppc(struct gpib_board *board, uint8_t configuration); +int ibppc(struct gpib_board *board, u8 configuration); #endif /* GPIB_PROTO_INCLUDED */ From 173f8e4d314084d6a068c616f38badff76144b6f Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:36 +0000 Subject: [PATCH 081/203] staging: gpib: gpib_types: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_types.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 2d8c05d1fd4a..71af9e808a76 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -68,19 +68,19 @@ struct gpib_interface_struct { * return indicates error. * nbytes returns number of bytes read */ - int (*read)(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, + int (*read)(struct gpib_board *board, u8 *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)(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, + int (*write)(struct gpib_board *board, u8 *buffer, size_t length, int 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)(struct gpib_board *board, uint8_t *buffer, size_t length, + int (*command)(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written); /* Take control (assert ATN). If 'asyncronous' is nonzero, take * control asyncronously (assert ATN immediately without waiting @@ -107,13 +107,13 @@ struct gpib_interface_struct { * with the eos bytes. Otherwise only the 7 least significant * bits are compared. */ - int (*enable_eos)(struct gpib_board *board, uint8_t eos, int compare_8_bits); + int (*enable_eos)(struct gpib_board *board, u8 eos, int compare_8_bits); /* disable END on eos byte (END on EOI only)*/ void (*disable_eos)(struct gpib_board *board); /* configure parallel poll */ - void (*parallel_poll_configure)(struct gpib_board *board, uint8_t configuration); + void (*parallel_poll_configure)(struct gpib_board *board, u8 configuration); /* conduct parallel poll */ - int (*parallel_poll)(struct gpib_board *board, uint8_t *result); + int (*parallel_poll)(struct gpib_board *board, u8 *result); /* set/clear ist (individual status bit) */ void (*parallel_poll_response)(struct gpib_board *board, int ist); /* select local parallel poll configuration mode PP2 versus remote PP1 */ @@ -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)(struct gpib_board *board, uint8_t status_byte); + void (*serial_poll_response)(struct gpib_board *board, u8 status_byte); /* 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,11 +164,11 @@ 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)(struct gpib_board *board, uint8_t status_byte, + void (*serial_poll_response2)(struct gpib_board *board, u8 status_byte, int new_reason_for_service); /* returns the byte the board will send in response to a serial poll. */ - uint8_t (*serial_poll_status)(struct gpib_board *board); + u8 (*serial_poll_status)(struct gpib_board *board); /* adjust T1 delay */ int (*t1_delay)(struct gpib_board *board, unsigned int nano_sec); /* go to local mode */ From 72a560b423a243fbba68ce03a9f25d649f4b8352 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:37 +0000 Subject: [PATCH 082/203] staging: gpib: nec7210: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-8-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/nec7210.h | 33 +++++++++++---------- drivers/staging/gpib/nec7210/nec7210.c | 40 +++++++++++++------------- 2 files changed, 36 insertions(+), 37 deletions(-) diff --git a/drivers/staging/gpib/include/nec7210.h b/drivers/staging/gpib/include/nec7210.h index 5c57fbffb9d0..97a56f74258b 100644 --- a/drivers/staging/gpib/include/nec7210.h +++ b/drivers/staging/gpib/include/nec7210.h @@ -78,11 +78,11 @@ enum { }; // interface functions -int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read); -int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); -int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, size_t *bytes_written); int nec7210_take_control(struct gpib_board *board, struct nec7210_priv *priv, int syncronous); int nec7210_go_to_standby(struct gpib_board *board, struct nec7210_priv *priv); @@ -90,7 +90,7 @@ void nec7210_request_system_control(struct gpib_board *board, struct nec7210_priv *priv, int request_control); 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 nec7210_enable_eos(struct gpib_board *board, struct nec7210_priv *priv, u8 eos_bytes, int compare_8_bits); void nec7210_disable_eos(struct gpib_board *board, struct nec7210_priv *priv); unsigned int nec7210_update_status(struct gpib_board *board, struct nec7210_priv *priv, @@ -100,15 +100,14 @@ int nec7210_primary_address(const struct gpib_board *board, struct nec7210_priv *priv, unsigned int address); int nec7210_secondary_address(const struct gpib_board *board, struct nec7210_priv *priv, unsigned int address, int enable); -int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *result); +int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *priv, u8 *result); void nec7210_serial_poll_response(struct gpib_board *board, - struct nec7210_priv *priv, uint8_t status); + struct nec7210_priv *priv, u8 status); void nec7210_parallel_poll_configure(struct gpib_board *board, struct nec7210_priv *priv, unsigned int configuration); void nec7210_parallel_poll_response(struct gpib_board *board, struct nec7210_priv *priv, int ist); -uint8_t nec7210_serial_poll_status(struct gpib_board *board, - struct nec7210_priv *priv); +u8 nec7210_serial_poll_status(struct gpib_board *board, struct nec7210_priv *priv); int nec7210_t1_delay(struct gpib_board *board, struct nec7210_priv *priv, unsigned int nano_sec); void nec7210_return_to_local(const struct gpib_board *board, struct nec7210_priv *priv); @@ -120,18 +119,18 @@ unsigned int nec7210_set_reg_bits(struct nec7210_priv *priv, unsigned int reg, unsigned int mask, unsigned int bits); void nec7210_set_handshake_mode(struct gpib_board *board, struct nec7210_priv *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); +u8 nec7210_read_data_in(struct gpib_board *board, struct nec7210_priv *priv, int *end); // wrappers for io functions -uint8_t nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num); -uint8_t nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num); -uint8_t nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, +u8 nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_ioport_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); +u8 nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_iomem_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); +u8 nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); -uint8_t nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); -void nec7210_locking_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, +u8 nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num); +void nec7210_locking_iomem_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num); // interrupt service routine diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/nec7210/nec7210.c index 9b4870f1b421..2998ed0ea528 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"); -int nec7210_enable_eos(struct gpib_board *board, struct nec7210_priv *priv, uint8_t eos_byte, +int nec7210_enable_eos(struct gpib_board *board, struct nec7210_priv *priv, u8 eos_byte, int compare_8_bits) { write_byte(priv, eos_byte, EOSR); @@ -44,7 +44,7 @@ void nec7210_disable_eos(struct gpib_board *board, struct nec7210_priv *priv) } EXPORT_SYMBOL(nec7210_disable_eos); -int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *result) +int nec7210_parallel_poll(struct gpib_board *board, struct nec7210_priv *priv, u8 *result) { int ret; @@ -86,7 +86,7 @@ EXPORT_SYMBOL(nec7210_parallel_poll_response); * 488.2 set srv state machine in the driver (if that is even viable). */ void nec7210_serial_poll_response(struct gpib_board *board, - struct nec7210_priv *priv, uint8_t status) + struct nec7210_priv *priv, u8 status) { unsigned long flags; @@ -103,7 +103,7 @@ void nec7210_serial_poll_response(struct gpib_board *board, } EXPORT_SYMBOL(nec7210_serial_poll_response); -uint8_t nec7210_serial_poll_status(struct gpib_board *board, struct nec7210_priv *priv) +u8 nec7210_serial_poll_status(struct gpib_board *board, struct nec7210_priv *priv) { return read_byte(priv, SPSR); } @@ -251,7 +251,7 @@ void nec7210_set_handshake_mode(struct gpib_board *board, struct nec7210_priv *p } EXPORT_SYMBOL(nec7210_set_handshake_mode); -uint8_t nec7210_read_data_in(struct gpib_board *board, struct nec7210_priv *priv, int *end) +u8 nec7210_read_data_in(struct gpib_board *board, struct nec7210_priv *priv, int *end) { unsigned long flags; u8 data; @@ -415,7 +415,7 @@ static inline short nec7210_atn_has_changed(struct gpib_board *board, struct nec return -1; } -int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, uint8_t +int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, size_t *bytes_written) { int retval = 0; @@ -464,7 +464,7 @@ int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, uint8_t } EXPORT_SYMBOL(nec7210_command); -static int pio_read(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +static int pio_read(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; @@ -568,7 +568,7 @@ static ssize_t __dma_read(struct gpib_board *board, struct nec7210_priv *priv, s return retval ? retval : count; } -static ssize_t dma_read(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +static ssize_t dma_read(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length) { size_t remain = length; @@ -595,7 +595,7 @@ static ssize_t dma_read(struct gpib_board *board, struct nec7210_priv *priv, uin } #endif -int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +int nec7210_read(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; @@ -642,7 +642,7 @@ static int pio_write_wait(struct gpib_board *board, struct nec7210_priv *priv, return 0; } -static int pio_write(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +static int pio_write(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length, size_t *bytes_written) { size_t last_count = 0; @@ -742,7 +742,7 @@ static ssize_t __dma_write(struct gpib_board *board, struct nec7210_priv *priv, return retval ? retval : length; } -static ssize_t dma_write(struct gpib_board *board, struct nec7210_priv *priv, uint8_t *buffer, +static ssize_t dma_write(struct gpib_board *board, struct nec7210_priv *priv, u8 *buffer, size_t length) { size_t remain = length; @@ -767,7 +767,7 @@ static ssize_t dma_write(struct gpib_board *board, struct nec7210_priv *priv, ui } #endif int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, - uint8_t *buffer, size_t length, int send_eoi, + u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { int retval = 0; @@ -1012,13 +1012,13 @@ EXPORT_SYMBOL(nec7210_board_online); #ifdef CONFIG_HAS_IOPORT /* wrappers for io */ -uint8_t nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num) +u8 nec7210_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num) { return inb(priv->iobase + register_num * priv->offset); } EXPORT_SYMBOL(nec7210_ioport_read_byte); -void nec7210_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num) +void nec7210_ioport_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num) { if (register_num == AUXMR) /* locking makes absolutely sure noone accesses the @@ -1031,7 +1031,7 @@ void nec7210_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned EXPORT_SYMBOL(nec7210_ioport_write_byte); /* locking variants of io wrappers, for chips that page-in registers */ -uint8_t nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num) +u8 nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int register_num) { u8 retval; unsigned long flags; @@ -1043,7 +1043,7 @@ uint8_t nec7210_locking_ioport_read_byte(struct nec7210_priv *priv, unsigned int } EXPORT_SYMBOL(nec7210_locking_ioport_read_byte); -void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, +void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num) { unsigned long flags; @@ -1057,13 +1057,13 @@ void nec7210_locking_ioport_write_byte(struct nec7210_priv *priv, uint8_t data, EXPORT_SYMBOL(nec7210_locking_ioport_write_byte); #endif -uint8_t nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num) +u8 nec7210_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num) { return readb(priv->mmiobase + register_num * priv->offset); } EXPORT_SYMBOL(nec7210_iomem_read_byte); -void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned int register_num) +void nec7210_iomem_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num) { if (register_num == AUXMR) /* locking makes absolutely sure noone accesses the @@ -1075,7 +1075,7 @@ void nec7210_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, unsigned } EXPORT_SYMBOL(nec7210_iomem_write_byte); -uint8_t nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num) +u8 nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int register_num) { u8 retval; unsigned long flags; @@ -1087,7 +1087,7 @@ uint8_t nec7210_locking_iomem_read_byte(struct nec7210_priv *priv, unsigned int } EXPORT_SYMBOL(nec7210_locking_iomem_read_byte); -void nec7210_locking_iomem_write_byte(struct nec7210_priv *priv, uint8_t data, +void nec7210_locking_iomem_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num) { unsigned long flags; From 9c5cc7962ccb699a01716388c6c13913e2865d2a Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:38 +0000 Subject: [PATCH 083/203] staging: gpib: tms9914: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-9-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/tms9914.h | 24 +++++++++--------- drivers/staging/gpib/tms9914/tms9914.c | 34 +++++++++++++------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/include/tms9914.h index 08a40d84825f..d9ba11426ab1 100644 --- a/drivers/staging/gpib/include/tms9914.h +++ b/drivers/staging/gpib/include/tms9914.h @@ -79,11 +79,11 @@ enum { }; // interface functions -int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read); -int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); -int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, size_t *bytes_written); int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *priv, int syncronous); /* alternate version of tms9914_take_control which works around buggy tcs @@ -96,7 +96,7 @@ void tms9914_request_system_control(struct gpib_board *board, struct tms9914_pri int request_control); 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 tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv, u8 eos_bytes, int compare_8_bits); void tms9914_disable_eos(struct gpib_board *board, struct tms9914_priv *priv); unsigned int tms9914_update_status(struct gpib_board *board, struct tms9914_priv *priv, @@ -105,14 +105,14 @@ int tms9914_primary_address(struct gpib_board *board, struct tms9914_priv *priv, unsigned int address); int tms9914_secondary_address(struct gpib_board *board, struct tms9914_priv *priv, unsigned int address, int enable); -int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *result); +int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, u8 *result); void tms9914_parallel_poll_configure(struct gpib_board *board, - struct tms9914_priv *priv, uint8_t config); + struct tms9914_priv *priv, u8 config); void tms9914_parallel_poll_response(struct gpib_board *board, struct tms9914_priv *priv, int ist); 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 tms9914_priv *priv); + struct tms9914_priv *priv, u8 status); +u8 tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv *priv); int tms9914_line_status(const struct gpib_board *board, struct tms9914_priv *priv); unsigned int tms9914_t1_delay(struct gpib_board *board, struct tms9914_priv *priv, unsigned int nano_sec); @@ -125,10 +125,10 @@ void tms9914_release_holdoff(struct tms9914_priv *priv); void tms9914_set_holdoff_mode(struct tms9914_priv *priv, enum tms9914_holdoff_mode mode); // wrappers for io functions -uint8_t tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num); -void tms9914_ioport_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num); -uint8_t tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num); -void tms9914_iomem_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num); +u8 tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num); +void tms9914_ioport_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num); +u8 tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num); +void tms9914_iomem_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num); // interrupt service routine irqreturn_t tms9914_interrupt(struct gpib_board *board, struct tms9914_priv *priv); diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c index 4064320df4c1..7afd710a105c 100644 --- a/drivers/staging/gpib/tms9914/tms9914.c +++ b/drivers/staging/gpib/tms9914/tms9914.c @@ -193,7 +193,7 @@ void tms9914_release_holdoff(struct tms9914_priv *priv) } EXPORT_SYMBOL_GPL(tms9914_release_holdoff); -int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv, uint8_t eos_byte, +int tms9914_enable_eos(struct gpib_board *board, struct tms9914_priv *priv, u8 eos_byte, int compare_8_bits) { priv->eos = eos_byte; @@ -210,7 +210,7 @@ void tms9914_disable_eos(struct gpib_board *board, struct tms9914_priv *priv) } EXPORT_SYMBOL(tms9914_disable_eos); -int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *result) +int tms9914_parallel_poll(struct gpib_board *board, struct tms9914_priv *priv, u8 *result) { // execute parallel poll write_byte(priv, AUX_CS | AUX_RPP, AUXCR); @@ -236,7 +236,7 @@ static void set_ppoll_reg(struct tms9914_priv *priv, int enable, } void tms9914_parallel_poll_configure(struct gpib_board *board, - struct tms9914_priv *priv, uint8_t config) + struct tms9914_priv *priv, u8 config) { priv->ppoll_enable = (config & PPC_DISABLE) == 0; priv->ppoll_line = (config & PPC_DIO_MASK) + 1; @@ -253,7 +253,7 @@ void tms9914_parallel_poll_response(struct gpib_board *board, EXPORT_SYMBOL(tms9914_parallel_poll_response); void tms9914_serial_poll_response(struct gpib_board *board, - struct tms9914_priv *priv, uint8_t status) + struct tms9914_priv *priv, u8 status) { unsigned long flags; @@ -268,7 +268,7 @@ void tms9914_serial_poll_response(struct gpib_board *board, } EXPORT_SYMBOL(tms9914_serial_poll_response); -uint8_t tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv *priv) +u8 tms9914_serial_poll_status(struct gpib_board *board, struct tms9914_priv *priv) { u8 status; unsigned long flags; @@ -419,7 +419,7 @@ int tms9914_line_status(const struct gpib_board *board, struct tms9914_priv *pri } EXPORT_SYMBOL(tms9914_line_status); -static int check_for_eos(struct tms9914_priv *priv, uint8_t byte) +static int check_for_eos(struct tms9914_priv *priv, u8 byte) { static const u8 seven_bit_compare_mask = 0x7f; @@ -452,8 +452,8 @@ static int wait_for_read_byte(struct gpib_board *board, struct tms9914_priv *pri return 0; } -static inline uint8_t tms9914_read_data_in(struct gpib_board *board, - struct tms9914_priv *priv, int *end) +static inline u8 tms9914_read_data_in(struct gpib_board *board, + struct tms9914_priv *priv, int *end) { unsigned long flags; u8 data; @@ -484,7 +484,7 @@ static inline uint8_t tms9914_read_data_in(struct gpib_board *board, return data; } -static int pio_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +static int pio_read(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; @@ -505,7 +505,7 @@ static int pio_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t return retval; } -int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_read(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; @@ -565,7 +565,7 @@ static int pio_write_wait(struct gpib_board *board, struct tms9914_priv *priv) return 0; } -static int pio_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +static int pio_write(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, size_t *bytes_written) { ssize_t retval = 0; @@ -590,7 +590,7 @@ static int pio_write(struct gpib_board *board, struct tms9914_priv *priv, uint8_ } int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, - uint8_t *buffer, size_t length, int send_eoi, size_t *bytes_written) + u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { ssize_t retval = 0; @@ -660,7 +660,7 @@ static void check_my_address_state(struct gpib_board *board, } } -int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, uint8_t *buffer, +int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, size_t *bytes_written) { int retval = 0; @@ -864,14 +864,14 @@ EXPORT_SYMBOL_GPL(tms9914_online); #ifdef CONFIG_HAS_IOPORT // wrapper for inb -uint8_t tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num) +u8 tms9914_ioport_read_byte(struct tms9914_priv *priv, unsigned int register_num) { return inb(priv->iobase + register_num * priv->offset); } EXPORT_SYMBOL_GPL(tms9914_ioport_read_byte); // wrapper for outb -void tms9914_ioport_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num) +void tms9914_ioport_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num) { outb(data, priv->iobase + register_num * priv->offset); if (register_num == AUXCR) @@ -881,14 +881,14 @@ EXPORT_SYMBOL_GPL(tms9914_ioport_write_byte); #endif // wrapper for readb -uint8_t tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num) +u8 tms9914_iomem_read_byte(struct tms9914_priv *priv, unsigned int register_num) { return readb(priv->mmiobase + register_num * priv->offset); } EXPORT_SYMBOL_GPL(tms9914_iomem_read_byte); // wrapper for writeb -void tms9914_iomem_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num) +void tms9914_iomem_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num) { writeb(data, priv->mmiobase + register_num * priv->offset); if (register_num == AUXCR) From 930ce1959c2a05029128ce7d82c37174cb821261 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 18:09:39 +0000 Subject: [PATCH 084/203] staging: gpib: ines: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409180953.398686-10-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines.h | 20 ++++++++++---------- drivers/staging/gpib/ines/ines_gpib.c | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/drivers/staging/gpib/ines/ines.h b/drivers/staging/gpib/ines/ines.h index abe977f8f961..396cf0bd9ad1 100644 --- a/drivers/staging/gpib/ines/ines.h +++ b/drivers/staging/gpib/ines/ines.h @@ -36,30 +36,30 @@ struct ines_priv { }; // interface functions -int ines_read(struct gpib_board *board, uint8_t *buffer, size_t length, +int ines_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read); -int ines_write(struct gpib_board *board, uint8_t *buffer, size_t length, +int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); -int ines_accel_read(struct gpib_board *board, uint8_t *buffer, size_t length, +int ines_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read); -int ines_accel_write(struct gpib_board *board, uint8_t *buffer, size_t length, +int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); -int ines_command(struct gpib_board *board, uint8_t *buffer, size_t length, size_t *bytes_written); +int ines_command(struct gpib_board *board, u8 *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_control); 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 compare_8_bits); +int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits); void ines_disable_eos(struct gpib_board *board); unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_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); +int ines_parallel_poll(struct gpib_board *board, u8 *result); +void ines_parallel_poll_configure(struct gpib_board *board, u8 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); +void ines_serial_poll_response(struct gpib_board *board, u8 status); +u8 ines_serial_poll_status(struct gpib_board *board); int ines_line_status(const struct gpib_board *board); int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec); void ines_return_to_local(struct gpib_board *board); diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index 860fa1bf459c..ef545bbaae42 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -95,7 +95,7 @@ static inline unsigned short num_in_fifo_bytes(struct ines_priv *ines_priv) return ines_inb(ines_priv, IN_FIFO_COUNT); } -static ssize_t pio_read(struct gpib_board *board, struct ines_priv *ines_priv, uint8_t *buffer, +static ssize_t pio_read(struct gpib_board *board, struct ines_priv *ines_priv, u8 *buffer, size_t length, size_t *nbytes) { ssize_t retval = 0; @@ -133,7 +133,7 @@ static ssize_t pio_read(struct gpib_board *board, struct ines_priv *ines_priv, u return retval; } -int ines_accel_read(struct gpib_board *board, uint8_t *buffer, +int ines_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; @@ -213,7 +213,7 @@ static int ines_write_wait(struct gpib_board *board, struct ines_priv *ines_priv return 0; } -int ines_accel_write(struct gpib_board *board, uint8_t *buffer, size_t length, +int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { size_t count = 0; @@ -393,7 +393,7 @@ static struct ines_pci_id pci_ids[] = { static const int num_pci_chips = ARRAY_SIZE(pci_ids); // wrappers for interface functions -int ines_read(struct gpib_board *board, uint8_t *buffer, size_t length, +int ines_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct ines_priv *priv = board->private_data; @@ -412,7 +412,7 @@ int ines_read(struct gpib_board *board, uint8_t *buffer, size_t length, return retval; } -int ines_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, +int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct ines_priv *priv = board->private_data; @@ -420,7 +420,7 @@ int ines_write(struct gpib_board *board, uint8_t *buffer, size_t length, int sen return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -int ines_command(struct gpib_board *board, uint8_t *buffer, size_t length, size_t *bytes_written) +int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct ines_priv *priv = board->private_data; @@ -462,7 +462,7 @@ void ines_remote_enable(struct gpib_board *board, int enable) nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -int ines_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct ines_priv *priv = board->private_data; @@ -497,14 +497,14 @@ int ines_secondary_address(struct gpib_board *board, unsigned int address, int e return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -int ines_parallel_poll(struct gpib_board *board, uint8_t *result) +int ines_parallel_poll(struct gpib_board *board, u8 *result) { struct ines_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -void ines_parallel_poll_configure(struct gpib_board *board, uint8_t config) +void ines_parallel_poll_configure(struct gpib_board *board, u8 config) { struct ines_priv *priv = board->private_data; @@ -518,14 +518,14 @@ void ines_parallel_poll_response(struct gpib_board *board, int ist) nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -void ines_serial_poll_response(struct gpib_board *board, uint8_t status) +void ines_serial_poll_response(struct gpib_board *board, u8 status) { struct ines_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -uint8_t ines_serial_poll_status(struct gpib_board *board) +u8 ines_serial_poll_status(struct gpib_board *board) { struct ines_priv *priv = board->private_data; From 6215fb3d44998bde8c260931e2da6e77f5253772 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:43 +0000 Subject: [PATCH 085/203] staging: gpib: Using struct gpib_board_type_ioctl Using Linux code style for 'struct gpib_board_type_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 5 +++-- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 549a752af950..64500e150d70 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -813,7 +813,7 @@ static int board_type_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { struct list_head *list_ptr; - board_type_ioctl_t cmd; + struct gpib_board_type_ioctl cmd; int retval; if (!capable(CAP_SYS_ADMIN)) @@ -821,7 +821,8 @@ static int board_type_ioctl(struct gpib_file_private *file_priv, if (board->online) return -EBUSY; - retval = copy_from_user(&cmd, (void __user *)arg, sizeof(board_type_ioctl_t)); + retval = copy_from_user(&cmd, (void __user *)arg, + sizeof(struct gpib_board_type_ioctl)); if (retval) return retval; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 6202865278ea..4ddcbc2a81b0 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -12,9 +12,9 @@ #define GPIB_CODE 160 -typedef struct { +struct gpib_board_type_ioctl { char name[100]; -} board_type_ioctl_t; +}; /* argument for read/write/command ioctls */ typedef struct { @@ -143,7 +143,7 @@ enum gpib_ioctl { CFCBASE = _IOW(GPIB_CODE, 21, uint64_t), CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int), CFCDMA = _IOW(GPIB_CODE, 23, unsigned int), - CFCBOARDTYPE = _IOW(GPIB_CODE, 24, board_type_ioctl_t), + CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl), IBMUTEX = _IOW(GPIB_CODE, 26, int), IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, spoll_bytes_ioctl_t), From 28396c51c5d18180b46e168062b8b59efe69bb05 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:44 +0000 Subject: [PATCH 086/203] staging: gpib: Using struct gpib_read_write_ioctl Using Linux code style for 'struct gpib_read_write_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 6 +++--- drivers/staging/gpib/uapi/gpib_ioctl.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 64500e150d70..dff0674cf31c 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -865,7 +865,7 @@ static int board_type_ioctl(struct gpib_file_private *file_priv, static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { - read_write_ioctl_t read_cmd; + struct gpib_read_write_ioctl read_cmd; u8 __user *userbuf; unsigned long remain; int end_flag = 0; @@ -940,7 +940,7 @@ static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *bo static int command_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { - read_write_ioctl_t cmd; + struct gpib_read_write_ioctl cmd; u8 __user *userbuf; unsigned long remain; int retval; @@ -1024,7 +1024,7 @@ static int command_ioctl(struct gpib_file_private *file_priv, static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { - read_write_ioctl_t write_cmd; + struct gpib_read_write_ioctl write_cmd; u8 __user *userbuf; unsigned long remain; int retval = 0; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 4ddcbc2a81b0..15c924efe5bc 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -17,13 +17,13 @@ struct gpib_board_type_ioctl { }; /* argument for read/write/command ioctls */ -typedef struct { +struct gpib_read_write_ioctl { uint64_t buffer_ptr; unsigned int requested_transfer_count; unsigned int completed_transfer_count; int end; /* end flag return for reads, end io suppression request for cmd*/ int handle; -} read_write_ioctl_t; +}; typedef struct { unsigned int handle; @@ -121,9 +121,9 @@ typedef struct { /* Standard functions. */ enum gpib_ioctl { - IBRD = _IOWR(GPIB_CODE, 100, read_write_ioctl_t), - IBWRT = _IOWR(GPIB_CODE, 101, read_write_ioctl_t), - IBCMD = _IOWR(GPIB_CODE, 102, read_write_ioctl_t), + IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl), + IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl), + IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl), IBOPENDEV = _IOWR(GPIB_CODE, 3, open_dev_ioctl_t), IBCLOSEDEV = _IOW(GPIB_CODE, 4, close_dev_ioctl_t), IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t), From 6e5f0402c87e7033120868c44b31925a89945e79 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:45 +0000 Subject: [PATCH 087/203] staging: gpib: Using struct gpib_open_dev_ioctl Using Linux code style for 'struct gpib_open_dev_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index dff0674cf31c..8a17e8bb3bd2 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1212,7 +1212,7 @@ static int cleanup_open_devices(struct gpib_file_private *file_priv, struct gpib static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned long arg) { - open_dev_ioctl_t open_dev_cmd; + struct gpib_open_dev_ioctl open_dev_cmd; int retval; struct gpib_file_private *file_priv = filep->private_data; int i; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 15c924efe5bc..cfd1afb36e4f 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -25,12 +25,12 @@ struct gpib_read_write_ioctl { int handle; }; -typedef struct { +struct gpib_open_dev_ioctl { unsigned int handle; unsigned int pad; int sad; unsigned is_board : 1; -} open_dev_ioctl_t; +}; typedef struct { unsigned int handle; @@ -124,7 +124,7 @@ enum gpib_ioctl { IBRD = _IOWR(GPIB_CODE, 100, struct gpib_read_write_ioctl), IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl), IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl), - IBOPENDEV = _IOWR(GPIB_CODE, 3, open_dev_ioctl_t), + IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl), IBCLOSEDEV = _IOW(GPIB_CODE, 4, close_dev_ioctl_t), IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t), IBRPP = _IOWR(GPIB_CODE, 6, uint8_t), From 2e9a95ddffc60c567670ca5b54db1557d26d68a2 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:46 +0000 Subject: [PATCH 088/203] staging: gpib: Using struct gpib_close_dev_ioctl Using Linux code style for 'struct gpib_close_dev_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 8a17e8bb3bd2..1df833127846 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1262,7 +1262,7 @@ static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned static int close_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned long arg) { - close_dev_ioctl_t cmd; + struct gpib_close_dev_ioctl cmd; struct gpib_file_private *file_priv = filep->private_data; int retval; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index cfd1afb36e4f..6ea6114ae78a 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -32,9 +32,9 @@ struct gpib_open_dev_ioctl { unsigned is_board : 1; }; -typedef struct { +struct gpib_close_dev_ioctl { unsigned int handle; -} close_dev_ioctl_t; +}; typedef struct { unsigned int pad; @@ -125,7 +125,7 @@ enum gpib_ioctl { IBWRT = _IOWR(GPIB_CODE, 101, struct gpib_read_write_ioctl), IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl), IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl), - IBCLOSEDEV = _IOW(GPIB_CODE, 4, close_dev_ioctl_t), + IBCLOSEDEV = _IOW(GPIB_CODE, 4, struct gpib_close_dev_ioctl), IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t), IBRPP = _IOWR(GPIB_CODE, 6, uint8_t), From 262040faa5e9522848f6c7aa9d772a6f1995f85d Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:47 +0000 Subject: [PATCH 089/203] staging: gpib: Using struct gpib_serial_poll_ioctl Using Linux code style for 'struct gpib_serial_poll_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 1df833127846..4e93d1c7e3d6 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1289,7 +1289,7 @@ static int close_dev_ioctl(struct file *filep, struct gpib_board *board, unsigne static int serial_poll_ioctl(struct gpib_board *board, unsigned long arg) { - serial_poll_ioctl_t serial_cmd; + struct gpib_serial_poll_ioctl serial_cmd; int retval; retval = copy_from_user(&serial_cmd, (void __user *)arg, sizeof(serial_cmd)); diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 6ea6114ae78a..9be3262271c5 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -36,11 +36,11 @@ struct gpib_close_dev_ioctl { unsigned int handle; }; -typedef struct { +struct gpib_serial_poll_ioctl { unsigned int pad; int sad; uint8_t status_byte; -} serial_poll_ioctl_t; +}; typedef struct { int eos; @@ -137,7 +137,7 @@ enum gpib_ioctl { IBPAD = _IOW(GPIB_CODE, 15, pad_ioctl_t), IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t), IBTMO = _IOW(GPIB_CODE, 17, unsigned int), - IBRSP = _IOWR(GPIB_CODE, 18, serial_poll_ioctl_t), + IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl), IBEOS = _IOW(GPIB_CODE, 19, eos_ioctl_t), IBRSV = _IOW(GPIB_CODE, 20, uint8_t), CFCBASE = _IOW(GPIB_CODE, 21, uint64_t), From 7e9f21bb1be8a96df31a61fc4fd1a438f0993483 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:48 +0000 Subject: [PATCH 090/203] staging: gpib: Using struct gpib_eos_ioctl Using Linux code style for 'struct gpib_eos_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 4e93d1c7e3d6..7c6f764a6253 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1508,7 +1508,7 @@ static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *file_pr static int eos_ioctl(struct gpib_board *board, unsigned long arg) { - eos_ioctl_t eos_cmd; + struct gpib_eos_ioctl eos_cmd; int retval; retval = copy_from_user(&eos_cmd, (void __user *)arg, sizeof(eos_cmd)); diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 9be3262271c5..3f32eceaca93 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -42,10 +42,10 @@ struct gpib_serial_poll_ioctl { uint8_t status_byte; }; -typedef struct { +struct gpib_eos_ioctl { int eos; int eos_flags; -} eos_ioctl_t; +}; typedef struct { int handle; @@ -138,7 +138,7 @@ enum gpib_ioctl { IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t), IBTMO = _IOW(GPIB_CODE, 17, unsigned int), IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl), - IBEOS = _IOW(GPIB_CODE, 19, eos_ioctl_t), + IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl), IBRSV = _IOW(GPIB_CODE, 20, uint8_t), CFCBASE = _IOW(GPIB_CODE, 21, uint64_t), CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int), From 15738cb610430ea52f3eb8ccc994fd3bc02c91f6 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:49 +0000 Subject: [PATCH 091/203] staging: gpib: Using struct gpib_wait_ioctl Using Linux code style for 'struct gpib_wait_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-8-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 7c6f764a6253..70fa66f70780 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1311,7 +1311,7 @@ static int serial_poll_ioctl(struct gpib_board *board, unsigned long arg) static int wait_ioctl(struct gpib_file_private *file_priv, struct gpib_board *board, unsigned long arg) { - wait_ioctl_t wait_cmd; + struct gpib_wait_ioctl wait_cmd; int retval; struct gpib_descriptor *desc; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 3f32eceaca93..71c5e3d020bb 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -47,7 +47,7 @@ struct gpib_eos_ioctl { int eos_flags; }; -typedef struct { +struct gpib_wait_ioctl { int handle; int wait_mask; int clear_mask; @@ -56,7 +56,7 @@ typedef struct { int pad; int sad; unsigned int usec_timeout; -} wait_ioctl_t; +}; typedef struct { uint64_t init_data_ptr; @@ -126,7 +126,7 @@ enum gpib_ioctl { IBCMD = _IOWR(GPIB_CODE, 102, struct gpib_read_write_ioctl), IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl), IBCLOSEDEV = _IOW(GPIB_CODE, 4, struct gpib_close_dev_ioctl), - IBWAIT = _IOWR(GPIB_CODE, 5, wait_ioctl_t), + IBWAIT = _IOWR(GPIB_CODE, 5, struct gpib_wait_ioctl), IBRPP = _IOWR(GPIB_CODE, 6, uint8_t), IBSIC = _IOW(GPIB_CODE, 9, unsigned int), From 7e17963fa99086e809d70191417aa9ef77f1db58 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:50 +0000 Subject: [PATCH 092/203] staging: gpib: Using struct gpib_online_ioctl Using Linux code style for 'struct gpib_online_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-9-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 70fa66f70780..a8189f296cf9 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1353,7 +1353,7 @@ static int parallel_poll_ioctl(struct gpib_board *board, unsigned long arg) static int online_ioctl(struct gpib_board *board, unsigned long arg) { - online_ioctl_t online_cmd; + struct gpib_online_ioctl online_cmd; int retval; void __user *init_data = NULL; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 71c5e3d020bb..dab170b09764 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -58,11 +58,11 @@ struct gpib_wait_ioctl { unsigned int usec_timeout; }; -typedef struct { +struct gpib_online_ioctl { uint64_t init_data_ptr; int init_data_length; int online; -} online_ioctl_t; +}; typedef struct { unsigned int num_bytes; @@ -158,7 +158,7 @@ enum gpib_ioctl { IBLOC = _IO(GPIB_CODE, 36), IBAUTOSPOLL = _IOW(GPIB_CODE, 38, autospoll_ioctl_t), - IBONL = _IOW(GPIB_CODE, 39, online_ioctl_t), + IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl), IBPP2_SET = _IOW(GPIB_CODE, 40, local_ppoll_mode_ioctl_t), IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t), IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, select_device_path_ioctl_t), From 770b63fd93739d5ba48241faa8ecb8cf716ad95e Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:51 +0000 Subject: [PATCH 093/203] staging: gpib: Using struct gpib_spoll_bytes_ioctl Using Linux code style for 'struct gpib_spoll_bytes_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-10-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index a8189f296cf9..25d9e885ec00 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1095,7 +1095,7 @@ static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *b static int status_bytes_ioctl(struct gpib_board *board, unsigned long arg) { struct gpib_status_queue *device; - spoll_bytes_ioctl_t cmd; + struct gpib_spoll_bytes_ioctl cmd; int retval; retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index dab170b09764..e3d167edfd69 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -64,11 +64,11 @@ struct gpib_online_ioctl { int online; }; -typedef struct { +struct gpib_spoll_bytes_ioctl { unsigned int num_bytes; unsigned int pad; int sad; -} spoll_bytes_ioctl_t; +}; typedef struct { unsigned int pad; @@ -146,7 +146,7 @@ enum gpib_ioctl { CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl), IBMUTEX = _IOW(GPIB_CODE, 26, int), - IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, spoll_bytes_ioctl_t), + IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl), IBPPC = _IOW(GPIB_CODE, 28, ppoll_config_ioctl_t), IBBOARD_INFO = _IOR(GPIB_CODE, 29, board_info_ioctl_t), From c39eabbffeca621f54bb5a4477a43fdf9e253e47 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:52 +0000 Subject: [PATCH 094/203] staging: gpib: Using struct gpib_board_info_ioctl Using Linux code style for 'struct gpib_board_info_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-11-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 25d9e885ec00..4b062fd70ec2 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1762,7 +1762,7 @@ static int query_board_rsv_ioctl(struct gpib_board *board, unsigned long arg) static int board_info_ioctl(const struct gpib_board *board, unsigned long arg) { - board_info_ioctl_t info; + struct gpib_board_info_ioctl info; int retval; info.pad = board->pad; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index e3d167edfd69..041b0a1593e9 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -70,7 +70,7 @@ struct gpib_spoll_bytes_ioctl { int sad; }; -typedef struct { +struct gpib_board_info_ioctl { unsigned int pad; int sad; int parallel_poll_configuration; @@ -79,7 +79,7 @@ typedef struct { unsigned int t1_delay; unsigned ist : 1; unsigned no_7_bit_eos : 1; -} board_info_ioctl_t; +}; typedef struct { int pci_bus; @@ -148,7 +148,7 @@ enum gpib_ioctl { IBMUTEX = _IOW(GPIB_CODE, 26, int), IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl), IBPPC = _IOW(GPIB_CODE, 28, ppoll_config_ioctl_t), - IBBOARD_INFO = _IOR(GPIB_CODE, 29, board_info_ioctl_t), + IBBOARD_INFO = _IOR(GPIB_CODE, 29, struct gpib_board_info_ioctl), IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, int), IBSELECT_PCI = _IOWR(GPIB_CODE, 32, select_pci_ioctl_t), From 4c2170378cb426e02d398e1beabeb18b806df6a9 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:53 +0000 Subject: [PATCH 095/203] staging: gpib: Using struct gpib_select_pci_ioctl Using Linux code style for 'struct gpib_select_pci_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-12-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 4b062fd70ec2..aa6e07b1f73d 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1797,7 +1797,7 @@ static int interface_clear_ioctl(struct gpib_board *board, unsigned long arg) static int select_pci_ioctl(struct gpib_board_config *config, unsigned long arg) { - select_pci_ioctl_t selection; + struct gpib_select_pci_ioctl selection; int retval; if (!capable(CAP_SYS_ADMIN)) diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 041b0a1593e9..5681a66483a8 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -81,10 +81,10 @@ struct gpib_board_info_ioctl { unsigned no_7_bit_eos : 1; }; -typedef struct { +struct gpib_select_pci_ioctl { int pci_bus; int pci_slot; -} select_pci_ioctl_t; +}; typedef struct { uint8_t config; @@ -151,7 +151,7 @@ enum gpib_ioctl { IBBOARD_INFO = _IOR(GPIB_CODE, 29, struct gpib_board_info_ioctl), IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, int), - IBSELECT_PCI = _IOWR(GPIB_CODE, 32, select_pci_ioctl_t), + IBSELECT_PCI = _IOWR(GPIB_CODE, 32, struct gpib_select_pci_ioctl), IBEVENT = _IOR(GPIB_CODE, 33, event_ioctl_t), IBRSC = _IOW(GPIB_CODE, 34, rsc_ioctl_t), IB_T1_DELAY = _IOW(GPIB_CODE, 35, t1_delay_ioctl_t), From 419a3433f03cb1bedbdb2e14ad7a3eee4deed4bf Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:54 +0000 Subject: [PATCH 096/203] staging: gpib: Using struct gpib_ppoll_config_ioctl` Using Linux code style for 'struct gpib_ppoll_config_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-13-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index aa6e07b1f73d..9e4ed6262afe 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1692,7 +1692,7 @@ static int timeout_ioctl(struct gpib_board *board, unsigned long arg) static int ppc_ioctl(struct gpib_board *board, unsigned long arg) { - ppoll_config_ioctl_t cmd; + struct gpib_ppoll_config_ioctl cmd; int retval; retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 5681a66483a8..df428899ba3f 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -86,11 +86,11 @@ struct gpib_select_pci_ioctl { int pci_slot; }; -typedef struct { +struct gpib_ppoll_config_ioctl { uint8_t config; unsigned set_ist : 1; unsigned clear_ist : 1; -} ppoll_config_ioctl_t; +}; typedef struct { unsigned int handle; @@ -147,7 +147,7 @@ enum gpib_ioctl { IBMUTEX = _IOW(GPIB_CODE, 26, int), IBSPOLL_BYTES = _IOWR(GPIB_CODE, 27, struct gpib_spoll_bytes_ioctl), - IBPPC = _IOW(GPIB_CODE, 28, ppoll_config_ioctl_t), + IBPPC = _IOW(GPIB_CODE, 28, struct gpib_ppoll_config_ioctl), IBBOARD_INFO = _IOR(GPIB_CODE, 29, struct gpib_board_info_ioctl), IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, int), From faebdfab317c73581fbd0853ccd6467e2385c311 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:55 +0000 Subject: [PATCH 097/203] staging: gpib: Using struct gpib_pad_ioctl Using Linux code style for 'struct gpib_pad_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-14-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 9e4ed6262afe..19bda8ff095d 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1438,7 +1438,7 @@ static int line_status_ioctl(struct gpib_board *board, unsigned long arg) static int pad_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg) { - pad_ioctl_t cmd; + struct gpib_pad_ioctl cmd; int retval; struct gpib_descriptor *desc; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index df428899ba3f..7cb09cac6cd0 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -92,10 +92,10 @@ struct gpib_ppoll_config_ioctl { unsigned clear_ist : 1; }; -typedef struct { +struct gpib_pad_ioctl { unsigned int handle; unsigned int pad; -} pad_ioctl_t; +}; typedef struct { unsigned int handle; @@ -134,7 +134,7 @@ enum gpib_ioctl { IBGTS = _IO(GPIB_CODE, 11), IBCAC = _IOW(GPIB_CODE, 12, int), IBLINES = _IOR(GPIB_CODE, 14, short), - IBPAD = _IOW(GPIB_CODE, 15, pad_ioctl_t), + IBPAD = _IOW(GPIB_CODE, 15, struct gpib_pad_ioctl), IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t), IBTMO = _IOW(GPIB_CODE, 17, unsigned int), IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl), From d178bc14c9281f616ef98f76b4859928e81dcece Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:56 +0000 Subject: [PATCH 098/203] staging: gpib: Using struct gpib_sad_ioctl Using Linux code style for 'struct gpib_sad_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-15-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 19bda8ff095d..ceaf9cc93233 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1474,7 +1474,7 @@ static int pad_ioctl(struct gpib_board *board, struct gpib_file_private *file_pr static int sad_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg) { - sad_ioctl_t cmd; + struct gpib_sad_ioctl cmd; int retval; struct gpib_descriptor *desc; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 7cb09cac6cd0..a0fbc660ab99 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -97,10 +97,10 @@ struct gpib_pad_ioctl { unsigned int pad; }; -typedef struct { +struct gpib_sad_ioctl { unsigned int handle; int sad; -} sad_ioctl_t; +}; // select a piece of hardware to attach by its sysfs device path typedef struct { @@ -135,7 +135,7 @@ enum gpib_ioctl { IBCAC = _IOW(GPIB_CODE, 12, int), IBLINES = _IOR(GPIB_CODE, 14, short), IBPAD = _IOW(GPIB_CODE, 15, struct gpib_pad_ioctl), - IBSAD = _IOW(GPIB_CODE, 16, sad_ioctl_t), + IBSAD = _IOW(GPIB_CODE, 16, struct gpib_sad_ioctl), IBTMO = _IOW(GPIB_CODE, 17, unsigned int), IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl), IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl), From 1b462bf26c1e92e6abbe60ec26bc50368306642a Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:57 +0000 Subject: [PATCH 099/203] staging: gpib: Using gpib_select_device_path_ioctl Using Linux code style for 'struct gpib_select_device_path_ioctl' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-16-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 7 ++++--- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index ceaf9cc93233..b47a5078c493 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1815,17 +1815,18 @@ static int select_pci_ioctl(struct gpib_board_config *config, unsigned long arg) static int select_device_path_ioctl(struct gpib_board_config *config, unsigned long arg) { - select_device_path_ioctl_t *selection; + struct gpib_select_device_path_ioctl *selection; int retval; if (!capable(CAP_SYS_ADMIN)) return -EPERM; - selection = vmalloc(sizeof(select_device_path_ioctl_t)); + selection = vmalloc(sizeof(struct gpib_select_device_path_ioctl)); if (!selection) return -ENOMEM; - retval = copy_from_user(selection, (void __user *)arg, sizeof(select_device_path_ioctl_t)); + retval = copy_from_user(selection, (void __user *)arg, + sizeof(struct gpib_select_device_path_ioctl)); if (retval) { vfree(selection); return -EFAULT; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index a0fbc660ab99..473b09d4efaa 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -103,9 +103,9 @@ struct gpib_sad_ioctl { }; // select a piece of hardware to attach by its sysfs device path -typedef struct { +struct gpib_select_device_path_ioctl { char device_path[0x1000]; -} select_device_path_ioctl_t; +}; typedef short event_ioctl_t; typedef int rsc_ioctl_t; @@ -161,7 +161,7 @@ enum gpib_ioctl { IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl), IBPP2_SET = _IOW(GPIB_CODE, 40, local_ppoll_mode_ioctl_t), IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t), - IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, select_device_path_ioctl_t), + IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl), // 44 was IBSELECT_SERIAL_NUMBER IBRSV2 = _IOW(GPIB_CODE, 45, request_service2_t) }; From ad368b53ac0999a4861899148a60606aad548d0d Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:58 +0000 Subject: [PATCH 100/203] staging: gpib: Using struct gpib_request_service2 Using Linux code style for 'struct gpib_request_service2' to remove typedef. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-17-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 4 ++-- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index b47a5078c493..6cad9e1879fa 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1532,11 +1532,11 @@ static int request_service_ioctl(struct gpib_board *board, unsigned long arg) static int request_service2_ioctl(struct gpib_board *board, unsigned long arg) { - request_service2_t request_service2_cmd; + struct gpib_request_service2 request_service2_cmd; int retval; retval = copy_from_user(&request_service2_cmd, (void __user *)arg, - sizeof(request_service2_t)); + sizeof(struct gpib_request_service2)); if (retval) return -EFAULT; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 473b09d4efaa..eea169a0ba40 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -114,10 +114,10 @@ typedef short autospoll_ioctl_t; typedef short local_ppoll_mode_ioctl_t; // update status byte and request service -typedef struct { +struct gpib_request_service2 { uint8_t status_byte; int new_reason_for_service; -} request_service2_t; +}; /* Standard functions. */ enum gpib_ioctl { @@ -163,7 +163,7 @@ enum gpib_ioctl { IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t), IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl), // 44 was IBSELECT_SERIAL_NUMBER - IBRSV2 = _IOW(GPIB_CODE, 45, request_service2_t) + IBRSV2 = _IOW(GPIB_CODE, 45, struct gpib_request_service2) }; #endif /* _GPIB_IOCTL_H */ From 8cc35955b5ab71e3cf8a39204be3a724f72c5487 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:58:59 +0000 Subject: [PATCH 101/203] staging: gpib: event_ioctl_t now short Using Linux code style to replace typedef event_ioctl_t with type short. Adhering to Linux code style. Reported by checkpatch.pl WARNING: do not add new typedefs Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-18-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 6cad9e1879fa..05c3ebf027a3 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1951,7 +1951,7 @@ int pop_gpib_event(struct gpib_board *board, struct gpib_event_queue *queue, sho static int event_ioctl(struct gpib_board *board, unsigned long arg) { - event_ioctl_t user_event; + short user_event; int retval; short event; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index eea169a0ba40..e9baa6724fb4 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -107,7 +107,6 @@ struct gpib_select_device_path_ioctl { char device_path[0x1000]; }; -typedef short event_ioctl_t; typedef int rsc_ioctl_t; typedef unsigned int t1_delay_ioctl_t; typedef short autospoll_ioctl_t; @@ -152,7 +151,7 @@ enum gpib_ioctl { IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, int), IBSELECT_PCI = _IOWR(GPIB_CODE, 32, struct gpib_select_pci_ioctl), - IBEVENT = _IOR(GPIB_CODE, 33, event_ioctl_t), + IBEVENT = _IOR(GPIB_CODE, 33, short), IBRSC = _IOW(GPIB_CODE, 34, rsc_ioctl_t), IB_T1_DELAY = _IOW(GPIB_CODE, 35, t1_delay_ioctl_t), IBLOC = _IO(GPIB_CODE, 36), From 6856bb17cf6fe0007f66c61280def9c00db71869 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:59:00 +0000 Subject: [PATCH 102/203] staging: gpib: rsc_ioctl_t now int Using Linux code style to replace typedef rsc_ioctl_t with type int. Adhering to Linux code style. Reported by checkpatch.pl WARNING: do not add new typedefs Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-19-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 05c3ebf027a3..41f4015babf7 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1970,7 +1970,7 @@ static int event_ioctl(struct gpib_board *board, unsigned long arg) static int request_system_control_ioctl(struct gpib_board *board, unsigned long arg) { - rsc_ioctl_t request_control; + int request_control; int retval; retval = copy_from_user(&request_control, (void __user *)arg, sizeof(request_control)); diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index e9baa6724fb4..c3d82b627210 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -107,7 +107,6 @@ struct gpib_select_device_path_ioctl { char device_path[0x1000]; }; -typedef int rsc_ioctl_t; typedef unsigned int t1_delay_ioctl_t; typedef short autospoll_ioctl_t; typedef short local_ppoll_mode_ioctl_t; @@ -152,7 +151,7 @@ enum gpib_ioctl { IBQUERY_BOARD_RSV = _IOR(GPIB_CODE, 31, int), IBSELECT_PCI = _IOWR(GPIB_CODE, 32, struct gpib_select_pci_ioctl), IBEVENT = _IOR(GPIB_CODE, 33, short), - IBRSC = _IOW(GPIB_CODE, 34, rsc_ioctl_t), + IBRSC = _IOW(GPIB_CODE, 34, int), IB_T1_DELAY = _IOW(GPIB_CODE, 35, t1_delay_ioctl_t), IBLOC = _IO(GPIB_CODE, 36), From 7c3a08ffb07e89373d6f461952d14b4c10a6fcf2 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:59:01 +0000 Subject: [PATCH 103/203] staging: gpib: t1_delay_ioctl_t now unsigned int Using Linux code style to replace typedef t1_delay_ioctl_t with type unsigned int. Adhering to Linux code style. Reported by checkpatch.pl WARNING: do not add new typedefs Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-20-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 41f4015babf7..baf530e251c9 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1984,7 +1984,7 @@ static int request_system_control_ioctl(struct gpib_board *board, unsigned long static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg) { - t1_delay_ioctl_t cmd; + unsigned int cmd; unsigned int delay; int retval; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index c3d82b627210..0403e285eed4 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -107,7 +107,6 @@ struct gpib_select_device_path_ioctl { char device_path[0x1000]; }; -typedef unsigned int t1_delay_ioctl_t; typedef short autospoll_ioctl_t; typedef short local_ppoll_mode_ioctl_t; @@ -152,7 +151,7 @@ enum gpib_ioctl { IBSELECT_PCI = _IOWR(GPIB_CODE, 32, struct gpib_select_pci_ioctl), IBEVENT = _IOR(GPIB_CODE, 33, short), IBRSC = _IOW(GPIB_CODE, 34, int), - IB_T1_DELAY = _IOW(GPIB_CODE, 35, t1_delay_ioctl_t), + IB_T1_DELAY = _IOW(GPIB_CODE, 35, unsigned int), IBLOC = _IO(GPIB_CODE, 36), IBAUTOSPOLL = _IOW(GPIB_CODE, 38, autospoll_ioctl_t), From 9979a80cf5d0d54b202d44bbb8ebf2d2f4137043 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:59:02 +0000 Subject: [PATCH 104/203] staging: gpib: autospoll_ioctl_t now short Using Linux code style to replace typedef autospoll_ioctl_t with type short. Adhering to Linux code style. Reported by checkpatch.pl WARNING: do not add new typedefs Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-21-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- drivers/staging/gpib/uapi/gpib_ioctl.h | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index baf530e251c9..f90cc8182278 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1600,7 +1600,7 @@ static int dma_ioctl(struct gpib_board_config *config, unsigned long arg) static int autospoll_ioctl(struct gpib_board *board, struct gpib_file_private *file_priv, unsigned long arg) { - autospoll_ioctl_t enable; + short enable; int retval; struct gpib_descriptor *desc; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 0403e285eed4..c66b8d59a46b 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -107,7 +107,6 @@ struct gpib_select_device_path_ioctl { char device_path[0x1000]; }; -typedef short autospoll_ioctl_t; typedef short local_ppoll_mode_ioctl_t; // update status byte and request service @@ -154,7 +153,7 @@ enum gpib_ioctl { IB_T1_DELAY = _IOW(GPIB_CODE, 35, unsigned int), IBLOC = _IO(GPIB_CODE, 36), - IBAUTOSPOLL = _IOW(GPIB_CODE, 38, autospoll_ioctl_t), + IBAUTOSPOLL = _IOW(GPIB_CODE, 38, short), IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl), IBPP2_SET = _IOW(GPIB_CODE, 40, local_ppoll_mode_ioctl_t), IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t), From 132ea5875df7c6cc35930e12d21a5c1a46d0c872 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 9 Apr 2025 05:59:03 +0000 Subject: [PATCH 105/203] staging: gpib: local_ppoll_mode_ioctl_t now short Using Linux code style to replace typedef local_ppoll_mode_ioctl_t with type short. Adhering to Linux code style. Reported by checkpatch.pl WARNING: do not add new typedefs Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250409055903.321438-22-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 4 ++-- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index f90cc8182278..4684527808f7 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1718,7 +1718,7 @@ static int ppc_ioctl(struct gpib_board *board, unsigned long arg) static int set_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned long arg) { - local_ppoll_mode_ioctl_t cmd; + short cmd; int retval; retval = copy_from_user(&cmd, (void __user *)arg, sizeof(cmd)); @@ -1735,7 +1735,7 @@ static int set_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned long ar static int get_local_ppoll_mode_ioctl(struct gpib_board *board, unsigned long arg) { - local_ppoll_mode_ioctl_t cmd; + short cmd; int retval; cmd = board->local_ppoll_mode; diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index c66b8d59a46b..e903ec1fe274 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -107,8 +107,6 @@ struct gpib_select_device_path_ioctl { char device_path[0x1000]; }; -typedef short local_ppoll_mode_ioctl_t; - // update status byte and request service struct gpib_request_service2 { uint8_t status_byte; @@ -155,8 +153,8 @@ enum gpib_ioctl { IBAUTOSPOLL = _IOW(GPIB_CODE, 38, short), IBONL = _IOW(GPIB_CODE, 39, struct gpib_online_ioctl), - IBPP2_SET = _IOW(GPIB_CODE, 40, local_ppoll_mode_ioctl_t), - IBPP2_GET = _IOR(GPIB_CODE, 41, local_ppoll_mode_ioctl_t), + IBPP2_SET = _IOW(GPIB_CODE, 40, short), + IBPP2_GET = _IOR(GPIB_CODE, 41, short), IBSELECT_DEVICE_PATH = _IOW(GPIB_CODE, 43, struct gpib_select_device_path_ioctl), // 44 was IBSELECT_SERIAL_NUMBER IBRSV2 = _IOW(GPIB_CODE, 45, struct gpib_request_service2) From 51ab134daf5b9b6be9b9c0d19f7963e971497c63 Mon Sep 17 00:00:00 2001 From: Chen Ni Date: Mon, 7 Apr 2025 11:07:43 +0800 Subject: [PATCH 106/203] staging: gpib: eastwood: Remove unnecessary print function dev_err() Function dev_err() is redundant because platform_get_irq() already prints an error. Signed-off-by: Chen Ni Link: https://lore.kernel.org/r/20250407030743.2382246-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/eastwood/fluke_gpib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c index 8e6916cd9a9f..516643657c93 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -1026,10 +1026,8 @@ static int fluke_attach_impl(struct gpib_board *board, const struct gpib_board_c } irq = platform_get_irq(fluke_gpib_pdev, 0); - if (irq < 0) { - dev_err(&fluke_gpib_pdev->dev, "failed to obtain IRQ\n"); + if (irq < 0) return -EBUSY; - } retval = request_irq(irq, fluke_gpib_interrupt, isr_flags, fluke_gpib_pdev->name, board); if (retval) { dev_err(&fluke_gpib_pdev->dev, From 1269b01cdf3fd3727af2e6b24e6eb61fc750cdb9 Mon Sep 17 00:00:00 2001 From: Chen Ni Date: Mon, 7 Apr 2025 11:11:10 +0800 Subject: [PATCH 107/203] staging: gpib: fmh_gpib: Remove unnecessary print function dev_err() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Function dev_err() is redundant because platform_get_irq() already prints an error. Signed-off-by: Chen Ni Reviewed-by: Dominik Karol PiÄ…tkowski Link: https://lore.kernel.org/r/20250407031110.2382308-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index ef2f91dcf8b6..6c122ed4152b 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -1426,10 +1426,8 @@ static int fmh_gpib_attach_impl(struct gpib_board *board, const struct gpib_boar (unsigned long)resource_size(e_priv->dma_port_res)); irq = platform_get_irq(pdev, 0); - if (irq < 0) { - dev_err(board->dev, "request for IRQ failed\n"); + if (irq < 0) return -EBUSY; - } retval = request_irq(irq, fmh_gpib_interrupt, IRQF_SHARED, pdev->name, board); if (retval) { dev_err(board->dev, From 86796b69c8c2048fe1e5745ed20e8cc7976bf0c3 Mon Sep 17 00:00:00 2001 From: Chen Ni Date: Mon, 7 Apr 2025 17:26:32 +0800 Subject: [PATCH 108/203] staging: gpib: fmh_gpib: Remove unnecessary .owner assignment Remove .owner field if calls are used which set it automatically. Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci. Signed-off-by: Chen Ni Link: https://lore.kernel.org/r/20250407092632.2952200-1-nichen@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index 6c122ed4152b..cba91f7c1239 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -1634,7 +1634,6 @@ MODULE_DEVICE_TABLE(of, fmh_gpib_of_match); static struct platform_driver fmh_gpib_platform_driver = { .driver = { .name = DRV_NAME, - .owner = THIS_MODULE, .of_match_table = fmh_gpib_of_match, }, .probe = &fmh_gpib_platform_probe From a1c7fc159583f7d30844fb774357c7cb90b09d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:21:53 -0700 Subject: [PATCH 109/203] staging: gpib: agilent_82357a: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/3ecb8bc6701ce7b3e5d098c10c2a2b75c9f155f0.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- .../staging/gpib/agilent_82357a/agilent_82357a.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index a4870d53725c..7076e9f57d69 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -524,9 +524,10 @@ static int agilent_82357a_read(struct gpib_board *board, uint8_t *buffer, size_t } kfree(in_data); - /* Fix for a bug in 9914A that does not return the contents of ADSR - * when the board is in listener active state and ATN is not asserted. - * Set ATN here to obtain a valid board level ibsta + /* + * Fix for a bug in 9914A that does not return the contents of ADSR + * when the board is in listener active state and ATN is not asserted. + * Set ATN here to obtain a valid board level ibsta */ agilent_82357a_take_control_internal(board, 0); @@ -715,9 +716,10 @@ static int agilent_82357a_take_control(struct gpib_board *board, int synchronous if (!a_priv->bus_interface) return -ENODEV; -/* It looks like the 9914 does not handle tcs properly. - * See comment above tms9914_take_control_workaround() in - * drivers/gpib/tms9914/tms9914_aux.c +/* + * It looks like the 9914 does not handle tcs properly. + * See comment above tms9914_take_control_workaround() in + * drivers/gpib/tms9914/tms9914_aux.c */ if (synchronous) return -ETIMEDOUT; From 55fae2fb503fb1345c264a451bf61dd39ebfd2d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:21:54 -0700 Subject: [PATCH 110/203] staging: gpib: cb7210: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/f4b504b59c500ed5a666422128c90340e8ff4f63.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cb7210/cb7210.c | 9 +++++---- drivers/staging/gpib/cb7210/cb7210.h | 14 ++++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c index f2163117af17..b15ffc777c39 100644 --- a/drivers/staging/gpib/cb7210/cb7210.c +++ b/drivers/staging/gpib/cb7210/cb7210.c @@ -905,7 +905,8 @@ static int cb7210_init(struct cb7210_priv *cb_priv, struct gpib_board *board) cb7210_write_byte(cb_priv, cb_priv->hs_mode_bits, HS_MODE); write_byte(nec_priv, AUX_LO_SPEED, AUXMR); - /* set clock register for maximum (20 MHz) driving frequency + /* + * set clock register for maximum (20 MHz) driving frequency * ICR should be set to clock in megahertz (1-15) and to zero * for clocks faster than 15 MHz (max 20MHz) */ @@ -1275,9 +1276,9 @@ static int cb_gpib_config(struct pcmcia_device *link) } /* gpib_config */ /* - * After a card is removed, gpib_release() will unregister the net - * device, and release the PCMCIA configuration. If the device is - * still open, this will be postponed until it is closed. + * After a card is removed, gpib_release() will unregister the net + * device, and release the PCMCIA configuration. If the device is + * still open, this will be postponed until it is closed. */ static void cb_gpib_release(struct pcmcia_device *link) diff --git a/drivers/staging/gpib/cb7210/cb7210.h b/drivers/staging/gpib/cb7210/cb7210.h index 32d8ec5991de..13f127563ab3 100644 --- a/drivers/staging/gpib/cb7210/cb7210.h +++ b/drivers/staging/gpib/cb7210/cb7210.h @@ -134,7 +134,8 @@ enum bus_status_bits { /* CBI 488.2 HS control */ -/* when both bit 0 and 1 are set, it +/* + * when both bit 0 and 1 are set, it * 1 clears the transmit state machine to an initial condition * 2 clears any residual interrupts left latched on cbi488.2 * 3 resets all control bits in HS_MODE to zero @@ -189,11 +190,12 @@ static inline unsigned int irq_bits(unsigned int irq) } enum cb7210_aux_cmds { -/* AUX_RTL2 is an undocumented aux command which causes cb7210 to assert - * (and keep asserted) local rtl message. This is used in conjunction - * with the (stupid) cb7210 implementation - * of the normal nec7210 AUX_RTL aux command, which - * causes the rtl message to toggle between on and off. +/* + * AUX_RTL2 is an undocumented aux command which causes cb7210 to assert + * (and keep asserted) local rtl message. This is used in conjunction + * with the (stupid) cb7210 implementation + * of the normal nec7210 AUX_RTL aux command, which + * causes the rtl message to toggle between on and off. */ AUX_RTL2 = 0xd, AUX_LO_SPEED = 0x40, From 79d1aa8cb7695947f95a8980fdf9df2f30731c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:21:55 -0700 Subject: [PATCH 111/203] staging: gpib: common: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/2ffeae1761ba77526e6aa7188f07d25a2f9a1950.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 47 +++++++++++++++++---------- drivers/staging/gpib/common/iblib.c | 19 +++++++---- 2 files changed, 41 insertions(+), 25 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 4684527808f7..029590f95fd3 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -122,7 +122,8 @@ int io_timed_out(struct gpib_board *board) return 0; } -/* this is a function instead of a constant because of Suse +/* + * this is a function instead of a constant because of Suse * defining HZ to be a function call to get_hz() */ static inline int pseudo_irq_period(void) @@ -294,7 +295,8 @@ int autopoll_all_devices(struct gpib_board *board) } dev_dbg(board->gpib_dev, "complete\n"); - /* need to wake wait queue in case someone is + /* + * need to wake wait queue in case someone is * waiting on RQS */ wake_up_interruptible(&board->wait); @@ -668,8 +670,9 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) retval = board_info_ioctl(board, arg); goto done; case IBMUTEX: - /* Need to unlock board->big_gpib_mutex before potentially locking board->user_mutex - * to maintain consistent locking order + /* + * Need to unlock board->big_gpib_mutex before potentially locking board->user_mutex + * to maintain consistent locking order */ mutex_unlock(&board->big_gpib_mutex); return mutex_ioctl(board, file_priv, arg); @@ -739,8 +742,9 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) retval = take_control_ioctl(board, arg); goto done; case IBCMD: - /* IO ioctls can take a long time, we need to unlock board->big_gpib_mutex - * before we call them. + /* + * IO ioctls can take a long time, we need to unlock board->big_gpib_mutex + * before we call them. */ mutex_unlock(&board->big_gpib_mutex); return command_ioctl(file_priv, board, arg); @@ -763,8 +767,9 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) retval = query_board_rsv_ioctl(board, arg); goto done; case IBRD: - /* IO ioctls can take a long time, we need to unlock board->big_gpib_mutex - * before we call them. + /* + * IO ioctls can take a long time, we need to unlock board->big_gpib_mutex + * before we call them. */ mutex_unlock(&board->big_gpib_mutex); return read_ioctl(file_priv, board, arg); @@ -793,8 +798,9 @@ long ibioctl(struct file *filep, unsigned int cmd, unsigned long arg) retval = timeout_ioctl(board, arg); goto done; case IBWRT: - /* IO ioctls can take a long time, we need to unlock board->big_gpib_mutex - * before we call them. + /* + * IO ioctls can take a long time, we need to unlock board->big_gpib_mutex + * before we call them. */ mutex_unlock(&board->big_gpib_mutex); return write_ioctl(file_priv, board, arg); @@ -918,7 +924,8 @@ static int read_ioctl(struct gpib_file_private *file_priv, struct gpib_board *bo } read_cmd.completed_transfer_count = read_cmd.requested_transfer_count - remain; read_cmd.end = end_flag; - /* suppress errors (for example due to timeout or interruption by device clear) + /* + * suppress errors (for example due to timeout or interruption by device clear) * if all bytes got sent. This prevents races that can occur in the various drivers * if a device receives a device clear immediately after a transfer completes and * the driver code wasn't careful enough to handle that case. @@ -972,10 +979,11 @@ static int command_ioctl(struct gpib_file_private *file_priv, if (!access_ok(userbuf, remain)) return -EFAULT; - /* Write buffer loads till we empty the user supplied buffer. - * Call drivers at least once, even if remain is zero, in - * order to allow them to insure previous commands were - * completely finished, in the case of a restarted ioctl. + /* + * Write buffer loads till we empty the user supplied buffer. + * Call drivers at least once, even if remain is zero, in + * order to allow them to insure previous commands were + * completely finished, in the case of a restarted ioctl. */ atomic_set(&desc->io_in_progress, 1); @@ -1073,7 +1081,8 @@ static int write_ioctl(struct gpib_file_private *file_priv, struct gpib_board *b break; } write_cmd.completed_transfer_count = write_cmd.requested_transfer_count - remain; - /* suppress errors (for example due to timeout or interruption by device clear) + /* + * suppress errors (for example due to timeout or interruption by device clear) * if all bytes got sent. This prevents races that can occur in the various drivers * if a device receives a device clear immediately after a transfer completes and * the driver code wasn't careful enough to handle that case. @@ -1121,7 +1130,8 @@ static int increment_open_device_count(struct gpib_board *board, struct list_hea struct list_head *list_ptr; struct gpib_status_queue *device; - /* first see if address has already been opened, then increment + /* + * first see if address has already been opened, then increment * open count */ for (list_ptr = head->next; list_ptr != head; list_ptr = list_ptr->next) { @@ -1247,7 +1257,8 @@ static int open_dev_ioctl(struct file *filep, struct gpib_board *board, unsigned if (retval < 0) return retval; - /* clear stuck srq state, since we may be able to find service request on + /* + * clear stuck srq state, since we may be able to find service request on * the new device */ atomic_set(&board->stuck_srq, 0); diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/common/iblib.c index 632653ea45c7..a8a215d4ffe4 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -33,9 +33,10 @@ int ibcac(struct gpib_board *board, int sync, int fallback_to_async) return 0; if (sync && (status & LACS) == 0) - /* tcs (take control synchronously) can only possibly work when - * controller is listener. Error code also needs to be -ETIMEDOUT - * or it will giveout without doing fallback. + /* + * tcs (take control synchronously) can only possibly work when + * controller is listener. Error code also needs to be -ETIMEDOUT + * or it will giveout without doing fallback. */ retval = -ETIMEDOUT; else @@ -50,7 +51,8 @@ int ibcac(struct gpib_board *board, int sync, int fallback_to_async) return retval; } -/* After ATN is asserted, it should cause any connected devices +/* + * After ATN is asserted, it should cause any connected devices * to start listening for command bytes and leave acceptor idle state. * So if ATN is asserted and neither NDAC or NRFD are asserted, * then there are no devices and ibcmd should error out immediately. @@ -218,7 +220,8 @@ int ibonline(struct gpib_board *board) board->interface->detach(board); return retval; } - /* nios2nommu on 2.6.11 uclinux kernel has weird problems + /* + * nios2nommu on 2.6.11 uclinux kernel has weird problems * with autospoll thread causing huge slowdowns */ #ifndef CONFIG_NIOS2 @@ -313,7 +316,8 @@ int ibrd(struct gpib_board *board, u8 *buf, size_t length, int *end_flag, size_t if (retval < 0) return retval; } - /* XXX resetting timer here could cause timeouts take longer than they should, + /* + * XXX resetting timer here could cause timeouts take longer than they should, * since read_ioctl calls this * function in a loop, there is probably a similar problem with writes/commands */ @@ -514,7 +518,8 @@ int general_ibstatus(struct gpib_board *board, const struct gpib_status_queue *d if (board->private_data) { status = board->interface->update_status(board, clear_mask); - /* XXX should probably stop having drivers use TIMO bit in + /* + * XXX should probably stop having drivers use TIMO bit in * board->status to avoid confusion */ status &= ~TIMO; From 073b54f342be3ea8fadcc6e416edf1e42ffe5de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:21:56 -0700 Subject: [PATCH 112/203] staging: gpib: eastwood: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/ce51b42401d7bdbcc08c8c000b69c23905856cbe.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/eastwood/fluke_gpib.c | 51 ++++++++++++++-------- drivers/staging/gpib/eastwood/fluke_gpib.h | 17 +++++--- 2 files changed, 44 insertions(+), 24 deletions(-) diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c index 516643657c93..396524901f12 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -256,7 +256,8 @@ static int lacs_or_read_ready(struct gpib_board *board) return retval; } -/* Wait until it is possible for a read to do something useful. This +/* + * 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 released pointlessly. */ static int wait_for_read(struct gpib_board *board) @@ -278,7 +279,8 @@ static int wait_for_read(struct gpib_board *board) return retval; } -/* Check if the SH state machine is in SGNS. We check twice since there is a very small chance +/* + * Check if the SH state machine is in SGNS. We check twice since there is a very small chance * we could be blowing through SGNS from SIDS to SDYS if there is already a * byte available in the handshake state machine. We are interested * in the case where the handshake is stuck in SGNS due to no byte being @@ -312,7 +314,8 @@ static int source_handshake_is_sids_or_sgns(struct fluke_priv *e_priv) (source_handshake_bits == SOURCE_HANDSHAKE_SIDS_BITS); } -/* Wait until the gpib chip is ready to accept a data out byte. +/* + * Wait until the gpib chip is ready to accept a data out byte. * If the chip is SGNS it is probably waiting for a a byte to * be written to it. */ @@ -443,7 +446,8 @@ static int fluke_dma_write(struct gpib_board *board, u8 *buffer, size_t length, if (test_bit(DMA_WRITE_IN_PROGRESS_BN, &nec_priv->state)) fluke_dma_callback(board); - /* if everything went fine, try to wait until last byte is actually + /* + * if everything went fine, try to wait until last byte is actually * transmitted across gpib (but don't try _too_ hard) */ if (retval == 0) @@ -510,7 +514,8 @@ static int fluke_accel_write(struct gpib_board *board, u8 *buffer, size_t length if (WARN_ON_ONCE(remainder != 1)) return -EFAULT; - /* wait until we are sure we will be able to write the data byte + /* + * wait until we are sure we will be able to write the data byte * into the chip before we send AUX_SEOI. This prevents a timeout * scenerio where we send AUX_SEOI but then timeout without getting * any bytes into the gpib chip. This will result in the first byte @@ -541,8 +546,10 @@ static int fluke_get_dma_residue(struct dma_chan *chan, dma_cookie_t cookie) return result; } dmaengine_tx_status(chan, cookie, &state); - // hardware doesn't support resume, so dont call this - // method unless the dma transfer is done. + /* + * hardware doesn't support resume, so dont call this + * method unless the dma transfer is done. + */ return state.residue; } @@ -610,7 +617,8 @@ static int fluke_dma_read(struct gpib_board *board, u8 *buffer, if (test_bit(DEV_CLEAR_BN, &nec_priv->state)) retval = -EINTR; - /* If we woke up because of end, wait until the dma transfer has pulled + /* + * If we woke up because of end, wait until the dma transfer has pulled * the data byte associated with the end before we cancel the dma transfer. */ if (test_bit(RECEIVED_END_BN, &nec_priv->state)) { @@ -627,7 +635,8 @@ static int fluke_dma_read(struct gpib_board *board, u8 *buffer, // stop the dma transfer nec7210_set_reg_bits(nec_priv, IMR2, HR_DMAI, 0); - /* delay a little just to make sure any bytes in dma controller's fifo get + /* + * delay a little just to make sure any bytes in dma controller's fifo get * written to memory before we disable it */ usleep_range(10, 15); @@ -643,14 +652,17 @@ static int fluke_dma_read(struct gpib_board *board, u8 *buffer, dma_unmap_single(board->dev, bus_address, length, DMA_FROM_DEVICE); memcpy(buffer, e_priv->dma_buffer, *bytes_read); - /* If we got an end interrupt, figure out if it was + /* + * If we got an end interrupt, figure out if it was * associated with the last byte we dma'd or with a * byte still sitting on the cb7210. */ spin_lock_irqsave(&board->spinlock, flags); if (test_bit(READ_READY_BN, &nec_priv->state) == 0) { - // There is no byte sitting on the cb7210. If we - // saw an end interrupt, we need to deal with it now + /* + * There is no byte sitting on the cb7210. If we + * saw an end interrupt, we need to deal with it now + */ if (test_and_clear_bit(RECEIVED_END_BN, &nec_priv->state)) *end = 1; } @@ -727,7 +739,8 @@ static gpib_interface_t fluke_unaccel_interface = { .return_to_local = fluke_return_to_local, }; -/* fluke_hybrid uses dma for writes but not for reads. Added +/* + * fluke_hybrid uses dma for writes but not for reads. Added * to deal with occasional corruption of bytes seen when doing dma * reads. From looking at the cb7210 vhdl, I believe the corruption * is due to a hardware bug triggered by the cpu reading a cb7210 @@ -916,7 +929,8 @@ static int fluke_init(struct fluke_priv *e_priv, struct gpib_board *board, int h nec7210_board_reset(nec_priv, board); write_byte(nec_priv, AUX_LO_SPEED, AUXMR); - /* set clock register for driving frequency + /* + * set clock register for driving frequency * ICR should be set to clock in megahertz (1-15) and to zero * for clocks faster than 15 MHz (max 20MHz) */ @@ -935,7 +949,8 @@ static int fluke_init(struct fluke_priv *e_priv, struct gpib_board *board, int h return 0; } -/* This function is passed to dma_request_channel() in order to +/* + * This function is passed to dma_request_channel() in order to * select the pl330 dma channel which has been hardwired to * the gpib controller. */ @@ -1042,8 +1057,10 @@ static int fluke_attach_impl(struct gpib_board *board, const struct gpib_board_c e_priv->dma_channel = dma_request_channel(dma_cap, gpib_dma_channel_filter, NULL); if (!e_priv->dma_channel) { dev_err(board->gpib_dev, "failed to allocate a dma channel.\n"); - // we don't error out here because unaccel interface will still - // work without dma + /* + * we don't error out here because unaccel interface will still + * work without dma + */ } return fluke_init(e_priv, board, handshake_mode); diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.h b/drivers/staging/gpib/eastwood/fluke_gpib.h index c721636c6eca..493c200d0bbf 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.h +++ b/drivers/staging/gpib/eastwood/fluke_gpib.h @@ -55,8 +55,10 @@ enum state1_bits { SOURCE_HANDSHAKE_MASK = 0x7 }; -// we customized the cb7210 vhdl to give the "data in" status -// on the unused bit 7 of the address0 register. +/* + * we customized the cb7210 vhdl to give the "data in" status + * on the unused bit 7 of the address0 register. + */ enum cb7210_address0 { DATA_IN_STATUS = 0x80 }; @@ -124,11 +126,12 @@ enum bus_status_bits { }; enum cb7210_aux_cmds { -/* AUX_RTL2 is an undocumented aux command which causes cb7210 to assert - * (and keep asserted) local rtl message. This is used in conjunction - * with the (stupid) cb7210 implementation - * of the normal nec7210 AUX_RTL aux command, which - * causes the rtl message to toggle between on and off. +/* + * AUX_RTL2 is an undocumented aux command which causes cb7210 to assert + * (and keep asserted) local rtl message. This is used in conjunction + * with the (stupid) cb7210 implementation + * of the normal nec7210 AUX_RTL aux command, which + * causes the rtl message to toggle between on and off. */ AUX_RTL2 = 0xd, AUX_NBAF = 0xe, // new byte available false (also clears seoi) From 6008c89dbdfc867519ee5530522a5802959cd3be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:31:37 -0700 Subject: [PATCH 113/203] staging: gpib: fmh_gpib: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/ecf59455b825f97e7866044bee1b1c149cd8e086.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 66 ++++++++++++++++-------- 1 file changed, 44 insertions(+), 22 deletions(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index cba91f7c1239..a7be878bd3e4 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -171,7 +171,8 @@ static void fmh_gpib_local_parallel_poll_mode(struct gpib_board *board, int loca if (local) { write_byte(&priv->nec7210_priv, AUX_I_REG | LOCAL_PPOLL_MODE_BIT, AUXMR); } else { - /* For fmh_gpib_core, remote parallel poll config mode is unaffected by the + /* + * For fmh_gpib_core, remote parallel poll config mode is unaffected by the * state of the disable bit of the parallel poll register (unlike the tnt4882). * So, we don't need to worry about that. */ @@ -197,7 +198,8 @@ static void fmh_gpib_serial_poll_response2(struct gpib_board *board, u8 status, } if (reqt) { - /* It may seem like a race to issue reqt before updating + /* + * It may seem like a race to issue reqt before updating * the status byte, but it is not. The chip does not * issue the reqt until the SPMR is written to at * a later time. @@ -206,7 +208,8 @@ static void fmh_gpib_serial_poll_response2(struct gpib_board *board, u8 status, } else if (reqf) { write_byte(&priv->nec7210_priv, AUX_REQF, AUXMR); } - /* We need to always zero bit 6 of the status byte before writing it to + /* + * We need to always zero bit 6 of the status byte before writing it to * the SPMR to insure we are using * serial poll mode SP1, and not accidentally triggering mode SP3. */ @@ -335,7 +338,8 @@ static int wait_for_rx_fifo_half_full_or_end(struct gpib_board *board) return retval; } -/* Wait until the gpib chip is ready to accept a data out byte. +/* + * Wait until the gpib chip is ready to accept a data out byte. */ static int wait_for_data_out_ready(struct gpib_board *board) { @@ -379,7 +383,8 @@ static void fmh_gpib_dma_callback(void *arg) spin_unlock_irqrestore(&board->spinlock, flags); } -/* returns true when all the bytes of a write have been transferred to +/* + * returns true when all the bytes of a write have been transferred to * the chip and successfully transferred out over the gpib bus. */ static int fmh_gpib_all_bytes_are_sent(struct fmh_priv *e_priv) @@ -525,7 +530,8 @@ static int fmh_gpib_accel_write(struct gpib_board *board, u8 *buffer, if (WARN_ON_ONCE(remainder != 1)) return -EFAULT; - /* wait until we are sure we will be able to write the data byte + /* + * wait until we are sure we will be able to write the data byte * into the chip before we send AUX_SEOI. This prevents a timeout * scenario where we send AUX_SEOI but then timeout without getting * any bytes into the gpib chip. This will result in the first byte @@ -556,8 +562,10 @@ static int fmh_gpib_get_dma_residue(struct dma_chan *chan, dma_cookie_t cookie) return result; } dmaengine_tx_status(chan, cookie, &state); - // dma330 hardware doesn't support resume, so dont call this - // method unless the dma transfer is done. + /* + * dma330 hardware doesn't support resume, so dont call this + * method unless the dma transfer is done. + */ return state.residue; } @@ -583,7 +591,8 @@ static int wait_for_tx_fifo_half_empty(struct gpib_board *board) return retval; } -/* supports writing a chunk of data whose length must fit into the hardware'd xfer counter, +/* + * supports writing a chunk of data whose length must fit into the hardware'd xfer counter, * called in a loop by fmh_gpib_fifo_write() */ static int fmh_gpib_fifo_write_countable(struct gpib_board *board, u8 *buffer, @@ -770,8 +779,10 @@ static int fmh_gpib_dma_read(struct gpib_board *board, u8 *buffer, // stop the dma transfer nec7210_set_reg_bits(nec_priv, IMR2, HR_DMAI, 0); fifos_write(e_priv, 0, FIFO_CONTROL_STATUS_REG); - // give time for pl330 to transfer any in-flight data, since - // pl330 will throw it away when dmaengine_pause is called. + /* + * give time for pl330 to transfer any in-flight data, since + * pl330 will throw it away when dmaengine_pause is called. + */ usleep_range(10, 15); residue = fmh_gpib_get_dma_residue(e_priv->dma_channel, dma_cookie); if (WARN_ON_ONCE(residue > length || residue < 0)) @@ -795,14 +806,17 @@ static int fmh_gpib_dma_read(struct gpib_board *board, u8 *buffer, buffer[(*bytes_read)++] = fifos_read(e_priv, FIFO_DATA_REG) & fifo_data_mask; } - /* If we got an end interrupt, figure out if it was + /* + * If we got an end interrupt, figure out if it was * associated with the last byte we dma'd or with a * byte still sitting on the cb7210. */ spin_lock_irqsave(&board->spinlock, flags); if (*bytes_read > 0 && test_bit(READ_READY_BN, &nec_priv->state) == 0) { - // If there is no byte sitting on the cb7210 and we - // saw an end, we need to deal with it now + /* + * If there is no byte sitting on the cb7210 and we + * saw an end, we need to deal with it now + */ if (test_and_clear_bit(RECEIVED_END_BN, &nec_priv->state)) *end = 1; } @@ -821,7 +835,8 @@ static void fmh_gpib_release_rfd_holdoff(struct gpib_board *board, struct fmh_pr ext_status_1 = read_byte(nec_priv, EXT_STATUS_1_REG); - /* if there is an end byte sitting on the chip, don't release + /* + * if there is an end byte sitting on the chip, don't release * holdoff. We want it left set after we read out the end * byte. */ @@ -830,7 +845,8 @@ static void fmh_gpib_release_rfd_holdoff(struct gpib_board *board, struct fmh_pr if (ext_status_1 & RFD_HOLDOFF_STATUS_BIT) write_byte(nec_priv, AUX_FH, AUXMR); - /* Check if an end byte raced in before we executed the AUX_FH command. + /* + * Check if an end byte raced in before we executed the AUX_FH command. * If it did, we want to make sure the rfd holdoff is in effect. The end * byte can arrive since * AUX_RFD_HOLDOFF_ASAP doesn't immediately force the acceptor handshake @@ -895,7 +911,8 @@ static int fmh_gpib_accel_read(struct gpib_board *board, u8 *buffer, size_t leng return retval; } -/* Read a chunk of data whose length is within the limits of the hardware's +/* + * 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(struct gpib_board *board, u8 *buffer, @@ -971,7 +988,8 @@ static int fmh_gpib_fifo_read(struct gpib_board *board, u8 *buffer, size_t lengt *end = 0; *bytes_read = 0; - /* Do a little prep with data in interrupt so that following wait_for_read() + /* + * Do a little prep with data in interrupt so that following wait_for_read() * will wake up if a data byte is received. */ nec7210_set_reg_bits(nec_priv, IMR1, HR_DIIE, HR_DIIE); @@ -1168,7 +1186,8 @@ irqreturn_t fmh_gpib_internal_interrupt(struct gpib_board *board) clear_bit(RFD_HOLDOFF_BN, &nec_priv->state); if (ext_status_1 & END_STATUS_BIT) { - /* only set RECEIVED_END while there is still a data + /* + * only set RECEIVED_END while there is still a data * byte sitting in the chip, to avoid spuriously * setting it multiple times after it has been cleared * during a read. @@ -1181,7 +1200,8 @@ irqreturn_t fmh_gpib_internal_interrupt(struct gpib_board *board) if ((fifo_status & TX_FIFO_HALF_EMPTY_INTERRUPT_IS_ENABLED) && (fifo_status & TX_FIFO_HALF_EMPTY)) { - /* We really only want to clear the + /* + * We really only want to clear the * TX_FIFO_HALF_EMPTY_INTERRUPT_ENABLE bit in the * FIFO_CONTROL_STATUS_REG. Since we are not being * careful, this also has a side effect of disabling @@ -1195,7 +1215,8 @@ irqreturn_t fmh_gpib_internal_interrupt(struct gpib_board *board) if ((fifo_status & RX_FIFO_HALF_FULL_INTERRUPT_IS_ENABLED) && (fifo_status & RX_FIFO_HALF_FULL)) { - /* We really only want to clear the + /* + * We really only want to clear the * RX_FIFO_HALF_FULL_INTERRUPT_ENABLE bit in the * FIFO_CONTROL_STATUS_REG. Since we are not being * careful, this also has a side effect of disabling @@ -1444,7 +1465,8 @@ static int fmh_gpib_attach_impl(struct gpib_board *board, const struct gpib_boar return -EIO; } } - /* in the future we might want to know the half-fifo size + /* + * in the future we might want to know the half-fifo size * (dma_burst_length) even when not using dma, so go ahead an * initialize it unconditionally. */ From c35371bc08e81a1900e3e085675bc5e75f0d28b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:34:25 -0700 Subject: [PATCH 114/203] staging: gpib: gpio: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/44c064ed914fef384800e94ac99d00af5ff5f13b.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 7d25ad5c18ca..87622ee841c7 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -32,7 +32,8 @@ #define ENABLE_IRQ(IRQ, TYPE) irq_set_irq_type(IRQ, TYPE) #define DISABLE_IRQ(IRQ) irq_set_irq_type(IRQ, IRQ_TYPE_NONE) -/* Debug print levels: +/* + * Debug print levels: * 0 = load/unload info and errors that make the driver fail; * 1 = + warnings for unforeseen events that may break the current * operation and lead to a timeout, but do not affect the @@ -1256,7 +1257,8 @@ static int bb_attach(struct gpib_board *board, const struct gpib_board_config *c if (allocate_gpios(board)) goto bb_attach_fail; -/* Configure SN7516X control lines. +/* + * Configure SN7516X control lines. * drive ATN, IFC and REN as outputs only when master * i.e. system controller. In this mode can only be the CIC * When not master then enable device mode ATN, IFC & REN as inputs From 3381060f5ad96cc3aacdea7cd599d80c7a6755eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:37:25 -0700 Subject: [PATCH 115/203] staging: gpib: hp_82335: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/cf973e61d37b0509605e49b963f2dae4887efd4a.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82335/hp82335.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c index 4ec15ae4c7f4..319b7f6e35ec 100644 --- a/drivers/staging/gpib/hp_82335/hp82335.c +++ b/drivers/staging/gpib/hp_82335/hp82335.c @@ -4,8 +4,9 @@ * copyright : (C) 2002 by Frank Mori Hess * ***************************************************************************/ -/*should enable ATN interrupts (and update board->status on occurrence), - * implement recovery from bus errors (if necessary) +/* + * should enable ATN interrupts (and update board->status on occurrence), + * implement recovery from bus errors (if necessary) */ #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt From c899f4586b1f8c8c3b3b9ae403d7b9bc4d888da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:42:14 -0700 Subject: [PATCH 116/203] staging: gpib: hp_82341: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/5bc4da465b2df932b7cb7783012786a7220a2e2a.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82341/hp_82341.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpib/hp_82341/hp_82341.c index a0412c9143b5..5ca0bd2f1a08 100644 --- a/drivers/staging/gpib/hp_82341/hp_82341.c +++ b/drivers/staging/gpib/hp_82341/hp_82341.c @@ -51,11 +51,12 @@ static int hp_82341_accel_read(struct gpib_board *board, uint8_t *buffer, size_t return 0; //disable fifo for the moment outb(DIRECTION_GPIB_TO_HOST_BIT, hp_priv->iobase[3] + BUFFER_CONTROL_REG); - // Handle corner case of board not in holdoff and one byte has slipped in already. - // Also, board sometimes has problems (spurious 1 byte reads) when read fifo is - // started up with board in - // TACS under certain data holdoff conditions. Doing a 1 byte tms9914-style - // read avoids these problems. + /* + * Handle corner case of board not in holdoff and one byte has slipped in already. + * Also, board sometimes has problems (spurious 1 byte reads) when read fifo is + * started up with board in TACS under certain data holdoff conditions. + * Doing a 1 byte tms9914-style read avoids these problems. + */ if (/*tms_priv->holdoff_active == 0 && */length > 1) { size_t num_bytes; From 2de3fa2c3f4e25b1d7feb567e108a255d8d6b5c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:47:18 -0700 Subject: [PATCH 117/203] staging: gpib: ines: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/69a082f18148881a673e1d57b4a9d83767d87a2a.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines_gpib.c | 86 ++++++++++++++------------- 1 file changed, 44 insertions(+), 42 deletions(-) diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index ef545bbaae42..2d98c571a4b1 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -990,12 +990,13 @@ static struct pci_driver ines_pci_driver = { static const int ines_pcmcia_iosize = 0x20; -/* The event() function is this driver's Card Services event handler. - * It will be called by Card Services when an appropriate card status - * event is received. The config() and release() entry points are - * used to configure or release a socket, in response to card insertion - * and ejection events. They are invoked from the gpib event - * handler. +/* + * The event() function is this driver's Card Services event handler. + * It will be called by Card Services when an appropriate card status + * event is received. The config() and release() entry points are + * used to configure or release a socket, in response to card insertion + * and ejection events. They are invoked from the gpib event + * handler. */ static int ines_gpib_config(struct pcmcia_device *link); @@ -1008,31 +1009,31 @@ static irqreturn_t ines_pcmcia_interrupt(int irq, void *arg); 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 - * by one dev_link_t structure (defined in ds.h). + * PCMCIA card corresponds to one device instance, and is described + * by one dev_link_t structure (defined in ds.h). * - * You may not want to use a linked list for this -- for example, the - * memory card driver uses an array of dev_link_t pointers, where minor - * device numbers are used to derive the corresponding array index. + * You may not want to use a linked list for this -- for example, the + * memory card driver uses an array of dev_link_t pointers, where minor + * device numbers are used to derive the corresponding array index. */ static struct pcmcia_device *curr_dev; /* - * A dev_link_t structure has fields for most things that are needed - * to keep track of a socket, but there will usually be some device - * specific information that also needs to be kept track of. The - * 'priv' pointer in a dev_link_t structure can be used to point to - * a device-specific private data structure, like this. + * A dev_link_t structure has fields for most things that are needed + * to keep track of a socket, but there will usually be some device + * specific information that also needs to be kept track of. The + * 'priv' pointer in a dev_link_t structure can be used to point to + * a device-specific private data structure, like this. * - * A driver needs to provide a dev_node_t structure for each device - * on a card. In some cases, there is only one device per card (for - * example, ethernet cards, modems). In other cases, there may be - * many actual or logical devices (SCSI adapters, memory cards with - * multiple partitions). The dev_node_t structures need to be kept - * in a linked list starting at the 'dev' field of a dev_link_t - * structure. We allocate them in the card's private data structure, - * because they generally can't be allocated dynamically. + * A driver needs to provide a dev_node_t structure for each device + * on a card. In some cases, there is only one device per card (for + * example, ethernet cards, modems). In other cases, there may be + * many actual or logical devices (SCSI adapters, memory cards with + * multiple partitions). The dev_node_t structures need to be kept + * in a linked list starting at the 'dev' field of a dev_link_t + * structure. We allocate them in the card's private data structure, + * because they generally can't be allocated dynamically. */ struct local_info { @@ -1043,13 +1044,13 @@ struct local_info { }; /* - * gpib_attach() creates an "instance" of the driver, allocating - * local data structures for one device. The device is registered - * with Card Services. + * gpib_attach() creates an "instance" of the driver, allocating + * local data structures for one device. The device is registered + * with Card Services. * - * The dev_link structure is initialized, but we don't actually - * configure the card at this point -- we wait until we receive a - * card insertion event. + * The dev_link structure is initialized, but we don't actually + * configure the card at this point -- we wait until we receive a + * card insertion event. */ static int ines_gpib_probe(struct pcmcia_device *link) { @@ -1080,10 +1081,10 @@ static int ines_gpib_probe(struct pcmcia_device *link) } /* - * This deletes a driver "instance". The device is de-registered - * with Card Services. If it has been released, all local data - * structures are freed. Otherwise, the structures will be freed - * when the device is released. + * This deletes a driver "instance". The device is de-registered + * with Card Services. If it has been released, all local data + * structures are freed. Otherwise, the structures will be freed + * when the device is released. */ static void ines_gpib_remove(struct pcmcia_device *link) { @@ -1104,9 +1105,9 @@ static int ines_gpib_config_iteration(struct pcmcia_device *link, void *priv_dat } /* - * gpib_config() is scheduled to run after a CARD_INSERTION event - * is received, to configure the PCMCIA socket, and to make the - * device available to the system. + * gpib_config() is scheduled to run after a CARD_INSERTION event + * is received, to configure the PCMCIA socket, and to make the + * device available to the system. */ static int ines_gpib_config(struct pcmcia_device *link) { @@ -1126,8 +1127,9 @@ static int ines_gpib_config(struct pcmcia_device *link) dev_dbg(&link->dev, "ines_cs: manufacturer: 0x%x card: 0x%x\n", link->manf_id, link->card_id); - /* for the ines card we have to setup the configuration registers in - * attribute memory here + /* + * for the ines card we have to setup the configuration registers in + * attribute memory here */ link->resource[2]->flags |= WIN_MEMORY_TYPE_AM | WIN_DATA_WIDTH_8 | WIN_ENABLE; link->resource[2]->end = 0x1000; @@ -1160,9 +1162,9 @@ static int ines_gpib_config(struct pcmcia_device *link) } /* gpib_config */ /* - * After a card is removed, gpib_release() will unregister the net - * device, and release the PCMCIA configuration. If the device is - * still open, this will be postponed until it is closed. + * After a card is removed, gpib_release() will unregister the net + * device, and release the PCMCIA configuration. If the device is + * still open, this will be postponed until it is closed. */ static void ines_gpib_release(struct pcmcia_device *link) From 9c77850d9d7bee41a30824ea916ac892c45f5944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:48:35 -0700 Subject: [PATCH 118/203] staging: gpib: lpvo_usb_gpib: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/7699226216a99b8bf053c4d6017941ebc87cb8e2.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 123 +++++++++--------- 1 file changed, 64 insertions(+), 59 deletions(-) diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 267019bc866f..47f56fea28a6 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -36,16 +36,16 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for LPVO usb devices"); /* - * Table of devices that work with this driver. + * Table of devices that work with this driver. * - * Currently, only one device is known to be used in the - * lpvo_usb_gpib adapter (FTDI 0403:6001). - * If your adapter uses a different chip, insert a line - * in the following table with proper , . + * Currently, only one device is known to be used in the + * lpvo_usb_gpib adapter (FTDI 0403:6001). + * If your adapter uses a different chip, insert a line + * in the following table with proper , . * - * To have your chip automatically handled by the driver, - * update files "/usr/local/etc/modprobe.d/lpvo_usb_gpib.conf" - * and /usr/local/etc/udev/rules.d/99-lpvo_usb_gpib.rules. + * To have your chip automatically handled by the driver, + * update files "/usr/local/etc/modprobe.d/lpvo_usb_gpib.conf" + * and /usr/local/etc/udev/rules.d/99-lpvo_usb_gpib.rules. * */ @@ -56,18 +56,18 @@ static const struct usb_device_id skel_table[] = { MODULE_DEVICE_TABLE(usb, skel_table); /* - * *** Diagnostics and Debug *** - * To enable the diagnostic and debug messages either compile with DEBUG set - * or control via the dynamic debug mechanisms. - * The module parameter "debug" controls the sending of debug messages to - * syslog. By default it is set to 0 - * debug = 0: only attach/detach messages are sent - * 1: every action is logged - * 2: extended logging; each single exchanged byte is documented - * (about twice the log volume of [1]) - * To switch debug level: - * At module loading: modprobe lpvo_usb_gpib debug={0,1,2} - * On the fly: echo {0,1,2} > /sys/modules/lpvo_usb_gpib/parameters/debug + * *** Diagnostics and Debug *** + * To enable the diagnostic and debug messages either compile with DEBUG set + * or control via the dynamic debug mechanisms. + * The module parameter "debug" controls the sending of debug messages to + * syslog. By default it is set to 0 + * debug = 0: only attach/detach messages are sent + * 1: every action is logged + * 2: extended logging; each single exchanged byte is documented + * (about twice the log volume of [1]) + * To switch debug level: + * At module loading: modprobe lpvo_usb_gpib debug={0,1,2} + * On the fly: echo {0,1,2} > /sys/modules/lpvo_usb_gpib/parameters/debug */ static int debug; @@ -169,10 +169,10 @@ static void show_status(struct gpib_board *board) } /* - * GLOBAL VARIABLES: required for - * pairing among gpib minor and usb minor. - * MAX_DEV is the max number of usb-gpib adapters; free - * to change as you like, but no more than 32 + * GLOBAL VARIABLES: required for + * pairing among gpib minor and usb minor. + * MAX_DEV is the max number of usb-gpib adapters; free + * to change as you like, but no more than 32 */ #define MAX_DEV 8 @@ -182,7 +182,7 @@ static int assigned_usb_minors; /* mask of filled slots */ static struct mutex minors_lock; /* operations on usb_minors are to be protected */ /* - * usb-skeleton prototypes + * usb-skeleton prototypes */ struct usb_skel; @@ -192,7 +192,7 @@ static int skel_do_open(struct gpib_board *, int); static int skel_do_release(struct gpib_board *); /* - * usec_diff : take difference in MICROsec between two 'timespec' + * usec_diff : take difference in MICROsec between two 'timespec' * (unix time in sec and NANOsec) */ @@ -203,7 +203,7 @@ static inline int usec_diff(struct timespec64 *a, struct timespec64 *b) } /* - * *** these routines are specific to the usb-gpib adapter *** + * *** these routines are specific to the usb-gpib adapter *** */ /** @@ -262,13 +262,11 @@ static int send_command(struct gpib_board *board, char *msg, int leng) } /* - * * set_control_line() - Set the value of a single gpib control line * * @board: the gpib_board_struct data area for this gpib interface * @line: line mask * @value: line new value (0/1) - * */ static int set_control_line(struct gpib_board *board, int line, int value) @@ -368,7 +366,7 @@ static void set_timeout(struct gpib_board *board) } /* - * now the standard interface functions - attach and detach + * now the standard interface functions - attach and detach */ /** @@ -464,7 +462,8 @@ static int usb_gpib_attach(struct gpib_board *board, const struct gpib_board_con if (retval != ACK) return -EIO; - /* We must setup debug mode because we need the extended instruction + /* + * We must setup debug mode because we need the extended instruction * set to cope with the Core (gpib_common) point of view */ @@ -473,7 +472,8 @@ static int usb_gpib_attach(struct gpib_board *board, const struct gpib_board_con if (retval != ACK) return -EIO; - /* We must keep REN off after an IFC because so it is + /* + * We must keep REN off after an IFC because so it is * assumed by the Core */ @@ -654,7 +654,8 @@ static int usb_gpib_line_status(const struct gpib_board *board) DIA_LOG(1, "%s\n", "request"); - /* if we are on the wait queue (board->wait), do not hurry + /* + * if we are on the wait queue (board->wait), do not hurry * reading status line; instead, pause a little */ @@ -707,7 +708,8 @@ static int usb_gpib_line_status(const struct gpib_board *board) static int usb_gpib_parallel_poll(struct gpib_board *board, uint8_t *result) { - /* request parallel poll asserting ATN | EOI; + /* + * request parallel poll asserting ATN | EOI; * we suppose ATN already asserted */ @@ -1083,13 +1085,13 @@ static gpib_interface_t usb_gpib_interface = { }; /* - * usb_gpib_init_module(), usb_gpib_exit_module() + * usb_gpib_init_module(), usb_gpib_exit_module() * - * This functions are called every time a new device is detected - * and registered or is removed and unregistered. - * We must take note of created and destroyed usb minors to be used - * when usb_gpib_attach() and usb_gpib_detach() will be called on - * request by gpib_config. + * This functions are called every time a new device is detected + * and registered or is removed and unregistered. + * We must take note of created and destroyed usb minors to be used + * when usb_gpib_attach() and usb_gpib_detach() will be called on + * request by gpib_config. */ static int usb_gpib_init_module(struct usb_interface *interface) @@ -1107,8 +1109,9 @@ static int usb_gpib_init_module(struct usb_interface *interface) goto exit; } } else { - /* check if minor is already registered - maybe useless, but if - * it happens the code is inconsistent somewhere + /* + * check if minor is already registered - maybe useless, but if + * it happens the code is inconsistent somewhere */ for (j = 0 ; j < MAX_DEV ; j++) { @@ -1162,12 +1165,11 @@ static void usb_gpib_exit_module(int minor) } /* - * Default latency time (16 msec) is too long. - * We must use 1 msec (best); anyhow, no more than 5 msec. - * - * Defines and function taken and modified from the kernel tree - * (see ftdi_sio.h and ftdi_sio.c). + * Default latency time (16 msec) is too long. + * We must use 1 msec (best); anyhow, no more than 5 msec. * + * Defines and function taken and modified from the kernel tree + * (see ftdi_sio.h and ftdi_sio.c). */ #define FTDI_SIO_SET_LATENCY_TIMER 9 /* Set the latency timer */ @@ -1235,7 +1237,8 @@ static int write_latency_timer(struct usb_device *udev) /* private defines */ #define MAX_TRANSFER (PAGE_SIZE - 512) -/* MAX_TRANSFER is chosen so that the VM is not stressed by +/* + * MAX_TRANSFER is chosen so that the VM is not stressed by * allocations > PAGE_SIZE and the number of packets in a page * is an integer 512 is the largest possible packet on EHCI */ @@ -1280,7 +1283,7 @@ static void skel_delete(struct kref *kref) } /* - * skel_do_open() - to be called by usb_gpib_attach + * skel_do_open() - to be called by usb_gpib_attach */ static int skel_do_open(struct gpib_board *board, int subminor) @@ -1317,7 +1320,7 @@ static int skel_do_open(struct gpib_board *board, int subminor) } /* - * skel_do_release() - to be called by usb_gpib_detach + * skel_do_release() - to be called by usb_gpib_detach */ static int skel_do_release(struct gpib_board *board) @@ -1340,7 +1343,7 @@ static int skel_do_release(struct gpib_board *board) } /* - * read functions + * read functions */ static void skel_read_bulk_callback(struct urb *urb) @@ -1405,7 +1408,7 @@ static int skel_do_read_io(struct usb_skel *dev, size_t count) } /* - * skel_do_read() - read operations from lpvo_usb_gpib + * skel_do_read() - read operations from lpvo_usb_gpib */ static ssize_t skel_do_read(struct usb_skel *dev, char *buffer, size_t count) @@ -1482,7 +1485,8 @@ static ssize_t skel_do_read(struct usb_skel *dev, char *buffer, size_t count) * all data has been used * actual IO needs to be done */ - /* it seems that requests for less than dev->bulk_in_size + /* + * it seems that requests for less than dev->bulk_in_size * are not accepted */ rv = skel_do_read_io(dev, dev->bulk_in_size); @@ -1496,7 +1500,8 @@ static ssize_t skel_do_read(struct usb_skel *dev, char *buffer, size_t count) * data is available - chunk tells us how much shall be copied */ - /* Condition dev->bulk_in_copied > 0 maybe will never happen. In case, + /* + * Condition dev->bulk_in_copied > 0 maybe will never happen. In case, * signal the event and copy using the original procedure, i.e., copy * first two bytes also */ @@ -1551,7 +1556,7 @@ static ssize_t skel_do_read(struct usb_skel *dev, char *buffer, size_t count) } /* - * write functions + * write functions */ static void skel_write_bulk_callback(struct urb *urb) @@ -1581,7 +1586,7 @@ static void skel_write_bulk_callback(struct urb *urb) } /* - * skel_do_write() - write operations from lpvo_usb_gpib + * skel_do_write() - write operations from lpvo_usb_gpib */ static ssize_t skel_do_write(struct usb_skel *dev, const char *buffer, size_t count) @@ -1686,7 +1691,7 @@ static ssize_t skel_do_write(struct usb_skel *dev, const char *buffer, size_t co } /* - * services for the user space devices + * services for the user space devices */ #if USER_DEVICE /* conditional compilation of user space device */ @@ -1771,7 +1776,7 @@ static int skel_release(struct inode *inode, struct file *file) } /* - * user space access to read function + * user space access to read function */ static ssize_t skel_read(struct file *file, char __user *buffer, size_t count, @@ -1800,7 +1805,7 @@ static ssize_t skel_read(struct file *file, char __user *buffer, size_t count, } /* - * user space access to write function + * user space access to write function */ static ssize_t skel_write(struct file *file, const char __user *user_buffer, From b5c0bd6b6c4feda1715e756e2bbb58a4f3cee55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Fri, 11 Apr 2025 23:49:26 -0700 Subject: [PATCH 119/203] staging: gpib: nec7210: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/2bdfadb59d11441d10c8e3994de49b876f8e7efe.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/nec7210/nec7210.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/nec7210/nec7210.c index 2998ed0ea528..e68361d213ee 100644 --- a/drivers/staging/gpib/nec7210/nec7210.c +++ b/drivers/staging/gpib/nec7210/nec7210.c @@ -79,7 +79,8 @@ void nec7210_parallel_poll_response(struct gpib_board *board, struct nec7210_pri write_byte(priv, AUX_CPPF, AUXMR); } EXPORT_SYMBOL(nec7210_parallel_poll_response); -/* This is really only adequate for chips that do a 488.2 style reqt/reqf +/* + * This is really only adequate for chips that do a 488.2 style reqt/reqf * based on bit 6 of the SPMR (see chapter 11.3.3 of 488.2). For simpler chips that simply * set rsv directly based on bit 6, we either need to do more hardware setup to expose * the 488.2 capability (for example with NI chips), or we need to implement the @@ -202,7 +203,8 @@ unsigned int nec7210_update_status_nolock(struct gpib_board *board, struct nec72 set_bit(SPOLL_NUM, &board->status); } - /* we rely on the interrupt handler to set the + /* + * we rely on the interrupt handler to set the * rest of the status bits */ @@ -482,7 +484,8 @@ static int pio_read(struct gpib_board *board, struct nec7210_priv *priv, u8 *buf } if (test_bit(READ_READY_BN, &priv->state)) { if (*bytes_read == 0) { - /* We set the handshake mode here because we know + /* + * We set the handshake mode here because we know * no new bytes will arrive (it has already arrived * and is awaiting being read out of the chip) while we are changing * modes. This ensures we can reliably keep track @@ -662,7 +665,8 @@ static int pio_write(struct gpib_board *board, struct nec7210_priv *priv, u8 *bu if (retval == -EIO) { /* resend last byte on bus error */ *bytes_written = last_count; - /* we can get unrecoverable bus errors, + /* + * we can get unrecoverable bus errors, * so give up after a while */ bus_error_count++; @@ -805,7 +809,8 @@ int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, if (send_eoi) { size_t num_bytes; - /* We need to wait to make sure we will immediately be able to write the data byte + /* + * We need to wait to make sure we will immediately be able to write the data byte * into the chip before sending the associated AUX_SEOI command. This is really * only needed for length==1 since otherwise the earlier calls to pio_write * will have dont the wait already. @@ -827,7 +832,7 @@ int nec7210_write(struct gpib_board *board, struct nec7210_priv *priv, EXPORT_SYMBOL(nec7210_write); /* - * interrupt service routine + * interrupt service routine */ irqreturn_t nec7210_interrupt(struct gpib_board *board, struct nec7210_priv *priv) { @@ -1021,7 +1026,8 @@ EXPORT_SYMBOL(nec7210_ioport_read_byte); void nec7210_ioport_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num) { if (register_num == AUXMR) - /* locking makes absolutely sure noone accesses the + /* + * locking makes absolutely sure noone accesses the * AUXMR register faster than once per microsecond */ nec7210_locking_ioport_write_byte(priv, data, register_num); @@ -1066,7 +1072,8 @@ EXPORT_SYMBOL(nec7210_iomem_read_byte); void nec7210_iomem_write_byte(struct nec7210_priv *priv, u8 data, unsigned int register_num) { if (register_num == AUXMR) - /* locking makes absolutely sure noone accesses the + /* + * locking makes absolutely sure noone accesses the * AUXMR register faster than once per microsecond */ nec7210_locking_iomem_write_byte(priv, data, register_num); From c22fc80984c8da0da165fbbe2c8d6de1a2e52756 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Sat, 12 Apr 2025 00:07:54 -0700 Subject: [PATCH 120/203] staging: gpib: ni_usb: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/4b2762d349e06db8f541a86ca0ec429bc1351097.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 40 +++++++++++++++-------- drivers/staging/gpib/ni_usb/ni_usb_gpib.h | 32 +++++++++++------- 2 files changed, 47 insertions(+), 25 deletions(-) diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c index f0b64ef1f44c..00f788a59dcc 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -74,7 +74,8 @@ static unsigned short ni_usb_timeout_code(unsigned int usec) return 0xff; else if (usec <= 300000000) return 0x01; - /* NI driver actually uses 0xff for timeout T1000s, which is a bug in their code. + /* + * NI driver actually uses 0xff for timeout T1000s, which is a bug in their code. * I've verified on a usb-b that a code of 0x2 is correct for a 1000 sec timeout */ else if (usec <= 1000000000) @@ -232,7 +233,8 @@ static int ni_usb_nonblocking_receive_bulk_msg(struct ni_usb_priv *ni_priv, mutex_unlock(&ni_priv->bulk_transfer_lock); if (interruptible) { if (wait_for_completion_interruptible(&context->complete)) { - /* If we got interrupted by a signal while + /* + * If we got interrupted by a signal while * waiting for the usb gpib to respond, we * should send a stop command so it will * finish up with whatever it was doing and @@ -240,8 +242,9 @@ static int ni_usb_nonblocking_receive_bulk_msg(struct ni_usb_priv *ni_priv, */ ni_usb_stop(ni_priv); retval = -ERESTARTSYS; - /* now do an uninterruptible wait, it shouldn't take long - * for the board to respond now. + /* + * now do an uninterruptible wait, it shouldn't take long + * for the board to respond now. */ wait_for_completion(&context->complete); } @@ -684,7 +687,8 @@ static int ni_usb_read(struct gpib_board *board, uint8_t *buffer, size_t length, retval = 0; break; case NIUSB_ABORTED_ERROR: - /* this is expected if ni_usb_receive_bulk_msg got + /* + * this is expected if ni_usb_receive_bulk_msg got * interrupted by a signal and returned -ERESTARTSYS */ break; @@ -794,7 +798,8 @@ static int ni_usb_write(struct gpib_board *board, uint8_t *buffer, size_t length retval = 0; break; case NIUSB_ABORTED_ERROR: - /* this is expected if ni_usb_receive_bulk_msg got + /* + * this is expected if ni_usb_receive_bulk_msg got * interrupted by a signal and returned -ERESTARTSYS */ break; @@ -893,7 +898,8 @@ static int ni_usb_command_chunk(struct gpib_board *board, uint8_t *buffer, size_ case NIUSB_NO_ERROR: break; case NIUSB_ABORTED_ERROR: - /* this is expected if ni_usb_receive_bulk_msg got + /* + * this is expected if ni_usb_receive_bulk_msg got * interrupted by a signal and returned -ERESTARTSYS */ break; @@ -1192,8 +1198,9 @@ static int ni_usb_enable_eos(struct gpib_board *board, uint8_t eos_byte, int com static void ni_usb_disable_eos(struct gpib_board *board) { struct ni_usb_priv *ni_priv = board->private_data; - /* adapter gets unhappy if you don't zero all the bits - * for the eos mode and eos char (returns error 4 on reads). + /* + * adapter gets unhappy if you don't zero all the bits + * for the eos mode and eos char (returns error 4 on reads). */ ni_priv->eos_mode = 0; ni_priv->eos_char = 0; @@ -2045,8 +2052,10 @@ static int ni_usb_hs_wait_for_ready(struct ni_usb_priv *ni_priv) unexpected = 1; } ++j; - // MC usb-488 (and sometimes NI-USB-HS?) sends 0x8 here; MC usb-488A sends 0x7 here - // NI-USB-HS+ sends 0x0 + /* + * MC usb-488 (and sometimes NI-USB-HS?) sends 0x8 here; MC usb-488A sends 0x7 here + * NI-USB-HS+ sends 0x0 + */ if (buffer[j] != 0x1 && buffer[j] != 0x8 && buffer[j] != 0x7 && buffer[j] != 0x0) { // [3] dev_err(&usb_dev->dev, "unexpected data: buffer[%i]=0x%x, expected 0x0, 0x1, 0x7 or 0x8\n", @@ -2127,7 +2136,8 @@ static int ni_usb_hs_wait_for_ready(struct ni_usb_priv *ni_priv) return retval; } -/* This does some extra init for HS+ models, as observed on Windows. One of the +/* + * This does some extra init for HS+ models, as observed on Windows. One of the * control requests causes the LED to stop blinking. * I'm not sure what the other 2 requests do. None of these requests are actually required * for the adapter to work, maybe they do some init for the analyzer interface @@ -2343,8 +2353,10 @@ static void ni_usb_detach(struct gpib_board *board) struct ni_usb_priv *ni_priv; mutex_lock(&ni_usb_hotplug_lock); -// under windows, software unplug does chip_reset nec7210 aux command, -// then writes 0x0 to address 0x10 of device 3 + /* + * under windows, software unplug does chip_reset nec7210 aux command, + * then writes 0x0 to address 0x10 of device 3 + */ ni_priv = board->private_data; if (ni_priv) { if (ni_priv->bus_interface) { diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.h b/drivers/staging/gpib/ni_usb/ni_usb_gpib.h index 4b297db09a9b..b011e131201c 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.h +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.h @@ -113,27 +113,37 @@ enum ni_usb_bulk_ids { enum ni_usb_error_codes { NIUSB_NO_ERROR = 0, - /* NIUSB_ABORTED_ERROR occurs when I/O is interrupted early by - * doing a NI_USB_STOP_REQUEST on the control endpoint. + /* + * NIUSB_ABORTED_ERROR occurs when I/O is interrupted early by + * doing a NI_USB_STOP_REQUEST on the control endpoint. */ NIUSB_ABORTED_ERROR = 1, - // NIUSB_READ_ATN_ERROR occurs when you do a board read while - // ATN is set + /* + * NIUSB_READ_ATN_ERROR occurs when you do a board read while + * ATN is set + */ NIUSB_ATN_STATE_ERROR = 2, - // NIUSB_ADDRESSING_ERROR occurs when you do a board - // read/write as CIC but are not in LACS/TACS + /* + * NIUSB_ADDRESSING_ERROR occurs when you do a board + * read/write as CIC but are not in LACS/TACS + */ NIUSB_ADDRESSING_ERROR = 3, - /* NIUSB_EOSMODE_ERROR occurs on reads if any eos mode or char + /* + * NIUSB_EOSMODE_ERROR occurs on reads if any eos mode or char * bits are set when REOS is not set. * Have also seen error 4 if you try to send more than 16 * command bytes at once on a usb-b. */ NIUSB_EOSMODE_ERROR = 4, - // NIUSB_NO_BUS_ERROR occurs when you try to write a command - // byte but there are no devices connected to the gpib bus + /* + * NIUSB_NO_BUS_ERROR occurs when you try to write a command + * byte but there are no devices connected to the gpib bus + */ NIUSB_NO_BUS_ERROR = 5, - // NIUSB_NO_LISTENER_ERROR occurs when you do a board write as - // CIC with no listener + /* + * NIUSB_NO_LISTENER_ERROR occurs when you do a board write as + * CIC with no listener + */ NIUSB_NO_LISTENER_ERROR = 8, // get NIUSB_TIMEOUT_ERROR on board read/write timeout NIUSB_TIMEOUT_ERROR = 10, From 9c95c9d1fac80ede2d3d45eeafd16a658c514b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Sat, 12 Apr 2025 00:48:34 -0700 Subject: [PATCH 121/203] staging: gpib: pc2: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/77eb5fc5050298503009fa212600f00514eeb713.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/pc2/pc2_gpib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c index c3c4fcf091ed..ee4ea1f32dfc 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -268,8 +268,9 @@ static int pc2_generic_attach(struct gpib_board *board, const struct gpib_board_ nec_priv->type = chipset; #ifndef PC2_DMA - /* board->dev hasn't been initialized, so forget about DMA until this driver - * is adapted to use isa_register_driver. + /* + * board->dev hasn't been initialized, so forget about DMA until this driver + * is adapted to use isa_register_driver. */ if (config->ibdma) // driver needs to be adapted to use isa_register_driver to get a struct device* From d7814813ed9d61d38a76cfa70ffa09f47c5c1efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Sat, 12 Apr 2025 11:09:46 -0700 Subject: [PATCH 122/203] staging: gpib: tms9914: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/a05655260b082c94af71348f05dd2f4e586e2a03.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/tms9914/tms9914.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c index 7afd710a105c..9208c50d9c75 100644 --- a/drivers/staging/gpib/tms9914/tms9914.c +++ b/drivers/staging/gpib/tms9914/tms9914.c @@ -53,7 +53,8 @@ int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *priv, in } EXPORT_SYMBOL_GPL(tms9914_take_control); -/* The agilent 82350B has a buggy implementation of tcs which interferes with the +/* + * The agilent 82350B has a buggy implementation of tcs which interferes with the * operation of tca. It appears to be based on the controller state machine * described in the TI 9900 TMS9914A data manual published in 1982. This * manual describes tcs as putting the controller into a CWAS @@ -324,7 +325,8 @@ static void update_talker_state(struct tms9914_priv *priv, unsigned int address_ if (address_status_bits & HR_ATN) priv->talker_state = talker_addressed; else - /* this could also be serial_poll_active, but the tms9914 provides no + /* + * this could also be serial_poll_active, but the tms9914 provides no * way to distinguish, so we'll assume talker_active */ priv->talker_state = talker_active; @@ -743,7 +745,8 @@ irqreturn_t tms9914_interrupt_have_status(struct gpib_board *board, struct tms99 switch (command_byte) { case PP_CONFIG: priv->ppoll_configure_state = 1; - /* AUX_PTS generates another UNC interrupt on the next command byte + /* + * AUX_PTS generates another UNC interrupt on the next command byte * if it is in the secondary address group (such as PPE and PPD). */ write_byte(priv, AUX_PTS, AUXCR); From 1adf3edaa0ce52eed664fff9102d0f7afe57406e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Sat, 12 Apr 2025 11:10:05 -0700 Subject: [PATCH 123/203] staging: gpib: tnt4882: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/2b72df3bfc4a3f57679d2af52112e58acb5c259f.1744438358.git.paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 32 ++++++++++++--------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c index 8de0fa0ae837..da13d11c20bd 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -258,7 +258,8 @@ static void tnt4882_release_holdoff(struct gpib_board *board, struct tnt4882_pri sasr_bits = tnt_readb(tnt_priv, SASR); - /*tnt4882 not in one-chip mode won't always release holdoff unless we + /* + * tnt4882 not in one-chip mode won't always release holdoff unless we * are in the right mode when release handshake command is given */ if (sasr_bits & AEHS_BIT) /* holding off due to holdoff on end mode*/ { @@ -384,7 +385,8 @@ static int tnt4882_accel_read(struct gpib_board *board, uint8_t *buffer, size_t nec7210_set_reg_bits(nec_priv, IMR1, HR_ENDIE, 0); nec7210_set_reg_bits(nec_priv, IMR2, HR_DMAI, 0); - /* force handling of any pending interrupts (seems to be needed + /* + * force handling of any pending interrupts (seems to be needed * to keep interrupts from getting hosed, plus for syncing * with RECEIVED_END below) */ @@ -531,7 +533,8 @@ static int generic_write(struct gpib_board *board, uint8_t *buffer, size_t lengt nec7210_set_reg_bits(nec_priv, IMR1, HR_ERR, 0x0); nec7210_set_reg_bits(nec_priv, IMR2, HR_DMAO, 0x0); - /* force handling of any interrupts that happened + /* + * force handling of any interrupts that happened * while they were masked (this appears to be needed) */ tnt4882_internal_interrupt(board); @@ -760,7 +763,8 @@ static void tnt4882_parallel_poll_response(struct gpib_board *board, int ist) nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -/* this is just used by the old nec7210 isa interfaces, the newer +/* + * this is just used by the old nec7210 isa interfaces, the newer * boards use tnt4882_serial_poll_response2 */ static void tnt4882_serial_poll_response(struct gpib_board *board, uint8_t status) @@ -788,7 +792,8 @@ static void tnt4882_serial_poll_response2(struct gpib_board *board, uint8_t stat priv->nec7210_priv.srq_pending = 0; } if (reqt) - /* It may seem like a race to issue reqt before updating + /* + * It may seem like a race to issue reqt before updating * the status byte, but it is not. The chip does not * issue the reqt until the SPMR is written to at * a later time. @@ -796,7 +801,8 @@ static void tnt4882_serial_poll_response2(struct gpib_board *board, uint8_t stat write_byte(&priv->nec7210_priv, AUX_REQT, AUXMR); else if (reqf) write_byte(&priv->nec7210_priv, AUX_REQF, AUXMR); - /* We need to always zero bit 6 of the status byte before writing it to + /* + * We need to always zero bit 6 of the status byte before writing it to * the SPMR to insure we are using * serial poll mode SP1, and not accidentally triggering mode SP3. */ @@ -1581,10 +1587,10 @@ static int ni_gpib_probe(struct pcmcia_device *link) } /* - * This deletes a driver "instance". The device is de-registered - * with Card Services. If it has been released, all local data - * structures are freed. Otherwise, the structures will be freed - * when the device is released. + * This deletes a driver "instance". The device is de-registered + * with Card Services. If it has been released, all local data + * structures are freed. Otherwise, the structures will be freed + * when the device is released. */ static void ni_gpib_remove(struct pcmcia_device *link) { @@ -1611,9 +1617,9 @@ static int ni_gpib_config_iteration(struct pcmcia_device *link, void *priv_data) } /* - * ni_gpib_config() is scheduled to run after a CARD_INSERTION event - * is received, to configure the PCMCIA socket, and to make the - * device available to the system. + * ni_gpib_config() is scheduled to run after a CARD_INSERTION event + * is received, to configure the PCMCIA socket, and to make the + * device available to the system. */ static int ni_gpib_config(struct pcmcia_device *link) { From e72334b74423f08f91e02481b99eeec3fb17e08b Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:20 +0000 Subject: [PATCH 124/203] staging: gpib: gpib_ioctl: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_ioctl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index e903ec1fe274..2d2a268d8573 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -39,7 +39,7 @@ struct gpib_close_dev_ioctl { struct gpib_serial_poll_ioctl { unsigned int pad; int sad; - uint8_t status_byte; + __u8 status_byte; }; struct gpib_eos_ioctl { @@ -87,7 +87,7 @@ struct gpib_select_pci_ioctl { }; struct gpib_ppoll_config_ioctl { - uint8_t config; + __u8 config; unsigned set_ist : 1; unsigned clear_ist : 1; }; @@ -109,7 +109,7 @@ struct gpib_select_device_path_ioctl { // update status byte and request service struct gpib_request_service2 { - uint8_t status_byte; + __u8 status_byte; int new_reason_for_service; }; @@ -121,7 +121,7 @@ enum gpib_ioctl { IBOPENDEV = _IOWR(GPIB_CODE, 3, struct gpib_open_dev_ioctl), IBCLOSEDEV = _IOW(GPIB_CODE, 4, struct gpib_close_dev_ioctl), IBWAIT = _IOWR(GPIB_CODE, 5, struct gpib_wait_ioctl), - IBRPP = _IOWR(GPIB_CODE, 6, uint8_t), + IBRPP = _IOWR(GPIB_CODE, 6, __u8), IBSIC = _IOW(GPIB_CODE, 9, unsigned int), IBSRE = _IOW(GPIB_CODE, 10, int), @@ -133,7 +133,7 @@ enum gpib_ioctl { IBTMO = _IOW(GPIB_CODE, 17, unsigned int), IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl), IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl), - IBRSV = _IOW(GPIB_CODE, 20, uint8_t), + IBRSV = _IOW(GPIB_CODE, 20, __u8), CFCBASE = _IOW(GPIB_CODE, 21, uint64_t), CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int), CFCDMA = _IOW(GPIB_CODE, 23, unsigned int), From f207bc3a480060ecc99b386542d7c572234510c7 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:21 +0000 Subject: [PATCH 125/203] staging: gpib: gpib_user: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_user.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index 301083f287ad..83ddaaf81529 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -166,24 +166,24 @@ static inline unsigned int gpib_address_restrict(unsigned int addr) return addr; } -static inline uint8_t MLA(unsigned int addr) +static inline __u8 MLA(unsigned int addr) { return gpib_address_restrict(addr) | LAD; } -static inline uint8_t MTA(unsigned int addr) +static inline __u8 MTA(unsigned int addr) { return gpib_address_restrict(addr) | TAD; } -static inline uint8_t MSA(unsigned int addr) +static inline __u8 MSA(unsigned int addr) { return gpib_address_restrict(addr) | SAD; } -static inline uint8_t PPE_byte(unsigned int dio_line, int sense) +static inline __u8 PPE_byte(unsigned int dio_line, int sense) { - uint8_t cmd; + __u8 cmd; cmd = PPE; if (sense) @@ -192,7 +192,7 @@ static inline uint8_t PPE_byte(unsigned int dio_line, int sense) return cmd; } -static inline uint8_t CFGn(unsigned int meters) +static inline __u8 CFGn(unsigned int meters) { return 0x6 | (meters & 0xf); } @@ -202,37 +202,37 @@ enum { gpib_command_mask = 0x7f, }; -static inline int is_PPE(uint8_t command) +static inline int is_PPE(__u8 command) { return (command & 0x70) == 0x60; } -static inline int is_PPD(uint8_t command) +static inline int is_PPD(__u8 command) { return (command & 0x70) == 0x70; } -static inline int in_addressed_command_group(uint8_t command) +static inline int in_addressed_command_group(__u8 command) { return (command & 0x70) == 0x0; } -static inline int in_universal_command_group(uint8_t command) +static inline int in_universal_command_group(__u8 command) { return (command & 0x70) == 0x10; } -static inline int in_listen_address_group(uint8_t command) +static inline int in_listen_address_group(__u8 command) { return (command & 0x60) == 0x20; } -static inline int in_talk_address_group(uint8_t command) +static inline int in_talk_address_group(__u8 command) { return (command & 0x60) == 0x40; } -static inline int in_primary_command_group(uint8_t command) +static inline int in_primary_command_group(__u8 command) { return in_addressed_command_group(command) || in_universal_command_group(command) || From f2390e8a9cc638f1bc696f37b27012431db8e0f0 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:22 +0000 Subject: [PATCH 126/203] staging: gpib: agilent_82350b: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- .../gpib/agilent_82350b/agilent_82350b.c | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c index 97717afbb214..3e061c0b272f 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c @@ -27,10 +27,10 @@ MODULE_DESCRIPTION("GPIB driver for Agilent 82350b"); static int read_transfer_counter(struct agilent_82350b_priv *a_priv); static unsigned short read_and_clear_event_status(struct gpib_board *board); static void set_transfer_counter(struct agilent_82350b_priv *a_priv, int count); -static int agilent_82350b_write(struct gpib_board *board, uint8_t *buffer, +static int agilent_82350b_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); -static int agilent_82350b_accel_read(struct gpib_board *board, uint8_t *buffer, +static int agilent_82350b_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { @@ -145,7 +145,7 @@ static int translate_wait_return_value(struct gpib_board *board, int retval) return 0; } -static int agilent_82350b_accel_write(struct gpib_board *board, uint8_t *buffer, +static int agilent_82350b_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { @@ -297,7 +297,7 @@ static void set_transfer_counter(struct agilent_82350b_priv *a_priv, int count) } // wrappers for interface functions -static int agilent_82350b_read(struct gpib_board *board, uint8_t *buffer, +static int agilent_82350b_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct agilent_82350b_priv *priv = board->private_data; @@ -305,7 +305,7 @@ static int agilent_82350b_read(struct gpib_board *board, uint8_t *buffer, return tms9914_read(board, &priv->tms9914_priv, buffer, length, end, bytes_read); } -static int agilent_82350b_write(struct gpib_board *board, uint8_t *buffer, +static int agilent_82350b_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { @@ -314,7 +314,7 @@ static int agilent_82350b_write(struct gpib_board *board, uint8_t *buffer, return tms9914_write(board, &priv->tms9914_priv, buffer, length, send_eoi, bytes_written); } -static int agilent_82350b_command(struct gpib_board *board, uint8_t *buffer, +static int agilent_82350b_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { @@ -373,7 +373,7 @@ static void agilent_82350b_remote_enable(struct gpib_board *board, int enable) tms9914_remote_enable(board, &priv->tms9914_priv, enable); } -static int agilent_82350b_enable_eos(struct gpib_board *board, uint8_t eos_byte, +static int agilent_82350b_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct agilent_82350b_priv *priv = board->private_data; @@ -412,7 +412,7 @@ static int agilent_82350b_secondary_address(struct gpib_board *board, return tms9914_secondary_address(board, &priv->tms9914_priv, address, enable); } -static int agilent_82350b_parallel_poll(struct gpib_board *board, uint8_t *result) +static int agilent_82350b_parallel_poll(struct gpib_board *board, u8 *result) { struct agilent_82350b_priv *priv = board->private_data; @@ -420,7 +420,7 @@ static int agilent_82350b_parallel_poll(struct gpib_board *board, uint8_t *resul } static void agilent_82350b_parallel_poll_configure(struct gpib_board *board, - uint8_t config) + u8 config) { struct agilent_82350b_priv *priv = board->private_data; @@ -434,14 +434,14 @@ static void agilent_82350b_parallel_poll_response(struct gpib_board *board, int tms9914_parallel_poll_response(board, &priv->tms9914_priv, ist); } -static void agilent_82350b_serial_poll_response(struct gpib_board *board, uint8_t status) +static void agilent_82350b_serial_poll_response(struct gpib_board *board, u8 status) { struct agilent_82350b_priv *priv = board->private_data; tms9914_serial_poll_response(board, &priv->tms9914_priv, status); } -static uint8_t agilent_82350b_serial_poll_status(struct gpib_board *board) +static u8 agilent_82350b_serial_poll_status(struct gpib_board *board) { struct agilent_82350b_priv *priv = board->private_data; From 2f960f8aa2ab1e4f12ec285242fc3fc903bcef52 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:23 +0000 Subject: [PATCH 127/203] staging: gpib: agilent_82357a: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- .../gpib/agilent_82357a/agilent_82357a.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index 7076e9f57d69..01dd18d9e425 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -420,10 +420,10 @@ static int agilent_82357a_abort(struct agilent_82357a_priv *a_priv, int flush) } // interface functions -int agilent_82357a_command(struct gpib_board *board, uint8_t *buffer, size_t length, +int agilent_82357a_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written); -static int agilent_82357a_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int agilent_82357a_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *nbytes) { int retval; @@ -536,7 +536,7 @@ static int agilent_82357a_read(struct gpib_board *board, uint8_t *buffer, size_t } static ssize_t agilent_82357a_generic_write(struct gpib_board *board, - uint8_t *buffer, size_t length, + u8 *buffer, size_t length, int send_commands, int send_eoi, size_t *bytes_written) { @@ -676,13 +676,13 @@ static ssize_t agilent_82357a_generic_write(struct gpib_board *board, return 0; } -static int agilent_82357a_write(struct gpib_board *board, uint8_t *buffer, +static int agilent_82357a_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { return agilent_82357a_generic_write(board, buffer, length, 0, send_eoi, bytes_written); } -int agilent_82357a_command(struct gpib_board *board, uint8_t *buffer, size_t length, +int agilent_82357a_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { return agilent_82357a_generic_write(board, buffer, length, 1, 0, bytes_written); @@ -834,7 +834,7 @@ static void agilent_82357a_remote_enable(struct gpib_board *board, int enable) return;// 0; } -static int agilent_82357a_enable_eos(struct gpib_board *board, uint8_t eos_byte, +static int agilent_82357a_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct agilent_82357a_priv *a_priv = board->private_data; @@ -948,7 +948,7 @@ static int agilent_82357a_secondary_address(struct gpib_board *board, return 0; } -static int agilent_82357a_parallel_poll(struct gpib_board *board, uint8_t *result) +static int agilent_82357a_parallel_poll(struct gpib_board *board, u8 *result) { struct agilent_82357a_priv *a_priv = board->private_data; struct usb_device *usb_dev; @@ -990,7 +990,7 @@ static int agilent_82357a_parallel_poll(struct gpib_board *board, uint8_t *resul return 0; } -static void agilent_82357a_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void agilent_82357a_parallel_poll_configure(struct gpib_board *board, u8 config) { //board can only be system controller return;// 0; @@ -1002,13 +1002,13 @@ static void agilent_82357a_parallel_poll_response(struct gpib_board *board, int return;// 0; } -static void agilent_82357a_serial_poll_response(struct gpib_board *board, uint8_t status) +static void agilent_82357a_serial_poll_response(struct gpib_board *board, u8 status) { //board can only be system controller return;// 0; } -static uint8_t agilent_82357a_serial_poll_status(struct gpib_board *board) +static u8 agilent_82357a_serial_poll_status(struct gpib_board *board) { //board can only be system controller return 0; From 60ec9ca488f33809b50432f96f7935ef404efb42 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:24 +0000 Subject: [PATCH 128/203] staging: gpib: cec: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cec/cec_gpib.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec/cec_gpib.c index 03d5b6c4fd8c..1b7af871ca5b 100644 --- a/drivers/staging/gpib/cec/cec_gpib.c +++ b/drivers/staging/gpib/cec/cec_gpib.c @@ -45,7 +45,7 @@ static int cec_pci_attach(struct gpib_board *board, const struct gpib_board_conf static void cec_pci_detach(struct gpib_board *board); // wrappers for interface functions -static int cec_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int cec_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct cec_priv *priv = board->private_data; @@ -53,7 +53,7 @@ static int cec_read(struct gpib_board *board, uint8_t *buffer, size_t length, in return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, bytes_read); } -static int cec_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, +static int cec_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct cec_priv *priv = board->private_data; @@ -61,7 +61,7 @@ static int cec_write(struct gpib_board *board, uint8_t *buffer, size_t length, i return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -static int cec_command(struct gpib_board *board, uint8_t *buffer, +static int cec_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct cec_priv *priv = board->private_data; @@ -104,7 +104,7 @@ static void cec_remote_enable(struct gpib_board *board, int enable) nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -static int cec_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int cec_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct cec_priv *priv = board->private_data; @@ -139,14 +139,14 @@ static int cec_secondary_address(struct gpib_board *board, unsigned int address, return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -static int cec_parallel_poll(struct gpib_board *board, uint8_t *result) +static int cec_parallel_poll(struct gpib_board *board, u8 *result) { struct cec_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -static void cec_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void cec_parallel_poll_configure(struct gpib_board *board, u8 config) { struct cec_priv *priv = board->private_data; @@ -160,14 +160,14 @@ static void cec_parallel_poll_response(struct gpib_board *board, int ist) nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -static void cec_serial_poll_response(struct gpib_board *board, uint8_t status) +static void cec_serial_poll_response(struct gpib_board *board, u8 status) { struct cec_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -static uint8_t cec_serial_poll_status(struct gpib_board *board) +static u8 cec_serial_poll_status(struct gpib_board *board) { struct cec_priv *priv = board->private_data; From 1128aab1b5d9d60c2fc6b95f0046204475699aeb Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:25 +0000 Subject: [PATCH 129/203] staging: gpib: gpib_os: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 029590f95fd3..a23b8aa3638a 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -263,7 +263,7 @@ struct gpib_status_queue *get_gpib_status_queue(struct gpib_board *board, unsign } int get_serial_poll_byte(struct gpib_board *board, unsigned int pad, int sad, - unsigned int usec_timeout, uint8_t *poll_byte) + unsigned int usec_timeout, u8 *poll_byte) { struct gpib_status_queue *device; @@ -339,7 +339,7 @@ static int setup_serial_poll(struct gpib_board *board, unsigned int usec_timeout } static int read_serial_poll_byte(struct gpib_board *board, unsigned int pad, - int sad, unsigned int usec_timeout, uint8_t *result) + int sad, unsigned int usec_timeout, u8 *result) { u8 cmd_string[8]; int end_flag; @@ -410,7 +410,7 @@ static int cleanup_serial_poll(struct gpib_board *board, unsigned int usec_timeo } static int serial_poll_single(struct gpib_board *board, unsigned int pad, int sad, - unsigned int usec_timeout, uint8_t *result) + unsigned int usec_timeout, u8 *result) { int retval, cleanup_retval; @@ -475,7 +475,7 @@ int serial_poll_all(struct gpib_board *board, unsigned int usec_timeout) */ int dvrsp(struct gpib_board *board, unsigned int pad, int sad, - unsigned int usec_timeout, uint8_t *result) + unsigned int usec_timeout, u8 *result) { int status = ibstatus(board); int retval; From aa7f3b35ac16fd4dda0266c4b2681ba0ac3d91b4 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:26 +0000 Subject: [PATCH 130/203] staging: gpib: gpib_bitbang: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-8-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 87622ee841c7..a43e871c21ff 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -325,7 +325,7 @@ 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 inline int check_for_eos(struct bb_priv *priv, u8 byte); static void set_atn(struct gpib_board *board, int atn_asserted); static inline void SET_DIR_WRITE(struct bb_priv *priv); @@ -354,7 +354,7 @@ static char printable(char x) * * ***************************************************************************/ -static int bb_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int bb_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct bb_priv *priv = board->private_data; @@ -492,7 +492,7 @@ static irqreturn_t bb_DAV_interrupt(int irq, void *arg) * * ***************************************************************************/ -static int bb_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int bb_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { unsigned long flags; @@ -729,7 +729,7 @@ static irqreturn_t bb_SRQ_interrupt(int irq, void *arg) return IRQ_HANDLED; } -static int bb_command(struct gpib_board *board, uint8_t *buffer, +static int bb_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { size_t ret; @@ -921,7 +921,7 @@ static void bb_remote_enable(struct gpib_board *board, int enable) } } -static int bb_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int bb_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct bb_priv *priv = board->private_data; @@ -988,12 +988,12 @@ static int bb_secondary_address(struct gpib_board *board, unsigned int address, return 0; } -static int bb_parallel_poll(struct gpib_board *board, uint8_t *result) +static int bb_parallel_poll(struct gpib_board *board, u8 *result) { return -ENOENT; } -static void bb_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void bb_parallel_poll_configure(struct gpib_board *board, u8 config) { } @@ -1001,11 +1001,11 @@ static void bb_parallel_poll_response(struct gpib_board *board, int ist) { } -static void bb_serial_poll_response(struct gpib_board *board, uint8_t status) +static void bb_serial_poll_response(struct gpib_board *board, u8 status) { } -static uint8_t bb_serial_poll_status(struct gpib_board *board) +static u8 bb_serial_poll_status(struct gpib_board *board) { return 0; // -ENOENT; } @@ -1366,7 +1366,7 @@ inline long usec_diff(struct timespec64 *a, struct timespec64 *b) (a->tv_nsec - b->tv_nsec) / 1000); } -static inline int check_for_eos(struct bb_priv *priv, uint8_t byte) +static inline int check_for_eos(struct bb_priv *priv, u8 byte) { if (priv->eos_check) return 0; From 8bf26540438ad8b45c29f3abe50b4b81324cf70c Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:27 +0000 Subject: [PATCH 131/203] staging: gpib: hp_82335: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-9-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82335/hp82335.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c index 319b7f6e35ec..f8e5d785746e 100644 --- a/drivers/staging/gpib/hp_82335/hp82335.c +++ b/drivers/staging/gpib/hp_82335/hp82335.c @@ -30,7 +30,7 @@ static void hp82335_detach(struct gpib_board *board); static irqreturn_t hp82335_interrupt(int irq, void *arg); // wrappers for interface functions -static int hp82335_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int hp82335_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct hp82335_priv *priv = board->private_data; @@ -38,7 +38,7 @@ static int hp82335_read(struct gpib_board *board, uint8_t *buffer, size_t length return tms9914_read(board, &priv->tms9914_priv, buffer, length, end, bytes_read); } -static int hp82335_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, +static int hp82335_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct hp82335_priv *priv = board->private_data; @@ -46,7 +46,7 @@ static int hp82335_write(struct gpib_board *board, uint8_t *buffer, size_t lengt return tms9914_write(board, &priv->tms9914_priv, buffer, length, send_eoi, bytes_written); } -static int hp82335_command(struct gpib_board *board, uint8_t *buffer, size_t length, +static int hp82335_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct hp82335_priv *priv = board->private_data; @@ -89,7 +89,7 @@ static void hp82335_remote_enable(struct gpib_board *board, int enable) tms9914_remote_enable(board, &priv->tms9914_priv, enable); } -static int hp82335_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int hp82335_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct hp82335_priv *priv = board->private_data; @@ -124,14 +124,14 @@ static int hp82335_secondary_address(struct gpib_board *board, unsigned int addr return tms9914_secondary_address(board, &priv->tms9914_priv, address, enable); } -static int hp82335_parallel_poll(struct gpib_board *board, uint8_t *result) +static int hp82335_parallel_poll(struct gpib_board *board, u8 *result) { struct hp82335_priv *priv = board->private_data; return tms9914_parallel_poll(board, &priv->tms9914_priv, result); } -static void hp82335_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void hp82335_parallel_poll_configure(struct gpib_board *board, u8 config) { struct hp82335_priv *priv = board->private_data; @@ -145,14 +145,14 @@ static void hp82335_parallel_poll_response(struct gpib_board *board, int ist) tms9914_parallel_poll_response(board, &priv->tms9914_priv, ist); } -static void hp82335_serial_poll_response(struct gpib_board *board, uint8_t status) +static void hp82335_serial_poll_response(struct gpib_board *board, u8 status) { struct hp82335_priv *priv = board->private_data; tms9914_serial_poll_response(board, &priv->tms9914_priv, status); } -static uint8_t hp82335_serial_poll_status(struct gpib_board *board) +static u8 hp82335_serial_poll_status(struct gpib_board *board) { struct hp82335_priv *priv = board->private_data; @@ -227,12 +227,12 @@ static inline unsigned int tms9914_to_hp82335_offset(unsigned int register_num) return 0x1ff8 + register_num; } -static uint8_t hp82335_read_byte(struct tms9914_priv *priv, unsigned int register_num) +static u8 hp82335_read_byte(struct tms9914_priv *priv, unsigned int register_num) { return tms9914_iomem_read_byte(priv, tms9914_to_hp82335_offset(register_num)); } -static void hp82335_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num) +static void hp82335_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num) { tms9914_iomem_write_byte(priv, data, tms9914_to_hp82335_offset(register_num)); } From 2ec7c08f391f88700ad855a26b5eb199d1316ebe Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:28 +0000 Subject: [PATCH 132/203] staging: gpib: hp_82341: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-10-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82341/hp_82341.c | 26 ++++++++++++------------ 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpib/hp_82341/hp_82341.c index 5ca0bd2f1a08..66e4480b5fba 100644 --- a/drivers/staging/gpib/hp_82341/hp_82341.c +++ b/drivers/staging/gpib/hp_82341/hp_82341.c @@ -25,11 +25,11 @@ MODULE_DESCRIPTION("GPIB driver for hp 82341a/b/c/d boards"); 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(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, +static int hp_82341_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); static irqreturn_t hp_82341_interrupt(int irq, void *arg); -static int hp_82341_accel_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int hp_82341_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct hp_82341_priv *hp_priv = board->private_data; @@ -173,7 +173,7 @@ static int restart_write_fifo(struct gpib_board *board, struct hp_82341_priv *hp return 0; } -static int hp_82341_accel_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int hp_82341_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct hp_82341_priv *hp_priv = board->private_data; @@ -256,7 +256,7 @@ static int hp_82341_attach(struct gpib_board *board, const struct gpib_board_con static void hp_82341_detach(struct gpib_board *board); // wrappers for interface functions -static int hp_82341_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int hp_82341_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct hp_82341_priv *priv = board->private_data; @@ -264,7 +264,7 @@ static int hp_82341_read(struct gpib_board *board, uint8_t *buffer, size_t lengt return tms9914_read(board, &priv->tms9914_priv, buffer, length, end, bytes_read); } -static int hp_82341_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, +static int hp_82341_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct hp_82341_priv *priv = board->private_data; @@ -272,7 +272,7 @@ static int hp_82341_write(struct gpib_board *board, uint8_t *buffer, size_t leng return tms9914_write(board, &priv->tms9914_priv, buffer, length, send_eoi, bytes_written); } -static int hp_82341_command(struct gpib_board *board, uint8_t *buffer, size_t length, +static int hp_82341_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct hp_82341_priv *priv = board->private_data; @@ -320,7 +320,7 @@ static void hp_82341_remote_enable(struct gpib_board *board, int enable) tms9914_remote_enable(board, &priv->tms9914_priv, enable); } -static int hp_82341_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int hp_82341_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct hp_82341_priv *priv = board->private_data; @@ -355,14 +355,14 @@ static int hp_82341_secondary_address(struct gpib_board *board, unsigned int add return tms9914_secondary_address(board, &priv->tms9914_priv, address, enable); } -static int hp_82341_parallel_poll(struct gpib_board *board, uint8_t *result) +static int hp_82341_parallel_poll(struct gpib_board *board, u8 *result) { struct hp_82341_priv *priv = board->private_data; return tms9914_parallel_poll(board, &priv->tms9914_priv, result); } -static void hp_82341_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void hp_82341_parallel_poll_configure(struct gpib_board *board, u8 config) { struct hp_82341_priv *priv = board->private_data; @@ -376,14 +376,14 @@ static void hp_82341_parallel_poll_response(struct gpib_board *board, int ist) tms9914_parallel_poll_response(board, &priv->tms9914_priv, ist); } -static void hp_82341_serial_poll_response(struct gpib_board *board, uint8_t status) +static void hp_82341_serial_poll_response(struct gpib_board *board, u8 status) { struct hp_82341_priv *priv = board->private_data; tms9914_serial_poll_response(board, &priv->tms9914_priv, status); } -static uint8_t hp_82341_serial_poll_status(struct gpib_board *board) +static u8 hp_82341_serial_poll_status(struct gpib_board *board) { struct hp_82341_priv *priv = board->private_data; @@ -480,12 +480,12 @@ static void hp_82341_free_private(struct gpib_board *board) board->private_data = NULL; } -static uint8_t hp_82341_read_byte(struct tms9914_priv *priv, unsigned int register_num) +static u8 hp_82341_read_byte(struct tms9914_priv *priv, unsigned int register_num) { return inb(priv->iobase + register_num); } -static void hp_82341_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num) +static void hp_82341_write_byte(struct tms9914_priv *priv, u8 data, unsigned int register_num) { outb(data, priv->iobase + register_num); } From fcd93950959aec33f5e4b175341613683e2953a0 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:29 +0000 Subject: [PATCH 133/203] staging: gpib: ni_usb: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-11-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c index 00f788a59dcc..588bb3da9832 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -589,7 +589,7 @@ static int ni_usb_write_registers(struct ni_usb_priv *ni_priv, } // interface functions -static int ni_usb_read(struct gpib_board *board, uint8_t *buffer, size_t length, +static int ni_usb_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { int retval, parse_retval; @@ -720,7 +720,7 @@ static int ni_usb_read(struct gpib_board *board, uint8_t *buffer, size_t length, return retval; } -static int ni_usb_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int ni_usb_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { int retval; @@ -824,7 +824,7 @@ static int ni_usb_write(struct gpib_board *board, uint8_t *buffer, size_t length return retval; } -static int ni_usb_command_chunk(struct gpib_board *board, uint8_t *buffer, size_t length, +static int ni_usb_command_chunk(struct gpib_board *board, u8 *buffer, size_t length, size_t *command_bytes_written) { int retval; @@ -918,7 +918,7 @@ static int ni_usb_command_chunk(struct gpib_board *board, uint8_t *buffer, size_ return 0; } -static int ni_usb_command(struct gpib_board *board, uint8_t *buffer, size_t length, +static int ni_usb_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { size_t count; @@ -1182,7 +1182,7 @@ static void ni_usb_remote_enable(struct gpib_board *board, int enable) return;// 0; } -static int ni_usb_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int ni_usb_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct ni_usb_priv *ni_priv = board->private_data; @@ -1341,7 +1341,7 @@ static int ni_usb_secondary_address(struct gpib_board *board, unsigned int addre return 0; } -static int ni_usb_parallel_poll(struct gpib_board *board, uint8_t *result) +static int ni_usb_parallel_poll(struct gpib_board *board, u8 *result) { int retval; struct ni_usb_priv *ni_priv = board->private_data; @@ -1396,7 +1396,7 @@ static int ni_usb_parallel_poll(struct gpib_board *board, uint8_t *result) return retval; } -static void ni_usb_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void ni_usb_parallel_poll_configure(struct gpib_board *board, u8 config) { int retval; struct ni_usb_priv *ni_priv = board->private_data; @@ -1474,7 +1474,7 @@ static void ni_usb_serial_poll_response(struct gpib_board *board, u8 status) return;// 0; } -static uint8_t ni_usb_serial_poll_status(struct gpib_board *board) +static u8 ni_usb_serial_poll_status(struct gpib_board *board) { return 0; } From 6b0bf6f2edd2c0f0f2517664ba22b2c5d6406a8c Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:30 +0000 Subject: [PATCH 134/203] staging: gpib: pc2: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-12-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/pc2/pc2_gpib.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c index ee4ea1f32dfc..48f57a917d0d 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -90,7 +90,7 @@ irqreturn_t pc2a_interrupt(int irq, void *arg) } // wrappers for interface functions -static int pc2_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int pc2_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct pc2_priv *priv = board->private_data; @@ -98,7 +98,7 @@ static int pc2_read(struct gpib_board *board, uint8_t *buffer, size_t length, in return nec7210_read(board, &priv->nec7210_priv, buffer, length, end, bytes_read); } -static int pc2_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, +static int pc2_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct pc2_priv *priv = board->private_data; @@ -106,7 +106,7 @@ static int pc2_write(struct gpib_board *board, uint8_t *buffer, size_t length, i return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -static int pc2_command(struct gpib_board *board, uint8_t *buffer, +static int pc2_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct pc2_priv *priv = board->private_data; @@ -149,7 +149,7 @@ static void pc2_remote_enable(struct gpib_board *board, int enable) nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -static int pc2_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int pc2_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct pc2_priv *priv = board->private_data; @@ -184,14 +184,14 @@ static int pc2_secondary_address(struct gpib_board *board, unsigned int address, return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -static int pc2_parallel_poll(struct gpib_board *board, uint8_t *result) +static int pc2_parallel_poll(struct gpib_board *board, u8 *result) { struct pc2_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -static void pc2_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void pc2_parallel_poll_configure(struct gpib_board *board, u8 config) { struct pc2_priv *priv = board->private_data; @@ -205,14 +205,14 @@ static void pc2_parallel_poll_response(struct gpib_board *board, int ist) nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -static void pc2_serial_poll_response(struct gpib_board *board, uint8_t status) +static void pc2_serial_poll_response(struct gpib_board *board, u8 status) { struct pc2_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -static uint8_t pc2_serial_poll_status(struct gpib_board *board) +static u8 pc2_serial_poll_status(struct gpib_board *board) { struct pc2_priv *priv = board->private_data; From 78001dd08e56cb5390c5e639f15fb60e0576bfe0 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:31 +0000 Subject: [PATCH 135/203] staging: gpib: gpib_ioctl: u64 over uint64_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u64' over 'uint64_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-13-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_ioctl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_ioctl.h b/drivers/staging/gpib/uapi/gpib_ioctl.h index 2d2a268d8573..0fed5c0fa7f2 100644 --- a/drivers/staging/gpib/uapi/gpib_ioctl.h +++ b/drivers/staging/gpib/uapi/gpib_ioctl.h @@ -18,7 +18,7 @@ struct gpib_board_type_ioctl { /* argument for read/write/command ioctls */ struct gpib_read_write_ioctl { - uint64_t buffer_ptr; + __u64 buffer_ptr; unsigned int requested_transfer_count; unsigned int completed_transfer_count; int end; /* end flag return for reads, end io suppression request for cmd*/ @@ -59,7 +59,7 @@ struct gpib_wait_ioctl { }; struct gpib_online_ioctl { - uint64_t init_data_ptr; + __u64 init_data_ptr; int init_data_length; int online; }; @@ -134,7 +134,7 @@ enum gpib_ioctl { IBRSP = _IOWR(GPIB_CODE, 18, struct gpib_serial_poll_ioctl), IBEOS = _IOW(GPIB_CODE, 19, struct gpib_eos_ioctl), IBRSV = _IOW(GPIB_CODE, 20, __u8), - CFCBASE = _IOW(GPIB_CODE, 21, uint64_t), + CFCBASE = _IOW(GPIB_CODE, 21, __u64), CFCIRQ = _IOW(GPIB_CODE, 22, unsigned int), CFCDMA = _IOW(GPIB_CODE, 23, unsigned int), CFCBOARDTYPE = _IOW(GPIB_CODE, 24, struct gpib_board_type_ioctl), From 17598a86ad8deef667251eac81ff99ab09a67523 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:32 +0000 Subject: [PATCH 136/203] staging: gpib: lpvo_usb_gpib: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-14-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 47f56fea28a6..fdf10b53585d 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -706,7 +706,7 @@ static int usb_gpib_line_status(const struct gpib_board *board) /* parallel_poll */ -static int usb_gpib_parallel_poll(struct gpib_board *board, uint8_t *result) +static int usb_gpib_parallel_poll(struct gpib_board *board, u8 *result) { /* * request parallel poll asserting ATN | EOI; @@ -999,7 +999,7 @@ static int usb_gpib_write(struct gpib_board *board, /* parallel_poll configure */ static void usb_gpib_parallel_poll_configure(struct gpib_board *board, - uint8_t configuration) + u8 configuration) { } @@ -1033,13 +1033,13 @@ static int usb_gpib_secondary_address(struct gpib_board *board, /* serial_poll_response */ -static void usb_gpib_serial_poll_response(struct gpib_board *board, uint8_t status) +static void usb_gpib_serial_poll_response(struct gpib_board *board, u8 status) { } /* serial_poll_status */ -static uint8_t usb_gpib_serial_poll_status(struct gpib_board *board) +static u8 usb_gpib_serial_poll_status(struct gpib_board *board) { return 0; } From d6e1f701c61f227cb8fc1dbabf005f9ee34c5cf4 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:45:33 +0000 Subject: [PATCH 137/203] staging: gpib: tnt4882: u8 over uint8_t Reported by checkpatch.pl. CHECK: Prefer kernel type 'u8' over 'uint8_t' Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417004533.86765-15-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 28 ++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c index da13d11c20bd..3abcd65cc449 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -236,7 +236,7 @@ static int fifo_xfer_done(struct tnt4882_priv *tnt_priv) return retval; } -static int drain_fifo_words(struct tnt4882_priv *tnt_priv, uint8_t *buffer, int num_bytes) +static int drain_fifo_words(struct tnt4882_priv *tnt_priv, u8 *buffer, int num_bytes) { int count = 0; struct nec7210_priv *nec_priv = &tnt_priv->nec7210_priv; @@ -275,7 +275,7 @@ static void tnt4882_release_holdoff(struct gpib_board *board, struct tnt4882_pri } } -static int tnt4882_accel_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int tnt4882_accel_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { size_t count = 0; @@ -450,7 +450,7 @@ static int write_wait(struct gpib_board *board, struct tnt4882_priv *tnt_priv, return 0; } -static int generic_write(struct gpib_board *board, uint8_t *buffer, size_t length, +static int generic_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, int send_commands, size_t *bytes_written) { size_t count = 0; @@ -542,13 +542,13 @@ static int generic_write(struct gpib_board *board, uint8_t *buffer, size_t lengt return retval; } -static int tnt4882_accel_write(struct gpib_board *board, uint8_t *buffer, +static int tnt4882_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { return generic_write(board, buffer, length, send_eoi, 0, bytes_written); } -static int tnt4882_command(struct gpib_board *board, uint8_t *buffer, size_t length, +static int tnt4882_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { return generic_write(board, buffer, length, 0, 1, bytes_written); @@ -595,7 +595,7 @@ static irqreturn_t tnt4882_interrupt(int irq, void *arg) } // wrappers for interface functions -static int tnt4882_read(struct gpib_board *board, uint8_t *buffer, size_t length, int *end, +static int tnt4882_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { struct tnt4882_priv *priv = board->private_data; @@ -615,7 +615,7 @@ static int tnt4882_read(struct gpib_board *board, uint8_t *buffer, size_t length return retval; } -static int tnt4882_write(struct gpib_board *board, uint8_t *buffer, size_t length, int send_eoi, +static int tnt4882_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written) { struct tnt4882_priv *priv = board->private_data; @@ -623,7 +623,7 @@ static int tnt4882_write(struct gpib_board *board, uint8_t *buffer, size_t lengt return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -static int tnt4882_command_unaccel(struct gpib_board *board, uint8_t *buffer, +static int tnt4882_command_unaccel(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct tnt4882_priv *priv = board->private_data; @@ -674,7 +674,7 @@ static void tnt4882_remote_enable(struct gpib_board *board, int enable) nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -static int tnt4882_enable_eos(struct gpib_board *board, uint8_t eos_byte, int compare_8_bits) +static int tnt4882_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct tnt4882_priv *priv = board->private_data; @@ -721,7 +721,7 @@ static int tnt4882_secondary_address(struct gpib_board *board, unsigned int addr return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -static int tnt4882_parallel_poll(struct gpib_board *board, uint8_t *result) +static int tnt4882_parallel_poll(struct gpib_board *board, u8 *result) { struct tnt4882_priv *tnt_priv = board->private_data; @@ -738,7 +738,7 @@ static int tnt4882_parallel_poll(struct gpib_board *board, uint8_t *result) } } -static void tnt4882_parallel_poll_configure(struct gpib_board *board, uint8_t config) +static void tnt4882_parallel_poll_configure(struct gpib_board *board, u8 config) { struct tnt4882_priv *priv = board->private_data; @@ -767,14 +767,14 @@ static void tnt4882_parallel_poll_response(struct gpib_board *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(struct gpib_board *board, uint8_t status) +static void tnt4882_serial_poll_response(struct gpib_board *board, u8 status) { struct tnt4882_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -static void tnt4882_serial_poll_response2(struct gpib_board *board, uint8_t status, +static void tnt4882_serial_poll_response2(struct gpib_board *board, u8 status, int new_reason_for_service) { struct tnt4882_priv *priv = board->private_data; @@ -810,7 +810,7 @@ static void tnt4882_serial_poll_response2(struct gpib_board *board, uint8_t stat spin_unlock_irqrestore(&board->spinlock, flags); } -static uint8_t tnt4882_serial_poll_status(struct gpib_board *board) +static u8 tnt4882_serial_poll_status(struct gpib_board *board) { struct tnt4882_priv *priv = board->private_data; From 2492a17bdc6a484bbaa5320377b9eef47e38e22b Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:29 +0000 Subject: [PATCH 138/203] staging: gpib: struct typing for gpib_interface "Having the word "_struct" in the name of the struct doesn't add any information so rename "struct gpib_interface_struct" to "struct gpib_interface". Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- 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/gpib/include/gpib_types.h index 71af9e808a76..16aaade310fd 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -22,7 +22,7 @@ #include #include -typedef struct gpib_interface_struct gpib_interface_t; +typedef struct gpib_interface gpib_interface_t; struct gpib_board; /* config parameters that are only used by driver attach functions */ @@ -51,7 +51,7 @@ struct gpib_board_config { char *serial_number; }; -struct gpib_interface_struct { +struct gpib_interface { /* name of board */ char *name; /* attach() initializes board and allocates resources */ From 411d0ba3dd3cdd9b968a48061f75ccf4fb6638b9 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:30 +0000 Subject: [PATCH 139/203] staging: gpib: agilent_82350b: gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-3-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/agilent_82350b/agilent_82350b.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c index 3e061c0b272f..ce9c88a2b9f5 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c @@ -773,7 +773,7 @@ static void agilent_82350b_detach(struct gpib_board *board) agilent_82350b_free_private(board); } -static gpib_interface_t agilent_82350b_unaccel_interface = { +static struct gpib_interface agilent_82350b_unaccel_interface = { .name = "agilent_82350b_unaccel", .attach = agilent_82350b_unaccel_attach, .detach = agilent_82350b_detach, @@ -801,7 +801,7 @@ static gpib_interface_t agilent_82350b_unaccel_interface = { .return_to_local = agilent_82350b_return_to_local, }; -static gpib_interface_t agilent_82350b_interface = { +static struct gpib_interface agilent_82350b_interface = { .name = "agilent_82350b", .attach = agilent_82350b_accel_attach, .detach = agilent_82350b_detach, From 476d9feeccf3f0952fa26bcae4cf0264d4f50a9e Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:31 +0000 Subject: [PATCH 140/203] staging: gpib: agilent_82357a: gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-4-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/agilent_82357a/agilent_82357a.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index 01dd18d9e425..4728ec85caa8 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -1434,7 +1434,7 @@ static void agilent_82357a_detach(struct gpib_board *board) mutex_unlock(&agilent_82357a_hotplug_lock); } -static gpib_interface_t agilent_82357a_gpib_interface = { +static struct gpib_interface agilent_82357a_gpib_interface = { .name = "agilent_82357a", .attach = agilent_82357a_attach, .detach = agilent_82357a_detach, From a988518b0272343ea8645727599203b2460c8c8c Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:32 +0000 Subject: [PATCH 141/203] staging: gpib: cb7210: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-5-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cb7210/cb7210.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c index b15ffc777c39..54c037aabc26 100644 --- a/drivers/staging/gpib/cb7210/cb7210.c +++ b/drivers/staging/gpib/cb7210/cb7210.c @@ -686,7 +686,7 @@ static void cb7210_return_to_local(struct gpib_board *board) write_byte(nec_priv, AUX_RTL, AUXMR); } -static gpib_interface_t cb_pci_unaccel_interface = { +static struct gpib_interface cb_pci_unaccel_interface = { .name = "cbi_pci_unaccel", .attach = cb_pci_attach, .detach = cb_pci_detach, @@ -714,7 +714,7 @@ static gpib_interface_t cb_pci_unaccel_interface = { .return_to_local = cb7210_return_to_local, }; -static gpib_interface_t cb_pci_accel_interface = { +static struct gpib_interface cb_pci_accel_interface = { .name = "cbi_pci_accel", .attach = cb_pci_attach, .detach = cb_pci_detach, @@ -742,7 +742,7 @@ static gpib_interface_t cb_pci_accel_interface = { .return_to_local = cb7210_return_to_local, }; -static gpib_interface_t cb_pci_interface = { +static struct gpib_interface cb_pci_interface = { .name = "cbi_pci", .attach = cb_pci_attach, .detach = cb_pci_detach, @@ -769,7 +769,7 @@ static gpib_interface_t cb_pci_interface = { .return_to_local = cb7210_return_to_local, }; -static gpib_interface_t cb_isa_unaccel_interface = { +static struct gpib_interface cb_isa_unaccel_interface = { .name = "cbi_isa_unaccel", .attach = cb_isa_attach, .detach = cb_isa_detach, @@ -797,7 +797,7 @@ static gpib_interface_t cb_isa_unaccel_interface = { .return_to_local = cb7210_return_to_local, }; -static gpib_interface_t cb_isa_interface = { +static struct gpib_interface cb_isa_interface = { .name = "cbi_isa", .attach = cb_isa_attach, .detach = cb_isa_detach, @@ -824,7 +824,7 @@ static gpib_interface_t cb_isa_interface = { .return_to_local = cb7210_return_to_local, }; -static gpib_interface_t cb_isa_accel_interface = { +static struct gpib_interface cb_isa_accel_interface = { .name = "cbi_isa_accel", .attach = cb_isa_attach, .detach = cb_isa_detach, @@ -1334,7 +1334,7 @@ static void cb_pcmcia_cleanup_module(void) pcmcia_unregister_driver(&cb_gpib_cs_driver); } -static gpib_interface_t cb_pcmcia_unaccel_interface = { +static struct gpib_interface cb_pcmcia_unaccel_interface = { .name = "cbi_pcmcia_unaccel", .attach = cb_pcmcia_attach, .detach = cb_pcmcia_detach, @@ -1362,7 +1362,7 @@ static gpib_interface_t cb_pcmcia_unaccel_interface = { .return_to_local = cb7210_return_to_local, }; -static gpib_interface_t cb_pcmcia_interface = { +static struct gpib_interface cb_pcmcia_interface = { .name = "cbi_pcmcia", .attach = cb_pcmcia_attach, .detach = cb_pcmcia_detach, @@ -1390,7 +1390,7 @@ static gpib_interface_t cb_pcmcia_interface = { .return_to_local = cb7210_return_to_local, }; -static gpib_interface_t cb_pcmcia_accel_interface = { +static struct gpib_interface cb_pcmcia_accel_interface = { .name = "cbi_pcmcia_accel", .attach = cb_pcmcia_attach, .detach = cb_pcmcia_detach, From 276da96d9f48183bbc27041f882ed341d79b0eee Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:33 +0000 Subject: [PATCH 142/203] staging: gpib: cec: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-6-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cec/cec_gpib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec/cec_gpib.c index 1b7af871ca5b..737d78736ea5 100644 --- a/drivers/staging/gpib/cec/cec_gpib.c +++ b/drivers/staging/gpib/cec/cec_gpib.c @@ -188,7 +188,7 @@ static void cec_return_to_local(struct gpib_board *board) nec7210_return_to_local(board, &priv->nec7210_priv); } -static gpib_interface_t cec_pci_interface = { +static struct gpib_interface cec_pci_interface = { .name = "cec_pci", .attach = cec_pci_attach, .detach = cec_pci_detach, From 67bfc7529575cc81a765af932d539baa5c01a405 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:34 +0000 Subject: [PATCH 143/203] staging: gpib: common: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-7-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index a23b8aa3638a..163d9a64e7df 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -2038,7 +2038,7 @@ void init_gpib_descriptor(struct gpib_descriptor *desc) atomic_set(&desc->io_in_progress, 0); } -int gpib_register_driver(gpib_interface_t *interface, struct module *provider_module) +int gpib_register_driver(struct gpib_interface *interface, struct module *provider_module) { struct gpib_interface_list *entry; @@ -2054,7 +2054,7 @@ int gpib_register_driver(gpib_interface_t *interface, struct module *provider_mo } EXPORT_SYMBOL(gpib_register_driver); -void gpib_unregister_driver(gpib_interface_t *interface) +void gpib_unregister_driver(struct gpib_interface *interface) { int i; struct list_head *list_ptr; From 1de93ff920dc839a10c9249d58956c0589896d18 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:35 +0000 Subject: [PATCH 144/203] staging: gpib: fluke: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-8-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/eastwood/fluke_gpib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c index 396524901f12..f6a84200e3a1 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -712,7 +712,7 @@ static int fluke_accel_read(struct gpib_board *board, u8 *buffer, size_t length, return retval; } -static gpib_interface_t fluke_unaccel_interface = { +static struct gpib_interface fluke_unaccel_interface = { .name = "fluke_unaccel", .attach = fluke_attach_holdoff_all, .detach = fluke_detach, @@ -748,7 +748,7 @@ static gpib_interface_t fluke_unaccel_interface = { * register just as the dma controller is also doing a read. */ -static gpib_interface_t fluke_hybrid_interface = { +static struct gpib_interface fluke_hybrid_interface = { .name = "fluke_hybrid", .attach = fluke_attach_holdoff_all, .detach = fluke_detach, @@ -775,7 +775,7 @@ static gpib_interface_t fluke_hybrid_interface = { .return_to_local = fluke_return_to_local, }; -static gpib_interface_t fluke_interface = { +static struct gpib_interface fluke_interface = { .name = "fluke", .attach = fluke_attach_holdoff_end, .detach = fluke_detach, From 326ecce53e489a7b610b047da0b0f82266f82195 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:36 +0000 Subject: [PATCH 145/203] staging: gpib: fmh: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-9-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index a7be878bd3e4..ca07e6ecb0a8 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -1031,7 +1031,7 @@ static int fmh_gpib_fifo_read(struct gpib_board *board, u8 *buffer, size_t lengt return retval; } -static gpib_interface_t fmh_gpib_unaccel_interface = { +static struct gpib_interface fmh_gpib_unaccel_interface = { .name = "fmh_gpib_unaccel", .attach = fmh_gpib_attach_holdoff_all, .detach = fmh_gpib_detach, @@ -1059,7 +1059,7 @@ static gpib_interface_t fmh_gpib_unaccel_interface = { .return_to_local = fmh_gpib_return_to_local, }; -static gpib_interface_t fmh_gpib_interface = { +static struct gpib_interface fmh_gpib_interface = { .name = "fmh_gpib", .attach = fmh_gpib_attach_holdoff_end, .detach = fmh_gpib_detach, @@ -1087,7 +1087,7 @@ static gpib_interface_t fmh_gpib_interface = { .return_to_local = fmh_gpib_return_to_local, }; -static gpib_interface_t fmh_gpib_pci_interface = { +static struct gpib_interface fmh_gpib_pci_interface = { .name = "fmh_gpib_pci", .attach = fmh_gpib_pci_attach_holdoff_end, .detach = fmh_gpib_pci_detach, @@ -1115,7 +1115,7 @@ static gpib_interface_t fmh_gpib_pci_interface = { .return_to_local = fmh_gpib_return_to_local, }; -static gpib_interface_t fmh_gpib_pci_unaccel_interface = { +static struct gpib_interface fmh_gpib_pci_unaccel_interface = { .name = "fmh_gpib_pci_unaccel", .attach = fmh_gpib_pci_attach_holdoff_all, .detach = fmh_gpib_pci_detach, From 57b580be50aeda8fb0836468aa4c486b30415f42 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:37 +0000 Subject: [PATCH 146/203] staging: gpib: gpio: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-10-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index a43e871c21ff..0da718389182 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -1308,7 +1308,7 @@ static int bb_attach(struct gpib_board *board, const struct gpib_board_config *c return retval; } -static gpib_interface_t bb_interface = { +static struct gpib_interface bb_interface = { .name = NAME, .attach = bb_attach, .detach = bb_detach, From e86b18d2b1127d33d33cecb7f0e06e6846d033fd Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:38 +0000 Subject: [PATCH 147/203] staging: gpib: hp_82335: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-11-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82335/hp82335.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c index f8e5d785746e..3d08d2f726e1 100644 --- a/drivers/staging/gpib/hp_82335/hp82335.c +++ b/drivers/staging/gpib/hp_82335/hp82335.c @@ -180,7 +180,7 @@ static void hp82335_return_to_local(struct gpib_board *board) tms9914_return_to_local(board, &priv->tms9914_priv); } -static gpib_interface_t hp82335_interface = { +static struct gpib_interface hp82335_interface = { .name = "hp82335", .attach = hp82335_attach, .detach = hp82335_detach, From c424bd8e483480d586ce2d5b11e5339429f10496 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:39 +0000 Subject: [PATCH 148/203] staging: gpib: hp2341: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-12-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/hp_82341/hp_82341.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpib/hp_82341/hp_82341.c index 66e4480b5fba..41accfdbc49a 100644 --- a/drivers/staging/gpib/hp_82341/hp_82341.c +++ b/drivers/staging/gpib/hp_82341/hp_82341.c @@ -411,7 +411,7 @@ static void hp_82341_return_to_local(struct gpib_board *board) tms9914_return_to_local(board, &priv->tms9914_priv); } -static gpib_interface_t hp_82341_unaccel_interface = { +static struct gpib_interface hp_82341_unaccel_interface = { .name = "hp_82341_unaccel", .attach = hp_82341_attach, .detach = hp_82341_detach, @@ -439,7 +439,7 @@ static gpib_interface_t hp_82341_unaccel_interface = { .return_to_local = hp_82341_return_to_local, }; -static gpib_interface_t hp_82341_interface = { +static struct gpib_interface hp_82341_interface = { .name = "hp_82341", .attach = hp_82341_attach, .detach = hp_82341_detach, From 03ccd6cc2356b135b6806782e28aa3297ee89f6d Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:40 +0000 Subject: [PATCH 149/203] staging: gpib: gpibP: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-13-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpibP.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/include/gpibP.h index 3e21bb1a4297..6461b330a3c3 100644 --- a/drivers/staging/gpib/include/gpibP.h +++ b/drivers/staging/gpib/include/gpibP.h @@ -18,8 +18,8 @@ #include #include -int gpib_register_driver(gpib_interface_t *interface, struct module *mod); -void gpib_unregister_driver(gpib_interface_t *interface); +int gpib_register_driver(struct gpib_interface *interface, struct module *mod); +void gpib_unregister_driver(struct gpib_interface *interface); struct pci_dev *gpib_pci_get_device(const struct gpib_board_config *config, unsigned int vendor_id, unsigned int device_id, struct pci_dev *from); struct pci_dev *gpib_pci_get_subsys(const struct gpib_board_config *config, unsigned int vendor_id, From 3b306801b146bc3626fd85f29d39e52aad022457 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:41 +0000 Subject: [PATCH 150/203] staging: gpib: ines: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-14-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines_gpib.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index 2d98c571a4b1..bf830defcad3 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -539,7 +539,7 @@ void ines_return_to_local(struct gpib_board *board) nec7210_return_to_local(board, &priv->nec7210_priv); } -static gpib_interface_t ines_pci_unaccel_interface = { +static struct gpib_interface ines_pci_unaccel_interface = { .name = "ines_pci_unaccel", .attach = ines_pci_attach, .detach = ines_pci_detach, @@ -567,7 +567,7 @@ static gpib_interface_t ines_pci_unaccel_interface = { .return_to_local = ines_return_to_local, }; -static gpib_interface_t ines_pci_interface = { +static struct gpib_interface ines_pci_interface = { .name = "ines_pci", .attach = ines_pci_accel_attach, .detach = ines_pci_detach, @@ -595,7 +595,7 @@ static gpib_interface_t ines_pci_interface = { .return_to_local = ines_return_to_local, }; -static gpib_interface_t ines_pci_accel_interface = { +static struct gpib_interface ines_pci_accel_interface = { .name = "ines_pci_accel", .attach = ines_pci_accel_attach, .detach = ines_pci_detach, @@ -623,7 +623,7 @@ static gpib_interface_t ines_pci_accel_interface = { .return_to_local = ines_return_to_local, }; -static gpib_interface_t ines_isa_interface = { +static struct gpib_interface ines_isa_interface = { .name = "ines_isa", .attach = ines_isa_attach, .detach = ines_isa_detach, @@ -1218,7 +1218,7 @@ void ines_pcmcia_cleanup_module(void) pcmcia_unregister_driver(&ines_gpib_cs_driver); } -static gpib_interface_t ines_pcmcia_unaccel_interface = { +static struct gpib_interface ines_pcmcia_unaccel_interface = { .name = "ines_pcmcia_unaccel", .attach = ines_pcmcia_attach, .detach = ines_pcmcia_detach, @@ -1246,7 +1246,7 @@ static gpib_interface_t ines_pcmcia_unaccel_interface = { .return_to_local = ines_return_to_local, }; -static gpib_interface_t ines_pcmcia_accel_interface = { +static struct gpib_interface ines_pcmcia_accel_interface = { .name = "ines_pcmcia_accel", .attach = ines_pcmcia_accel_attach, .detach = ines_pcmcia_detach, @@ -1274,7 +1274,7 @@ static gpib_interface_t ines_pcmcia_accel_interface = { .return_to_local = ines_return_to_local, }; -static gpib_interface_t ines_pcmcia_interface = { +static struct gpib_interface ines_pcmcia_interface = { .name = "ines_pcmcia", .attach = ines_pcmcia_accel_attach, .detach = ines_pcmcia_detach, From 355582c2388f04e9fcaef484956abe67d19909c7 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:42 +0000 Subject: [PATCH 151/203] staging: gpib: lpvo_usb: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-15-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index fdf10b53585d..19127ee906c2 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -1055,7 +1055,7 @@ static int usb_gpib_t1_delay(struct gpib_board *board, unsigned int nano_sec) * *** module dispatch table and init/exit functions *** */ -static gpib_interface_t usb_gpib_interface = { +static struct gpib_interface usb_gpib_interface = { .name = NAME, .attach = usb_gpib_attach, .detach = usb_gpib_detach, From 4f7c2391168f657209b7321a889a9e6428892708 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:43 +0000 Subject: [PATCH 152/203] staging: gpib: ni_usb: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-16-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c index 588bb3da9832..d5b281fa8b37 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -2373,7 +2373,7 @@ static void ni_usb_detach(struct gpib_board *board) mutex_unlock(&ni_usb_hotplug_lock); } -static gpib_interface_t ni_usb_gpib_interface = { +static struct gpib_interface ni_usb_gpib_interface = { .name = "ni_usb_b", .attach = ni_usb_attach, .detach = ni_usb_detach, From 575fb9c3fa03ee4c1de2e7a48d8ac90d633dc29f Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:44 +0000 Subject: [PATCH 153/203] staging: gpib: pc2: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-17-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/pc2/pc2_gpib.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c index 48f57a917d0d..fd191d24d7a6 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -519,7 +519,7 @@ static void pc2_2a_detach(struct gpib_board *board) pc2a_common_detach(board, pc2_2a_iosize); } -static gpib_interface_t pc2_interface = { +static struct gpib_interface pc2_interface = { .name = "pcII", .attach = pc2_attach, .detach = pc2_detach, @@ -547,7 +547,7 @@ static gpib_interface_t pc2_interface = { .return_to_local = pc2_return_to_local, }; -static gpib_interface_t pc2a_interface = { +static struct gpib_interface pc2a_interface = { .name = "pcIIa", .attach = pc2a_attach, .detach = pc2a_detach, @@ -575,7 +575,7 @@ static gpib_interface_t pc2a_interface = { .return_to_local = pc2_return_to_local, }; -static gpib_interface_t pc2a_cb7210_interface = { +static struct gpib_interface pc2a_cb7210_interface = { .name = "pcIIa_cb7210", .attach = pc2a_cb7210_attach, .detach = pc2a_detach, @@ -603,7 +603,7 @@ static gpib_interface_t pc2a_cb7210_interface = { .return_to_local = pc2_return_to_local, }; -static gpib_interface_t pc2_2a_interface = { +static struct gpib_interface pc2_2a_interface = { .name = "pcII_IIa", .attach = pc2_2a_attach, .detach = pc2_2a_detach, From 124248c48d413491cfb86632ec2f8639fa4c4d49 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:45 +0000 Subject: [PATCH 154/203] staging: gpib: tnt4882: struct gpib_interface Using Linux code style for struct gpib_interface. Adhering to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-18-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c index 3abcd65cc449..9f7f8b311da3 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -1122,7 +1122,7 @@ static int tnt4882_pci_probe(struct pci_dev *dev, const struct pci_device_id *id return 0; } -static gpib_interface_t ni_pci_interface = { +static struct gpib_interface ni_pci_interface = { .name = "ni_pci", .attach = ni_pci_attach, .detach = ni_pci_detach, @@ -1150,7 +1150,7 @@ static gpib_interface_t ni_pci_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_pci_accel_interface = { +static struct gpib_interface ni_pci_accel_interface = { .name = "ni_pci_accel", .attach = ni_pci_attach, .detach = ni_pci_detach, @@ -1178,7 +1178,7 @@ static gpib_interface_t ni_pci_accel_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_isa_interface = { +static struct gpib_interface ni_isa_interface = { .name = "ni_isa", .attach = ni_tnt_isa_attach, .detach = ni_isa_detach, @@ -1206,7 +1206,7 @@ static gpib_interface_t ni_isa_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_nat4882_isa_interface = { +static struct gpib_interface ni_nat4882_isa_interface = { .name = "ni_nat4882_isa", .attach = ni_nat4882_isa_attach, .detach = ni_isa_detach, @@ -1234,7 +1234,7 @@ static gpib_interface_t ni_nat4882_isa_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_nec_isa_interface = { +static struct gpib_interface ni_nec_isa_interface = { .name = "ni_nec_isa", .attach = ni_nec_isa_attach, .detach = ni_isa_detach, @@ -1262,7 +1262,7 @@ static gpib_interface_t ni_nec_isa_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_isa_accel_interface = { +static struct gpib_interface ni_isa_accel_interface = { .name = "ni_isa_accel", .attach = ni_tnt_isa_attach, .detach = ni_isa_detach, @@ -1290,7 +1290,7 @@ static gpib_interface_t ni_isa_accel_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_nat4882_isa_accel_interface = { +static struct gpib_interface ni_nat4882_isa_accel_interface = { .name = "ni_nat4882_isa_accel", .attach = ni_nat4882_isa_attach, .detach = ni_isa_detach, @@ -1318,7 +1318,7 @@ static gpib_interface_t ni_nat4882_isa_accel_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_nec_isa_accel_interface = { +static struct gpib_interface ni_nec_isa_accel_interface = { .name = "ni_nec_isa_accel", .attach = ni_nec_isa_attach, .detach = ni_isa_detach, @@ -1377,8 +1377,8 @@ MODULE_DEVICE_TABLE(pnp, tnt4882_pnp_table); #endif #ifdef CONFIG_GPIB_PCMCIA -static gpib_interface_t ni_pcmcia_interface; -static gpib_interface_t ni_pcmcia_accel_interface; +static struct gpib_interface ni_pcmcia_interface; +static struct gpib_interface ni_pcmcia_accel_interface; static int __init init_ni_gpib_cs(void); static void __exit exit_ni_gpib_cs(void); #endif @@ -1775,7 +1775,7 @@ static void ni_pcmcia_detach(struct gpib_board *board) tnt4882_free_private(board); } -static gpib_interface_t ni_pcmcia_interface = { +static struct gpib_interface ni_pcmcia_interface = { .name = "ni_pcmcia", .attach = ni_pcmcia_attach, .detach = ni_pcmcia_detach, @@ -1803,7 +1803,7 @@ static gpib_interface_t ni_pcmcia_interface = { .return_to_local = tnt4882_return_to_local, }; -static gpib_interface_t ni_pcmcia_accel_interface = { +static struct gpib_interface ni_pcmcia_accel_interface = { .name = "ni_pcmcia_accel", .attach = ni_pcmcia_attach, .detach = ni_pcmcia_detach, From 7567dfdd242aa77b9f7724b0be0f675f163eca91 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 00:32:46 +0000 Subject: [PATCH 155/203] staging: gpib: Removing typedef gpib_interface_t Removing gpib_interface_t to adhere to Linux code style. Reported by checkpatch.pl In general, a pointer, or a struct that has elements that can reasonably be directly accessed should never be a typedef. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417003246.84445-19-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_types.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 16aaade310fd..62ce174add85 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -8,7 +8,7 @@ #define _GPIB_TYPES_H #ifdef __KERNEL__ -/* gpib_interface_t defines the interface +/* gpib_interface defines the interface * between the board-specific details dealt with in the drivers * and generic interface provided by gpib-common. * This really should be in a different header file. @@ -22,7 +22,6 @@ #include #include -typedef struct gpib_interface gpib_interface_t; struct gpib_board; /* config parameters that are only used by driver attach functions */ @@ -212,7 +211,7 @@ static inline void init_gpib_pseudo_irq(struct gpib_pseudo_irq *pseudo_irq) /* list so we can make a linked list of drivers */ struct gpib_interface_list { struct list_head list; - gpib_interface_t *interface; + struct gpib_interface *interface; struct module *module; }; @@ -222,7 +221,7 @@ struct gpib_interface_list { */ struct gpib_board { /* functions used by this board */ - gpib_interface_t *interface; + struct gpib_interface *interface; /* Pointer to module whose use count we should increment when * interface is in use */ From b0b23267b6fc74c5a6ed355643b5c8da58d2866f Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Wed, 16 Apr 2025 20:32:59 +0000 Subject: [PATCH 156/203] staging: gpib: uapi: Fix CamelCase and IBA Dup Resolved duplicate entry for IbaSPollBit vs IbaSpollBit. Correct CamelCase for IBA enums Adhere to Linux kernel coding style. Reported by checkpatch Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250416203259.7862-2-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_user.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index 83ddaaf81529..eaf7399a164a 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -285,7 +285,7 @@ enum ibask_option { IBA_RSV = 0x21, /* board only */ IBA_BNA = 0x200, /* device only */ /* linux-gpib extensions */ - IBA_7BitEOS = 0x1000 /* board only. Returns 1 if board supports 7 bit eos compares*/ + IBA_7_BIT_EOS = 0x1000 /* board only. Returns 1 if board supports 7 bit eos compares*/ }; enum ibconfig_option { From c9bc151fb0ef8447f073dc321cdbf9aedb39b2d3 Mon Sep 17 00:00:00 2001 From: Ruben Wauters Date: Tue, 15 Apr 2025 16:11:38 +0100 Subject: [PATCH 157/203] staging: gpib: agilent_02350b: cleanup comments Cleans up the comments in both the c and the h file. Standardises the comment type (/* */) and the indentation. Signed-off-by: Ruben Wauters Link: https://lore.kernel.org/r/20250415151246.30337-1-rubenru09@aol.com Signed-off-by: Greg Kroah-Hartman --- .../gpib/agilent_82350b/agilent_82350b.c | 46 ++++++++++--------- .../gpib/agilent_82350b/agilent_82350b.h | 28 +++++------ 2 files changed, 38 insertions(+), 36 deletions(-) diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c index ce9c88a2b9f5..14ff7f19c8f7 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c @@ -39,7 +39,7 @@ static int agilent_82350b_accel_read(struct gpib_board *board, u8 *buffer, int retval = 0; unsigned short event_status; int i, num_fifo_bytes; - //hardware doesn't support checking for end-of-string character when using fifo + /* hardware doesn't support checking for end-of-string character when using fifo */ if (tms_priv->eos_flags & REOS) return tms9914_read(board, tms_priv, buffer, length, end, bytes_read); @@ -50,9 +50,9 @@ static int agilent_82350b_accel_read(struct gpib_board *board, u8 *buffer, *bytes_read = 0; if (length == 0) return 0; - //disable fifo for the moment + /* disable fifo for the moment */ writeb(DIRECTION_GPIB_TO_HOST, a_priv->gpib_base + SRAM_ACCESS_CONTROL_REG); - // handle corner case of board not in holdoff and one byte might slip in early + /* handle corner case of board not in holdoff and one byte might slip in early */ if (tms_priv->holdoff_active == 0 && length > 1) { size_t num_bytes; @@ -67,7 +67,8 @@ static int agilent_82350b_accel_read(struct gpib_board *board, u8 *buffer, tms9914_release_holdoff(tms_priv); i = 0; num_fifo_bytes = length - 1; - write_byte(tms_priv, tms_priv->imr0_bits & ~HR_BIIE, IMR0); // disable BI interrupts + /* disable BI interrupts */ + write_byte(tms_priv, tms_priv->imr0_bits & ~HR_BIIE, IMR0); while (i < num_fifo_bytes && *end == 0) { int block_size; int j; @@ -111,17 +112,18 @@ static int agilent_82350b_accel_read(struct gpib_board *board, u8 *buffer, break; } } - write_byte(tms_priv, tms_priv->imr0_bits, IMR0); // re-enable BI interrupts + /* re-enable BI interrupts */ + write_byte(tms_priv, tms_priv->imr0_bits, IMR0); *bytes_read += i; buffer += i; length -= i; writeb(DIRECTION_GPIB_TO_HOST, a_priv->gpib_base + SRAM_ACCESS_CONTROL_REG); if (retval < 0) return retval; - // read last bytes if we havn't received an END yet + /* read last bytes if we havn't received an END yet */ if (*end == 0) { size_t num_bytes; - // try to make sure we holdoff after last byte read + /* try to make sure we holdoff after last byte read */ retval = tms9914_read(board, tms_priv, buffer, length, end, &num_bytes); *bytes_read += num_bytes; if (retval < 0) @@ -169,7 +171,7 @@ static int agilent_82350b_accel_write(struct gpib_board *board, u8 *buffer, event_status = read_and_clear_event_status(board); #ifdef EXPERIMENTAL - // wait for previous BO to complete if any + /* wait for previous BO to complete if any */ retval = wait_event_interruptible(board->wait, test_bit(DEV_CLEAR_BN, &tms_priv->state) || test_bit(WRITE_READY_BN, &tms_priv->state) || @@ -192,7 +194,7 @@ static int agilent_82350b_accel_write(struct gpib_board *board, u8 *buffer, block_size = min(fifotransferlength - i, agilent_82350b_fifo_size); set_transfer_counter(a_priv, block_size); for (j = 0; j < block_size; ++j, ++i) { - // load data into board's sram + /* load data into board's sram */ writeb(buffer[i], a_priv->sram_base + j); } writeb(ENABLE_TI_TO_SRAM, a_priv->gpib_base + SRAM_ACCESS_CONTROL_REG); @@ -262,7 +264,7 @@ static irqreturn_t agilent_82350b_interrupt(int irq, void *arg) tms9914_interrupt_have_status(board, &a_priv->tms9914_priv, tms9914_status1, tms9914_status2); } -//write-clear status bits + /* write-clear status bits */ if (event_status & (BUFFER_END_STATUS_BIT | TERM_COUNT_STATUS_BIT)) { writeb(event_status & (BUFFER_END_STATUS_BIT | TERM_COUNT_STATUS_BIT), a_priv->gpib_base + EVENT_STATUS_REG); @@ -292,11 +294,11 @@ static void set_transfer_counter(struct agilent_82350b_priv *a_priv, int count) writeb(complement & 0xff, a_priv->gpib_base + XFER_COUNT_LO_REG); writeb((complement >> 8) & 0xff, a_priv->gpib_base + XFER_COUNT_MID_REG); - //I don't think the hi count reg is even used, but oh well + /* I don't think the hi count reg is even used, but oh well */ writeb((complement >> 16) & 0xf, a_priv->gpib_base + XFER_COUNT_HI_REG); } -// wrappers for interface functions +/* wrappers for interface functions */ static int agilent_82350b_read(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read) { @@ -511,18 +513,18 @@ static int init_82350a_hardware(struct gpib_board *board, PLX9050_PCI_RETRY_DELAY_BITS(64) | PLX9050_DIRECT_SLAVE_LOCK_ENABLE_BIT; -// load borg data + /* load borg data */ borg_status = readb(a_priv->borg_base); if ((borg_status & BORG_DONE_BIT)) return 0; - // need to programme borg + /* need to programme borg */ if (!config->init_data || config->init_data_length != firmware_length) { dev_err(board->gpib_dev, "the 82350A board requires firmware after powering on.\n"); return -EIO; } dev_dbg(board->gpib_dev, "Loading firmware...\n"); - // tickle the borg + /* tickle the borg */ writel(plx_cntrl_static_bits | PLX9050_USER3_DATA_BIT, a_priv->plx_base + PLX9050_CNTRL_REG); usleep_range(1000, 2000); @@ -563,7 +565,7 @@ static int test_sram(struct gpib_board *board) struct agilent_82350b_priv *a_priv = board->private_data; unsigned int i; const unsigned int sram_length = pci_resource_len(a_priv->pci_device, SRAM_82350A_REGION); - // test SRAM + /* test SRAM */ const unsigned int byte_mask = 0xff; for (i = 0; i < sram_length; ++i) { @@ -606,7 +608,7 @@ static int agilent_82350b_generic_attach(struct gpib_board *board, tms_priv->write_byte = tms9914_iomem_write_byte; tms_priv->offset = 1; - // find board + /* find board */ a_priv->pci_device = gpib_pci_get_device(config, PCI_VENDOR_ID_AGILENT, PCI_DEVICE_ID_82350B, NULL); if (a_priv->pci_device) { @@ -702,7 +704,7 @@ static int agilent_82350b_generic_attach(struct gpib_board *board, writeb(a_priv->card_mode_bits, a_priv->gpib_base + CARD_MODE_REG); if (a_priv->model == MODEL_82350A) { - // enable PCI interrupts for 82350a + /* enable PCI interrupts for 82350a */ writel(PLX9050_LINTR1_EN_BIT | PLX9050_LINTR2_POLARITY_BIT | PLX9050_PCI_INTR_EN_BIT, a_priv->plx_base + PLX9050_INTCSR_REG); @@ -713,7 +715,7 @@ static int agilent_82350b_generic_attach(struct gpib_board *board, a_priv->gpib_base + EVENT_ENABLE_REG); writeb(ENABLE_TERM_COUNT_INTERRUPT_BIT | ENABLE_BUFFER_END_INTERRUPT_BIT | ENABLE_TMS9914_INTERRUPTS_BIT, a_priv->gpib_base + INTERRUPT_ENABLE_REG); - //write-clear event status bits + /* write-clear event status bits */ writeb(BUFFER_END_STATUS_BIT | TERM_COUNT_STATUS_BIT, a_priv->gpib_base + EVENT_STATUS_REG); } else { @@ -747,7 +749,7 @@ static void agilent_82350b_detach(struct gpib_board *board) struct tms9914_priv *tms_priv; if (a_priv) { - if (a_priv->plx_base) // disable interrupts + if (a_priv->plx_base) /* disable interrupts */ writel(0, a_priv->plx_base + PLX9050_INTCSR_REG); tms_priv = &a_priv->tms9914_priv; @@ -790,7 +792,7 @@ static struct gpib_interface agilent_82350b_unaccel_interface = { .parallel_poll = agilent_82350b_parallel_poll, .parallel_poll_configure = agilent_82350b_parallel_poll_configure, .parallel_poll_response = agilent_82350b_parallel_poll_response, - .local_parallel_poll_mode = NULL, // XXX + .local_parallel_poll_mode = NULL, /* XXX */ .line_status = agilent_82350b_line_status, .update_status = agilent_82350b_update_status, .primary_address = agilent_82350b_primary_address, @@ -818,7 +820,7 @@ static struct gpib_interface agilent_82350b_interface = { .parallel_poll = agilent_82350b_parallel_poll, .parallel_poll_configure = agilent_82350b_parallel_poll_configure, .parallel_poll_response = agilent_82350b_parallel_poll_response, - .local_parallel_poll_mode = NULL, // XXX + .local_parallel_poll_mode = NULL, /* XXX */ .line_status = agilent_82350b_line_status, .update_status = agilent_82350b_update_status, .primary_address = agilent_82350b_primary_address, diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.h b/drivers/staging/gpib/agilent_82350b/agilent_82350b.h index 1573230c619d..ef841957297f 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.h +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.h @@ -41,11 +41,11 @@ enum board_model { MODEL_82351A }; -// struct which defines private_data for board +/* struct which defines private_data for board */ struct agilent_82350b_priv { struct tms9914_priv tms9914_priv; struct pci_dev *pci_device; - void __iomem *plx_base; //82350a only + void __iomem *plx_base; /* 82350a only */ void __iomem *gpib_base; void __iomem *sram_base; void __iomem *misc_base; @@ -57,12 +57,12 @@ struct agilent_82350b_priv { bool using_fifos; }; -//registers +/* registers */ enum agilent_82350b_gpib_registers { CARD_MODE_REG = 0x1, - CONFIG_DATA_REG = 0x2, // 82350A specific + CONFIG_DATA_REG = 0x2, /* 82350A specific */ INTERRUPT_ENABLE_REG = 0x3, EVENT_STATUS_REG = 0x4, EVENT_ENABLE_REG = 0x5, @@ -76,8 +76,8 @@ enum agilent_82350b_gpib_registers XFER_COUNT_HI_REG = 0xe, TMS9914_BASE_REG = 0x10, INTERNAL_CONFIG_REG = 0x18, - IMR0_READ_REG = 0x19, //read - T1_DELAY_REG = 0x19, // write + IMR0_READ_REG = 0x19, /* read */ + T1_DELAY_REG = 0x19, /* write */ IMR1_READ_REG = 0x1a, ADR_READ_REG = 0x1b, SPMR_READ_REG = 0x1c, @@ -89,7 +89,7 @@ enum agilent_82350b_gpib_registers enum card_mode_bits { - ACTIVE_CONTROLLER_BIT = 0x2, // read-only + ACTIVE_CONTROLLER_BIT = 0x2, /* read-only */ CM_SYSTEM_CONTROLLER_BIT = 0x8, ENABLE_BUS_MONITOR_BIT = 0x10, ENABLE_PCI_IRQ_BIT = 0x20, @@ -115,15 +115,15 @@ enum event_status_bits { TMS9914_IRQ_STATUS_BIT = 0x1, IRQ_STATUS_BIT = 0x2, - BUFFER_END_STATUS_BIT = 0x10, // write-clear - TERM_COUNT_STATUS_BIT = 0x20, // write-clear + BUFFER_END_STATUS_BIT = 0x10, /* write-clear */ + TERM_COUNT_STATUS_BIT = 0x20, /* write-clear */ }; enum stream_status_bits { - HALTED_STATUS_BIT = 0x1, //read - RESTART_STREAM_BIT = 0x1, //write + HALTED_STATUS_BIT = 0x1, /* read */ + RESTART_STREAM_BIT = 0x1, /* write */ }; enum internal_config_bits @@ -135,9 +135,9 @@ enum internal_config_bits enum sram_access_control_bits { - DIRECTION_GPIB_TO_HOST = 0x20, // transfer direction - ENABLE_TI_TO_SRAM = 0x40, // enable fifo - ENABLE_FAST_TALKER = 0x80 // added for 82350A (not used) + DIRECTION_GPIB_TO_HOST = 0x20, /* transfer direction */ + ENABLE_TI_TO_SRAM = 0x40, /* enable fifo */ + ENABLE_FAST_TALKER = 0x80 /* added for 82350A (not used) */ }; enum borg_bits From 06886c96a1dacf54af9938931e3fc75b4f9fa624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20Retourn=C3=A9?= Date: Wed, 16 Apr 2025 14:04:09 -0700 Subject: [PATCH 158/203] staging: gpib: include: fixes multiline comments style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the style of multiline comments to comply with the linux kernel coding style. Signed-off-by: Paul RetournĂ© Link: https://lore.kernel.org/r/20250416210411.9300-2-paul.retourne@orange.fr Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpib_types.h | 89 ++++++++++++------- .../staging/gpib/include/nec7210_registers.h | 3 +- drivers/staging/gpib/include/tms9914.h | 6 +- 3 files changed, 64 insertions(+), 34 deletions(-) diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 62ce174add85..9e0dfdb9904d 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -8,11 +8,6 @@ #define _GPIB_TYPES_H #ifdef __KERNEL__ -/* gpib_interface defines the interface - * between the board-specific details dealt with in the drivers - * and generic interface provided by gpib-common. - * This really should be in a different header file. - */ #include "gpib_user.h" #include #include @@ -36,11 +31,13 @@ struct gpib_board_config { unsigned int ibirq; /* dma channel to use for non-pnp cards (set by core, driver should make local copy) */ unsigned int ibdma; - /* pci bus of card, useful for distinguishing multiple identical pci cards + /* + * pci bus of card, useful for distinguishing multiple identical pci cards * (negative means don't care) */ int pci_bus; - /* pci slot of card, useful for distinguishing multiple identical pci cards + /* + * pci slot of card, useful for distinguishing multiple identical pci cards * (negative means don't care) */ int pci_slot; @@ -50,6 +47,12 @@ struct gpib_board_config { char *serial_number; }; +/* + * struct gpib_interface defines the interface + * between the board-specific details dealt with in the drivers + * and generic interface provided by gpib-common. + * This really should be in a different header file. + */ struct gpib_interface { /* name of board */ char *name; @@ -57,7 +60,8 @@ struct gpib_interface { int (*attach)(struct gpib_board *board, const struct gpib_board_config *config); /* detach() shuts down board and frees resources */ void (*detach)(struct gpib_board *board); - /* read() should read at most 'length' bytes from the bus into + /* + * 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' * to be nonzero if the read was terminated by an END, otherwise 'end' @@ -69,39 +73,46 @@ struct gpib_interface { */ int (*read)(struct gpib_board *board, u8 *buffer, size_t length, int *end, size_t *bytes_read); - /* write() should write 'length' bytes from buffer to the bus. + /* + * 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)(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, size_t *bytes_written); - /* command() writes the command bytes in 'buffer' to the bus + /* + * command() writes the command bytes in 'buffer' to the bus * Returns zero on success or negative value on error. */ int (*command)(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written); - /* Take control (assert ATN). If 'asyncronous' is nonzero, take + /* + * Take control (assert ATN). If 'asyncronous' is nonzero, take * control asyncronously (assert ATN immediately without waiting * for other processes to complete first). Should not return * until board becomes controller in charge. Returns zero no success, * nonzero on error. */ int (*take_control)(struct gpib_board *board, int asyncronous); - /* De-assert ATN. Returns zero on success, nonzer on error. + /* + * De-assert ATN. Returns zero on success, nonzer on error. */ int (*go_to_standby)(struct gpib_board *board); /* request/release control of the IFC and REN lines (system controller) */ void (*request_system_control)(struct gpib_board *board, int request_control); - /* Asserts or de-asserts 'interface clear' (IFC) depending on + /* + * Asserts or de-asserts 'interface clear' (IFC) depending on * boolean value of 'assert' */ void (*interface_clear)(struct gpib_board *board, int assert); - /* Sends remote enable command if 'enable' is nonzero, disables remote mode + /* + * Sends remote enable command if 'enable' is nonzero, disables remote mode * if 'enable' is zero */ void (*remote_enable)(struct gpib_board *board, int enable); - /* enable END for reads, when byte 'eos' is received. If + /* + * 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. @@ -117,26 +128,31 @@ struct gpib_interface { 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)(struct gpib_board *board, int local); - /* Returns current status of the bus lines. Should be set to + /* + * 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 struct gpib_board *board); - /* updates and returns the board's current status. + /* + * 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)(struct gpib_board *board, unsigned int clear_mask); - /* Sets primary address 0-30 for gpib interface card. + /* + * Sets primary address 0-30 for gpib interface card. */ int (*primary_address)(struct gpib_board *board, unsigned int address); - /* Sets and enables, or disables secondary address 0-30 + /* + * Sets and enables, or disables secondary address 0-30 * for gpib interface card. */ 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. + /* + * Sets the byte the board should send in response to a serial poll. * This function should also start or stop requests for service via * IEEE 488.2 reqt/reqf, based on MSS (bit 6 of the status_byte). * If the more flexible serial_poll_response2 is implemented by the @@ -149,7 +165,8 @@ struct gpib_interface { * STB, reqt, and reqf". */ void (*serial_poll_response)(struct gpib_board *board, u8 status_byte); - /* Sets the byte the board should send in response to a serial poll. + /* + * 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. * reqt should be set true if new_reason_for_service is true, @@ -165,7 +182,8 @@ struct gpib_interface { */ void (*serial_poll_response2)(struct gpib_board *board, u8 status_byte, int new_reason_for_service); - /* returns the byte the board will send in response to a serial poll. + /* + * returns the byte the board will send in response to a serial poll. */ u8 (*serial_poll_status)(struct gpib_board *board); /* adjust T1 delay */ @@ -215,14 +233,16 @@ struct gpib_interface_list { struct module *module; }; -/* One struct gpib_board is allocated for each physical board in the computer. +/* + * One struct gpib_board is allocated for each physical board in the computer. * It provides storage for variables local to each board, and interface * functions for performing operations on the board */ struct gpib_board { /* functions used by this board */ struct gpib_interface *interface; - /* Pointer to module whose use count we should increment when + /* + * Pointer to module whose use count we should increment when * interface is in use */ struct module *provider_module; @@ -230,20 +250,24 @@ struct gpib_board { u8 *buffer; /* length of buffer */ unsigned int buffer_length; - /* Used to hold the board's current status (see update_status() above) + /* + * Used to hold the board's current status (see update_status() above) */ unsigned long status; - /* Driver should only sleep on this wait queue. It is special in that the + /* + * Driver should only sleep on this wait queue. It is special in that the * core will wake this queue and set the TIMO bit in 'status' when the * watchdog timer times out. */ wait_queue_head_t wait; - /* Lock that only allows one process to access this board at a time. + /* + * Lock that only allows one process to access this board at a time. * Has to be first in any locking order, since it can be locked over * multiple ioctls. */ struct mutex user_mutex; - /* Mutex which compensates for removal of "big kernel lock" from kernel. + /* + * Mutex which compensates for removal of "big kernel lock" from kernel. * Should not be held for extended waits. */ struct mutex big_gpib_mutex; @@ -258,7 +282,8 @@ struct gpib_board { struct device *dev; /* gpib_common device gpibN */ struct device *gpib_dev; - /* 'private_data' can be used as seen fit by the driver to + /* + * 'private_data' can be used as seen fit by the driver to * store additional variables for this board */ void *private_data; @@ -295,7 +320,8 @@ struct gpib_board { unsigned master : 1; /* individual status bit */ unsigned ist : 1; - /* one means local parallel poll mode ieee 488.1 PP2 (or no parallel poll PP0), + /* + * one means local parallel poll mode ieee 488.1 PP2 (or no parallel poll PP0), * zero means remote parallel poll configuration mode ieee 488.1 PP1 */ unsigned local_ppoll_mode : 1; @@ -307,7 +333,8 @@ struct gpib_event { short event_type; }; -/* Each board has a list of gpib_status_queue to keep track of all open devices +/* + * Each board has a list of gpib_status_queue to keep track of all open devices * on the bus, so we know what address to poll when we get a service request */ struct gpib_status_queue { diff --git a/drivers/staging/gpib/include/nec7210_registers.h b/drivers/staging/gpib/include/nec7210_registers.h index 888803dd97f9..97c53ac8e805 100644 --- a/drivers/staging/gpib/include/nec7210_registers.h +++ b/drivers/staging/gpib/include/nec7210_registers.h @@ -17,7 +17,8 @@ enum nec7210_chipset { TNT5004, // NI (minor differences to TNT4882) }; -/* nec7210 register numbers (might need to be multiplied by +/* + * nec7210 register numbers (might need to be multiplied by * a board-dependent offset to get actually io address offset) */ // write registers diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/include/tms9914.h index d9ba11426ab1..352fc516fd40 100644 --- a/drivers/staging/gpib/include/tms9914.h +++ b/drivers/staging/gpib/include/tms9914.h @@ -86,7 +86,8 @@ int tms9914_write(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffe int tms9914_command(struct gpib_board *board, struct tms9914_priv *priv, u8 *buffer, size_t length, size_t *bytes_written); int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *priv, int syncronous); -/* alternate version of tms9914_take_control which works around buggy tcs +/* + * alternate version of tms9914_take_control which works around buggy tcs * implementation. */ int tms9914_take_control_workaround(struct gpib_board *board, struct tms9914_priv *priv, @@ -140,7 +141,8 @@ enum { ms9914_num_registers = 8, }; -/* tms9914 register numbers (might need to be multiplied by +/* + * tms9914 register numbers (might need to be multiplied by * a board-dependent offset to get actually io address offset) */ // write registers From e9996a9ac562b025506f062d23ea60286dbad0a1 Mon Sep 17 00:00:00 2001 From: Michael Rubin Date: Thu, 17 Apr 2025 15:38:37 +0000 Subject: [PATCH 159/203] staging: gpib: Removing unused function CFGn Removing CFGn since it is not called by kernel code nor any of the gpib drivers. Signed-off-by: Michael Rubin Link: https://lore.kernel.org/r/20250417153837.92690-1-matchstick@neverthere.org Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_user.h | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index eaf7399a164a..1cb6b6219e67 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -192,11 +192,6 @@ static inline __u8 PPE_byte(unsigned int dio_line, int sense) return cmd; } -static inline __u8 CFGn(unsigned int meters) -{ - return 0x6 | (meters & 0xf); -} - /* mask of bits that actually matter in a command byte */ enum { gpib_command_mask = 0x7f, From d065b12eb31cb883f53897107abdcf92bf342efc Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Thu, 17 Apr 2025 20:50:23 -0700 Subject: [PATCH 160/203] staging: sm750fb: clean-up `else`-blocks Clean-up `else`-blocks in `hw_sm750_map` that occur after `if`-blocks that terminate function execution. Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/20250418035023.27067-1-ericflorin.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750_hw.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 4bc89218c11c..64b199061d14 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -55,9 +55,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev) pr_err("mmio failed\n"); ret = -EFAULT; goto exit; - } else { - pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg); } + pr_info("mmio virtual addr = %p\n", sm750_dev->pvReg); sm750_dev->accel.dprBase = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1; sm750_dev->accel.dpPortBase = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1; @@ -84,9 +83,8 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev) pr_err("Map video memory failed\n"); ret = -EFAULT; goto exit; - } else { - pr_info("video memory vaddr = %p\n", sm750_dev->pvMem); } + pr_info("video memory vaddr = %p\n", sm750_dev->pvMem); exit: return ret; } From db14478045af2605fa5d08f1061c2ff311648c1d Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 11:31:10 +0200 Subject: [PATCH 161/203] staging: gpib: Remove unused enums from common include file The error code and timeout code enums are not used by any of the gpib kernel code. This patch removes them. Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418093111.8820-2-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib_user.h | 42 --------------------------- 1 file changed, 42 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib_user.h index 1cb6b6219e67..4ca3cc9e0cd7 100644 --- a/drivers/staging/gpib/uapi/gpib_user.h +++ b/drivers/staging/gpib/uapi/gpib_user.h @@ -53,48 +53,6 @@ enum ibsta_bits { EVENT | LOK | REM | CIC | ATN | TACS | LACS | DTAS | DCAS | SRQI, }; -/* IBERR error codes */ -enum iberr_code { - EDVR = 0, /* system error */ - ECIC = 1, /* not CIC */ - ENOL = 2, /* no listeners */ - EADR = 3, /* CIC and not addressed before I/O */ - EARG = 4, /* bad argument to function call */ - ESAC = 5, /* not SAC */ - EABO = 6, /* I/O operation was aborted */ - ENEB = 7, /* non-existent board (GPIB interface offline) */ - EDMA = 8, /* DMA hardware error detected */ - EOIP = 10, /* new I/O attempted with old I/O in progress */ - ECAP = 11, /* no capability for intended opeation */ - EFSO = 12, /* file system operation error */ - EBUS = 14, /* bus error */ - ESTB = 15, /* lost serial poll bytes */ - ESRQ = 16, /* SRQ stuck on */ - ETAB = 20 /* Table Overflow */ -}; - -/* Timeout values and meanings */ -enum gpib_timeout { - TNONE = 0, /* Infinite timeout (disabled) */ - T10us = 1, /* Timeout of 10 usec (ideal) */ - T30us = 2, /* Timeout of 30 usec (ideal) */ - T100us = 3, /* Timeout of 100 usec (ideal) */ - T300us = 4, /* Timeout of 300 usec (ideal) */ - T1ms = 5, /* Timeout of 1 msec (ideal) */ - T3ms = 6, /* Timeout of 3 msec (ideal) */ - T10ms = 7, /* Timeout of 10 msec (ideal) */ - T30ms = 8, /* Timeout of 30 msec (ideal) */ - T100ms = 9, /* Timeout of 100 msec (ideal) */ - T300ms = 10, /* Timeout of 300 msec (ideal) */ - T1s = 11, /* Timeout of 1 sec (ideal) */ - T3s = 12, /* Timeout of 3 sec (ideal) */ - T10s = 13, /* Timeout of 10 sec (ideal) */ - T30s = 14, /* Timeout of 30 sec (ideal) */ - T100s = 15, /* Timeout of 100 sec (ideal) */ - T300s = 16, /* Timeout of 300 sec (ideal) */ - T1000s = 17 /* Timeout of 1000 sec (maximum) */ -}; - /* End-of-string (EOS) modes for use with ibeos */ enum eos_flags { From c7184cbf5530da955407be46dd120eb7111d8973 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 11:31:11 +0200 Subject: [PATCH 162/203] staging: gpib: Rename common include file User code includes gpib_user.h. Since this include has diverged from the original by - removing unused functions and defines - changing camel-case identifiers - removing typedefs we need to change the name of the kernel include. This include will be included in the userland gpib_user.h ensuring backward compatibility for application programmes. Rename the file and change the references to it. Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418093111.8820-3-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/include/gpibP.h | 2 +- drivers/staging/gpib/include/gpib_types.h | 2 +- drivers/staging/gpib/uapi/{gpib_user.h => gpib.h} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename drivers/staging/gpib/uapi/{gpib_user.h => gpib.h} (100%) diff --git a/drivers/staging/gpib/include/gpibP.h b/drivers/staging/gpib/include/gpibP.h index 6461b330a3c3..0af72934ce24 100644 --- a/drivers/staging/gpib/include/gpibP.h +++ b/drivers/staging/gpib/include/gpibP.h @@ -11,7 +11,7 @@ #include "gpib_types.h" #include "gpib_proto.h" -#include "gpib_user.h" +#include "gpib.h" #include "gpib_ioctl.h" #include diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 9e0dfdb9904d..2af4574d400c 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -8,7 +8,7 @@ #define _GPIB_TYPES_H #ifdef __KERNEL__ -#include "gpib_user.h" +#include "gpib.h" #include #include #include diff --git a/drivers/staging/gpib/uapi/gpib_user.h b/drivers/staging/gpib/uapi/gpib.h similarity index 100% rename from drivers/staging/gpib/uapi/gpib_user.h rename to drivers/staging/gpib/uapi/gpib.h From 28925280ed6c12705a9273cc9853c97b22ef2176 Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Fri, 18 Apr 2025 09:47:54 +0000 Subject: [PATCH 163/203] staging: rtl8723bs: Add spaces and line breaks to improve readability The code contains no spaces around binary operators with long lines which reduces readability thereby not adhering to Linux kernel coding style. Add white spaces around the binary operators and use line breaks to increase readability and ensure adherence to Linux kernel coding styles. Suggested-by: Andy Shevchenko Signed-off-by: Abraham Samuel Adekunle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/3b9a0572ad56699b095642fc169c9603e08616e9.1744966511.git.abrahamadekunle50@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_xmit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index e2f7b2415524..dfee7b0e9abe 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -963,11 +963,14 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr if (SN_LESS(pattrib->seqnum, tx_seq)) { pattrib->ampdu_en = false;/* AGG BK */ } else if (SN_EQUAL(pattrib->seqnum, tx_seq)) { - psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (tx_seq+1)&0xfff; + psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = + (tx_seq + 1) & 0xfff; pattrib->ampdu_en = true;/* AGG EN */ } else { - psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = (pattrib->seqnum+1)&0xfff; + psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = + (pattrib->seqnum + 1) & 0xfff; + pattrib->ampdu_en = true;/* AGG EN */ } } From a5df13cd7b05f87f864c2d575020d287879659aa Mon Sep 17 00:00:00 2001 From: Abraham Samuel Adekunle Date: Fri, 18 Apr 2025 09:47:55 +0000 Subject: [PATCH 164/203] staging: rtl8723bs: Use % 4096 instead of & 0xfff The sequence number is constrained to a range of [0, 4095], which is a total of 4096 values. The bitmask operation using `& 0xfff` is used to perform this wrap-around. While this is functionally correct, it obscures the intended semantic of a 4096-based wrap. Using a modulo operation `% 4096u` makes the wrap-around logic explicit and easier to understand. It clearly signals that the sequence number cycles through a range of 4096 values. It also makes the code robust against potential changes of the 4096 upper limit, especially when it becomes a non power-of-2 value while the AND(&) works solely for power-of-2 values. The use of `% 4096u` also guarantees that the modulo operation is performed with unsigned arithmetic, preventing potential issues with the signed types. Found by Coccinelle. Suggested-by: Andy Shevchenko Suggested-by: David Laight Signed-off-by: Abraham Samuel Adekunle Reviewed-by: Andy Shevchenko Link: https://lore.kernel.org/r/e8d515539ba560961003eae15d301d03e6cdd17d.1744966511.git.abrahamadekunle50@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8723bs/core/rtw_recv.c | 6 +++--- drivers/staging/rtl8723bs/core/rtw_xmit.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c index 3d36b6f005e0..e74fb7d5dc37 100644 --- a/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c +++ b/drivers/staging/rtl8723bs/core/rtw_mlme_ext.c @@ -3511,7 +3511,7 @@ void issue_action_BA(struct adapter *padapter, unsigned char *raddr, unsigned ch /* if ((psta = rtw_get_stainfo(pstapriv, pmlmeinfo->network.mac_address)) != NULL) */ psta = rtw_get_stainfo(pstapriv, raddr); if (psta) { - start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07]&0xfff) + 1; + start_seq = (psta->sta_xmitpriv.txseq_tid[status & 0x07] % 4096u) + 1; psta->BA_starting_seqctrl[status & 0x07] = start_seq; diff --git a/drivers/staging/rtl8723bs/core/rtw_recv.c b/drivers/staging/rtl8723bs/core/rtw_recv.c index 895116e9f4e7..709a606be7c9 100644 --- a/drivers/staging/rtl8723bs/core/rtw_recv.c +++ b/drivers/staging/rtl8723bs/core/rtw_recv.c @@ -1641,7 +1641,7 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n struct dvobj_priv *psdpriv = padapter->dvobj; struct debug_priv *pdbgpriv = &psdpriv->drv_dbg; u8 wsize = preorder_ctrl->wsize_b; - u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) & 0xFFF;/* 4096; */ + u16 wend = (preorder_ctrl->indicate_seq + wsize - 1) % 4096u; /* Rx Reorder initialize condition. */ if (preorder_ctrl->indicate_seq == 0xFFFF) @@ -1657,7 +1657,7 @@ static int check_indicate_seq(struct recv_reorder_ctrl *preorder_ctrl, u16 seq_n /* 2. Incoming SeqNum is larger than the WinEnd => Window shift N */ /* */ if (SN_EQUAL(seq_num, preorder_ctrl->indicate_seq)) { - preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF; + preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) % 4096u; } else if (SN_LESS(wend, seq_num)) { /* boundary situation, when seq_num cross 0xFFF */ @@ -1772,7 +1772,7 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor list_del_init(&(prframe->u.hdr.list)); if (SN_EQUAL(preorder_ctrl->indicate_seq, pattrib->seq_num)) - preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) & 0xFFF; + preorder_ctrl->indicate_seq = (preorder_ctrl->indicate_seq + 1) % 4096u; /* Set this as a lock to make sure that only one thread is indicating packet. */ /* pTS->RxIndicateState = RXTS_INDICATE_PROCESSING; */ diff --git a/drivers/staging/rtl8723bs/core/rtw_xmit.c b/drivers/staging/rtl8723bs/core/rtw_xmit.c index dfee7b0e9abe..026d58b4bd7f 100644 --- a/drivers/staging/rtl8723bs/core/rtw_xmit.c +++ b/drivers/staging/rtl8723bs/core/rtw_xmit.c @@ -943,7 +943,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr if (psta) { psta->sta_xmitpriv.txseq_tid[pattrib->priority]++; - psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF; + psta->sta_xmitpriv.txseq_tid[pattrib->priority] %= 4096u; pattrib->seqnum = psta->sta_xmitpriv.txseq_tid[pattrib->priority]; SetSeqNum(hdr, pattrib->seqnum); @@ -964,12 +964,12 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr pattrib->ampdu_en = false;/* AGG BK */ } else if (SN_EQUAL(pattrib->seqnum, tx_seq)) { psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = - (tx_seq + 1) & 0xfff; + (tx_seq + 1) % 4096u; pattrib->ampdu_en = true;/* AGG EN */ } else { psta->BA_starting_seqctrl[pattrib->priority & 0x0f] = - (pattrib->seqnum + 1) & 0xfff; + (pattrib->seqnum + 1) % 4096u; pattrib->ampdu_en = true;/* AGG EN */ } From 4960bce324fedb1966eaf737bcb5eb1cef8865c9 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 15:35:37 +0200 Subject: [PATCH 165/203] staging: gpib: Add return value to request_control A number of drivers are unable to release control due to hardware or software limitations. As request_system_control was defined as void, no error could be signalled. This patch changes the prototype of request_system_control to int and adds the appropriate checking and returns. In the case that a board cannot release control EINVAL is returned. If a driver does not implement request_system_control EPERM is returned. Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418133537.22491-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- .../gpib/agilent_82350b/agilent_82350b.c | 6 ++--- .../gpib/agilent_82357a/agilent_82357a.c | 22 +++++++++---------- drivers/staging/gpib/cb7210/cb7210.c | 4 ++-- drivers/staging/gpib/cec/cec_gpib.c | 4 ++-- drivers/staging/gpib/common/gpib_os.c | 4 +--- drivers/staging/gpib/common/iblib.c | 17 ++++++++++---- drivers/staging/gpib/eastwood/fluke_gpib.c | 4 ++-- drivers/staging/gpib/fmh_gpib/fmh_gpib.c | 4 ++-- drivers/staging/gpib/gpio/gpib_bitbang.c | 16 +++++++------- drivers/staging/gpib/hp_82335/hp82335.c | 4 ++-- drivers/staging/gpib/hp_82341/hp_82341.c | 4 ++-- drivers/staging/gpib/include/gpib_proto.h | 2 +- drivers/staging/gpib/include/gpib_types.h | 2 +- drivers/staging/gpib/include/nec7210.h | 4 ++-- drivers/staging/gpib/include/tms9914.h | 4 ++-- drivers/staging/gpib/ines/ines.h | 2 +- drivers/staging/gpib/ines/ines_gpib.c | 4 ++-- .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 11 +++++----- drivers/staging/gpib/nec7210/nec7210.c | 5 +++-- drivers/staging/gpib/ni_usb/ni_usb_gpib.c | 8 +++---- drivers/staging/gpib/pc2/pc2_gpib.c | 4 ++-- drivers/staging/gpib/tms9914/tms9914.c | 5 +++-- drivers/staging/gpib/tnt4882/tnt4882_gpib.c | 6 +++-- 23 files changed, 76 insertions(+), 70 deletions(-) diff --git a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c index 14ff7f19c8f7..94bbb3b6576d 100644 --- a/drivers/staging/gpib/agilent_82350b/agilent_82350b.c +++ b/drivers/staging/gpib/agilent_82350b/agilent_82350b.c @@ -341,9 +341,7 @@ static int agilent_82350b_go_to_standby(struct gpib_board *board) return tms9914_go_to_standby(board, &priv->tms9914_priv); } -static void agilent_82350b_request_system_control(struct gpib_board *board, - int request_control) - +static int agilent_82350b_request_system_control(struct gpib_board *board, int request_control) { struct agilent_82350b_priv *a_priv = board->private_data; @@ -357,7 +355,7 @@ static void agilent_82350b_request_system_control(struct gpib_board *board, writeb(0, a_priv->gpib_base + INTERNAL_CONFIG_REG); } writeb(a_priv->card_mode_bits, a_priv->gpib_base + CARD_MODE_REG); - tms9914_request_system_control(board, &a_priv->tms9914_priv, request_control); + return tms9914_request_system_control(board, &a_priv->tms9914_priv, request_control); } static void agilent_82350b_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c index 4728ec85caa8..454d46b8b677 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -756,9 +756,7 @@ static int agilent_82357a_go_to_standby(struct gpib_board *board) return 0; } -//FIXME should change prototype to return int -static void agilent_82357a_request_system_control(struct gpib_board *board, - int request_control) +static int agilent_82357a_request_system_control(struct gpib_board *board, int request_control) { struct agilent_82357a_priv *a_priv = board->private_data; struct usb_device *usb_dev; @@ -767,7 +765,7 @@ static void agilent_82357a_request_system_control(struct gpib_board *board, int i = 0; if (!a_priv->bus_interface) - return; // -ENODEV; + return -ENODEV; usb_dev = interface_to_usbdev(a_priv->bus_interface); /* 82357B needs bit to be set in 9914 AUXCR register */ @@ -776,9 +774,7 @@ static void agilent_82357a_request_system_control(struct gpib_board *board, writes[i].value = AUX_RQC; a_priv->hw_control_bits |= SYSTEM_CONTROLLER; } else { - writes[i].value = AUX_RLC; - a_priv->is_cic = 0; - a_priv->hw_control_bits &= ~SYSTEM_CONTROLLER; + return -EINVAL; } ++i; writes[i].address = HW_CONTROL; @@ -787,7 +783,7 @@ static void agilent_82357a_request_system_control(struct gpib_board *board, retval = agilent_82357a_write_registers(a_priv, writes, i); if (retval) dev_err(&usb_dev->dev, "write_registers() returned error\n"); - return;// retval; + return retval; } static void agilent_82357a_interface_clear(struct gpib_board *board, int assert) @@ -1593,7 +1589,7 @@ static int agilent_82357a_driver_resume(struct usb_interface *interface) { struct usb_device *usb_dev = interface_to_usbdev(interface); struct gpib_board *board; - int i, retval; + int i, retval = 0; mutex_lock(&agilent_82357a_hotplug_lock); @@ -1604,8 +1600,10 @@ static int agilent_82357a_driver_resume(struct usb_interface *interface) break; } } - if (i == MAX_NUM_82357A_INTERFACES) + if (i == MAX_NUM_82357A_INTERFACES) { + retval = -ENOENT; goto resume_exit; + } struct agilent_82357a_priv *a_priv = board->private_data; @@ -1628,7 +1626,7 @@ static int agilent_82357a_driver_resume(struct usb_interface *interface) return retval; } // set/unset system controller - agilent_82357a_request_system_control(board, board->master); + retval = agilent_82357a_request_system_control(board, board->master); // toggle ifc if master if (board->master) { agilent_82357a_interface_clear(board, 1); @@ -1646,7 +1644,7 @@ static int agilent_82357a_driver_resume(struct usb_interface *interface) resume_exit: mutex_unlock(&agilent_82357a_hotplug_lock); - return 0; + return retval; } static struct usb_driver agilent_82357a_bus_driver = { diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c index 54c037aabc26..c686896bb088 100644 --- a/drivers/staging/gpib/cb7210/cb7210.c +++ b/drivers/staging/gpib/cb7210/cb7210.c @@ -578,7 +578,7 @@ static int cb7210_go_to_standby(struct gpib_board *board) return nec7210_go_to_standby(board, &priv->nec7210_priv); } -static void cb7210_request_system_control(struct gpib_board *board, int request_control) +static int cb7210_request_system_control(struct gpib_board *board, int request_control) { struct cb7210_priv *priv = board->private_data; struct nec7210_priv *nec_priv = &priv->nec7210_priv; @@ -589,7 +589,7 @@ static void cb7210_request_system_control(struct gpib_board *board, int request_ priv->hs_mode_bits &= ~HS_SYS_CONTROL; cb7210_write_byte(priv, priv->hs_mode_bits, HS_MODE); - nec7210_request_system_control(board, nec_priv, request_control); + return nec7210_request_system_control(board, nec_priv, request_control); } static void cb7210_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/cec/cec_gpib.c b/drivers/staging/gpib/cec/cec_gpib.c index 737d78736ea5..e8736cbf50e3 100644 --- a/drivers/staging/gpib/cec/cec_gpib.c +++ b/drivers/staging/gpib/cec/cec_gpib.c @@ -83,11 +83,11 @@ static int cec_go_to_standby(struct gpib_board *board) return nec7210_go_to_standby(board, &priv->nec7210_priv); } -static void cec_request_system_control(struct gpib_board *board, int request_control) +static int cec_request_system_control(struct gpib_board *board, int request_control) { struct cec_priv *priv = board->private_data; - nec7210_request_system_control(board, &priv->nec7210_priv, request_control); + return nec7210_request_system_control(board, &priv->nec7210_priv, request_control); } static void cec_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index 163d9a64e7df..d87025aadccc 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -1988,9 +1988,7 @@ static int request_system_control_ioctl(struct gpib_board *board, unsigned long if (retval) return -EFAULT; - ibrsc(board, request_control); - - return 0; + return ibrsc(board, request_control); } static int t1_delay_ioctl(struct gpib_board *board, unsigned long arg) diff --git a/drivers/staging/gpib/common/iblib.c b/drivers/staging/gpib/common/iblib.c index a8a215d4ffe4..7a44517464ab 100644 --- a/drivers/staging/gpib/common/iblib.c +++ b/drivers/staging/gpib/common/iblib.c @@ -422,12 +422,21 @@ int ibsic(struct gpib_board *board, unsigned int usec_duration) return 0; } - /* FIXME make int */ -void ibrsc(struct gpib_board *board, int request_control) +int ibrsc(struct gpib_board *board, int request_control) { + int retval; + + if (!board->interface->request_system_control) + return -EPERM; + + retval = board->interface->request_system_control(board, request_control); + + if (retval) + return retval; + board->master = request_control != 0; - if (board->interface->request_system_control) - board->interface->request_system_control(board, request_control); + + return 0; } /* diff --git a/drivers/staging/gpib/eastwood/fluke_gpib.c b/drivers/staging/gpib/eastwood/fluke_gpib.c index f6a84200e3a1..491356433249 100644 --- a/drivers/staging/gpib/eastwood/fluke_gpib.c +++ b/drivers/staging/gpib/eastwood/fluke_gpib.c @@ -94,12 +94,12 @@ static int fluke_go_to_standby(struct gpib_board *board) return nec7210_go_to_standby(board, &priv->nec7210_priv); } -static void fluke_request_system_control(struct gpib_board *board, int request_control) +static int fluke_request_system_control(struct gpib_board *board, int request_control) { struct fluke_priv *priv = board->private_data; struct nec7210_priv *nec_priv = &priv->nec7210_priv; - nec7210_request_system_control(board, nec_priv, request_control); + return nec7210_request_system_control(board, nec_priv, request_control); } static void fluke_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c index ca07e6ecb0a8..4138f3d2bae7 100644 --- a/drivers/staging/gpib/fmh_gpib/fmh_gpib.c +++ b/drivers/staging/gpib/fmh_gpib/fmh_gpib.c @@ -86,12 +86,12 @@ static int fmh_gpib_go_to_standby(struct gpib_board *board) return nec7210_go_to_standby(board, &priv->nec7210_priv); } -static void fmh_gpib_request_system_control(struct gpib_board *board, int request_control) +static int fmh_gpib_request_system_control(struct gpib_board *board, int request_control) { struct fmh_priv *priv = board->private_data; struct nec7210_priv *nec_priv = &priv->nec7210_priv; - nec7210_request_system_control(board, nec_priv, request_control); + return nec7210_request_system_control(board, nec_priv, request_control); } static void fmh_gpib_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 0da718389182..9670522fe36e 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -883,16 +883,16 @@ static int bb_go_to_standby(struct gpib_board *board) return 0; } -static void bb_request_system_control(struct gpib_board *board, int request_control) +static int bb_request_system_control(struct gpib_board *board, int request_control) { dbg_printk(2, "%d\n", request_control); - if (request_control) { - set_bit(CIC_NUM, &board->status); - // drive DAV & EOI false, enable NRFD & NDAC irqs - SET_DIR_WRITE(board->private_data); - } else { - clear_bit(CIC_NUM, &board->status); - } + if (!request_control) + return -EINVAL; + + set_bit(CIC_NUM, &board->status); + // drive DAV & EOI false, enable NRFD & NDAC irqs + SET_DIR_WRITE(board->private_data); + return 0; } static void bb_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/hp_82335/hp82335.c b/drivers/staging/gpib/hp_82335/hp82335.c index 3d08d2f726e1..d0e47ef77c87 100644 --- a/drivers/staging/gpib/hp_82335/hp82335.c +++ b/drivers/staging/gpib/hp_82335/hp82335.c @@ -68,11 +68,11 @@ static int hp82335_go_to_standby(struct gpib_board *board) return tms9914_go_to_standby(board, &priv->tms9914_priv); } -static void hp82335_request_system_control(struct gpib_board *board, int request_control) +static int hp82335_request_system_control(struct gpib_board *board, int request_control) { struct hp82335_priv *priv = board->private_data; - tms9914_request_system_control(board, &priv->tms9914_priv, request_control); + return tms9914_request_system_control(board, &priv->tms9914_priv, request_control); } static void hp82335_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/hp_82341/hp_82341.c b/drivers/staging/gpib/hp_82341/hp_82341.c index 41accfdbc49a..1b0822b2a3b8 100644 --- a/drivers/staging/gpib/hp_82341/hp_82341.c +++ b/drivers/staging/gpib/hp_82341/hp_82341.c @@ -294,7 +294,7 @@ static int hp_82341_go_to_standby(struct gpib_board *board) return tms9914_go_to_standby(board, &priv->tms9914_priv); } -static void hp_82341_request_system_control(struct gpib_board *board, int request_control) +static int hp_82341_request_system_control(struct gpib_board *board, int request_control) { struct hp_82341_priv *priv = board->private_data; @@ -303,7 +303,7 @@ static void hp_82341_request_system_control(struct gpib_board *board, int reques else priv->mode_control_bits &= ~SYSTEM_CONTROLLER_BIT; outb(priv->mode_control_bits, priv->iobase[0] + MODE_CONTROL_STATUS_REG); - tms9914_request_system_control(board, &priv->tms9914_priv, request_control); + return tms9914_request_system_control(board, &priv->tms9914_priv, request_control); } static void hp_82341_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/include/gpib_proto.h b/drivers/staging/gpib/include/gpib_proto.h index 1c8e5955b9ce..42e736e3b7cd 100644 --- a/drivers/staging/gpib/include/gpib_proto.h +++ b/drivers/staging/gpib/include/gpib_proto.h @@ -31,7 +31,7 @@ int iblines(const struct gpib_board *board, short *lines); int ibrd(struct gpib_board *board, u8 *buf, size_t length, int *end_flag, size_t *bytes_read); int ibrpp(struct gpib_board *board, u8 *buf); int ibrsv2(struct gpib_board *board, u8 status_byte, int new_reason_for_service); -void ibrsc(struct gpib_board *board, int request_control); +int 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); diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h index 2af4574d400c..db040c80d778 100644 --- a/drivers/staging/gpib/include/gpib_types.h +++ b/drivers/staging/gpib/include/gpib_types.h @@ -100,7 +100,7 @@ struct gpib_interface { */ int (*go_to_standby)(struct gpib_board *board); /* request/release control of the IFC and REN lines (system controller) */ - void (*request_system_control)(struct gpib_board *board, int request_control); + int (*request_system_control)(struct gpib_board *board, int request_control); /* * Asserts or de-asserts 'interface clear' (IFC) depending on * boolean value of 'assert' diff --git a/drivers/staging/gpib/include/nec7210.h b/drivers/staging/gpib/include/nec7210.h index 97a56f74258b..312217b4580e 100644 --- a/drivers/staging/gpib/include/nec7210.h +++ b/drivers/staging/gpib/include/nec7210.h @@ -86,8 +86,8 @@ int nec7210_command(struct gpib_board *board, struct nec7210_priv *priv, u8 *buf size_t length, size_t *bytes_written); int nec7210_take_control(struct gpib_board *board, struct nec7210_priv *priv, int syncronous); int nec7210_go_to_standby(struct gpib_board *board, struct nec7210_priv *priv); -void nec7210_request_system_control(struct gpib_board *board, - struct nec7210_priv *priv, int request_control); +int nec7210_request_system_control(struct gpib_board *board, + struct nec7210_priv *priv, int request_control); 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, u8 eos_bytes, diff --git a/drivers/staging/gpib/include/tms9914.h b/drivers/staging/gpib/include/tms9914.h index 352fc516fd40..50a9d3b22619 100644 --- a/drivers/staging/gpib/include/tms9914.h +++ b/drivers/staging/gpib/include/tms9914.h @@ -93,8 +93,8 @@ int tms9914_take_control(struct gpib_board *board, struct tms9914_priv *priv, in int tms9914_take_control_workaround(struct gpib_board *board, struct tms9914_priv *priv, int syncronous); int tms9914_go_to_standby(struct gpib_board *board, struct tms9914_priv *priv); -void tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv, - int request_control); +int tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv, + int request_control); 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, u8 eos_bytes, diff --git a/drivers/staging/gpib/ines/ines.h b/drivers/staging/gpib/ines/ines.h index 396cf0bd9ad1..07b82f790c4b 100644 --- a/drivers/staging/gpib/ines/ines.h +++ b/drivers/staging/gpib/ines/ines.h @@ -47,7 +47,7 @@ int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, int ines_command(struct gpib_board *board, u8 *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_control); +int ines_request_system_control(struct gpib_board *board, int request_control); 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, u8 eos_byte, int compare_8_bits); diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index bf830defcad3..49947ac30feb 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -441,11 +441,11 @@ int ines_go_to_standby(struct gpib_board *board) return nec7210_go_to_standby(board, &priv->nec7210_priv); } -void ines_request_system_control(struct gpib_board *board, int request_control) +int ines_request_system_control(struct gpib_board *board, int request_control) { struct ines_priv *priv = board->private_data; - nec7210_request_system_control(board, &priv->nec7210_priv, request_control); + return nec7210_request_system_control(board, &priv->nec7210_priv, request_control); } void ines_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 19127ee906c2..2e315c7756c4 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -911,15 +911,14 @@ static void usb_gpib_remote_enable(struct gpib_board *board, int enable) /* request_system_control */ -static void usb_gpib_request_system_control(struct gpib_board *board, - int request_control) +static int usb_gpib_request_system_control(struct gpib_board *board, int request_control) { - if (request_control) - set_bit(CIC_NUM, &board->status); - else - clear_bit(CIC_NUM, &board->status); + if (!request_control) + return -EINVAL; + set_bit(CIC_NUM, &board->status); DIA_LOG(1, "done with %d -> %lx\n", request_control, board->status); + return 0; } /* take_control */ diff --git a/drivers/staging/gpib/nec7210/nec7210.c b/drivers/staging/gpib/nec7210/nec7210.c index e68361d213ee..34a1cae4f486 100644 --- a/drivers/staging/gpib/nec7210/nec7210.c +++ b/drivers/staging/gpib/nec7210/nec7210.c @@ -332,14 +332,15 @@ int nec7210_go_to_standby(struct gpib_board *board, struct nec7210_priv *priv) } EXPORT_SYMBOL(nec7210_go_to_standby); -void nec7210_request_system_control(struct gpib_board *board, struct nec7210_priv *priv, - int request_control) +int nec7210_request_system_control(struct gpib_board *board, struct nec7210_priv *priv, + int request_control) { if (request_control == 0) { write_byte(priv, AUX_CREN, AUXMR); write_byte(priv, AUX_CIFC, AUXMR); write_byte(priv, AUX_DSC, AUXMR); } + return 0; } EXPORT_SYMBOL(nec7210_request_system_control); diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c index d5b281fa8b37..9ec850c4749f 100644 --- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c +++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c @@ -1055,7 +1055,7 @@ static int ni_usb_go_to_standby(struct gpib_board *board) return 0; } -static void ni_usb_request_system_control(struct gpib_board *board, int request_control) +static int ni_usb_request_system_control(struct gpib_board *board, int request_control) { int retval; struct ni_usb_priv *ni_priv = board->private_data; @@ -1065,7 +1065,7 @@ static void ni_usb_request_system_control(struct gpib_board *board, int request_ unsigned int ibsta; if (!ni_priv->bus_interface) - return; // -ENODEV; + return -ENODEV; usb_dev = interface_to_usbdev(ni_priv->bus_interface); if (request_control) { writes[i].device = NIUSB_SUBDEV_TNT4882; @@ -1097,12 +1097,12 @@ static void ni_usb_request_system_control(struct gpib_board *board, int request_ retval = ni_usb_write_registers(ni_priv, writes, i, &ibsta); if (retval < 0) { dev_err(&usb_dev->dev, "register write failed, retval=%i\n", retval); - return; // retval; + return retval; } if (!request_control) ni_priv->ren_state = 0; ni_usb_soft_update_status(board, ibsta, 0); - return; // 0; + return 0; } //FIXME maybe the interface should have a "pulse interface clear" function that can return an error? diff --git a/drivers/staging/gpib/pc2/pc2_gpib.c b/drivers/staging/gpib/pc2/pc2_gpib.c index fd191d24d7a6..2282492025b7 100644 --- a/drivers/staging/gpib/pc2/pc2_gpib.c +++ b/drivers/staging/gpib/pc2/pc2_gpib.c @@ -128,11 +128,11 @@ static int pc2_go_to_standby(struct gpib_board *board) return nec7210_go_to_standby(board, &priv->nec7210_priv); } -static void pc2_request_system_control(struct gpib_board *board, int request_control) +static int pc2_request_system_control(struct gpib_board *board, int request_control) { struct pc2_priv *priv = board->private_data; - nec7210_request_system_control(board, &priv->nec7210_priv, request_control); + return nec7210_request_system_control(board, &priv->nec7210_priv, request_control); } static void pc2_interface_clear(struct gpib_board *board, int assert) diff --git a/drivers/staging/gpib/tms9914/tms9914.c b/drivers/staging/gpib/tms9914/tms9914.c index 9208c50d9c75..04d57108efc7 100644 --- a/drivers/staging/gpib/tms9914/tms9914.c +++ b/drivers/staging/gpib/tms9914/tms9914.c @@ -118,8 +118,8 @@ void tms9914_remote_enable(struct gpib_board *board, struct tms9914_priv *priv, } EXPORT_SYMBOL_GPL(tms9914_remote_enable); -void tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv, - int request_control) +int tms9914_request_system_control(struct gpib_board *board, struct tms9914_priv *priv, + int request_control) { if (request_control) { write_byte(priv, AUX_RQC, AUXCR); @@ -127,6 +127,7 @@ void tms9914_request_system_control(struct gpib_board *board, struct tms9914_pri clear_bit(CIC_NUM, &board->status); write_byte(priv, AUX_RLC, AUXCR); } + return 0; } EXPORT_SYMBOL_GPL(tms9914_request_system_control); diff --git a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c index 9f7f8b311da3..a17b69e34986 100644 --- a/drivers/staging/gpib/tnt4882/tnt4882_gpib.c +++ b/drivers/staging/gpib/tnt4882/tnt4882_gpib.c @@ -645,19 +645,21 @@ static int tnt4882_go_to_standby(struct gpib_board *board) return nec7210_go_to_standby(board, &priv->nec7210_priv); } -static void tnt4882_request_system_control(struct gpib_board *board, int request_control) +static int tnt4882_request_system_control(struct gpib_board *board, int request_control) { struct tnt4882_priv *priv = board->private_data; + int retval; if (request_control) { tnt_writeb(priv, SETSC, CMDR); udelay(1); } - nec7210_request_system_control(board, &priv->nec7210_priv, request_control); + retval = nec7210_request_system_control(board, &priv->nec7210_priv, request_control); if (!request_control) { tnt_writeb(priv, CLRSC, CMDR); udelay(1); } + return retval; } static void tnt4882_interface_clear(struct gpib_board *board, int assert) From 0dbd55e96fe4afba826a8084363d1caf9f0986d5 Mon Sep 17 00:00:00 2001 From: Ruben Wauters Date: Fri, 18 Apr 2025 16:17:47 +0100 Subject: [PATCH 166/203] staging: sm750fb: Remove ddk750_sii164 Removes unused functions and files ddk750_sii164. Functions were used in ddk750_dvi.c, which is itself unused. Removal will be in the second patch in the series. Signed-off-by: Ruben Wauters Link: https://lore.kernel.org/r/20250418151755.42624-2-rubenru09@aol.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/Makefile | 4 +- drivers/staging/sm750fb/ddk750_dvi.c | 21 +- drivers/staging/sm750fb/ddk750_sii164.c | 408 ------------------------ drivers/staging/sm750fb/ddk750_sii164.h | 174 ---------- 4 files changed, 4 insertions(+), 603 deletions(-) delete mode 100644 drivers/staging/sm750fb/ddk750_sii164.c delete mode 100644 drivers/staging/sm750fb/ddk750_sii164.h diff --git a/drivers/staging/sm750fb/Makefile b/drivers/staging/sm750fb/Makefile index b89aa4c12e9d..1926376664ca 100644 --- a/drivers/staging/sm750fb/Makefile +++ b/drivers/staging/sm750fb/Makefile @@ -3,5 +3,5 @@ obj-$(CONFIG_FB_SM750) += sm750fb.o sm750fb-objs := sm750.o sm750_hw.o sm750_accel.o sm750_cursor.o \ ddk750_chip.o ddk750_power.o ddk750_mode.o \ - ddk750_display.o ddk750_swi2c.o ddk750_sii164.o \ - ddk750_dvi.o ddk750_hwi2c.o + ddk750_display.o ddk750_swi2c.o ddk750_dvi.o \ + ddk750_hwi2c.o diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c index 6fef1ab484c1..9842c4e4cdf8 100644 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ b/drivers/staging/sm750fb/ddk750_dvi.c @@ -4,31 +4,14 @@ #include "ddk750_chip.h" #include "ddk750_reg.h" #include "ddk750_dvi.h" -#include "ddk750_sii164.h" /* * This global variable contains all the supported driver and its corresponding * function API. Please set the function pointer to NULL whenever the function * is not supported. */ -static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { -#ifdef DVI_CTRL_SII164 - { - .init = sii164_init_chip, - .get_vendor_id = sii164_get_vendor_id, - .get_device_id = sii164_get_device_id, -#ifdef SII164_FULL_FUNCTIONS - .reset_chip = sii164_reset_chip, - .get_chip_string = sii164_get_chip_string, - .set_power = sii164_set_power, - .enable_hot_plug_detection = sii164_enable_hot_plug_detection, - .is_connected = sii164_is_connected, - .check_interrupt = sii164_check_interrupt, - .clear_interrupt = sii164_clear_interrupt, -#endif - }, -#endif -}; + +static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { }; int dvi_init(unsigned char edge_select, unsigned char bus_select, diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c deleted file mode 100644 index 89700fc5dd2e..000000000000 --- a/drivers/staging/sm750fb/ddk750_sii164.c +++ /dev/null @@ -1,408 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#define USE_DVICHIP -#ifdef USE_DVICHIP - -#include "ddk750_sii164.h" -#include "ddk750_hwi2c.h" - -/* I2C Address of each SII164 chip */ -#define SII164_I2C_ADDRESS 0x70 - -/* Define this definition to use hardware i2c. */ -#define USE_HW_I2C - -#ifdef USE_HW_I2C - #define i2cWriteReg sm750_hw_i2c_write_reg - #define i2cReadReg sm750_hw_i2c_read_reg -#else - #define i2cWriteReg sm750_sw_i2c_write_reg - #define i2cReadReg sm750_sw_i2c_read_reg -#endif - -/* SII164 Vendor and Device ID */ -#define SII164_VENDOR_ID 0x0001 -#define SII164_DEVICE_ID 0x0006 - -#ifdef SII164_FULL_FUNCTIONS -/* Name of the DVI Controller chip */ -static char *gDviCtrlChipName = "Silicon Image SiI 164"; -#endif - -/* - * sii164_get_vendor_id - * This function gets the vendor ID of the DVI controller chip. - * - * Output: - * Vendor ID - */ -unsigned short sii164_get_vendor_id(void) -{ - unsigned short vendorID; - - vendorID = ((unsigned short)i2cReadReg(SII164_I2C_ADDRESS, - SII164_VENDOR_ID_HIGH) << 8) | - (unsigned short)i2cReadReg(SII164_I2C_ADDRESS, - SII164_VENDOR_ID_LOW); - - return vendorID; -} - -/* - * sii164_get_device_id - * This function gets the device ID of the DVI controller chip. - * - * Output: - * Device ID - */ -unsigned short sii164_get_device_id(void) -{ - unsigned short device_id; - - device_id = ((unsigned short)i2cReadReg(SII164_I2C_ADDRESS, - SII164_DEVICE_ID_HIGH) << 8) | - (unsigned short)i2cReadReg(SII164_I2C_ADDRESS, - SII164_DEVICE_ID_LOW); - - return device_id; -} - -/* - * DVI.C will handle all SiI164 chip stuffs and try its best to make code - * minimal and useful - */ - -/* - * sii164_init_chip - * This function initialize and detect the DVI controller chip. - * - * Input: - * edge_select - Edge Select: - * 0 = Input data is falling edge latched (falling - * edge latched first in dual edge mode) - * 1 = Input data is rising edge latched (rising - * edge latched first in dual edge mode) - * bus_select - Input Bus Select: - * 0 = Input data bus is 12-bits wide - * 1 = Input data bus is 24-bits wide - * dual_edge_clk_select - Dual Edge Clock Select - * 0 = Input data is single edge latched - * 1 = Input data is dual edge latched - * hsync_enable - Horizontal Sync Enable: - * 0 = HSYNC input is transmitted as fixed LOW - * 1 = HSYNC input is transmitted as is - * vsync_enable - Vertical Sync Enable: - * 0 = VSYNC input is transmitted as fixed LOW - * 1 = VSYNC input is transmitted as is - * deskew_enable - De-skewing Enable: - * 0 = De-skew disabled - * 1 = De-skew enabled - * deskew_setting - De-skewing Setting (increment of 260psec) - * 0 = 1 step --> minimum setup / maximum hold - * 1 = 2 step - * 2 = 3 step - * 3 = 4 step - * 4 = 5 step - * 5 = 6 step - * 6 = 7 step - * 7 = 8 step --> maximum setup / minimum hold - * continuous_sync_enable- SYNC Continuous: - * 0 = Disable - * 1 = Enable - * pll_filter_enable - PLL Filter Enable - * 0 = Disable PLL Filter - * 1 = Enable PLL Filter - * pll_filter_value - PLL Filter characteristics: - * 0~7 (recommended value is 4) - * - * Output: - * 0 - Success - * -1 - Fail. - */ -long sii164_init_chip(unsigned char edge_select, - unsigned char bus_select, - unsigned char dual_edge_clk_select, - unsigned char hsync_enable, - unsigned char vsync_enable, - unsigned char deskew_enable, - unsigned char deskew_setting, - unsigned char continuous_sync_enable, - unsigned char pll_filter_enable, - unsigned char pll_filter_value) -{ - unsigned char config; - - /* Initialize the i2c bus */ -#ifdef USE_HW_I2C - /* Use fast mode. */ - sm750_hw_i2c_init(1); -#else - sm750_sw_i2c_init(DEFAULT_I2C_SCL, DEFAULT_I2C_SDA); -#endif - - /* Check if SII164 Chip exists */ - if ((sii164_get_vendor_id() == SII164_VENDOR_ID) && - (sii164_get_device_id() == SII164_DEVICE_ID)) { - /* - * Initialize SII164 controller chip. - */ - - /* Select the edge */ - if (edge_select == 0) - config = SII164_CONFIGURATION_LATCH_FALLING; - else - config = SII164_CONFIGURATION_LATCH_RISING; - - /* Select bus wide */ - if (bus_select == 0) - config |= SII164_CONFIGURATION_BUS_12BITS; - else - config |= SII164_CONFIGURATION_BUS_24BITS; - - /* Select Dual/Single Edge Clock */ - if (dual_edge_clk_select == 0) - config |= SII164_CONFIGURATION_CLOCK_SINGLE; - else - config |= SII164_CONFIGURATION_CLOCK_DUAL; - - /* Select HSync Enable */ - if (hsync_enable == 0) - config |= SII164_CONFIGURATION_HSYNC_FORCE_LOW; - else - config |= SII164_CONFIGURATION_HSYNC_AS_IS; - - /* Select VSync Enable */ - if (vsync_enable == 0) - config |= SII164_CONFIGURATION_VSYNC_FORCE_LOW; - else - config |= SII164_CONFIGURATION_VSYNC_AS_IS; - - i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config); - - /* - * De-skew enabled with default 111b value. - * This fixes some artifacts problem in some mode on board 2.2. - * Somehow this fix does not affect board 2.1. - */ - if (deskew_enable == 0) - config = SII164_DESKEW_DISABLE; - else - config = SII164_DESKEW_ENABLE; - - switch (deskew_setting) { - case 0: - config |= SII164_DESKEW_1_STEP; - break; - case 1: - config |= SII164_DESKEW_2_STEP; - break; - case 2: - config |= SII164_DESKEW_3_STEP; - break; - case 3: - config |= SII164_DESKEW_4_STEP; - break; - case 4: - config |= SII164_DESKEW_5_STEP; - break; - case 5: - config |= SII164_DESKEW_6_STEP; - break; - case 6: - config |= SII164_DESKEW_7_STEP; - break; - case 7: - config |= SII164_DESKEW_8_STEP; - break; - } - i2cWriteReg(SII164_I2C_ADDRESS, SII164_DESKEW, config); - - /* Enable/Disable Continuous Sync. */ - if (continuous_sync_enable == 0) - config = SII164_PLL_FILTER_SYNC_CONTINUOUS_DISABLE; - else - config = SII164_PLL_FILTER_SYNC_CONTINUOUS_ENABLE; - - /* Enable/Disable PLL Filter */ - if (pll_filter_enable == 0) - config |= SII164_PLL_FILTER_DISABLE; - else - config |= SII164_PLL_FILTER_ENABLE; - - /* Set the PLL Filter value */ - config |= ((pll_filter_value & 0x07) << 1); - - i2cWriteReg(SII164_I2C_ADDRESS, SII164_PLL, config); - - /* Recover from Power Down and enable output. */ - config = i2cReadReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION); - config |= SII164_CONFIGURATION_POWER_NORMAL; - i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config); - - return 0; - } - - /* Return -1 if initialization fails. */ - return -1; -} - -/* below sii164 function is not necessary */ - -#ifdef SII164_FULL_FUNCTIONS - -/* - * sii164_reset_chip - * This function resets the DVI Controller Chip. - */ -void sii164_reset_chip(void) -{ - /* Power down */ - sii164_set_power(0); - sii164_set_power(1); -} - -/* - * sii164_get_chip_string - * This function returns a char string name of the current DVI Controller - * chip. - * - * It's convenient for application need to display the chip name. - */ -char *sii164_get_chip_string(void) -{ - return gDviCtrlChipName; -} - -/* - * sii164_set_power - * This function sets the power configuration of the DVI Controller Chip. - * - * Input: - * powerUp - Flag to set the power down or up - */ -void sii164_set_power(unsigned char powerUp) -{ - unsigned char config; - - config = i2cReadReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION); - if (powerUp == 1) { - /* Power up the chip */ - config &= ~SII164_CONFIGURATION_POWER_MASK; - config |= SII164_CONFIGURATION_POWER_NORMAL; - i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config); - } else { - /* Power down the chip */ - config &= ~SII164_CONFIGURATION_POWER_MASK; - config |= SII164_CONFIGURATION_POWER_DOWN; - i2cWriteReg(SII164_I2C_ADDRESS, SII164_CONFIGURATION, config); - } -} - -/* - * sii164SelectHotPlugDetectionMode - * This function selects the mode of the hot plug detection. - */ -static -void sii164SelectHotPlugDetectionMode(enum sii164_hot_plug_mode hotPlugMode) -{ - unsigned char detectReg; - - detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & - ~SII164_DETECT_MONITOR_SENSE_OUTPUT_FLAG; - switch (hotPlugMode) { - case SII164_HOTPLUG_DISABLE: - detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_HIGH; - break; - case SII164_HOTPLUG_USE_MDI: - detectReg &= ~SII164_DETECT_INTERRUPT_MASK; - detectReg |= SII164_DETECT_INTERRUPT_BY_HTPLG_PIN; - detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_MDI; - break; - case SII164_HOTPLUG_USE_RSEN: - detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_RSEN; - break; - case SII164_HOTPLUG_USE_HTPLG: - detectReg |= SII164_DETECT_MONITOR_SENSE_OUTPUT_HTPLG; - break; - } - - i2cWriteReg(SII164_I2C_ADDRESS, SII164_DETECT, detectReg); -} - -/* - * sii164_enable_hot_plug_detection - * This function enables the Hot Plug detection. - * - * enable_hot_plug - Enable (=1) / disable (=0) Hot Plug detection - */ -void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug) -{ - unsigned char detectReg; - - detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); - - /* Depending on each DVI controller, need to enable the hot plug based - * on each individual chip design. - */ - if (enable_hot_plug != 0) - sii164SelectHotPlugDetectionMode(SII164_HOTPLUG_USE_MDI); - else - sii164SelectHotPlugDetectionMode(SII164_HOTPLUG_DISABLE); -} - -/* - * sii164_is_connected - * Check if the DVI Monitor is connected. - * - * Output: - * 0 - Not Connected - * 1 - Connected - */ -unsigned char sii164_is_connected(void) -{ - unsigned char hotPlugValue; - - hotPlugValue = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & - SII164_DETECT_HOT_PLUG_STATUS_MASK; - if (hotPlugValue == SII164_DETECT_HOT_PLUG_STATUS_ON) - return 1; - else - return 0; -} - -/* - * sii164_check_interrupt - * Checks if interrupt has occurred. - * - * Output: - * 0 - No interrupt - * 1 - Interrupt occurs - */ -unsigned char sii164_check_interrupt(void) -{ - unsigned char detectReg; - - detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT) & - SII164_DETECT_MONITOR_STATE_MASK; - if (detectReg == SII164_DETECT_MONITOR_STATE_CHANGE) - return 1; - else - return 0; -} - -/* - * sii164_clear_interrupt - * Clear the hot plug interrupt. - */ -void sii164_clear_interrupt(void) -{ - unsigned char detectReg; - - /* Clear the MDI interrupt */ - detectReg = i2cReadReg(SII164_I2C_ADDRESS, SII164_DETECT); - i2cWriteReg(SII164_I2C_ADDRESS, SII164_DETECT, - detectReg | SII164_DETECT_MONITOR_STATE_CLEAR); -} - -#endif - -#endif diff --git a/drivers/staging/sm750fb/ddk750_sii164.h b/drivers/staging/sm750fb/ddk750_sii164.h deleted file mode 100644 index ebc173658f0e..000000000000 --- a/drivers/staging/sm750fb/ddk750_sii164.h +++ /dev/null @@ -1,174 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef DDK750_SII164_H__ -#define DDK750_SII164_H__ - -#define USE_DVICHIP - -/* Hot Plug detection mode structure */ -enum sii164_hot_plug_mode { - SII164_HOTPLUG_DISABLE = 0, /* Disable Hot Plug output bit - * (always high). - */ - - SII164_HOTPLUG_USE_MDI, /* Use Monitor Detect Interrupt bit. */ - SII164_HOTPLUG_USE_RSEN, /* Use Receiver Sense detect bit. */ - SII164_HOTPLUG_USE_HTPLG /* Use Hot Plug detect bit. */ -}; - -/* Silicon Image SiI164 chip prototype */ -long sii164_init_chip(unsigned char edgeSelect, - unsigned char busSelect, - unsigned char dualEdgeClkSelect, - unsigned char hsyncEnable, - unsigned char vsyncEnable, - unsigned char deskewEnable, - unsigned char deskewSetting, - unsigned char continuousSyncEnable, - unsigned char pllFilterEnable, - unsigned char pllFilterValue); - -unsigned short sii164_get_vendor_id(void); -unsigned short sii164_get_device_id(void); - -#ifdef SII164_FULL_FUNCTIONS -void sii164_reset_chip(void); -char *sii164_get_chip_string(void); -void sii164_set_power(unsigned char powerUp); -void sii164_enable_hot_plug_detection(unsigned char enable_hot_plug); -unsigned char sii164_is_connected(void); -unsigned char sii164_check_interrupt(void); -void sii164_clear_interrupt(void); -#endif -/* - * below register definition is used for - * Silicon Image SiI164 DVI controller chip - */ -/* - * Vendor ID registers - */ -#define SII164_VENDOR_ID_LOW 0x00 -#define SII164_VENDOR_ID_HIGH 0x01 - -/* - * Device ID registers - */ -#define SII164_DEVICE_ID_LOW 0x02 -#define SII164_DEVICE_ID_HIGH 0x03 - -/* - * Device Revision - */ -#define SII164_DEVICE_REVISION 0x04 - -/* - * Frequency Limitation registers - */ -#define SII164_FREQUENCY_LIMIT_LOW 0x06 -#define SII164_FREQUENCY_LIMIT_HIGH 0x07 - -/* - * Power Down and Input Signal Configuration registers - */ -#define SII164_CONFIGURATION 0x08 - -/* Power down (PD) */ -#define SII164_CONFIGURATION_POWER_DOWN 0x00 -#define SII164_CONFIGURATION_POWER_NORMAL 0x01 -#define SII164_CONFIGURATION_POWER_MASK 0x01 - -/* Input Edge Latch Select (EDGE) */ -#define SII164_CONFIGURATION_LATCH_FALLING 0x00 -#define SII164_CONFIGURATION_LATCH_RISING 0x02 - -/* Bus Select (BSEL) */ -#define SII164_CONFIGURATION_BUS_12BITS 0x00 -#define SII164_CONFIGURATION_BUS_24BITS 0x04 - -/* Dual Edge Clock Select (DSEL) */ -#define SII164_CONFIGURATION_CLOCK_SINGLE 0x00 -#define SII164_CONFIGURATION_CLOCK_DUAL 0x08 - -/* Horizontal Sync Enable (HEN) */ -#define SII164_CONFIGURATION_HSYNC_FORCE_LOW 0x00 -#define SII164_CONFIGURATION_HSYNC_AS_IS 0x10 - -/* Vertical Sync Enable (VEN) */ -#define SII164_CONFIGURATION_VSYNC_FORCE_LOW 0x00 -#define SII164_CONFIGURATION_VSYNC_AS_IS 0x20 - -/* - * Detection registers - */ -#define SII164_DETECT 0x09 - -/* Monitor Detect Interrupt (MDI) */ -#define SII164_DETECT_MONITOR_STATE_CHANGE 0x00 -#define SII164_DETECT_MONITOR_STATE_NO_CHANGE 0x01 -#define SII164_DETECT_MONITOR_STATE_CLEAR 0x01 -#define SII164_DETECT_MONITOR_STATE_MASK 0x01 - -/* Hot Plug detect Input (HTPLG) */ -#define SII164_DETECT_HOT_PLUG_STATUS_OFF 0x00 -#define SII164_DETECT_HOT_PLUG_STATUS_ON 0x02 -#define SII164_DETECT_HOT_PLUG_STATUS_MASK 0x02 - -/* Receiver Sense (RSEN) */ -#define SII164_DETECT_RECEIVER_SENSE_NOT_DETECTED 0x00 -#define SII164_DETECT_RECEIVER_SENSE_DETECTED 0x04 - -/* Interrupt Generation Method (TSEL) */ -#define SII164_DETECT_INTERRUPT_BY_RSEN_PIN 0x00 -#define SII164_DETECT_INTERRUPT_BY_HTPLG_PIN 0x08 -#define SII164_DETECT_INTERRUPT_MASK 0x08 - -/* Monitor Sense Output (MSEN) */ -#define SII164_DETECT_MONITOR_SENSE_OUTPUT_HIGH 0x00 -#define SII164_DETECT_MONITOR_SENSE_OUTPUT_MDI 0x10 -#define SII164_DETECT_MONITOR_SENSE_OUTPUT_RSEN 0x20 -#define SII164_DETECT_MONITOR_SENSE_OUTPUT_HTPLG 0x30 -#define SII164_DETECT_MONITOR_SENSE_OUTPUT_FLAG 0x30 - -/* - * Skewing registers - */ -#define SII164_DESKEW 0x0A - -/* General Purpose Input (CTL[3:1]) */ -#define SII164_DESKEW_GENERAL_PURPOSE_INPUT_MASK 0x0E - -/* De-skewing Enable bit (DKEN) */ -#define SII164_DESKEW_DISABLE 0x00 -#define SII164_DESKEW_ENABLE 0x10 - -/* De-skewing Setting (DK[3:1])*/ -#define SII164_DESKEW_1_STEP 0x00 -#define SII164_DESKEW_2_STEP 0x20 -#define SII164_DESKEW_3_STEP 0x40 -#define SII164_DESKEW_4_STEP 0x60 -#define SII164_DESKEW_5_STEP 0x80 -#define SII164_DESKEW_6_STEP 0xA0 -#define SII164_DESKEW_7_STEP 0xC0 -#define SII164_DESKEW_8_STEP 0xE0 - -/* - * User Configuration Data registers (CFG 7:0) - */ -#define SII164_USER_CONFIGURATION 0x0B - -/* - * PLL registers - */ -#define SII164_PLL 0x0C - -/* PLL Filter Value (PLLF) */ -#define SII164_PLL_FILTER_VALUE_MASK 0x0E - -/* PLL Filter Enable (PFEN) */ -#define SII164_PLL_FILTER_DISABLE 0x00 -#define SII164_PLL_FILTER_ENABLE 0x01 - -/* Sync Continuous (SCNT) */ -#define SII164_PLL_FILTER_SYNC_CONTINUOUS_DISABLE 0x00 -#define SII164_PLL_FILTER_SYNC_CONTINUOUS_ENABLE 0x80 - -#endif From 911ab08c0c2879c50469746dec7b3d52b3642918 Mon Sep 17 00:00:00 2001 From: Ruben Wauters Date: Fri, 18 Apr 2025 16:17:48 +0100 Subject: [PATCH 167/203] staging: sm750fb: remove ddk750_dvi This file and the code present was unused in the whole driver, therefore this patch removes the file and unused reference to the header. Signed-off-by: Ruben Wauters Link: https://lore.kernel.org/r/20250418151755.42624-3-rubenru09@aol.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/Makefile | 3 +- drivers/staging/sm750fb/ddk750_display.c | 1 - drivers/staging/sm750fb/ddk750_dvi.c | 45 ------------------- drivers/staging/sm750fb/ddk750_dvi.h | 57 ------------------------ 4 files changed, 1 insertion(+), 105 deletions(-) delete mode 100644 drivers/staging/sm750fb/ddk750_dvi.c delete mode 100644 drivers/staging/sm750fb/ddk750_dvi.h diff --git a/drivers/staging/sm750fb/Makefile b/drivers/staging/sm750fb/Makefile index 1926376664ca..b3cb973e2672 100644 --- a/drivers/staging/sm750fb/Makefile +++ b/drivers/staging/sm750fb/Makefile @@ -3,5 +3,4 @@ obj-$(CONFIG_FB_SM750) += sm750fb.o sm750fb-objs := sm750.o sm750_hw.o sm750_accel.o sm750_cursor.o \ ddk750_chip.o ddk750_power.o ddk750_mode.o \ - ddk750_display.o ddk750_swi2c.o ddk750_dvi.o \ - ddk750_hwi2c.o + ddk750_display.o ddk750_swi2c.o ddk750_hwi2c.o diff --git a/drivers/staging/sm750fb/ddk750_display.c b/drivers/staging/sm750fb/ddk750_display.c index 172624ff98b0..4e390541a507 100644 --- a/drivers/staging/sm750fb/ddk750_display.c +++ b/drivers/staging/sm750fb/ddk750_display.c @@ -3,7 +3,6 @@ #include "ddk750_chip.h" #include "ddk750_display.h" #include "ddk750_power.h" -#include "ddk750_dvi.h" static void set_display_control(int ctrl, int disp_state) { diff --git a/drivers/staging/sm750fb/ddk750_dvi.c b/drivers/staging/sm750fb/ddk750_dvi.c deleted file mode 100644 index 9842c4e4cdf8..000000000000 --- a/drivers/staging/sm750fb/ddk750_dvi.c +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#define USE_DVICHIP -#ifdef USE_DVICHIP -#include "ddk750_chip.h" -#include "ddk750_reg.h" -#include "ddk750_dvi.h" - -/* - * This global variable contains all the supported driver and its corresponding - * function API. Please set the function pointer to NULL whenever the function - * is not supported. - */ - -static struct dvi_ctrl_device dcft_supported_dvi_controller[] = { }; - -int dvi_init(unsigned char edge_select, - unsigned char bus_select, - unsigned char dual_edge_clk_select, - unsigned char hsync_enable, - unsigned char vsync_enable, - unsigned char deskew_enable, - unsigned char deskew_setting, - unsigned char continuous_sync_enable, - unsigned char pll_filter_enable, - unsigned char pll_filter_value) -{ - struct dvi_ctrl_device *current_dvi_ctrl; - - current_dvi_ctrl = dcft_supported_dvi_controller; - if (current_dvi_ctrl->init) { - return current_dvi_ctrl->init(edge_select, - bus_select, - dual_edge_clk_select, - hsync_enable, - vsync_enable, - deskew_enable, - deskew_setting, - continuous_sync_enable, - pll_filter_enable, - pll_filter_value); - } - return -1; /* error */ -} - -#endif diff --git a/drivers/staging/sm750fb/ddk750_dvi.h b/drivers/staging/sm750fb/ddk750_dvi.h deleted file mode 100644 index c2518b73bdbd..000000000000 --- a/drivers/staging/sm750fb/ddk750_dvi.h +++ /dev/null @@ -1,57 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef DDK750_DVI_H__ -#define DDK750_DVI_H__ - -/* dvi chip stuffs structros */ - -typedef long (*PFN_DVICTRL_INIT)(unsigned char edge_select, - unsigned char bus_select, - unsigned char dual_edge_clk_select, - unsigned char hsync_enable, - unsigned char vsync_enable, - unsigned char deskew_enable, - unsigned char deskew_setting, - unsigned char continuous_sync_enable, - unsigned char pll_filter_enable, - unsigned char pll_filter_value); - -typedef void (*PFN_DVICTRL_RESETCHIP)(void); -typedef char* (*PFN_DVICTRL_GETCHIPSTRING)(void); -typedef unsigned short (*PFN_DVICTRL_GETVENDORID)(void); -typedef unsigned short (*PFN_DVICTRL_GETDEVICEID)(void); -typedef void (*PFN_DVICTRL_SETPOWER)(unsigned char power_up); -typedef void (*PFN_DVICTRL_HOTPLUGDETECTION)(unsigned char enable_hot_plug); -typedef unsigned char (*PFN_DVICTRL_ISCONNECTED)(void); -typedef unsigned char (*PFN_DVICTRL_CHECKINTERRUPT)(void); -typedef void (*PFN_DVICTRL_CLEARINTERRUPT)(void); - -/* Structure to hold all the function pointer to the DVI Controller. */ -struct dvi_ctrl_device { - PFN_DVICTRL_INIT init; - PFN_DVICTRL_RESETCHIP reset_chip; - PFN_DVICTRL_GETCHIPSTRING get_chip_string; - PFN_DVICTRL_GETVENDORID get_vendor_id; - PFN_DVICTRL_GETDEVICEID get_device_id; - PFN_DVICTRL_SETPOWER set_power; - PFN_DVICTRL_HOTPLUGDETECTION enable_hot_plug_detection; - PFN_DVICTRL_ISCONNECTED is_connected; - PFN_DVICTRL_CHECKINTERRUPT check_interrupt; - PFN_DVICTRL_CLEARINTERRUPT clear_interrupt; -}; - -#define DVI_CTRL_SII164 - -/* dvi functions prototype */ -int dvi_init(unsigned char edge_select, - unsigned char bus_select, - unsigned char dual_edge_clk_select, - unsigned char hsync_enable, - unsigned char vsync_enable, - unsigned char deskew_enable, - unsigned char deskew_setting, - unsigned char continuous_sync_enable, - unsigned char pll_filter_enable, - unsigned char pll_filter_value); - -#endif - From 8d2edd726e02ad570512159a9b97a47266ddf074 Mon Sep 17 00:00:00 2001 From: Ruben Wauters Date: Fri, 18 Apr 2025 16:17:49 +0100 Subject: [PATCH 168/203] staging: sm750fb: remove ddk750_hwi2c With the removal of ddk750_sii164.c, the functions in ddk750_hwi2c are now also unused. This patch removes them and the files they are in. Signed-off-by: Ruben Wauters Link: https://lore.kernel.org/r/20250418151755.42624-4-rubenru09@aol.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/Makefile | 2 +- drivers/staging/sm750fb/ddk750.h | 3 - drivers/staging/sm750fb/ddk750_hwi2c.c | 247 ------------------------- drivers/staging/sm750fb/ddk750_hwi2c.h | 12 -- 4 files changed, 1 insertion(+), 263 deletions(-) delete mode 100644 drivers/staging/sm750fb/ddk750_hwi2c.c delete mode 100644 drivers/staging/sm750fb/ddk750_hwi2c.h diff --git a/drivers/staging/sm750fb/Makefile b/drivers/staging/sm750fb/Makefile index b3cb973e2672..f7e227df0e54 100644 --- a/drivers/staging/sm750fb/Makefile +++ b/drivers/staging/sm750fb/Makefile @@ -3,4 +3,4 @@ obj-$(CONFIG_FB_SM750) += sm750fb.o sm750fb-objs := sm750.o sm750_hw.o sm750_accel.o sm750_cursor.o \ ddk750_chip.o ddk750_power.o ddk750_mode.o \ - ddk750_display.o ddk750_swi2c.o ddk750_hwi2c.o + ddk750_display.o ddk750_swi2c.o diff --git a/drivers/staging/sm750fb/ddk750.h b/drivers/staging/sm750fb/ddk750.h index 64ef4d258a91..8a32f8cf3a98 100644 --- a/drivers/staging/sm750fb/ddk750.h +++ b/drivers/staging/sm750fb/ddk750.h @@ -14,8 +14,5 @@ #include "ddk750_chip.h" #include "ddk750_display.h" #include "ddk750_power.h" -#ifdef USE_HW_I2C -#include "ddk750_hwi2c.h" -#endif #include "ddk750_swi2c.h" #endif diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.c b/drivers/staging/sm750fb/ddk750_hwi2c.c deleted file mode 100644 index 8482689b665b..000000000000 --- a/drivers/staging/sm750fb/ddk750_hwi2c.c +++ /dev/null @@ -1,247 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -#define USE_HW_I2C -#ifdef USE_HW_I2C -#include "ddk750_chip.h" -#include "ddk750_reg.h" -#include "ddk750_hwi2c.h" -#include "ddk750_power.h" - -#define MAX_HWI2C_FIFO 16 -#define HWI2C_WAIT_TIMEOUT 0xF0000 - -int sm750_hw_i2c_init(unsigned char bus_speed_mode) -{ - unsigned int value; - - /* Enable GPIO 30 & 31 as IIC clock & data */ - value = peek32(GPIO_MUX); - - value |= (GPIO_MUX_30 | GPIO_MUX_31); - poke32(GPIO_MUX, value); - - /* - * Enable Hardware I2C power. - * TODO: Check if we need to enable GPIO power? - */ - sm750_enable_i2c(1); - - /* Enable the I2C Controller and set the bus speed mode */ - value = peek32(I2C_CTRL) & ~(I2C_CTRL_MODE | I2C_CTRL_EN); - if (bus_speed_mode) - value |= I2C_CTRL_MODE; - value |= I2C_CTRL_EN; - poke32(I2C_CTRL, value); - - return 0; -} - -void sm750_hw_i2c_close(void) -{ - unsigned int value; - - /* Disable I2C controller */ - value = peek32(I2C_CTRL) & ~I2C_CTRL_EN; - poke32(I2C_CTRL, value); - - /* Disable I2C Power */ - sm750_enable_i2c(0); - - /* Set GPIO 30 & 31 back as GPIO pins */ - value = peek32(GPIO_MUX); - value &= ~GPIO_MUX_30; - value &= ~GPIO_MUX_31; - poke32(GPIO_MUX, value); -} - -static long hw_i2c_wait_tx_done(void) -{ - unsigned int timeout; - - /* Wait until the transfer is completed. */ - timeout = HWI2C_WAIT_TIMEOUT; - while (!(peek32(I2C_STATUS) & I2C_STATUS_TX) && (timeout != 0)) - timeout--; - - if (timeout == 0) - return -1; - - return 0; -} - -/* - * This function writes data to the i2c slave device registers. - * - * Parameters: - * addr - i2c Slave device address - * length - Total number of bytes to be written to the device - * buf - The buffer that contains the data to be written to the - * i2c device. - * - * Return Value: - * Total number of bytes those are actually written. - */ -static unsigned int hw_i2c_write_data(unsigned char addr, - unsigned int length, - unsigned char *buf) -{ - unsigned char count, i; - unsigned int total_bytes = 0; - - /* Set the Device Address */ - poke32(I2C_SLAVE_ADDRESS, addr & ~0x01); - - /* - * Write data. - * Note: - * Only 16 byte can be accessed per i2c start instruction. - */ - do { - /* - * Reset I2C by writing 0 to I2C_RESET register to - * clear the previous status. - */ - poke32(I2C_RESET, 0); - - /* Set the number of bytes to be written */ - if (length < MAX_HWI2C_FIFO) - count = length - 1; - else - count = MAX_HWI2C_FIFO - 1; - poke32(I2C_BYTE_COUNT, count); - - /* Move the data to the I2C data register */ - for (i = 0; i <= count; i++) - poke32(I2C_DATA0 + i, *buf++); - - /* Start the I2C */ - poke32(I2C_CTRL, peek32(I2C_CTRL) | I2C_CTRL_CTRL); - - /* Wait until the transfer is completed. */ - if (hw_i2c_wait_tx_done() != 0) - break; - - /* Subtract length */ - length -= (count + 1); - - /* Total byte written */ - total_bytes += (count + 1); - - } while (length > 0); - - return total_bytes; -} - -/* - * This function reads data from the slave device and stores them - * in the given buffer - * - * Parameters: - * addr - i2c Slave device address - * length - Total number of bytes to be read - * buf - Pointer to a buffer to be filled with the data read - * from the slave device. It has to be the same size as the - * length to make sure that it can keep all the data read. - * - * Return Value: - * Total number of actual bytes read from the slave device - */ -static unsigned int hw_i2c_read_data(unsigned char addr, - unsigned int length, - unsigned char *buf) -{ - unsigned char count, i; - unsigned int total_bytes = 0; - - /* Set the Device Address */ - poke32(I2C_SLAVE_ADDRESS, addr | 0x01); - - /* - * Read data and save them to the buffer. - * Note: - * Only 16 byte can be accessed per i2c start instruction. - */ - do { - /* - * Reset I2C by writing 0 to I2C_RESET register to - * clear all the status. - */ - poke32(I2C_RESET, 0); - - /* Set the number of bytes to be read */ - if (length <= MAX_HWI2C_FIFO) - count = length - 1; - else - count = MAX_HWI2C_FIFO - 1; - poke32(I2C_BYTE_COUNT, count); - - /* Start the I2C */ - poke32(I2C_CTRL, peek32(I2C_CTRL) | I2C_CTRL_CTRL); - - /* Wait until transaction done. */ - if (hw_i2c_wait_tx_done() != 0) - break; - - /* Save the data to the given buffer */ - for (i = 0; i <= count; i++) - *buf++ = peek32(I2C_DATA0 + i); - - /* Subtract length by 16 */ - length -= (count + 1); - - /* Number of bytes read. */ - total_bytes += (count + 1); - - } while (length > 0); - - return total_bytes; -} - -/* - * This function reads the slave device's register - * - * Parameters: - * deviceAddress - i2c Slave device address which register - * to be read from - * registerIndex - Slave device's register to be read - * - * Return Value: - * Register value - */ -unsigned char sm750_hw_i2c_read_reg(unsigned char addr, unsigned char reg) -{ - unsigned char value = 0xFF; - - if (hw_i2c_write_data(addr, 1, ®) == 1) - hw_i2c_read_data(addr, 1, &value); - - return value; -} - -/* - * This function writes a value to the slave device's register - * - * Parameters: - * deviceAddress - i2c Slave device address which register - * to be written - * registerIndex - Slave device's register to be written - * data - Data to be written to the register - * - * Result: - * 0 - Success - * -1 - Fail - */ -int sm750_hw_i2c_write_reg(unsigned char addr, - unsigned char reg, - unsigned char data) -{ - unsigned char value[2]; - - value[0] = reg; - value[1] = data; - if (hw_i2c_write_data(addr, 2, value) == 2) - return 0; - - return -1; -} - -#endif diff --git a/drivers/staging/sm750fb/ddk750_hwi2c.h b/drivers/staging/sm750fb/ddk750_hwi2c.h deleted file mode 100644 index 337c6493ca61..000000000000 --- a/drivers/staging/sm750fb/ddk750_hwi2c.h +++ /dev/null @@ -1,12 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef DDK750_HWI2C_H__ -#define DDK750_HWI2C_H__ - -/* hwi2c functions */ -int sm750_hw_i2c_init(unsigned char bus_speed_mode); -void sm750_hw_i2c_close(void); - -unsigned char sm750_hw_i2c_read_reg(unsigned char addr, unsigned char reg); -int sm750_hw_i2c_write_reg(unsigned char addr, unsigned char reg, - unsigned char data); -#endif From 9a7988fa4d80a49fa444f7717837ebfd35b34181 Mon Sep 17 00:00:00 2001 From: Ruben Wauters Date: Fri, 18 Apr 2025 16:17:50 +0100 Subject: [PATCH 169/203] staging: sm750fb: remove irrelevant TODO line As all code referencing USE_HW_I2C and USE_DVICHIP has now been deleted, this patch removes the TODO line referencing it. Signed-off-by: Ruben Wauters Link: https://lore.kernel.org/r/20250418151755.42624-5-rubenru09@aol.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/TODO | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/sm750fb/TODO b/drivers/staging/sm750fb/TODO index 9dd57c566257..7ce632d040b3 100644 --- a/drivers/staging/sm750fb/TODO +++ b/drivers/staging/sm750fb/TODO @@ -3,9 +3,6 @@ TODO: - use kernel coding style - refine the code and remove unused code - Implement hardware acceleration for imageblit if image->depth > 1 -- check on hardware effects of removal of USE_HW_I2C and USE_DVICHIP (these two - are supposed to be sample code which is given here if someone wants to - use those functionalities) - must be ported to the atomic kms framework in the drm subsystem (which will give you a basic fbdev driver for free) From 8ba7c33be02ca099470b3acc21f859b3be4d1d61 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:27 +0200 Subject: [PATCH 170/203] staging: gpib: Fix request_system_control in gpio The implementation of the bb_request_system_control function confused setting controller-in-charge with becoming system-controller. Remove setting controller-in-charge and add initialization of the control lines for the system-controller role. Fixes: 4cd654f84769 ("staging: gpib: Add gpio bitbang GPIB driver") Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-2-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 9670522fe36e..29aab72c1f0f 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -889,9 +889,13 @@ static int bb_request_system_control(struct gpib_board *board, int request_contr if (!request_control) return -EINVAL; - set_bit(CIC_NUM, &board->status); - // drive DAV & EOI false, enable NRFD & NDAC irqs - SET_DIR_WRITE(board->private_data); + gpiod_direction_output(REN, 1); /* user space must enable REN if needed */ + gpiod_direction_output(IFC, 1); /* user space must toggle IFC if needed */ + if (sn7516x) + gpiod_direction_output(DC, 0); /* enable ATN as output on SN75161/2 */ + + gpiod_direction_input(SRQ); + return 0; } From f56f2d6c9b6514866d489da6175a6cc9a95af02d Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:28 +0200 Subject: [PATCH 171/203] staging: gpib: Fix setting controller-in-charge The gpio board can only act as system controller. By the IEEE488.1 standard a system controller becomes controller-in-charge when it asserts the interface-clear control line. Remove the setting of controller-in-charge from bb_take_control and move it to bb_interface_clear. Fixes: 4cd654f84769 ("staging: gpib: Add gpio bitbang GPIB driver") Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-3-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 29aab72c1f0f..a92c4eda99a0 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -872,7 +872,6 @@ static int bb_take_control(struct gpib_board *board, int synchronous) { dbg_printk(2, "%d\n", synchronous); set_atn(board, 1); - set_bit(CIC_NUM, &board->status); return 0; } @@ -908,6 +907,7 @@ static void bb_interface_clear(struct gpib_board *board, int assert) gpiod_direction_output(IFC, 0); priv->talker_state = talker_idle; priv->listener_state = listener_idle; + set_bit(CIC_NUM, &board->status); } else { gpiod_direction_output(IFC, 1); } From 2eab123b6e643c0a11d9bc31f8a63078bf38734d Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:29 +0200 Subject: [PATCH 172/203] staging: gpib: Enable SRQ irq on request_system_control The SRQ irq was being enabled on attach but the board is not set up to handle it until it becomes system controller. Move the enabling of the SRQ irq to bb_request_system_control. Fixes: 4cd654f84769 ("staging: gpib: Add gpio bitbang GPIB driver") Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-4-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index a92c4eda99a0..ac9ecb6e0aad 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -884,6 +884,8 @@ static int bb_go_to_standby(struct gpib_board *board) static int bb_request_system_control(struct gpib_board *board, int request_control) { + struct bb_priv *priv = board->private_data; + dbg_printk(2, "%d\n", request_control); if (!request_control) return -EINVAL; @@ -895,6 +897,8 @@ static int bb_request_system_control(struct gpib_board *board, int request_contr gpiod_direction_input(SRQ); + ENABLE_IRQ(priv->irq_SRQ, IRQ_TYPE_EDGE_FALLING); + return 0; } @@ -1299,8 +1303,6 @@ static int bb_attach(struct gpib_board *board, const struct gpib_board_config *c IRQF_TRIGGER_NONE)) goto bb_attach_fail_r; - ENABLE_IRQ(priv->irq_SRQ, IRQ_TYPE_EDGE_FALLING); - dbg_printk(0, "attached board %d\n", board->minor); goto bb_attach_out; From b56611d934bbd8b62ef3ee54c0edb7e0c973892d Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:30 +0200 Subject: [PATCH 173/203] staging: gpib: Remove dependency on LED subsystem The yoga pin map is compatible with the others so that its led can be used as the activity led. Using the LED subsytem required adding a dtoverlay to the boot config as well as setting up the activity led via sysfs. To simplify the setup we remove the dependency on the LED subsystem and use the on board led as for the other pin maps. Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-5-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index ac9ecb6e0aad..caa8361da696 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -66,7 +66,6 @@ #include #include #include -#include static int sn7516x_used = 1, sn7516x; module_param(sn7516x_used, int, 0660); @@ -136,19 +135,14 @@ enum lines_t { #define SN7516X_PINS 4 #define NUM_PINS (GPIB_PINS + SN7516X_PINS) -DEFINE_LED_TRIGGER(ledtrig_gpib); -#define ACT_LED_ON do { \ +#define ACT_LED_ON do { \ if (ACT_LED) \ - gpiod_direction_output(ACT_LED, 1); \ - else \ - led_trigger_event(ledtrig_gpib, LED_FULL); } \ - while (0) -#define ACT_LED_OFF do { \ + gpiod_direction_output(ACT_LED, 1); \ + } while (0) +#define ACT_LED_OFF do { \ if (ACT_LED) \ - gpiod_direction_output(ACT_LED, 0); \ - else \ - led_trigger_event(ledtrig_gpib, LED_OFF); } \ - while (0) + gpiod_direction_output(ACT_LED, 0); \ + } while (0) static struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS]; @@ -1180,8 +1174,6 @@ static int allocate_gpios(struct gpib_board *board) } if (lookup_table) gpiod_remove_lookup_table(lookup_table); - // Initialize LED trigger - led_trigger_register_simple("gpib", &ledtrig_gpib); return retval; } @@ -1193,8 +1185,6 @@ static void bb_detach(struct gpib_board *board) if (!board->private_data) return; - led_trigger_unregister_simple(ledtrig_gpib); - bb_free_irq(board, &priv->irq_DAV, NAME "_DAV"); bb_free_irq(board, &priv->irq_NRFD, NAME "_NRFD"); bb_free_irq(board, &priv->irq_NDAC, NAME "_NDAC"); @@ -1254,7 +1244,6 @@ static int bb_attach(struct gpib_board *board, const struct gpib_board_config *c gpios_vector[&(D06) - &all_descriptors[0]] = YOGA_D06_pin_nr; gpios_vector[&(PE) - &all_descriptors[0]] = -1; gpios_vector[&(DC) - &all_descriptors[0]] = -1; - gpios_vector[&(ACT_LED) - &all_descriptors[0]] = -1; } else { dev_err(board->gpib_dev, "Unrecognized pin map %s\n", pin_map); goto bb_attach_fail; From 8da1ce7ec08d3079d63709ead2ab56c32f2af744 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:31 +0200 Subject: [PATCH 174/203] staging: gpib: Remove atn_asserted global variable atn_asserted was introduced to deal with an issue where certain models of the Raspberry Pi would lose interrupts under heavy load. Using a combination of edge and level interrupts the problem was resolved so the work-around is no longer needed. This patch removes the work-around. Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-6-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index caa8361da696..1d650cb57cd2 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -306,7 +306,6 @@ struct bb_priv { int dav_seq; long all_irqs; int dav_idle; - int atn_asserted; enum talker_function_state talker_state; enum listener_function_state listener_state; @@ -614,7 +613,8 @@ static irqreturn_t bb_NRFD_interrupt(int irq, void *arg) goto nrfd_exit; } - if (priv->atn_asserted && priv->w_cnt >= priv->length) { // test for end of transfer + if (priv->w_cnt >= priv->length) { // test for missed NDAC end of transfer + dev_err(board->gpib_dev, "Unexpected NRFD exit\n"); priv->write_done = 1; priv->w_busy = 0; wake_up_interruptible(&board->wait); @@ -686,14 +686,14 @@ static irqreturn_t bb_NDAC_interrupt(int irq, void *arg) dbg_printk(3, "accepted %zu\n", priv->w_cnt - 1); - if (!priv->atn_asserted && priv->w_cnt >= priv->length) { // test for end of transfer + gpiod_set_value(DAV, 1); // Data not available + priv->dav_tx = 1; + priv->phase = 510; + + if (priv->w_cnt >= priv->length) { // test for end of transfer priv->write_done = 1; priv->w_busy = 0; wake_up_interruptible(&board->wait); - } else { - gpiod_set_value(DAV, 1); // Data not available - priv->dav_tx = 1; - priv->phase = 510; } ndac_exit: @@ -850,6 +850,7 @@ static void set_atn(struct gpib_board *board, int atn_asserted) priv->listener_state = listener_addressed; if (priv->talker_state == talker_active) priv->talker_state = talker_addressed; + SET_DIR_WRITE(priv); // need to be able to read bus NRFD/NDAC } else { if (priv->listener_state == listener_addressed) { priv->listener_state = listener_active; @@ -859,7 +860,6 @@ static void set_atn(struct gpib_board *board, int atn_asserted) priv->talker_state = talker_active; } gpiod_direction_output(_ATN, !atn_asserted); - priv->atn_asserted = atn_asserted; } static int bb_take_control(struct gpib_board *board, int synchronous) From 427ab512c2c8784686738ade287e5eb52bd8292a Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:32 +0200 Subject: [PATCH 175/203] staging: gpib: Change error code for no listener When doing a write a test is made to see whether there are any listeners. The code was returning ENODEV which is incorrect. The user library translates ENOTCONN to a user level no listener error code. Change the error code to ENOTCONN. Fixes: 4cd654f84769 ("staging: gpib: Add gpio bitbang GPIB driver") Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-7-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 1d650cb57cd2..86b98eb1ce69 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -516,7 +516,7 @@ static int bb_write(struct gpib_board *board, u8 *buffer, size_t length, gpiod_get_value(NRFD), gpiod_get_value(NDAC)); if (gpiod_get_value(NRFD) && gpiod_get_value(NDAC)) { /* check for listener */ - retval = -ENODEV; + retval = -ENOTCONN; goto write_end; } From 125cda86d1970572cf3d0086ad34cbae1f0c6afb Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:33 +0200 Subject: [PATCH 176/203] staging: gpib: Cleanup allocate_gpios code The function was using unnecessary variables error and retval. Simplify the code by testing for failure first and remove the redundant variables. Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-8-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 39 +++++++++++------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 86b98eb1ce69..5c134cfb6d61 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -1123,8 +1123,7 @@ static void release_gpios(void) static int allocate_gpios(struct gpib_board *board) { - int j, retval = 0; - bool error = false; + int j; int table_index = 0; char name[256]; struct gpio_desc *desc; @@ -1135,8 +1134,8 @@ static int allocate_gpios(struct gpib_board *board) return -ENOENT; } - lookup_table = lookup_tables[0]; - lookup_table->dev_id = dev_name(board->gpib_dev); + lookup_table = lookup_tables[table_index]; + lookup_table->dev_id = dev_name(board->gpib_dev); gpiod_add_lookup_table(lookup_table); dbg_printk(1, "Allocating gpios using table index %d\n", table_index); @@ -1153,28 +1152,26 @@ static int allocate_gpios(struct gpib_board *board) gpiod_remove_lookup_table(lookup_table); table_index++; lookup_table = lookup_tables[table_index]; - if (lookup_table) { - dbg_printk(1, "Allocation failed, now using table_index %d\n", - table_index); - lookup_table->dev_id = dev_name(board->gpib_dev); - gpiod_add_lookup_table(lookup_table); - goto try_again; + if (!lookup_table) { + dev_err(board->gpib_dev, "Unable to obtain gpio descriptor for pin %d error %ld\n", + gpios_vector[j], PTR_ERR(desc)); + goto alloc_gpios_fail; } - dev_err(board->gpib_dev, "Unable to obtain gpio descriptor for pin %d error %ld\n", - gpios_vector[j], PTR_ERR(desc)); - error = true; - break; + dbg_printk(1, "Allocation failed, now using table_index %d\n", table_index); + lookup_table->dev_id = dev_name(board->gpib_dev); + gpiod_add_lookup_table(lookup_table); + goto try_again; } all_descriptors[j] = desc; } - if (error) { /* undo what already done */ - release_gpios(); - retval = -1; - } - if (lookup_table) - gpiod_remove_lookup_table(lookup_table); - return retval; + gpiod_remove_lookup_table(lookup_table); + + return 0; + +alloc_gpios_fail: + release_gpios(); + return -1; } static void bb_detach(struct gpib_board *board) From 13f3e2c27161adc0c30c5a3ed72691e175163729 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 18 Apr 2025 19:34:34 +0200 Subject: [PATCH 177/203] staging: gpib: Set control lines in attach When the driver is attached the state of the main control lines is not defined and can lead to hangs. Set the control lines to a known state (logic false). Fixes: 4cd654f84769 ("staging: gpib: Add gpio bitbang GPIB driver") Tested-by: Dave Penkler Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250418173434.2892-9-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/gpio/gpib_bitbang.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpib/gpio/gpib_bitbang.c index 5c134cfb6d61..625fef24a0bf 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -1262,6 +1262,10 @@ static int bb_attach(struct gpib_board *board, const struct gpib_board_config *c gpiod_direction_output(TE, 1); gpiod_direction_output(PE, 1); } +/* Set main control lines to a known state */ + gpiod_direction_output(IFC, 1); + gpiod_direction_output(REN, 1); + gpiod_direction_output(_ATN, 1); if (strcmp(PINMAP_2, pin_map) == 0) { /* YOGA: enable level shifters */ gpiod_direction_output(YOGA_ENABLE, 1); From e0138bbbb38a2a838ff9d90eeb88ad953b608fc1 Mon Sep 17 00:00:00 2001 From: JJ Strnad Date: Tue, 22 Apr 2025 14:23:16 -0700 Subject: [PATCH 178/203] staging: rtl8723bs: remove multiple blank lines Adhere to Linux kernel coding style. Reported by checkpatch: CHECK: Please don't use multiple blank lines Signed-off-by: JJ Strnad Link: https://lore.kernel.org/r/20250422212332.23170-1-strnad.jj@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_cmd.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_cmd.c b/drivers/staging/rtl8723bs/core/rtw_cmd.c index 946511793c08..437934dd255e 100644 --- a/drivers/staging/rtl8723bs/core/rtw_cmd.c +++ b/drivers/staging/rtl8723bs/core/rtw_cmd.c @@ -695,7 +695,6 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) /* for ies is fix buf size */ t_len = sizeof(struct wlan_bssid_ex); - /* for hidden ap to set fw_state here */ if (check_fwstate(pmlmepriv, WIFI_STATION_STATE|WIFI_ADHOC_STATE) != true) { switch (ndis_network_mode) { @@ -738,7 +737,6 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork) psecnetwork->ie_length = rtw_restruct_sec_ie(padapter, &pnetwork->network.ies[0], &psecnetwork->ies[0], pnetwork->network.ie_length); - pqospriv->qos_option = 0; if (pregistrypriv->wmm_enable) { @@ -1032,7 +1030,6 @@ u8 rtw_reset_securitypriv_cmd(struct adapter *padapter) init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); - /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: @@ -1099,7 +1096,6 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter) pdrvextra_cmd_parm->pbuf = NULL; init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra)); - /* rtw_enqueue_cmd(pcmdpriv, ph2c); */ res = rtw_enqueue_cmd(pcmdpriv, ph2c); exit: @@ -1256,7 +1252,6 @@ static void dynamic_chk_wk_hdl(struct adapter *padapter) /* */ hal_btcoex_Handler(padapter); - /* always call rtw_ps_processor() at last one. */ rtw_ps_processor(padapter); } @@ -1367,7 +1362,6 @@ u8 rtw_dm_in_lps_wk_cmd(struct adapter *padapter) struct cmd_priv *pcmdpriv = &padapter->cmdpriv; u8 res = _SUCCESS; - ph2c = rtw_zmalloc(sizeof(struct cmd_obj)); if (!ph2c) { res = _FAIL; @@ -1850,7 +1844,6 @@ void rtw_createbss_cmd_callback(struct adapter *padapter, struct cmd_obj *pcmd) spin_lock_bh(&pmlmepriv->lock); - if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) { psta = rtw_get_stainfo(&padapter->stapriv, pnetwork->mac_address); if (!psta) { From 31c2d3287abd2af7f7876fea4b646829afef1c36 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Tue, 22 Apr 2025 21:03:45 -0700 Subject: [PATCH 179/203] staging: sm750fb: change `enum dpms` to snake_case Change the entries in `enum dpms` to snake_case in order to conform to kernel code styles as reported by checkpatch.pl CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/20250423040345.11323-1-ericflorin.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/ddk750_power.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h index 63c9e8b6ffb3..5cbb11986bb8 100644 --- a/drivers/staging/sm750fb/ddk750_power.h +++ b/drivers/staging/sm750fb/ddk750_power.h @@ -3,10 +3,10 @@ #define DDK750_POWER_H__ enum dpms { - crtDPMS_ON = 0x0, - crtDPMS_STANDBY = 0x1, - crtDPMS_SUSPEND = 0x2, - crtDPMS_OFF = 0x3, + CRT_DPMS_ON = 0x0, + CRT_DPMS_STANDBY = 0x1, + CRT_DPMS_SUSPEND = 0x2, + CRT_DPMS_OFF = 0x3, }; #define set_DAC(off) { \ From c1e36b07df08682656ecc38cadba03076378bd7c Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Tue, 29 Apr 2025 22:55:35 -0700 Subject: [PATCH 180/203] staging: sm750fb: rename sm750_hw_cursor_setSize Rename sm750_hw_cursor_setSize to sm750_hw_cursor_set_size to conform to kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/c465a42743c4fef0853ffa7f7c304dc569592d3e.1745982772.git.ericflorin.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 2 +- drivers/staging/sm750fb/sm750_cursor.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 04c1b32a22c5..47c84331e3d9 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -120,7 +120,7 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor) sm750_hw_cursor_disable(cursor); if (fbcursor->set & FB_CUR_SETSIZE) - sm750_hw_cursor_setSize(cursor, + sm750_hw_cursor_set_size(cursor, fbcursor->image.width, fbcursor->image.height); diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index eea4d1bd36ce..3128ff3f4b70 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -57,7 +57,7 @@ void sm750_hw_cursor_disable(struct lynx_cursor *cursor) poke32(HWC_ADDRESS, 0); } -void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h) +void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h) { cursor->w = w; cursor->h = h; diff --git a/drivers/staging/sm750fb/sm750_cursor.h b/drivers/staging/sm750fb/sm750_cursor.h index b59643dd61ed..edeed2ea4b04 100644 --- a/drivers/staging/sm750fb/sm750_cursor.h +++ b/drivers/staging/sm750fb/sm750_cursor.h @@ -5,7 +5,7 @@ /* hw_cursor_xxx works for voyager,718 and 750 */ void sm750_hw_cursor_enable(struct lynx_cursor *cursor); void sm750_hw_cursor_disable(struct lynx_cursor *cursor); -void sm750_hw_cursor_setSize(struct lynx_cursor *cursor, int w, int h); +void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h); void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y); void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg); void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop, From 8f168c835ec1a6599e9f0f4a7dbf71fda69d5f2a Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Tue, 29 Apr 2025 22:55:36 -0700 Subject: [PATCH 181/203] staging: sm750fb: rename sm750_hw_cursor_setPos Rename sm750_hw_cursor_setPos to sm750_hw_cursor_set_pos to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/bf20fba915d2f0139a55ada29fcdefb9fdcbc1d6.1745982772.git.ericflorin.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 2 +- drivers/staging/sm750fb/sm750_cursor.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 47c84331e3d9..8dd32aa6ac6e 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -125,7 +125,7 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor) fbcursor->image.height); if (fbcursor->set & FB_CUR_SETPOS) - sm750_hw_cursor_setPos(cursor, + sm750_hw_cursor_set_pos(cursor, fbcursor->image.dx - info->var.xoffset, fbcursor->image.dy - info->var.yoffset); diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 3128ff3f4b70..a6fe241e7748 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -63,7 +63,7 @@ void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h) cursor->h = h; } -void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y) +void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y) { u32 reg; diff --git a/drivers/staging/sm750fb/sm750_cursor.h b/drivers/staging/sm750fb/sm750_cursor.h index edeed2ea4b04..d0ade8e366f4 100644 --- a/drivers/staging/sm750fb/sm750_cursor.h +++ b/drivers/staging/sm750fb/sm750_cursor.h @@ -6,7 +6,7 @@ void sm750_hw_cursor_enable(struct lynx_cursor *cursor); void sm750_hw_cursor_disable(struct lynx_cursor *cursor); void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h); -void sm750_hw_cursor_setPos(struct lynx_cursor *cursor, int x, int y); +void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y); void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg); void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop, const u8 *data, const u8 *mask); From 5a32b7d9602120d4b4faff31a4f710bd3f35d40b Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Tue, 29 Apr 2025 22:55:37 -0700 Subject: [PATCH 182/203] staging: sm750fb: rename sm750_hw_cursor_setColor Rename sm750_hw_cursor_setColor to sm750_hw_cursor_set_color to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/93717027d952d14d9b17f78e8440a734e4dc5d89.1745982772.git.ericflorin.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750_cursor.c | 2 +- drivers/staging/sm750fb/sm750_cursor.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 8dd32aa6ac6e..483a30841c77 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -141,7 +141,7 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor) ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5) | ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11); - sm750_hw_cursor_setColor(cursor, fg, bg); + sm750_hw_cursor_set_color(cursor, fg, bg); } if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) { diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index a6fe241e7748..e80d6efe0ab1 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -72,7 +72,7 @@ void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y) poke32(HWC_LOCATION, reg); } -void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg) +void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg) { u32 reg = (fg << HWC_COLOR_12_2_RGB565_SHIFT) & HWC_COLOR_12_2_RGB565_MASK; diff --git a/drivers/staging/sm750fb/sm750_cursor.h b/drivers/staging/sm750fb/sm750_cursor.h index d0ade8e366f4..edfa6a8202cd 100644 --- a/drivers/staging/sm750fb/sm750_cursor.h +++ b/drivers/staging/sm750fb/sm750_cursor.h @@ -7,7 +7,7 @@ void sm750_hw_cursor_enable(struct lynx_cursor *cursor); void sm750_hw_cursor_disable(struct lynx_cursor *cursor); void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h); void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y); -void sm750_hw_cursor_setColor(struct lynx_cursor *cursor, u32 fg, u32 bg); +void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg); void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop, const u8 *data, const u8 *mask); void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop, From dcb66f73854f338bf457ec0573f7a3b1104b3d6a Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Tue, 29 Apr 2025 22:55:38 -0700 Subject: [PATCH 183/203] staging: sm750fb: rename sm750_hw_cursor_setData Rename sm750_hw_cursor_setData to sm750_hw_cursor_set_data to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/1ce4ddfd5ddf0443fd5a01ea5a4cb76a90e8cf30.1745982772.git.ericflorin.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 6 ++---- drivers/staging/sm750fb/sm750_cursor.c | 4 ++-- drivers/staging/sm750fb/sm750_cursor.h | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 483a30841c77..d74836fbdfa3 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -145,10 +145,8 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor) } if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) { - sm750_hw_cursor_setData(cursor, - fbcursor->rop, - fbcursor->image.data, - fbcursor->mask); + sm750_hw_cursor_set_data(cursor, fbcursor->rop, fbcursor->image.data, + fbcursor->mask); } if (fbcursor->enable) diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index e80d6efe0ab1..3aa26ef00011 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -81,8 +81,8 @@ void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg) poke32(HWC_COLOR_3, 0xffe0); } -void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop, - const u8 *pcol, const u8 *pmsk) +void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop, + const u8 *pcol, const u8 *pmsk) { int i, j, count, pitch, offset; u8 color, mask, opr; diff --git a/drivers/staging/sm750fb/sm750_cursor.h b/drivers/staging/sm750fb/sm750_cursor.h index edfa6a8202cd..cbb896a35160 100644 --- a/drivers/staging/sm750fb/sm750_cursor.h +++ b/drivers/staging/sm750fb/sm750_cursor.h @@ -8,8 +8,8 @@ void sm750_hw_cursor_disable(struct lynx_cursor *cursor); void sm750_hw_cursor_set_size(struct lynx_cursor *cursor, int w, int h); void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y); void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg); -void sm750_hw_cursor_setData(struct lynx_cursor *cursor, u16 rop, - const u8 *data, const u8 *mask); +void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop, + const u8 *data, const u8 *mask); void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop, const u8 *data, const u8 *mask); #endif From a50ae5bc83d64387425a19aad05850585e9a6c11 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Tue, 29 Apr 2025 22:55:39 -0700 Subject: [PATCH 184/203] staging: sm750fb: rename sm750_hw_cursor_setData2 Rename sm750_hw_cursor_setData2 to sm750_hw_cursor_set_data2 to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/af5080150498adf635be36e332a7ce7121692f93.1745982772.git.ericflorin.kernel@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750_cursor.c | 4 ++-- drivers/staging/sm750fb/sm750_cursor.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_cursor.c b/drivers/staging/sm750fb/sm750_cursor.c index 3aa26ef00011..7ede144905c9 100644 --- a/drivers/staging/sm750fb/sm750_cursor.c +++ b/drivers/staging/sm750fb/sm750_cursor.c @@ -131,8 +131,8 @@ void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop, } } -void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop, - const u8 *pcol, const u8 *pmsk) +void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop, + const u8 *pcol, const u8 *pmsk) { int i, j, count, pitch, offset; u8 color, mask; diff --git a/drivers/staging/sm750fb/sm750_cursor.h b/drivers/staging/sm750fb/sm750_cursor.h index cbb896a35160..88fa02f6377a 100644 --- a/drivers/staging/sm750fb/sm750_cursor.h +++ b/drivers/staging/sm750fb/sm750_cursor.h @@ -10,6 +10,6 @@ void sm750_hw_cursor_set_pos(struct lynx_cursor *cursor, int x, int y); void sm750_hw_cursor_set_color(struct lynx_cursor *cursor, u32 fg, u32 bg); void sm750_hw_cursor_set_data(struct lynx_cursor *cursor, u16 rop, const u8 *data, const u8 *mask); -void sm750_hw_cursor_setData2(struct lynx_cursor *cursor, u16 rop, - const u8 *data, const u8 *mask); +void sm750_hw_cursor_set_data2(struct lynx_cursor *cursor, u16 rop, + const u8 *data, const u8 *mask); #endif From 75d9d7c29b7f00045d859226592f2917b31b997e Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Sat, 26 Apr 2025 17:03:19 +0200 Subject: [PATCH 185/203] staging: gpib: Fix lpvo request_system_control The IEEE-488 GPIB standard was designed to ensure that there is only ever one controller-in-charge on the bus at any one time. If a board becomes controller-in-charge on request_system_control there is no way to ensure that there is not another board also acting as controller-in-charge. This can lead to bus conflicts and hangs. Remove the setting of controller-in-charge from request_system_control. Fixes: fce79512a96a ("staging: gpib: Add LPVO DIY USB GPIB driver") Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250426150319.5580-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c index 2e315c7756c4..3cf5037c0cd2 100644 --- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c @@ -916,7 +916,6 @@ static int usb_gpib_request_system_control(struct gpib_board *board, int request if (!request_control) return -EINVAL; - set_bit(CIC_NUM, &board->status); DIA_LOG(1, "done with %d -> %lx\n", request_control, board->status); return 0; } From 417ce77ef466580c2850fdd4a7bf5f0a97147cb8 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Sun, 27 Apr 2025 11:31:23 +0200 Subject: [PATCH 186/203] staging: gpib: Avoid unused variable warnings This addresses warnings produced by make W=1 with the configuration parameter CONFIG_GPIB_PCMCIA=y cb7210/cb7210.c:1251:28: warning: variable 'dev' set but not used [-Wunused-but-set-variable] cb7210/cb7210.c:1250:31: warning: variable 'handle' set but not used [-Wunused-but-set-variable] Remove the declarations and assignments of the unused variables. Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250427093123.18565-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/cb7210/cb7210.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/gpib/cb7210/cb7210.c b/drivers/staging/gpib/cb7210/cb7210.c index c686896bb088..298ed306189d 100644 --- a/drivers/staging/gpib/cb7210/cb7210.c +++ b/drivers/staging/gpib/cb7210/cb7210.c @@ -1247,13 +1247,8 @@ static int cb_gpib_config_iteration(struct pcmcia_device *link, void *priv_data) static int cb_gpib_config(struct pcmcia_device *link) { - struct pcmcia_device *handle; - struct local_info *dev; int retval; - handle = link; - dev = link->priv; - retval = pcmcia_loop_config(link, &cb_gpib_config_iteration, NULL); if (retval) { dev_warn(&link->dev, "no configuration found\n"); From 034a456869a071c635a9997e0bf3947a6cb20b25 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 2 May 2025 09:21:48 +0200 Subject: [PATCH 187/203] staging: gpib: Fix PCMCIA config identifier The PCMCIA config identifier in the ines_exit_module function was never changed because it was misspelled in the original commit. Update the config parameter to use the correct identifier from gpib/Kconfig Fixes: bb1bd92fa0f2 ("staging: gpib: Add ines GPIB driver") Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250502072150.32714-2-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines_gpib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index 49947ac30feb..5168811ee850 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -1487,7 +1487,7 @@ static void __exit ines_exit_module(void) gpib_unregister_driver(&ines_pci_unaccel_interface); gpib_unregister_driver(&ines_pci_accel_interface); gpib_unregister_driver(&ines_isa_interface); -#ifdef GPIB__PCMCIA +#ifdef CONFIG_GPIB_PCMCIA gpib_unregister_driver(&ines_pcmcia_interface); gpib_unregister_driver(&ines_pcmcia_unaccel_interface); gpib_unregister_driver(&ines_pcmcia_accel_interface); From cfa6673eae0281d0840838b9a488b7d2d1e78377 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 2 May 2025 09:21:49 +0200 Subject: [PATCH 188/203] staging: gpib: Declare driver entry points static Many of this driver's entry points were unecessarily not declared static. Remove the declarations from the include file. Make the declarations static in the .c file. Remove an uneccessary forward declaration in the .c file. Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250502072150.32714-3-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines.h | 44 ------------- drivers/staging/gpib/ines/ines_gpib.c | 92 ++++++++++++++------------- 2 files changed, 47 insertions(+), 89 deletions(-) diff --git a/drivers/staging/gpib/ines/ines.h b/drivers/staging/gpib/ines/ines.h index 07b82f790c4b..f0210ce2470d 100644 --- a/drivers/staging/gpib/ines/ines.h +++ b/drivers/staging/gpib/ines/ines.h @@ -35,45 +35,6 @@ struct ines_priv { u8 extend_mode_bits; }; -// interface functions -int ines_read(struct gpib_board *board, u8 *buffer, size_t length, - int *end, size_t *bytes_read); -int ines_write(struct gpib_board *board, u8 *buffer, size_t length, - int send_eoi, size_t *bytes_written); -int ines_accel_read(struct gpib_board *board, u8 *buffer, size_t length, - int *end, size_t *bytes_read); -int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, - int send_eoi, size_t *bytes_written); -int ines_command(struct gpib_board *board, u8 *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); -int ines_request_system_control(struct gpib_board *board, int request_control); -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, u8 eos_byte, int compare_8_bits); -void ines_disable_eos(struct gpib_board *board); -unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_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, u8 *result); -void ines_parallel_poll_configure(struct gpib_board *board, u8 config); -void ines_parallel_poll_response(struct gpib_board *board, int ist); -void ines_serial_poll_response(struct gpib_board *board, u8 status); -u8 ines_serial_poll_status(struct gpib_board *board); -int ines_line_status(const struct gpib_board *board); -int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec); -void ines_return_to_local(struct gpib_board *board); - -// interrupt service routines -irqreturn_t ines_pci_interrupt(int irq, void *arg); -irqreturn_t ines_interrupt(struct gpib_board *board); - -// utility functions -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, int use_accel); -void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count); - /* inb/outb wrappers */ static inline unsigned int ines_inb(struct ines_priv *priv, unsigned int register_number) { @@ -88,11 +49,6 @@ static inline void ines_outb(struct ines_priv *priv, unsigned int value, register_number * priv->nec7210_priv.offset); } -// pcmcia init/cleanup - -int ines_pcmcia_init_module(void); -void ines_pcmcia_cleanup_module(void); - enum ines_regs { // read FIFO_STATUS = 0x8, diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index 5168811ee850..a16219c0f7c8 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -25,7 +25,9 @@ MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("GPIB driver for Ines iGPIB 72010"); -int ines_line_status(const struct gpib_board *board) +static irqreturn_t ines_interrupt(struct gpib_board *board); + +static int ines_line_status(const struct gpib_board *board) { int status = VALID_ALL; int bcm_bits; @@ -55,7 +57,7 @@ int ines_line_status(const struct gpib_board *board) return status; } -void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) +static void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) { if (count > 0xffff) { pr_err("bug! tried to set xfer counter > 0xffff\n"); @@ -65,7 +67,7 @@ void ines_set_xfer_counter(struct ines_priv *priv, unsigned int count) ines_outb(priv, count & 0xff, XFER_COUNT_LOWER); } -int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec) +static int ines_t1_delay(struct gpib_board *board, unsigned int nano_sec) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv = &ines_priv->nec7210_priv; @@ -133,8 +135,8 @@ static ssize_t pio_read(struct gpib_board *board, struct ines_priv *ines_priv, u return retval; } -int ines_accel_read(struct gpib_board *board, u8 *buffer, - size_t length, int *end, size_t *bytes_read) +static int ines_accel_read(struct gpib_board *board, u8 *buffer, + size_t length, int *end, size_t *bytes_read) { ssize_t retval = 0; struct ines_priv *ines_priv = board->private_data; @@ -213,8 +215,8 @@ static int ines_write_wait(struct gpib_board *board, struct ines_priv *ines_priv return 0; } -int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, - int send_eoi, size_t *bytes_written) +static int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, + int send_eoi, size_t *bytes_written) { size_t count = 0; ssize_t retval = 0; @@ -264,7 +266,7 @@ int ines_accel_write(struct gpib_board *board, u8 *buffer, size_t length, return retval; } -irqreturn_t ines_pci_interrupt(int irq, void *arg) +static irqreturn_t ines_pci_interrupt(int irq, void *arg) { struct gpib_board *board = arg; struct ines_priv *priv = board->private_data; @@ -281,7 +283,7 @@ irqreturn_t ines_pci_interrupt(int irq, void *arg) return ines_interrupt(board); } -irqreturn_t ines_interrupt(struct gpib_board *board) +static irqreturn_t ines_interrupt(struct gpib_board *board) { struct ines_priv *priv = board->private_data; struct nec7210_priv *nec_priv = &priv->nec7210_priv; @@ -393,8 +395,8 @@ static struct ines_pci_id pci_ids[] = { static const int num_pci_chips = ARRAY_SIZE(pci_ids); // wrappers for interface functions -int ines_read(struct gpib_board *board, u8 *buffer, size_t length, - int *end, size_t *bytes_read) +static int ines_read(struct gpib_board *board, u8 *buffer, size_t length, + int *end, size_t *bytes_read) { struct ines_priv *priv = board->private_data; struct nec7210_priv *nec_priv = &priv->nec7210_priv; @@ -412,127 +414,127 @@ int ines_read(struct gpib_board *board, u8 *buffer, size_t length, return retval; } -int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, - size_t *bytes_written) +static int ines_write(struct gpib_board *board, u8 *buffer, size_t length, int send_eoi, + size_t *bytes_written) { struct ines_priv *priv = board->private_data; return nec7210_write(board, &priv->nec7210_priv, buffer, length, send_eoi, bytes_written); } -int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) +static int ines_command(struct gpib_board *board, u8 *buffer, size_t length, size_t *bytes_written) { struct ines_priv *priv = board->private_data; return nec7210_command(board, &priv->nec7210_priv, buffer, length, bytes_written); } -int ines_take_control(struct gpib_board *board, int synchronous) +static int ines_take_control(struct gpib_board *board, int synchronous) { struct ines_priv *priv = board->private_data; return nec7210_take_control(board, &priv->nec7210_priv, synchronous); } -int ines_go_to_standby(struct gpib_board *board) +static int ines_go_to_standby(struct gpib_board *board) { struct ines_priv *priv = board->private_data; return nec7210_go_to_standby(board, &priv->nec7210_priv); } -int ines_request_system_control(struct gpib_board *board, int request_control) +static int ines_request_system_control(struct gpib_board *board, int request_control) { struct ines_priv *priv = board->private_data; return nec7210_request_system_control(board, &priv->nec7210_priv, request_control); } -void ines_interface_clear(struct gpib_board *board, int assert) +static void ines_interface_clear(struct gpib_board *board, int assert) { struct ines_priv *priv = board->private_data; nec7210_interface_clear(board, &priv->nec7210_priv, assert); } -void ines_remote_enable(struct gpib_board *board, int enable) +static void ines_remote_enable(struct gpib_board *board, int enable) { struct ines_priv *priv = board->private_data; nec7210_remote_enable(board, &priv->nec7210_priv, enable); } -int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) +static int ines_enable_eos(struct gpib_board *board, u8 eos_byte, int compare_8_bits) { struct ines_priv *priv = board->private_data; return nec7210_enable_eos(board, &priv->nec7210_priv, eos_byte, compare_8_bits); } -void ines_disable_eos(struct gpib_board *board) +static void ines_disable_eos(struct gpib_board *board) { struct ines_priv *priv = board->private_data; nec7210_disable_eos(board, &priv->nec7210_priv); } -unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask) +static unsigned int ines_update_status(struct gpib_board *board, unsigned int clear_mask) { struct ines_priv *priv = board->private_data; return nec7210_update_status(board, &priv->nec7210_priv, clear_mask); } -int ines_primary_address(struct gpib_board *board, unsigned int address) +static int ines_primary_address(struct gpib_board *board, unsigned int address) { struct ines_priv *priv = board->private_data; return nec7210_primary_address(board, &priv->nec7210_priv, address); } -int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable) +static int ines_secondary_address(struct gpib_board *board, unsigned int address, int enable) { struct ines_priv *priv = board->private_data; return nec7210_secondary_address(board, &priv->nec7210_priv, address, enable); } -int ines_parallel_poll(struct gpib_board *board, u8 *result) +static int ines_parallel_poll(struct gpib_board *board, u8 *result) { struct ines_priv *priv = board->private_data; return nec7210_parallel_poll(board, &priv->nec7210_priv, result); } -void ines_parallel_poll_configure(struct gpib_board *board, u8 config) +static void ines_parallel_poll_configure(struct gpib_board *board, u8 config) { struct ines_priv *priv = board->private_data; nec7210_parallel_poll_configure(board, &priv->nec7210_priv, config); } -void ines_parallel_poll_response(struct gpib_board *board, int ist) +static void ines_parallel_poll_response(struct gpib_board *board, int ist) { struct ines_priv *priv = board->private_data; nec7210_parallel_poll_response(board, &priv->nec7210_priv, ist); } -void ines_serial_poll_response(struct gpib_board *board, u8 status) +static void ines_serial_poll_response(struct gpib_board *board, u8 status) { struct ines_priv *priv = board->private_data; nec7210_serial_poll_response(board, &priv->nec7210_priv, status); } -u8 ines_serial_poll_status(struct gpib_board *board) +static u8 ines_serial_poll_status(struct gpib_board *board) { struct ines_priv *priv = board->private_data; return nec7210_serial_poll_status(board, &priv->nec7210_priv); } -void ines_return_to_local(struct gpib_board *board) +static void ines_return_to_local(struct gpib_board *board) { struct ines_priv *priv = board->private_data; @@ -664,13 +666,13 @@ static int ines_allocate_private(struct gpib_board *board) return 0; } -void ines_free_private(struct gpib_board *board) +static void ines_free_private(struct gpib_board *board) { kfree(board->private_data); board->private_data = NULL; } -int ines_generic_attach(struct gpib_board *board) +static int ines_generic_attach(struct gpib_board *board) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -690,7 +692,7 @@ int ines_generic_attach(struct gpib_board *board) return 0; } -void ines_online(struct ines_priv *ines_priv, const struct gpib_board *board, int use_accel) +static void ines_online(struct ines_priv *ines_priv, const struct gpib_board *board, int use_accel) { struct nec7210_priv *nec_priv = &ines_priv->nec7210_priv; @@ -852,7 +854,7 @@ static int ines_common_pci_attach(struct gpib_board *board, const struct gpib_bo return 0; } -int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -867,7 +869,7 @@ int ines_pci_attach(struct gpib_board *board, const struct gpib_board_config *co return 0; } -int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -884,7 +886,7 @@ int ines_pci_accel_attach(struct gpib_board *board, const struct gpib_board_conf static const int ines_isa_iosize = 0x20; -int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -915,7 +917,7 @@ int ines_isa_attach(struct gpib_board *board, const struct gpib_board_config *co return 0; } -void ines_pci_detach(struct gpib_board *board) +static void ines_pci_detach(struct gpib_board *board) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv; @@ -949,7 +951,7 @@ void ines_pci_detach(struct gpib_board *board) ines_free_private(board); } -void ines_isa_detach(struct gpib_board *board) +static void ines_isa_detach(struct gpib_board *board) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv; @@ -1005,7 +1007,6 @@ static int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_ static int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_config *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(struct gpib_board *board); /* * A linked list of "instances" of the gpib device. Each actual @@ -1213,7 +1214,7 @@ static struct pcmcia_driver ines_gpib_cs_driver = { .resume = ines_gpib_resume, }; -void ines_pcmcia_cleanup_module(void) +static void ines_pcmcia_cleanup_module(void) { pcmcia_unregister_driver(&ines_gpib_cs_driver); } @@ -1302,14 +1303,14 @@ static struct gpib_interface ines_pcmcia_interface = { .return_to_local = ines_return_to_local, }; -irqreturn_t ines_pcmcia_interrupt(int irq, void *arg) +static irqreturn_t ines_pcmcia_interrupt(int irq, void *arg) { struct gpib_board *board = arg; return ines_interrupt(board); } -int ines_common_pcmcia_attach(struct gpib_board *board) +static int ines_common_pcmcia_attach(struct gpib_board *board) { struct ines_priv *ines_priv; struct nec7210_priv *nec_priv; @@ -1348,7 +1349,7 @@ int ines_common_pcmcia_attach(struct gpib_board *board) return 0; } -int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -1363,7 +1364,8 @@ int ines_pcmcia_attach(struct gpib_board *board, const struct gpib_board_config return 0; } -int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_config *config) +static int ines_pcmcia_accel_attach(struct gpib_board *board, + const struct gpib_board_config *config) { struct ines_priv *ines_priv; int retval; @@ -1378,7 +1380,7 @@ int ines_pcmcia_accel_attach(struct gpib_board *board, const struct gpib_board_c return 0; } -void ines_pcmcia_detach(struct gpib_board *board) +static void ines_pcmcia_detach(struct gpib_board *board) { struct ines_priv *ines_priv = board->private_data; struct nec7210_priv *nec_priv; From e8186a376483edc9b0bac2a66f2f3b07fb005082 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 2 May 2025 09:21:50 +0200 Subject: [PATCH 189/203] staging: gpib: Avoid unused variable warning This addresses a warning produced by make W=1 with the configuration parameter CONFIG_GPIB_PCMCIA=y ines/ines_gpib.c:1115:28: warning: variable 'dev' set but not used [-Wunused-but-set-variable] Remove the declaration and assignment of the unused variable. Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250502072150.32714-4-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/ines/ines_gpib.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/ines/ines_gpib.c index a16219c0f7c8..c851fd014f48 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -1112,12 +1112,9 @@ static int ines_gpib_config_iteration(struct pcmcia_device *link, void *priv_dat */ static int ines_gpib_config(struct pcmcia_device *link) { - struct local_info *dev; int retval; void __iomem *virt; - dev = link->priv; - retval = pcmcia_loop_config(link, &ines_gpib_config_iteration, NULL); if (retval) { dev_warn(&link->dev, "no configuration found\n"); From 7a7f07f248a60c10da9b751bcb1cb00d61f7fb30 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Fri, 9 May 2025 13:30:14 +0200 Subject: [PATCH 190/203] staging: gpib: Fix uapi include header guard name When gpib_user.h was renamed to gpio.h the include guard name was not changed accordingly. Change the include guard name to correspond with the file name and cleanup the comments after the #endif. Fixes: c7184cbf5530 ("staging: gpib: Rename common include file") Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250509113014.9105-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/gpib/uapi/gpib.h b/drivers/staging/gpib/uapi/gpib.h index 4ca3cc9e0cd7..667e2fcc9130 100644 --- a/drivers/staging/gpib/uapi/gpib.h +++ b/drivers/staging/gpib/uapi/gpib.h @@ -4,8 +4,8 @@ * copyright : (C) 2002 by Frank Mori Hess ***************************************************************************/ -#ifndef _GPIB_USER_H -#define _GPIB_USER_H +#ifndef _GPIB_H +#define _GPIB_H #define GPIB_MAX_NUM_BOARDS 16 #define GPIB_MAX_NUM_DESCRIPTORS 0x1000 @@ -298,6 +298,5 @@ enum gpib_stb { IB_STB_MAV = 0x10 /* IEEE 488.2 only */ }; -#endif /* _GPIB_USER_H */ +#endif /* _GPIB_H */ -/* Check for errors */ From 5aac95320d0f17f1098960e903ce5e087f42bc70 Mon Sep 17 00:00:00 2001 From: Dave Penkler Date: Tue, 20 May 2025 17:51:00 +0200 Subject: [PATCH 191/203] staging: gpib: Fix secondary address restriction GPIB secondary addresses have valid values between 0 and 31 inclusive. The Make Secondary Address function MSA, used to form the protocol byte, was using the gpib_address_restrict function erroneously restricting the address range to 0 through 30. Remove the call to gpib_address_restrict and simply trim the address to 5 bits. Fixes: 2da03e7e31aa ("staging: gpib: Add user api include files") Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250520155100.5808-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/uapi/gpib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/uapi/gpib.h b/drivers/staging/gpib/uapi/gpib.h index 667e2fcc9130..41500cee4029 100644 --- a/drivers/staging/gpib/uapi/gpib.h +++ b/drivers/staging/gpib/uapi/gpib.h @@ -136,7 +136,7 @@ static inline __u8 MTA(unsigned int addr) static inline __u8 MSA(unsigned int addr) { - return gpib_address_restrict(addr) | SAD; + return (addr & 0x1f) | SAD; } static inline __u8 PPE_byte(unsigned int dio_line, int sense) From 7aca10d57deb658daebe9d18f45587f774fb149d Mon Sep 17 00:00:00 2001 From: Andreas Kleinbichler Date: Fri, 16 May 2025 17:25:44 +0200 Subject: [PATCH 192/203] staging: gpib: switch to kmalloc(sizeof(*status)) Fix checkpatch warning: Prefer kmalloc(sizeof(*status)...) over kmalloc(sizeof(struct gpib_status_byte)...) Signed-off-by: Andreas Kleinbichler Link: https://lore.kernel.org/r/aCdY-OgvoTUjcIeF@andreas-VirtualBox Signed-off-by: Greg Kroah-Hartman --- drivers/staging/gpib/common/gpib_os.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/common/gpib_os.c index d87025aadccc..0678829ad14f 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -198,7 +198,7 @@ int push_status_byte(struct gpib_board *board, struct gpib_status_queue *device, return retval; } - status = kmalloc(sizeof(struct gpib_status_byte), GFP_KERNEL); + status = kmalloc(sizeof(*status), GFP_KERNEL); if (!status) return -ENOMEM; From 70fbc2891ac754363987d7efb7ff6c97743a1842 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:44 -0700 Subject: [PATCH 193/203] staging: sm750fb: rename `hw_sm750_initAccel` Rename `hw_sm750_initAccel` to `hw_sm750_init_accel` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/3c84dccaf38161d6de6ff560d4f10bb3d344cc51.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index aff69661c8e6..a797985a4df7 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -193,7 +193,7 @@ static inline unsigned long ps_to_hz(unsigned int psvalue) int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev); int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev); -void hw_sm750_initAccel(struct sm750_dev *sm750_dev); +void hw_sm750_init_accel(struct sm750_dev *sm750_dev); int hw_sm750_deWait(void); int hw_sm750le_deWait(void); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 64b199061d14..a5bb067b30cc 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -173,7 +173,7 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev) /* init 2d engine */ if (!sm750_dev->accel_off) - hw_sm750_initAccel(sm750_dev); + hw_sm750_init_accel(sm750_dev); return 0; } @@ -474,7 +474,7 @@ int hw_sm750_setBLANK(struct lynxfb_output *output, int blank) return 0; } -void hw_sm750_initAccel(struct sm750_dev *sm750_dev) +void hw_sm750_init_accel(struct sm750_dev *sm750_dev) { u32 reg; From 1e8990b29bf3ae9c2709a82b35ee70cab86a7284 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:45 -0700 Subject: [PATCH 194/203] staging: sm750fb: rename `hw_sm750_deWait` Rename `hw_sm750_deWait` to `hw_sm750_de_wait` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/2d94a42ca51de9fddddb64f74e217dfb2e0c7d1c.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index d74836fbdfa3..6a6b48254af8 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -609,7 +609,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) hw_sm750le_setBLANK : hw_sm750_setBLANK; /* chip specific phase */ sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ? - hw_sm750le_deWait : hw_sm750_deWait; + hw_sm750le_deWait : hw_sm750_de_wait; switch (sm750_dev->dataflow) { case sm750_simul_pri: output->paths = sm750_pnc; diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index a797985a4df7..e24ec6a9799e 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -194,7 +194,7 @@ static inline unsigned long ps_to_hz(unsigned int psvalue) int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev); int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev); void hw_sm750_init_accel(struct sm750_dev *sm750_dev); -int hw_sm750_deWait(void); +int hw_sm750_de_wait(void); int hw_sm750le_deWait(void); int hw_sm750_output_setMode(struct lynxfb_output *output, diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index a5bb067b30cc..5a6ee02bb95f 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -521,7 +521,7 @@ int hw_sm750le_deWait(void) return -1; } -int hw_sm750_deWait(void) +int hw_sm750_de_wait(void) { int i = 0x10000000; unsigned int mask = SYSTEM_CTRL_DE_STATUS_BUSY | From 2a7639ea2ec6fe11d652effbf4ec666d3275c730 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:46 -0700 Subject: [PATCH 195/203] staging: sm750fb: rename `hw_sm750le_deWait` Rename `hw_sm750le_deWait` to `hw_sm750le_de_wait` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/0e5332f7758ad24cc5bca36671fd811c87881db7.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 6a6b48254af8..9c62adec9914 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -609,7 +609,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) hw_sm750le_setBLANK : hw_sm750_setBLANK; /* chip specific phase */ sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ? - hw_sm750le_deWait : hw_sm750_de_wait; + hw_sm750le_de_wait : hw_sm750_de_wait; switch (sm750_dev->dataflow) { case sm750_simul_pri: output->paths = sm750_pnc; diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index e24ec6a9799e..7de3a3d44dce 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -195,7 +195,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev); int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev); void hw_sm750_init_accel(struct sm750_dev *sm750_dev); int hw_sm750_de_wait(void); -int hw_sm750le_deWait(void); +int hw_sm750le_de_wait(void); int hw_sm750_output_setMode(struct lynxfb_output *output, struct fb_var_screeninfo *var, diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 5a6ee02bb95f..49b0d5b91183 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -504,7 +504,7 @@ void hw_sm750_init_accel(struct sm750_dev *sm750_dev) sm750_dev->accel.de_init(&sm750_dev->accel); } -int hw_sm750le_deWait(void) +int hw_sm750le_de_wait(void) { int i = 0x10000000; unsigned int mask = DE_STATE2_DE_STATUS_BUSY | DE_STATE2_DE_FIFO_EMPTY | From 1bfa73953100dbdffd85adf1a9a1d6f00c2c741d Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:47 -0700 Subject: [PATCH 196/203] staging: sm750fb: rename `hw_sm750_output_setMode` Rename `hw_sm750_output_setMode` to `hw_sm750_output_set_mode` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/32daa589cf80d2f6f67ed257aa9397128a5458d2.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 6 +++--- drivers/staging/sm750fb/sm750_hw.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 9c62adec9914..eb7bae5e2044 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -394,7 +394,7 @@ static int lynxfb_ops_set_par(struct fb_info *info) } ret = hw_sm750_crtc_setMode(crtc, var, fix); if (!ret) - ret = hw_sm750_output_setMode(output, var, fix); + ret = hw_sm750_output_set_mode(output, var, fix); return ret; } diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 7de3a3d44dce..7450eb975b1b 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -197,9 +197,9 @@ void hw_sm750_init_accel(struct sm750_dev *sm750_dev); int hw_sm750_de_wait(void); int hw_sm750le_de_wait(void); -int hw_sm750_output_setMode(struct lynxfb_output *output, - struct fb_var_screeninfo *var, - struct fb_fix_screeninfo *fix); +int hw_sm750_output_set_mode(struct lynxfb_output *output, + struct fb_var_screeninfo *var, + struct fb_fix_screeninfo *fix); int hw_sm750_crtc_checkMode(struct lynxfb_crtc *crtc, struct fb_var_screeninfo *var); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 49b0d5b91183..c01abfcea811 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -178,9 +178,9 @@ int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev) return 0; } -int hw_sm750_output_setMode(struct lynxfb_output *output, - struct fb_var_screeninfo *var, - struct fb_fix_screeninfo *fix) +int hw_sm750_output_set_mode(struct lynxfb_output *output, + struct fb_var_screeninfo *var, + struct fb_fix_screeninfo *fix) { int ret; enum disp_output disp_set; From b6822fc35175abf04aa54c725978dafb08739802 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:48 -0700 Subject: [PATCH 197/203] staging: sm750fb: rename `hw_sm750_crtc_checkMode` Rename `hw_sm750_crtc_checkMode` to `hw_sm750_crtc_check_mode` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/546e9abb8eac1be75f47b51460ab69a5736d8a99.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 4 ++-- drivers/staging/sm750fb/sm750_hw.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index eb7bae5e2044..d4596590e266 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -512,7 +512,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var, return -ENOMEM; } - return hw_sm750_crtc_checkMode(crtc, var); + return hw_sm750_crtc_check_mode(crtc, var); } static int lynxfb_ops_setcolreg(unsigned int regno, diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 7450eb975b1b..8bf70a3731bf 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -201,8 +201,8 @@ int hw_sm750_output_set_mode(struct lynxfb_output *output, struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix); -int hw_sm750_crtc_checkMode(struct lynxfb_crtc *crtc, - struct fb_var_screeninfo *var); +int hw_sm750_crtc_check_mode(struct lynxfb_crtc *crtc, + struct fb_var_screeninfo *var); int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, struct fb_var_screeninfo *var, diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index c01abfcea811..3cb69a471c0a 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -219,8 +219,8 @@ int hw_sm750_output_set_mode(struct lynxfb_output *output, return ret; } -int hw_sm750_crtc_checkMode(struct lynxfb_crtc *crtc, - struct fb_var_screeninfo *var) +int hw_sm750_crtc_check_mode(struct lynxfb_crtc *crtc, + struct fb_var_screeninfo *var) { struct sm750_dev *sm750_dev; struct lynxfb_par *par = container_of(crtc, struct lynxfb_par, crtc); From 3f001e6d00a4189d309db0a0be2fc1fbf0491cb5 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:49 -0700 Subject: [PATCH 198/203] staging: sm750fb: rename `hw_sm750_crtc_setMode` Rename `hw_sm750_crtc_setMode` to `hw_sm750_crtc_set_mode` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/40d4a1f5b05bcb0eefdd787b9df329fceb96105e.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 6 +++--- drivers/staging/sm750fb/sm750_hw.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index d4596590e266..5f4b0064cf92 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -392,7 +392,7 @@ static int lynxfb_ops_set_par(struct fb_info *info) pr_err("bpp %d not supported\n", var->bits_per_pixel); return ret; } - ret = hw_sm750_crtc_setMode(crtc, var, fix); + ret = hw_sm750_crtc_set_mode(crtc, var, fix); if (!ret) ret = hw_sm750_output_set_mode(output, var, fix); return ret; diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 8bf70a3731bf..db80dd295658 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -204,9 +204,9 @@ int hw_sm750_output_set_mode(struct lynxfb_output *output, int hw_sm750_crtc_check_mode(struct lynxfb_crtc *crtc, struct fb_var_screeninfo *var); -int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, - struct fb_var_screeninfo *var, - struct fb_fix_screeninfo *fix); +int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc, + struct fb_var_screeninfo *var, + struct fb_fix_screeninfo *fix); int hw_sm750_setColReg(struct lynxfb_crtc *crtc, ushort index, ushort red, ushort green, ushort blue); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 3cb69a471c0a..d3f218cb20f5 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -245,9 +245,9 @@ int hw_sm750_crtc_check_mode(struct lynxfb_crtc *crtc, } /* set the controller's mode for @crtc charged with @var and @fix parameters */ -int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc, - struct fb_var_screeninfo *var, - struct fb_fix_screeninfo *fix) +int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc, + struct fb_var_screeninfo *var, + struct fb_fix_screeninfo *fix) { int ret, fmt; u32 reg; From f3147cede43ed4a3f50f79f1e19d32416246ef9c Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:50 -0700 Subject: [PATCH 199/203] staging: sm750fb: rename `hw_sm750_setColReg` Rename `hw_sm750_setColReg` to `hw_sm750_set_col_reg` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/3d4bb87742eee4a6792bbdae893256f621ffffe6.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 4 ++-- drivers/staging/sm750fb/sm750_hw.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 5f4b0064cf92..935c7b1a0fa4 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -545,7 +545,7 @@ static int lynxfb_ops_setcolreg(unsigned int regno, red >>= 8; green >>= 8; blue >>= 8; - ret = hw_sm750_setColReg(crtc, regno, red, green, blue); + ret = hw_sm750_set_col_reg(crtc, regno, red, green, blue); goto exit; } diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index db80dd295658..a70f51d08dd2 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -208,8 +208,8 @@ int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc, struct fb_var_screeninfo *var, struct fb_fix_screeninfo *fix); -int hw_sm750_setColReg(struct lynxfb_crtc *crtc, ushort index, - ushort red, ushort green, ushort blue); +int hw_sm750_set_col_reg(struct lynxfb_crtc *crtc, ushort index, + ushort red, ushort green, ushort blue); int hw_sm750_setBLANK(struct lynxfb_output *output, int blank); int hw_sm750le_setBLANK(struct lynxfb_output *output, int blank); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index d3f218cb20f5..04a0f9218eb8 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -370,8 +370,8 @@ int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc, return ret; } -int hw_sm750_setColReg(struct lynxfb_crtc *crtc, ushort index, ushort red, - ushort green, ushort blue) +int hw_sm750_set_col_reg(struct lynxfb_crtc *crtc, ushort index, ushort red, + ushort green, ushort blue) { static unsigned int add[] = { PANEL_PALETTE_RAM, CRT_PALETTE_RAM }; From f2cf2a38d37a302edc8c7d1efd5cb7dcec98ba7f Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:51 -0700 Subject: [PATCH 200/203] staging: sm750fb: rename `hw_sm750_setBLANK` Rename `hw_sm750_setBLANK` to `hw_sm750_set_blank` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/e00a39ffba89e000fdf8dc277166297d995aa891.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index 935c7b1a0fa4..eb7e107bae68 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -606,7 +606,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) crtc->ywrapstep = 0; output->proc_setBLANK = (sm750_dev->revid == SM750LE_REVISION_ID) ? - hw_sm750le_setBLANK : hw_sm750_setBLANK; + hw_sm750le_setBLANK : hw_sm750_set_blank; /* chip specific phase */ sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ? hw_sm750le_de_wait : hw_sm750_de_wait; diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index a70f51d08dd2..97682cb8c58f 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -211,7 +211,7 @@ int hw_sm750_crtc_set_mode(struct lynxfb_crtc *crtc, int hw_sm750_set_col_reg(struct lynxfb_crtc *crtc, ushort index, ushort red, ushort green, ushort blue); -int hw_sm750_setBLANK(struct lynxfb_output *output, int blank); +int hw_sm750_set_blank(struct lynxfb_output *output, int blank); int hw_sm750le_setBLANK(struct lynxfb_output *output, int blank); int hw_sm750_pan_display(struct lynxfb_crtc *crtc, const struct fb_var_screeninfo *var, diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index 04a0f9218eb8..c64807cd06b3 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -421,7 +421,7 @@ int hw_sm750le_setBLANK(struct lynxfb_output *output, int blank) return 0; } -int hw_sm750_setBLANK(struct lynxfb_output *output, int blank) +int hw_sm750_set_blank(struct lynxfb_output *output, int blank) { unsigned int dpms, pps, crtdb; From d2f8d185ba268b06c47bf3c7828896c738303b19 Mon Sep 17 00:00:00 2001 From: Eric Florin Date: Sun, 18 May 2025 19:04:52 -0700 Subject: [PATCH 201/203] staging: sm750fb: rename `hw_sm750le_setBLANK` Rename `hw_sm750le_setBLANK` to `hw_sm750le_set_blank` to conform with kernel style guidelines as reported by checkpatch.pl CHECK: Avoid CamelCase: Signed-off-by: Eric Florin Link: https://lore.kernel.org/r/b49d1a00628a3475fdfbff4055d8347d35a802a9.1747619816.git.ericflorin@google.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/sm750fb/sm750.c | 2 +- drivers/staging/sm750fb/sm750.h | 2 +- drivers/staging/sm750fb/sm750_hw.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c index eb7e107bae68..1d929aca399c 100644 --- a/drivers/staging/sm750fb/sm750.c +++ b/drivers/staging/sm750fb/sm750.c @@ -606,7 +606,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par) crtc->ywrapstep = 0; output->proc_setBLANK = (sm750_dev->revid == SM750LE_REVISION_ID) ? - hw_sm750le_setBLANK : hw_sm750_set_blank; + hw_sm750le_set_blank : hw_sm750_set_blank; /* chip specific phase */ sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ? hw_sm750le_de_wait : hw_sm750_de_wait; diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h index 97682cb8c58f..9cf8b3d30aac 100644 --- a/drivers/staging/sm750fb/sm750.h +++ b/drivers/staging/sm750fb/sm750.h @@ -212,7 +212,7 @@ int hw_sm750_set_col_reg(struct lynxfb_crtc *crtc, ushort index, ushort red, ushort green, ushort blue); int hw_sm750_set_blank(struct lynxfb_output *output, int blank); -int hw_sm750le_setBLANK(struct lynxfb_output *output, int blank); +int hw_sm750le_set_blank(struct lynxfb_output *output, int blank); int hw_sm750_pan_display(struct lynxfb_crtc *crtc, const struct fb_var_screeninfo *var, const struct fb_info *info); diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c index c64807cd06b3..7119b67efe11 100644 --- a/drivers/staging/sm750fb/sm750_hw.c +++ b/drivers/staging/sm750fb/sm750_hw.c @@ -380,7 +380,7 @@ int hw_sm750_set_col_reg(struct lynxfb_crtc *crtc, ushort index, ushort red, return 0; } -int hw_sm750le_setBLANK(struct lynxfb_output *output, int blank) +int hw_sm750le_set_blank(struct lynxfb_output *output, int blank) { int dpms, crtdb; From dff8e5d7404b1011d0d70318d87b8a69cbc94bff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rog=C3=A9rio=20Fernandes=20Pereira?= Date: Sat, 3 May 2025 17:24:30 -0300 Subject: [PATCH 202/203] staging: rtl8723bs: Removed multiple blank lines of rtw_pwrctrl.c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed multiple blank lines in file rtw_pwrctrl.c Found by checkpatch.pl Signed-off-by: RogĂ©rio Fernandes Pereira Link: https://lore.kernel.org/r/20250503202430.6053-1-rfp2005@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/core/rtw_pwrctrl.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c index 74a8fcf18e84..44f7c19308a5 100644 --- a/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c +++ b/drivers/staging/rtl8723bs/core/rtw_pwrctrl.c @@ -8,7 +8,6 @@ #include #include - void _ips_enter(struct adapter *padapter) { struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); @@ -994,7 +993,6 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter) pwrctrlpriv->wowlan_ap_mode = false; } - void rtw_free_pwrctrl_priv(struct adapter *adapter) { } From a481f0ebf213e0ccb85f70c07bfcd733d2dc6783 Mon Sep 17 00:00:00 2001 From: David Tadokoro Date: Wed, 21 May 2025 04:58:31 -0300 Subject: [PATCH 203/203] staging: rtl8723bs: remove unnecessary braces for single statement blocks Remove all unnecessary braces for single-statement blocks in `os_dep/recv_linux.c` to conform to code style rules. Warnings reported by checkpatch.pl: * WARNING: braces {} are not necessary for single statement blocks * WARNING: braces {} are not necessary for any arm of this statement Signed-off-by: David Tadokoro Link: https://lore.kernel.org/r/20250521075831.485199-1-davidbtadokoro@gmail.com Signed-off-by: Greg Kroah-Hartman --- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c index ca808ded61ac..98d3e4777210 100644 --- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c +++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c @@ -45,9 +45,8 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv) /* free os related resource in struct recv_buf */ void rtw_os_recvbuf_resource_free(struct adapter *padapter, struct recv_buf *precvbuf) { - if (precvbuf->pskb) { + if (precvbuf->pskb) dev_kfree_skb_any(precvbuf->pskb); - } } struct sk_buff *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata) @@ -160,21 +159,19 @@ void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup) } } - if (bgroup) { + if (bgroup) key_type |= NL80211_KEYTYPE_GROUP; - } else { + else key_type |= NL80211_KEYTYPE_PAIRWISE; - } cfg80211_michael_mic_failure(padapter->pnetdev, (u8 *)&pmlmepriv->assoc_bssid[0], key_type, -1, NULL, GFP_ATOMIC); memset(&ev, 0x00, sizeof(ev)); - if (bgroup) { + if (bgroup) ev.flags |= IW_MICFAILURE_GROUP; - } else { + else ev.flags |= IW_MICFAILURE_PAIRWISE; - } ev.src_addr.sa_family = ARPHRD_ETHER; memcpy(ev.src_addr.sa_data, &pmlmepriv->assoc_bssid[0], ETH_ALEN);