From nobody Tue Dec 16 14:49:37 2025 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 11B5F1C2DB2 for ; Tue, 14 Jan 2025 16:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873667; cv=none; b=WlcKL9recitZANo1Tm8WjIUi6qEgE+IXeBjyACpmMcrdQsxMSUhMCm8TNPV10Y+GrFkAskRGcphBiygH/odxcvzHR+qfQmQcUM/2ktPPU2W0p8mxQJf6F0uIqZyUdG3hv2+3xSAZwB+ttHhuYncM37BqOiDPvRzTH7nkBGFpP5Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736873667; c=relaxed/simple; bh=fv7VV+yGDdcKNZq/NRuMFgzCIGDrl6Myef6TMgc5mC8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mRyi7MipiaCKY0pYjzY4emELQEWK+Yho3m8n/PlhGVLTfudwf8GQcnT+4g/ioY2jpSzy0XIjOBCPcypVU6/8tLDarIvgLGE7PQKbyJJcLODmE+7S47IMz1CrDu7Cm+Y+1ssYTx4a/ciwDZwCIl6E1ozJtIc1ugfPw7tceLDt1UQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MCvB+d0L; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MCvB+d0L" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-436637e8c8dso59498975e9.1 for ; Tue, 14 Jan 2025 08:54:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736873663; x=1737478463; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iKxtdUb/cXgrIfHVWWlkiuhy6A7in5OGActCzYSUH9o=; b=MCvB+d0LQAK5T6H6gYr606MJaHEt0OVBSBfRWRYnGEr5P0hLcX5Ys5swuqMIndCqe0 2Hv12/mQ2rVNUksVnNLrGdmeRjcue3gsL5V+fokUR6YumikPzZOpM/lgokU38eXGy8gW KRmvTthG9cLZDMkYUY1sX6C/2huvNgdUWVEIojtlI1ehBX42Y064m4/7CjENP6pCJogy eofyjXUwsgeIgNIjKcAqSlSRtOgzJ3LSdCA3S0kq5ep4U+ibkCQteeQLqhoGcmf/lXbE l9qJXG6o4fZ4Szu83V1FBkPAKQdoYC/T2VYt+diGw/1og/2ud78m5pUgb9hcVW4ABkVN cGSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736873663; x=1737478463; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iKxtdUb/cXgrIfHVWWlkiuhy6A7in5OGActCzYSUH9o=; b=GeWyfySreI2kVr/bxijWJ3wza/NkH9DUaV72cg3qpHvvQ2rqUij/K2RezNHCcX7cQq dv8cL5XiuyaboYpNKRRSggc3EAsoAhQJ+BkeswkrY88PuF2eDB9lST3Up5Jq2Swg+6+0 Q4cZ1XBnT70Ve3UY9lov7rQNXU66AH07zLwlLnGRnyQshxCoLO9wp+aRd/jfOSZE16Es MALLnvMQyMtkvArFOHaQV2HexJ3FQzgnio1jCVuyRTnwgePuOsgjtwB7DqCw9viJmYKe ZCQAnheFINfcNNjUlocLoHPw7RvBvWoo4qPe7E/oUkEbemwdvJ0mP3Z322p4ZqyPvWGM RI0w== X-Forwarded-Encrypted: i=1; AJvYcCXT9GQn8M/WSyTkQAukk/d2KBoalnxLxE3ck7ijTeBeGjsesLeZEn1IxO5he0GEkgro+SyDY1VcBioXbBo=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0UZEWM1p2V5i6/ownUvR+CU4Fq8JfevZjsPzgBurplacnIBuv 1jBLHuOE+7lwNE+N61jt+hDX77USxqxqLpscNXpGZCS+G4lTliEj X-Gm-Gg: ASbGncu54gicmuFjkbBaMemuozhX5F/XN2QbqftHIBYwdMoai61z655WgAXtxsfUSoT A6Ll24rcFp818k72SeoR/72iuzHcnl6EWol+ieZ4gMNIo3wfh/7aOrGwjPlMaWFFoZeaO3BwBda Atw08OeduuD1ZAEGIWbUazMjT50F064fH7U4VYbcUD8XtgpSmW69JW1yfBz6z8MtgExWuUfVJ70 ksT3CAjgKj0ADfkWpxRY0VmhfOCroE8fedZLsaCSRX3mvNTTGK4j6evI1Gpov8wWBAkDyRrsUh7 aFkViJkll3B+quQR X-Google-Smtp-Source: AGHT+IHNNlWwCNRkFj3/gobGekOr/p7PqVWwRud7phxrhkbmHshASpA/cVN4a670kMbSs+kQSHQqcw== X-Received: by 2002:a05:600c:3c94:b0:434:fd15:3ac9 with SMTP id 5b1f17b1804b1-436e26e2563mr205625445e9.22.1736873663355; Tue, 14 Jan 2025 08:54:23 -0800 (PST) Received: from localhost.localdomain (82-64-73-52.subs.proxad.net. [82.64.73.52]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e9e03e5fsm179930495e9.18.2025.01.14.08.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jan 2025 08:54:22 -0800 (PST) From: Dave Penkler To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Dave Penkler Subject: [PATCH 4/4] staging: gpib: Use C99 syntax and make static Date: Tue, 14 Jan 2025 17:54:03 +0100 Message-ID: <20250114165403.16410-5-dpenkler@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250114165403.16410-1-dpenkler@gmail.com> References: <20250114165403.16410-1-dpenkler@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some drivers were still using the old syntax for initializing structs: field : value; This caused sparse to emit the following warning, for example: common/gpib_os.c:2026:1: warning: obsolete struct initializer, use C99 synt= ax Use C99 syntax: .field =3D value; Some local structs and arrays were not declared static causing sparse to emit the following warning, for example: warning: symbol 'ib_fops' was not declared. Should it be static? Declare the local structs and arrays as static. Signed-off-by: Dave Penkler --- .../gpib/agilent_82357a/agilent_82357a.c | 2 +- drivers/staging/gpib/common/gpib_os.c | 14 ++--- drivers/staging/gpib/gpio/gpib_bitbang.c | 4 +- drivers/staging/gpib/ines/ines_gpib.c | 58 +++++++++---------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c b/drivers= /staging/gpib/agilent_82357a/agilent_82357a.c index c22c6bb30776..34d85a1bdb37 100644 --- a/drivers/staging/gpib/agilent_82357a/agilent_82357a.c +++ b/drivers/staging/gpib/agilent_82357a/agilent_82357a.c @@ -19,7 +19,7 @@ MODULE_DESCRIPTION("GPIB driver for Agilent 82357A/B usb = adapters"); =20 #define MAX_NUM_82357A_INTERFACES 128 static struct usb_interface *agilent_82357a_driver_interfaces[MAX_NUM_8235= 7A_INTERFACES]; -DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board insertion and = removal +static DEFINE_MUTEX(agilent_82357a_hotplug_lock); // protect board inserti= on and removal =20 static unsigned int agilent_82357a_update_status(gpib_board_t *board, unsi= gned int clear_mask); =20 diff --git a/drivers/staging/gpib/common/gpib_os.c b/drivers/staging/gpib/c= ommon/gpib_os.c index 3234d4348957..4901e660242e 100644 --- a/drivers/staging/gpib/common/gpib_os.c +++ b/drivers/staging/gpib/common/gpib_os.c @@ -2023,13 +2023,13 @@ static int t1_delay_ioctl(gpib_board_t *board, unsi= gned long arg) return 0; } =20 -const struct file_operations ib_fops =3D { -owner: THIS_MODULE, -llseek : NULL, -unlocked_ioctl : &ibioctl, -compat_ioctl : &ibioctl, -open : &ibopen, -release : &ibclose, +static const struct file_operations ib_fops =3D { + .owner =3D THIS_MODULE, + .llseek =3D NULL, + .unlocked_ioctl =3D &ibioctl, + .compat_ioctl =3D &ibioctl, + .open =3D &ibopen, + .release =3D &ibclose, }; =20 gpib_board_t board_array[GPIB_MAX_NUM_BOARDS]; diff --git a/drivers/staging/gpib/gpio/gpib_bitbang.c b/drivers/staging/gpi= b/gpio/gpib_bitbang.c index 16e2d0c5642e..828c99ea613f 100644 --- a/drivers/staging/gpib/gpio/gpib_bitbang.c +++ b/drivers/staging/gpib/gpio/gpib_bitbang.c @@ -147,7 +147,7 @@ DEFINE_LED_TRIGGER(ledtrig_gpib); led_trigger_event(ledtrig_gpib, LED_OFF); } \ while (0) =20 -struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS]; +static struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_PINS]; =20 #define D01 all_descriptors[0] #define D02 all_descriptors[1] @@ -175,7 +175,7 @@ struct gpio_desc *all_descriptors[GPIB_PINS + SN7516X_P= INS]; /* YOGA dapter uses a global enable for the buffer chips, re-using the TE = pin */ #define YOGA_ENABLE TE =20 -int gpios_vector[] =3D { +static int gpios_vector[] =3D { D01_pin_nr, D02_pin_nr, D03_pin_nr, diff --git a/drivers/staging/gpib/ines/ines_gpib.c b/drivers/staging/gpib/i= nes/ines_gpib.c index 846dafc85c11..22a05a287bce 100644 --- a/drivers/staging/gpib/ines/ines_gpib.c +++ b/drivers/staging/gpib/ines/ines_gpib.c @@ -357,38 +357,38 @@ struct ines_pci_id { enum ines_pci_chip pci_chip_type; }; =20 -struct ines_pci_id pci_ids[] =3D { - {vendor_id: PCI_VENDOR_ID_PLX, - device_id : PCI_DEVICE_ID_PLX_9050, - subsystem_vendor_id : PCI_VENDOR_ID_PLX, - subsystem_device_id : PCI_SUBDEVICE_ID_INES_GPIB, - gpib_region : 2, - io_offset : 1, - pci_chip_type : PCI_CHIP_PLX9050, +static struct ines_pci_id pci_ids[] =3D { + {.vendor_id =3D PCI_VENDOR_ID_PLX, + .device_id =3D PCI_DEVICE_ID_PLX_9050, + .subsystem_vendor_id =3D PCI_VENDOR_ID_PLX, + .subsystem_device_id =3D PCI_SUBDEVICE_ID_INES_GPIB, + .gpib_region =3D 2, + .io_offset =3D 1, + .pci_chip_type =3D PCI_CHIP_PLX9050, }, - {vendor_id: PCI_VENDOR_ID_AMCC, - device_id : PCI_DEVICE_ID_INES_GPIB_AMCC, - subsystem_vendor_id : PCI_VENDOR_ID_AMCC, - subsystem_device_id : PCI_SUBDEVICE_ID_INES_GPIB, - gpib_region : 1, - io_offset : 1, - pci_chip_type : PCI_CHIP_AMCC5920, + {.vendor_id =3D PCI_VENDOR_ID_AMCC, + .device_id =3D PCI_DEVICE_ID_INES_GPIB_AMCC, + .subsystem_vendor_id =3D PCI_VENDOR_ID_AMCC, + .subsystem_device_id =3D PCI_SUBDEVICE_ID_INES_GPIB, + .gpib_region =3D 1, + .io_offset =3D 1, + .pci_chip_type =3D PCI_CHIP_AMCC5920, }, - {vendor_id: PCI_VENDOR_ID_INES_QUICKLOGIC, - device_id : PCI_DEVICE_ID_INES_GPIB_QL5030, - subsystem_vendor_id : PCI_VENDOR_ID_INES_QUICKLOGIC, - subsystem_device_id : PCI_DEVICE_ID_INES_GPIB_QL5030, - gpib_region : 1, - io_offset : 1, - pci_chip_type : PCI_CHIP_QUICKLOGIC5030, + {.vendor_id =3D PCI_VENDOR_ID_INES_QUICKLOGIC, + .device_id =3D PCI_DEVICE_ID_INES_GPIB_QL5030, + .subsystem_vendor_id =3D PCI_VENDOR_ID_INES_QUICKLOGIC, + .subsystem_device_id =3D PCI_DEVICE_ID_INES_GPIB_QL5030, + .gpib_region =3D 1, + .io_offset =3D 1, + .pci_chip_type =3D PCI_CHIP_QUICKLOGIC5030, }, - {vendor_id: PCI_VENDOR_ID_QUANCOM, - device_id : PCI_DEVICE_ID_QUANCOM_GPIB, - subsystem_vendor_id : -1, - subsystem_device_id : -1, - gpib_region : 0, - io_offset : 4, - pci_chip_type : PCI_CHIP_QUANCOM, + {.vendor_id =3D PCI_VENDOR_ID_QUANCOM, + .device_id =3D PCI_DEVICE_ID_QUANCOM_GPIB, + .subsystem_vendor_id =3D -1, + .subsystem_device_id =3D -1, + .gpib_region =3D 0, + .io_offset =3D 4, + .pci_chip_type =3D PCI_CHIP_QUANCOM, }, }; =20 --=20 2.47.1