Re: [Nouveau] [PATCH] dispnv50: atom: fix an incorrect NULL check on list iterator
On Sun, 27 Mar 2022 at 08:39, Xiaomeng Tong wrote: > > The bug is here: > return encoder; > > The list iterator value 'encoder' will *always* be set and non-NULL > by drm_for_each_encoder_mask(), so it is incorrect to assume that the > iterator value will be NULL if the list is empty or no element found. > Otherwise it will bypass some NULL checks and lead to invalid memory > access passing the check. > > To fix this bug, just return 'encoder' when found, otherwise return > NULL. > Isn't this covered by the upcoming list* iterator rework [1] or is this another iterator glitch? IMHO we should be looking at fixing the implementation and not the hundreds of users through the kernel. HTH -Emil [1] https://lwn.net/Articles/887097/
Re: [Nouveau] [PATCH] device: fix missing check on list iterator
On 3/26/22 23:59, Xiaomeng Tong wrote: On Sat, 26 Mar 2022 22:38:05 -0700, Guenter Roeck wrote: @@ -103,11 +103,16 @@ nvkm_control_mthd_pstate_attr(struct nvkm_control *ctrl, void *data, u32 size) return -EINVAL; if (args->v0.state != NVIF_CONTROL_PSTATE_ATTR_V0_STATE_CURRENT) { - list_for_each_entry(pstate, &clk->states, head) { - if (i++ == args->v0.state) + list_for_each_entry(iter, &clk->states, head) { + if (i++ == args->v0.state) { + pstate = iter; Is iter and the assignment really necessary ? Unless I am missing something, list_for_each_entry() always assigns pos (pstate/iter), even if the list is empty. If nothing is found, pstate would be NULL at the end, so the pstate will not be NULL at the end! so the assignment is necessary! #define list_for_each_entry(pos, head, member) \ for (pos = __container_of((head)->next, pos, member); \ &pos->member != (head);\ pos = __container_of(pos->member.next, pos, member)) Uuh, yes, you are correct. Sorry for the noise. Guenter
Re: [Nouveau] [PATCH 6/9] usb: gadget: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:07PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: bd25a14edb75 ("usb: gadget: legacy/serial: allow dynamic removal") > Fixes: 7bb5ea54be47 ("usb gadget serial: use composite gadget framework") > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") I continue to be confused about the latest rules for the Fixes tag but this one in particular seems completely useless. This is the 'beginning of time' commit by Linus AFAICT. So do any of these Fixes tags need to be in this series? Regardless: Reviewed-by: Ira Weiny > Signed-off-by: Randy Dunlap > Cc: Felipe Balbi > Cc: Michał Mirosław > Cc: Greg Kroah-Hartman > Cc: Sebastian Andrzej Siewior > Cc: linux-...@vger.kernel.org > --- > drivers/usb/gadget/legacy/inode.c |8 > drivers/usb/gadget/legacy/serial.c | 10 +- > drivers/usb/gadget/udc/dummy_hcd.c |8 > 3 files changed, 13 insertions(+), 13 deletions(-) > > --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/serial.c > +++ lnx-517-rc8/drivers/usb/gadget/legacy/serial.c > @@ -273,7 +273,7 @@ static struct usb_composite_driver gseri > static int switch_gserial_enable(bool do_enable) > { > if (!serial_config_driver.label) > - /* init() was not called, yet */ > + /* gserial_init() was not called, yet */ > return 0; > > if (do_enable) > @@ -283,7 +283,7 @@ static int switch_gserial_enable(bool do > return 0; > } > > -static int __init init(void) > +static int __init gserial_init(void) > { > /* We *could* export two configs; that'd be much cleaner... >* but neither of these product IDs was defined that way. > @@ -314,11 +314,11 @@ static int __init init(void) > > return usb_composite_probe(&gserial_driver); > } > -module_init(init); > +module_init(gserial_init); > > -static void __exit cleanup(void) > +static void __exit gserial_cleanup(void) > { > if (enable) > usb_composite_unregister(&gserial_driver); > } > -module_exit(cleanup); > +module_exit(gserial_cleanup); > --- lnx-517-rc8.orig/drivers/usb/gadget/udc/dummy_hcd.c > +++ lnx-517-rc8/drivers/usb/gadget/udc/dummy_hcd.c > @@ -2765,7 +2765,7 @@ static struct platform_driver dummy_hcd_ > static struct platform_device *the_udc_pdev[MAX_NUM_UDC]; > static struct platform_device *the_hcd_pdev[MAX_NUM_UDC]; > > -static int __init init(void) > +static int __init dummy_hcd_init(void) > { > int retval = -ENOMEM; > int i; > @@ -2887,9 +2887,9 @@ err_alloc_udc: > platform_device_put(the_hcd_pdev[i]); > return retval; > } > -module_init(init); > +module_init(dummy_hcd_init); > > -static void __exit cleanup(void) > +static void __exit dummy_hcd_cleanup(void) > { > int i; > > @@ -2905,4 +2905,4 @@ static void __exit cleanup(void) > platform_driver_unregister(&dummy_udc_driver); > platform_driver_unregister(&dummy_hcd_driver); > } > -module_exit(cleanup); > +module_exit(dummy_hcd_cleanup); > --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/inode.c > +++ lnx-517-rc8/drivers/usb/gadget/legacy/inode.c > @@ -2101,7 +2101,7 @@ MODULE_ALIAS_FS("gadgetfs"); > > /*--*/ > > -static int __init init (void) > +static int __init gadgetfs_init (void) > { > int status; > > @@ -2111,12 +2111,12 @@ static int __init init (void) > shortname, driver_desc); > return status; > } > -module_init (init); > +module_init (gadgetfs_init); > > -static void __exit cleanup (void) > +static void __exit gadgetfs_cleanup (void) > { > pr_debug ("unregister %s\n", shortname); > unregister_filesystem (&gadgetfs_type); > } > -module_exit (cleanup); > +module_exit (gadgetfs_cleanup); >
Re: [Nouveau] [PATCH 4/9] netfilter: h323: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:05PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs LGTM. Should I route this through the netfilter tree? > Fixes: f587de0e2feb ("[NETFILTER]: nf_conntrack/nf_nat: add H.323 helper > port") > Signed-off-by: Randy Dunlap > Cc: Pablo Neira Ayuso > Cc: Jozsef Kadlecsik > Cc: Florian Westphal > Cc: netfilter-de...@vger.kernel.org > Cc: coret...@netfilter.org > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: net...@vger.kernel.org > --- > net/ipv4/netfilter/nf_nat_h323.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/net/ipv4/netfilter/nf_nat_h323.c > +++ lnx-517-rc8/net/ipv4/netfilter/nf_nat_h323.c > @@ -580,7 +580,7 @@ static struct nf_ct_helper_expectfn call > }; > > > // > -static int __init init(void) > +static int __init nf_nat_h323_init(void) > { > BUG_ON(set_h245_addr_hook != NULL); > BUG_ON(set_h225_addr_hook != NULL); > @@ -607,7 +607,7 @@ static int __init init(void) > } > > > // > -static void __exit fini(void) > +static void __exit nf_nat_h323_fini(void) > { > RCU_INIT_POINTER(set_h245_addr_hook, NULL); > RCU_INIT_POINTER(set_h225_addr_hook, NULL); > @@ -624,8 +624,8 @@ static void __exit fini(void) > } > > > // > -module_init(init); > -module_exit(fini); > +module_init(nf_nat_h323_init); > +module_exit(nf_nat_h323_fini); > > MODULE_AUTHOR("Jing Min Zhao "); > MODULE_DESCRIPTION("H.323 NAT helper");
Re: [Nouveau] [PATCH 9/9] testmmiotrace: eliminate anonymous module_init & module_exit
On Wed, 16 Mar 2022 12:20:10 -0700 Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: 8b7d89d02ef3 ("x86: mmiotrace - trace memory mapped IO") > Signed-off-by: Randy Dunlap > Cc: Thomas Gleixner > Cc: Steven Rostedt Acked-by: Steven Rostedt (Google) -- Steve > Cc: Ingo Molnar > Cc: Karol Herbst > Cc: Pekka Paalanen > Cc: Dave Hansen > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Cc: nouveau@lists.freedesktop.org > Cc: x...@kernel.org > --- > arch/x86/mm/testmmiotrace.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/arch/x86/mm/testmmiotrace.c > +++ lnx-517-rc8/arch/x86/mm/testmmiotrace.c > @@ -113,7 +113,7 @@ static void do_test_bulk_ioremapping(voi > synchronize_rcu(); > } > > -static int __init init(void) > +static int __init testmmiotrace_init(void) > { > unsigned long size = (read_far) ? (8 << 20) : (16 << 10); > int ret = security_locked_down(LOCKDOWN_MMIOTRACE); > @@ -136,11 +136,11 @@ static int __init init(void) > return 0; > } > > -static void __exit cleanup(void) > +static void __exit testmmiotrace_cleanup(void) > { > pr_debug("unloaded.\n"); > } > > -module_init(init); > -module_exit(cleanup); > +module_init(testmmiotrace_init); > +module_exit(testmmiotrace_cleanup); > MODULE_LICENSE("GPL");
Re: [Nouveau] [PATCH 2/9] virtio_console: eliminate anonymous module_init & module_exit
On 3/17/22 08:47, Amit Shah wrote: > On Wed, 2022-03-16 at 12:20 -0700, Randy Dunlap wrote: >> Eliminate anonymous module_init() and module_exit(), which can lead to >> confusion or ambiguity when reading System.map, crashes/oops/bugs, >> or an initcall_debug log. >> >> Give each of these init and exit functions unique driver-specific >> names to eliminate the anonymous names. >> >> Example 1: (System.map) >> 832fc78c t init >> 832fc79e t init >> 832fc8f8 t init >> >> Example 2: (initcall_debug log) >> calling init+0x0/0x12 @ 1 >> initcall init+0x0/0x12 returned 0 after 15 usecs >> calling init+0x0/0x60 @ 1 >> initcall init+0x0/0x60 returned 0 after 2 usecs >> calling init+0x0/0x9a @ 1 >> initcall init+0x0/0x9a returned 0 after 74 usecs >> >> Fixes: 31610434bc35 ("Virtio console driver") >> Fixes: 7177876fea83 ("virtio: console: Add ability to remove module") >> Signed-off-by: Randy Dunlap < >> rdun...@infradead.org >>> >> Cc: Amit Shah < >> a...@kernel.org >>> >> Cc: >> virtualizat...@lists.linux-foundation.org >> >> Cc: Arnd Bergmann < >> a...@arndb.de >>> >> Cc: Greg Kroah-Hartman < >> gre...@linuxfoundation.org >>> >> --- >> drivers/char/virtio_console.c |8 >> 1 file changed, 4 insertions(+), 4 deletions(-) > > Reviewed-by: Amit Shah > > I don't think the Fixes-by really applies here, though - we don't > really want to push this into stable, nor do we want any automated > tools to pick this up because of that tag.. Yeah, I'm fine with that. thanks. -- ~Randy
Re: [Nouveau] (subset) [PATCH 0/9] treewide: eliminate anonymous module_init & module_exit
On Wed, 16 Mar 2022 12:20:01 -0700, Randy Dunlap wrote: > There are a number of drivers that use "module_init(init)" and > "module_exit(exit)", which are anonymous names and can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > [...] Applied, thanks! [1/9] virtio_blk: eliminate anonymous module_init & module_exit commit: bcfe9b6cbb4438b8c1cc4bd475221652c8f9301b Best regards, -- Jens Axboe
Re: [Nouveau] [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit
On Thu, Mar 17, 2022 at 3:25 AM Randy Dunlap wrote: > > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: e467cde23818 ("Block driver using virtio.") > Signed-off-by: Randy Dunlap > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: virtualizat...@lists.linux-foundation.org > Cc: Jens Axboe > Cc: linux-bl...@vger.kernel.org > --- Acked-by: Jason Wang > drivers/block/virtio_blk.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/drivers/block/virtio_blk.c > +++ lnx-517-rc8/drivers/block/virtio_blk.c > @@ -1058,7 +1058,7 @@ static struct virtio_driver virtio_blk = > #endif > }; > > -static int __init init(void) > +static int __init virtio_blk_init(void) > { > int error; > > @@ -1084,14 +1084,14 @@ out_destroy_workqueue: > return error; > } > > -static void __exit fini(void) > +static void __exit virtio_blk_fini(void) > { > unregister_virtio_driver(&virtio_blk); > unregister_blkdev(major, "virtblk"); > destroy_workqueue(virtblk_wq); > } > -module_init(init); > -module_exit(fini); > +module_init(virtio_blk_init); > +module_exit(virtio_blk_fini); > > MODULE_DEVICE_TABLE(virtio, id_table); > MODULE_DESCRIPTION("Virtio block driver"); >
[Nouveau] [PATCH 5/9] virtio-scsi: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 4fe74b1cb051 ("[SCSI] virtio-scsi: SCSI driver for QEMU based virtual machines") Signed-off-by: Randy Dunlap Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: linux-s...@vger.kernel.org Cc: virtualizat...@lists.linux-foundation.org --- drivers/scsi/virtio_scsi.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/scsi/virtio_scsi.c +++ lnx-517-rc8/drivers/scsi/virtio_scsi.c @@ -988,7 +988,7 @@ static struct virtio_driver virtio_scsi_ .remove = virtscsi_remove, }; -static int __init init(void) +static int __init virtio_scsi_init(void) { int ret = -ENOMEM; @@ -1020,14 +1020,14 @@ error: return ret; } -static void __exit fini(void) +static void __exit virtio_scsi_fini(void) { unregister_virtio_driver(&virtio_scsi_driver); mempool_destroy(virtscsi_cmd_pool); kmem_cache_destroy(virtscsi_cmd_cache); } -module_init(init); -module_exit(fini); +module_init(virtio_scsi_init); +module_exit(virtio_scsi_fini); MODULE_DEVICE_TABLE(virtio, id_table); MODULE_DESCRIPTION("Virtio SCSI HBA driver");
Re: [Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
On Sat, Mar 19, 2022 at 11:27:51AM +0100, Christophe Leroy wrote: > While working at fixing powerpc headers, I ended up with the > following error. > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: > conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const > char *)' > make[5]: *** [scripts/Makefile.build:288: > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1 > > powerpc and a few other architectures have a prom_init() global function. > One day or another it will conflict with the one in shadowrom.c > > Those being static, they can easily be renamed. Do it. > > While at it, also rename the ops structure as 'nvbios_prom' instead of > 'nvbios_rom' in order to make it clear that it refers to the > NV_PROM device. > > Signed-off-by: Christophe Leroy > --- > v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to > keep things consistant. > > drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h| 2 +- > drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 2 +- > .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c | 14 +++--- > 3 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h > index fac1bff1311b..cfa8a0c356dd 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h > @@ -19,7 +19,7 @@ struct nvbios_source { > int nvbios_extend(struct nvkm_bios *, u32 length); > int nvbios_shadow(struct nvkm_bios *); > > -extern const struct nvbios_source nvbios_rom; > +extern const struct nvbios_source nvbios_prom; > extern const struct nvbios_source nvbios_ramin; > extern const struct nvbios_source nvbios_acpi_fast; > extern const struct nvbios_source nvbios_acpi_slow; > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c > index 4b571cc6bc70..19188683c8fc 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c > @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios) > struct shadow mthds[] = { > { 0, &nvbios_of }, > { 0, &nvbios_ramin }, > - { 0, &nvbios_rom }, > + { 0, &nvbios_prom }, > { 0, &nvbios_acpi_fast }, > { 4, &nvbios_acpi_slow }, > { 1, &nvbios_pcirom }, > diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c > b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c > index ffa4b395220a..39144ceb117b 100644 > --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c > +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c > @@ -25,7 +25,7 @@ > #include > > static u32 > -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios) > +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios) > { > struct nvkm_device *device = data; > u32 i; > @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct > nvkm_bios *bios) > } > > static void > -prom_fini(void *data) > +nvbios_prom_fini(void *data) > { > struct nvkm_device *device = data; > nvkm_pci_rom_shadow(device->pci, true); > } > > static void * > -prom_init(struct nvkm_bios *bios, const char *name) > +nvbios_prom_init(struct nvkm_bios *bios, const char *name) > { > struct nvkm_device *device = bios->subdev.device; > if (device->card_type == NV_40 && device->chipset >= 0x4c) > @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name) > } > > const struct nvbios_source > -nvbios_rom = { > +nvbios_prom = { > .name = "PROM", > - .init = prom_init, > - .fini = prom_fini, > - .read = prom_read, > + .init = nvbios_prom_init, > + .fini = nvbios_prom_fini, > + .read = nvbios_prom_read, > .rw = false, > }; > -- > 2.35.1 > Look's good. Tommaso -- Tommaso Merciai Embedded Linux Engineer tommaso.merc...@amarulasolutions.com __ Amarula Solutions SRL Via Le Canevare 30, 31100 Treviso, Veneto, IT T. +39 042 243 5310 i...@amarulasolutions.com www.amarulasolutions.com
Re: [Nouveau] [PATCH 5/9] virtio-scsi: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:06PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: 4fe74b1cb051 ("[SCSI] virtio-scsi: SCSI driver for QEMU based virtual > machines") > Signed-off-by: Randy Dunlap > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: "James E.J. Bottomley" > Cc: "Martin K. Petersen" > Cc: linux-s...@vger.kernel.org > Cc: virtualizat...@lists.linux-foundation.org If this is done tree-wide, it's ok to do it for virtio too. Acked-by: Michael S. Tsirkin No real opinion on whether it's a good idea. > --- > drivers/scsi/virtio_scsi.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/drivers/scsi/virtio_scsi.c > +++ lnx-517-rc8/drivers/scsi/virtio_scsi.c > @@ -988,7 +988,7 @@ static struct virtio_driver virtio_scsi_ > .remove = virtscsi_remove, > }; > > -static int __init init(void) > +static int __init virtio_scsi_init(void) > { > int ret = -ENOMEM; > > @@ -1020,14 +1020,14 @@ error: > return ret; > } > > -static void __exit fini(void) > +static void __exit virtio_scsi_fini(void) > { > unregister_virtio_driver(&virtio_scsi_driver); > mempool_destroy(virtscsi_cmd_pool); > kmem_cache_destroy(virtscsi_cmd_cache); > } > -module_init(init); > -module_exit(fini); > +module_init(virtio_scsi_init); > +module_exit(virtio_scsi_fini); > > MODULE_DEVICE_TABLE(virtio, id_table); > MODULE_DESCRIPTION("Virtio SCSI HBA driver");
[Nouveau] [PATCH] dispnv50: atom: fix an incorrect NULL check on list iterator
The bug is here: return encoder; The list iterator value 'encoder' will *always* be set and non-NULL by drm_for_each_encoder_mask(), so it is incorrect to assume that the iterator value will be NULL if the list is empty or no element found. Otherwise it will bypass some NULL checks and lead to invalid memory access passing the check. To fix this bug, just return 'encoder' when found, otherwise return NULL. Cc: sta...@vger.kernel.org Fixes: 12885ecbfe62d ("drm/nouveau/kms/nvd9-: Add CRC support") Signed-off-by: Xiaomeng Tong --- drivers/gpu/drm/nouveau/dispnv50/atom.h | 6 +++--- drivers/gpu/drm/nouveau/dispnv50/crc.c | 27 - 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/atom.h b/drivers/gpu/drm/nouveau/dispnv50/atom.h index 3d82b3c67dec..93f8f4f64578 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/atom.h +++ b/drivers/gpu/drm/nouveau/dispnv50/atom.h @@ -160,14 +160,14 @@ nv50_head_atom_get(struct drm_atomic_state *state, struct drm_crtc *crtc) static inline struct drm_encoder * nv50_head_atom_get_encoder(struct nv50_head_atom *atom) { - struct drm_encoder *encoder = NULL; + struct drm_encoder *encoder; /* We only ever have a single encoder */ drm_for_each_encoder_mask(encoder, atom->state.crtc->dev, atom->state.encoder_mask) - break; + return encoder; - return encoder; + return NULL; } #define nv50_wndw_atom(p) container_of((p), struct nv50_wndw_atom, state) diff --git a/drivers/gpu/drm/nouveau/dispnv50/crc.c b/drivers/gpu/drm/nouveau/dispnv50/crc.c index 29428e770f14..b834e8a9ae77 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/crc.c +++ b/drivers/gpu/drm/nouveau/dispnv50/crc.c @@ -390,9 +390,18 @@ void nv50_crc_atomic_check_outp(struct nv50_atom *atom) struct nv50_head_atom *armh = nv50_head_atom(old_crtc_state); struct nv50_head_atom *asyh = nv50_head_atom(new_crtc_state); struct nv50_outp_atom *outp_atom; - struct nouveau_encoder *outp = - nv50_real_outp(nv50_head_atom_get_encoder(armh)); - struct drm_encoder *encoder = &outp->base.base; + struct nouveau_encoder *outp; + struct drm_encoder *encoder, *enc; + + enc = nv50_head_atom_get_encoder(armh); + if (!enc) + continue; + + outp = nv50_real_outp(enc); + if (!outp) + continue; + + encoder = &outp->base.base; if (!asyh->clr.crc) continue; @@ -443,8 +452,16 @@ void nv50_crc_atomic_set(struct nv50_head *head, struct drm_device *dev = crtc->dev; struct nv50_crc *crc = &head->crc; const struct nv50_crc_func *func = nv50_disp(dev)->core->func->crc; - struct nouveau_encoder *outp = - nv50_real_outp(nv50_head_atom_get_encoder(asyh)); + struct nouveau_encoder *outp; + struct drm_encoder *encoder; + + encoder = nv50_head_atom_get_encoder(asyh); + if (!encoder) + return; + + outp = nv50_real_outp(encoder); + if (!outp) + return; func->set_src(head, outp->or, nv50_crc_source_type(outp, asyh->crc.src), &crc->ctx[crc->ctx_idx]); -- 2.17.1
Re: [Nouveau] [PATCH] drm/nouveau/bios: Rename prom_init() and friends functions
Hi Paul, Le 05/03/2022 à 10:51, Christophe Leroy a écrit : Le 05/03/2022 à 08:38, Christophe Leroy a écrit : Le 04/03/2022 à 21:24, Lyude Paul a écrit : This mostly looks good to me. Just one question (and one comment down below that needs addressing). Is this with ppc32? (I ask because ppc64le doesn't seem to hit this compilation error). That's with PPC64, see http://kisskb.ellerman.id.au/kisskb/branch/chleroy/head/252ba609bea83234d2e35841c19ae84c67b43ec7/ But that's not (yet) with the mainline tree. That's work I'm doing to cleanup our asm/asm-protoypes.h header. Since commit 4efca4ed05cb ("kbuild: modversions for EXPORT_SYMBOL() for asm") that file is dedicated to prototypes of functions defined in assembly. Therefore I'm trying to dispatch C functions prototypes in other headers. I wanted to move prom_init() prototype into asm/prom.h and then I hit the problem. In the beginning I was thinking about just changing the name of the function in powerpc, but as I see that M68K, MIPS and SPARC also have a prom_init() function, I thought it would be better to change the name in shadowrom.c to avoid any future conflict like the one I got while reworking the headers. @@ -57,8 +57,8 @@ prom_init(struct nvkm_bios *bios, const char *name) const struct nvbios_source nvbios_rom = { .name = "PROM", - .init = prom_init, - .fini = prom_fini, - .read = prom_read, + .init = nvbios_rom_init, + .fini = nvbios_rom_fini, + .read = nvbios_rom_read, Seeing as the source name is prom, I think using the naming convention nvbios_prom_* would be better then nvbios_rom_*. Yes I wasn't sure about the best naming as the file name is shadowrom.c and not shadowprom.c. I will send v2 using nvbios_prom_* as a name. While preparing v2 I remembered that in fact, I called the functions nvbios_rom_* because the name of the nvbios_source struct is nvbios_rom, so for me it made sense to use the name of the struct as a prefix for the functions. So I'm OK to change it to nvbios_prom_* but it looks less logical to me. Please confirm you still prefer nvbios_prom as prefix to the function names. Are you still expecting a v2 for this patch ? As the name of the structure is nvbios_rom, do you really prefer the functions to be called nvbios_prom_* as you mentionned in your comment ? In that case, do you also expect the structure name to be changed to nvbios_prom ? Thanks Christophe
[Nouveau] [PATCH] device: fix missing check on list iterator
The bug is here: lo = pstate->base.domain[domain->name]; The list iterator 'pstate' will point to a bogus position containing HEAD if the list is empty or no element is found. This case should be checked before any use of the iterator, otherwise it will lead to a invalid memory access. To fix this bug, add an check. Use a new value 'iter' as the list iterator, while use the old value 'pstate' as a dedicated variable to point to the found element. Cc: sta...@vger.kernel.org Fixes: 9838366c1597d ("drm/nouveau/device: initial control object class, with pstate control methods") Signed-off-by: Xiaomeng Tong --- drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c index ce774579c89d..6b768635e8ba 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/ctrl.c @@ -72,7 +72,7 @@ nvkm_control_mthd_pstate_attr(struct nvkm_control *ctrl, void *data, u32 size) } *args = data; struct nvkm_clk *clk = ctrl->device->clk; const struct nvkm_domain *domain; - struct nvkm_pstate *pstate; + struct nvkm_pstate *pstate = NULL, *iter; struct nvkm_cstate *cstate; int i = 0, j = -1; u32 lo, hi; @@ -103,11 +103,16 @@ nvkm_control_mthd_pstate_attr(struct nvkm_control *ctrl, void *data, u32 size) return -EINVAL; if (args->v0.state != NVIF_CONTROL_PSTATE_ATTR_V0_STATE_CURRENT) { - list_for_each_entry(pstate, &clk->states, head) { - if (i++ == args->v0.state) + list_for_each_entry(iter, &clk->states, head) { + if (i++ == args->v0.state) { + pstate = iter; break; + } } + if (!pstate) + return -EINVAL; + lo = pstate->base.domain[domain->name]; hi = lo; list_for_each_entry(cstate, &pstate->list, head) { -- 2.17.1
Re: [Nouveau] [PATCH 6/9] usb: gadget: eliminate anonymous module_init & module_exit
On 3/16/22 20:29, Ira Weiny wrote: > On Wed, Mar 16, 2022 at 12:20:07PM -0700, Randy Dunlap wrote: >> Eliminate anonymous module_init() and module_exit(), which can lead to >> confusion or ambiguity when reading System.map, crashes/oops/bugs, >> or an initcall_debug log. >> >> Give each of these init and exit functions unique driver-specific >> names to eliminate the anonymous names. >> >> Example 1: (System.map) >> 832fc78c t init >> 832fc79e t init >> 832fc8f8 t init >> >> Example 2: (initcall_debug log) >> calling init+0x0/0x12 @ 1 >> initcall init+0x0/0x12 returned 0 after 15 usecs >> calling init+0x0/0x60 @ 1 >> initcall init+0x0/0x60 returned 0 after 2 usecs >> calling init+0x0/0x9a @ 1 >> initcall init+0x0/0x9a returned 0 after 74 usecs >> >> Fixes: bd25a14edb75 ("usb: gadget: legacy/serial: allow dynamic removal") >> Fixes: 7bb5ea54be47 ("usb gadget serial: use composite gadget framework") >> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > > I continue to be confused about the latest rules for the Fixes tag but this > one > in particular seems completely useless. This is the 'beginning of time' > commit > by Linus AFAICT. So do any of these Fixes tags need to be in this series? I guess it mostly depends on whether they get applied to stable trees, but it's entirely fine with me if they don't. {I also corrected Felipe's email address here.} > Regardless: > > Reviewed-by: Ira Weiny Thanks. > >> Signed-off-by: Randy Dunlap >> Cc: Felipe Balbi >> Cc: Michał Mirosław >> Cc: Greg Kroah-Hartman >> Cc: Sebastian Andrzej Siewior >> Cc: linux-...@vger.kernel.org >> --- >> drivers/usb/gadget/legacy/inode.c |8 >> drivers/usb/gadget/legacy/serial.c | 10 +- >> drivers/usb/gadget/udc/dummy_hcd.c |8 >> 3 files changed, 13 insertions(+), 13 deletions(-) >> >> --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/serial.c >> +++ lnx-517-rc8/drivers/usb/gadget/legacy/serial.c >> @@ -273,7 +273,7 @@ static struct usb_composite_driver gseri >> static int switch_gserial_enable(bool do_enable) >> { >> if (!serial_config_driver.label) >> -/* init() was not called, yet */ >> +/* gserial_init() was not called, yet */ >> return 0; >> >> if (do_enable) >> @@ -283,7 +283,7 @@ static int switch_gserial_enable(bool do >> return 0; >> } >> >> -static int __init init(void) >> +static int __init gserial_init(void) >> { >> /* We *could* export two configs; that'd be much cleaner... >> * but neither of these product IDs was defined that way. >> @@ -314,11 +314,11 @@ static int __init init(void) >> >> return usb_composite_probe(&gserial_driver); >> } >> -module_init(init); >> +module_init(gserial_init); >> >> -static void __exit cleanup(void) >> +static void __exit gserial_cleanup(void) >> { >> if (enable) >> usb_composite_unregister(&gserial_driver); >> } >> -module_exit(cleanup); >> +module_exit(gserial_cleanup); >> --- lnx-517-rc8.orig/drivers/usb/gadget/udc/dummy_hcd.c >> +++ lnx-517-rc8/drivers/usb/gadget/udc/dummy_hcd.c >> @@ -2765,7 +2765,7 @@ static struct platform_driver dummy_hcd_ >> static struct platform_device *the_udc_pdev[MAX_NUM_UDC]; >> static struct platform_device *the_hcd_pdev[MAX_NUM_UDC]; >> >> -static int __init init(void) >> +static int __init dummy_hcd_init(void) >> { >> int retval = -ENOMEM; >> int i; >> @@ -2887,9 +2887,9 @@ err_alloc_udc: >> platform_device_put(the_hcd_pdev[i]); >> return retval; >> } >> -module_init(init); >> +module_init(dummy_hcd_init); >> >> -static void __exit cleanup(void) >> +static void __exit dummy_hcd_cleanup(void) >> { >> int i; >> >> @@ -2905,4 +2905,4 @@ static void __exit cleanup(void) >> platform_driver_unregister(&dummy_udc_driver); >> platform_driver_unregister(&dummy_hcd_driver); >> } >> -module_exit(cleanup); >> +module_exit(dummy_hcd_cleanup); >> --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/inode.c >> +++ lnx-517-rc8/drivers/usb/gadget/legacy/inode.c >> @@ -2101,7 +2101,7 @@ MODULE_ALIAS_FS("gadgetfs"); >> >> /*--*/ >> >> -static int __init init (void) >> +static int __init gadgetfs_init (void) >> { >> int status; >> >> @@ -2111,12 +2111,12 @@ static int __init init (void) >> shortname, driver_desc); >> return status; >> } >> -module_init (init); >> +module_init (gadgetfs_init); >> >> -static void __exit cleanup (void) >> +static void __exit gadgetfs_cleanup (void) >> { >> pr_debug ("unregister %s\n", shortname); >> unregister_filesystem (&gadgetfs_type); >> } >> -module_exit (cleanup); >> +module_exit (gadgetfs_cleanup); >> -- ~Randy
Re: [Nouveau] [PATCH 2/9] virtio_console: eliminate anonymous module_init & module_exit
On Wed, 2022-03-16 at 12:20 -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: 31610434bc35 ("Virtio console driver") > Fixes: 7177876fea83 ("virtio: console: Add ability to remove module") > Signed-off-by: Randy Dunlap < > rdun...@infradead.org > > > Cc: Amit Shah < > a...@kernel.org > > > Cc: > virtualizat...@lists.linux-foundation.org > > Cc: Arnd Bergmann < > a...@arndb.de > > > Cc: Greg Kroah-Hartman < > gre...@linuxfoundation.org > > > --- > drivers/char/virtio_console.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Amit Shah I don't think the Fixes-by really applies here, though - we don't really want to push this into stable, nor do we want any automated tools to pick this up because of that tag.. Amit
Re: [Nouveau] [PATCH 3/9] net: mlx5: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:04PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") > Signed-off-by: Randy Dunlap > Cc: Eli Cohen > Cc: Saeed Mahameed > Cc: net...@vger.kernel.org > Cc: Leon Romanovsky > Cc: linux-r...@vger.kernel.org > --- > drivers/net/ethernet/mellanox/mlx5/core/main.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky
Re: [Nouveau] [PATCH] device: fix missing check on list iterator
On Sat, 26 Mar 2022 22:38:05 -0700, Guenter Roeck wrote: > > @@ -103,11 +103,16 @@ nvkm_control_mthd_pstate_attr(struct nvkm_control > > *ctrl, void *data, u32 size) > > return -EINVAL; > > > > if (args->v0.state != NVIF_CONTROL_PSTATE_ATTR_V0_STATE_CURRENT) { > > - list_for_each_entry(pstate, &clk->states, head) { > > - if (i++ == args->v0.state) > > + list_for_each_entry(iter, &clk->states, head) { > > + if (i++ == args->v0.state) { > > + pstate = iter; > > Is iter and the assignment really necessary ? Unless I am missing something, > list_for_each_entry() always assigns pos (pstate/iter), even if the list is > empty. If nothing is found, pstate would be NULL at the end, so the pstate will not be NULL at the end! so the assignment is necessary! #define list_for_each_entry(pos, head, member) \ for (pos = __container_of((head)->next, pos, member); \ &pos->member != (head);\ pos = __container_of(pos->member.next, pos, member)) -- Xiaomeng Tong
Re: [Nouveau] [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:02PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: e467cde23818 ("Block driver using virtio.") > Signed-off-by: Randy Dunlap > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: virtualizat...@lists.linux-foundation.org > Cc: Jens Axboe > Cc: linux-bl...@vger.kernel.org > --- > drivers/block/virtio_blk.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/drivers/block/virtio_blk.c > +++ lnx-517-rc8/drivers/block/virtio_blk.c > @@ -1058,7 +1058,7 @@ static struct virtio_driver virtio_blk = > #endif > }; > > -static int __init init(void) > +static int __init virtio_blk_init(void) > { > int error; > > @@ -1084,14 +1084,14 @@ out_destroy_workqueue: > return error; > } > > -static void __exit fini(void) > +static void __exit virtio_blk_fini(void) > { > unregister_virtio_driver(&virtio_blk); > unregister_blkdev(major, "virtblk"); > destroy_workqueue(virtblk_wq); > } > -module_init(init); > -module_exit(fini); > +module_init(virtio_blk_init); > +module_exit(virtio_blk_fini); > > MODULE_DEVICE_TABLE(virtio, id_table); > MODULE_DESCRIPTION("Virtio block driver"); > Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature
Re: [Nouveau] [PATCH 2/9] virtio_console: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:03PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: 31610434bc35 ("Virtio console driver") > Fixes: 7177876fea83 ("virtio: console: Add ability to remove module") > Signed-off-by: Randy Dunlap > Cc: Amit Shah > Cc: virtualizat...@lists.linux-foundation.org > Cc: Arnd Bergmann > Cc: Greg Kroah-Hartman If this is done tree-wide, it's ok to do it for virtio too. Acked-by: Michael S. Tsirkin No real opinion on whether it's a good idea. > --- > drivers/char/virtio_console.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/drivers/char/virtio_console.c > +++ lnx-517-rc8/drivers/char/virtio_console.c > @@ -2245,7 +2245,7 @@ static struct virtio_driver virtio_rproc > .remove = virtcons_remove, > }; > > -static int __init init(void) > +static int __init virtio_console_init(void) > { > int err; > > @@ -2280,7 +2280,7 @@ free: > return err; > } > > -static void __exit fini(void) > +static void __exit virtio_console_fini(void) > { > reclaim_dma_bufs(); > > @@ -2290,8 +2290,8 @@ static void __exit fini(void) > class_destroy(pdrvdata.class); > debugfs_remove_recursive(pdrvdata.debugfs_dir); > } > -module_init(init); > -module_exit(fini); > +module_init(virtio_console_init); > +module_exit(virtio_console_fini); > > MODULE_DESCRIPTION("Virtio console driver"); > MODULE_LICENSE("GPL");
Re: [Nouveau] [PATCH 7/9] usb: usbip: eliminate anonymous module_init & module_exit
On 3/16/22 1:20 PM, Randy Dunlap wrote: Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 80fd9cd52de6 ("usbip: vudc: Add VUDC main file") Signed-off-by: Randy Dunlap Cc: Krzysztof Opasiak Cc: Igor Kotrasinski Cc: Greg Kroah-Hartman Cc: Valentina Manea Cc: Shuah Khan Cc: Shuah Khan Cc: linux-...@vger.kernel.org --- drivers/usb/usbip/vudc_main.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/usb/usbip/vudc_main.c +++ lnx-517-rc8/drivers/usb/usbip/vudc_main.c @@ -28,7 +28,7 @@ static struct platform_driver vudc_drive static struct list_head vudc_devices = LIST_HEAD_INIT(vudc_devices); -static int __init init(void) +static int __init vudc_init(void) { int retval = -ENOMEM; int i; @@ -86,9 +86,9 @@ cleanup: out: return retval; } -module_init(init); +module_init(vudc_init); -static void __exit cleanup(void) +static void __exit vudc_cleanup(void) { struct vudc_device *udc_dev = NULL, *udc_dev2 = NULL; @@ -103,7 +103,7 @@ static void __exit cleanup(void) } platform_driver_unregister(&vudc_driver); } -module_exit(cleanup); +module_exit(vudc_cleanup); MODULE_DESCRIPTION("USB over IP Device Controller"); MODULE_AUTHOR("Krzysztof Opasiak, Karol Kosik, Igor Kotrasinski"); Thanks for fixing this. Acked-by: Shuah Khan thanks, -- Shuah
[Nouveau] [PATCH 4/9] netfilter: h323: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: f587de0e2feb ("[NETFILTER]: nf_conntrack/nf_nat: add H.323 helper port") Signed-off-by: Randy Dunlap Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: netfilter-de...@vger.kernel.org Cc: coret...@netfilter.org Cc: "David S. Miller" Cc: Jakub Kicinski Cc: net...@vger.kernel.org --- net/ipv4/netfilter/nf_nat_h323.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/net/ipv4/netfilter/nf_nat_h323.c +++ lnx-517-rc8/net/ipv4/netfilter/nf_nat_h323.c @@ -580,7 +580,7 @@ static struct nf_ct_helper_expectfn call }; // -static int __init init(void) +static int __init nf_nat_h323_init(void) { BUG_ON(set_h245_addr_hook != NULL); BUG_ON(set_h225_addr_hook != NULL); @@ -607,7 +607,7 @@ static int __init init(void) } // -static void __exit fini(void) +static void __exit nf_nat_h323_fini(void) { RCU_INIT_POINTER(set_h245_addr_hook, NULL); RCU_INIT_POINTER(set_h225_addr_hook, NULL); @@ -624,8 +624,8 @@ static void __exit fini(void) } // -module_init(init); -module_exit(fini); +module_init(nf_nat_h323_init); +module_exit(nf_nat_h323_fini); MODULE_AUTHOR("Jing Min Zhao "); MODULE_DESCRIPTION("H.323 NAT helper");
Re: [Nouveau] [PATCH 0/9] treewide: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:01PM -0700, Randy Dunlap wrote: > There are a number of drivers that use "module_init(init)" and > "module_exit(exit)", which are anonymous names and can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. I'm not fully sure about the Fixes tags but I don't see that it hurts anything. For the series: Reviewed-by: Ira Weiny > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > 832fca05 t init > 832fcbd2 t init > 83328f0e t init > 8332c5b1 t init > 8332d9eb t init > 8332f0aa t init > 83330e25 t init > 833317a5 t init > 8333dd6b t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > calling init+0x0/0x73 @ 1 > initcall init+0x0/0x73 returned 0 after 6 usecs > calling init+0x0/0x73 @ 1 > initcall init+0x0/0x73 returned 0 after 4 usecs > calling init+0x0/0xf5 @ 1 > initcall init+0x0/0xf5 returned 0 after 27 usecs > calling init+0x0/0x7d @ 1 > initcall init+0x0/0x7d returned 0 after 11 usecs > calling init+0x0/0xc9 @ 1 > initcall init+0x0/0xc9 returned 0 after 19 usecs > calling init+0x0/0x9d @ 1 > initcall init+0x0/0x9d returned 0 after 37 usecs > calling init+0x0/0x63f @ 1 > initcall init+0x0/0x63f returned 0 after 411 usecs > calling init+0x0/0x171 @ 1 > initcall init+0x0/0x171 returned 0 after 61 usecs > calling init+0x0/0xef @ 1 > initcall init+0x0/0xef returned 0 after 3 usecs > > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: Jens Axboe > Cc: Amit Shah > Cc: Arnd Bergmann > Cc: Greg Kroah-Hartman > Cc: Eli Cohen > Cc: Saeed Mahameed > Cc: Leon Romanovsky > Cc: Pablo Neira Ayuso > Cc: Jozsef Kadlecsik > Cc: Florian Westphal > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: "James E.J. Bottomley" > Cc: "Martin K. Petersen" > Cc: Felipe Balbi > Cc: Michał Mirosław > Cc: Sebastian Andrzej Siewior > Cc: Krzysztof Opasiak > Cc: Igor Kotrasinski > Cc: Valentina Manea > Cc: Shuah Khan > Cc: Shuah Khan > Cc: Jussi Kivilinna > Cc: Joachim Fritschi > Cc: Herbert Xu > Cc: Thomas Gleixner > Cc: Steven Rostedt > Cc: Ingo Molnar > Cc: Karol Herbst > Cc: Pekka Paalanen > Cc: Dave Hansen > Cc: Andy Lutomirski > Cc: Peter Zijlstra > Cc: Borislav Petkov > Cc: "H. Peter Anvin" > Cc: netfilter-de...@vger.kernel.org > Cc: coret...@netfilter.org > Cc: net...@vger.kernel.org > Cc: linux-bl...@vger.kernel.org > Cc: linux-cry...@vger.kernel.org > Cc: linux-r...@vger.kernel.org > Cc: linux-s...@vger.kernel.org > Cc: linux-...@vger.kernel.org > Cc: nouveau@lists.freedesktop.org > Cc: virtualizat...@lists.linux-foundation.org > Cc: x...@kernel.org > > patches: > [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit > [PATCH 2/9] virtio_console: eliminate anonymous module_init & module_exit > [PATCH 3/9] net: mlx5: eliminate anonymous module_init & module_exit > [PATCH 4/9] netfilter: h323: eliminate anonymous module_init & module_exit > [PATCH 5/9] virtio-scsi: eliminate anonymous module_init & module_exit > [PATCH 6/9] usb: gadget: eliminate anonymous module_init & module_exit > [PATCH 7/9] usb: usbip: eliminate anonymous module_init & module_exit > [PATCH 8/9] x86/crypto: eliminate anonymous module_init & module_exit > [PATCH 9/9] testmmiotrace: eliminate anonymous module_init & module_exit > > diffstat: > arch/x86/crypto/blowfish_glue.c|8 > arch/x86/crypto/camellia_glue.c|8 > arch/x86/crypto/serpent_avx2_glue.c|8 > arch/x86/crypto/twofish_glue.c |8 > arch/x86/crypto/twofish_glue_3way.c|8 > arch/x86/mm/testmmiotrace.c|8 > drivers/block/virtio_blk.c |8 > drivers/char/virtio_console.c |8 > drivers/net/ethernet/mellanox/mlx5/core/main.c |8 > drivers/scsi/virtio_scsi.c |8 > drivers/usb/gadget/legacy/inode.c |8 > drivers/usb/gadget/legacy/serial.c | 10 +- > drivers/usb/gadget/udc/dummy_hcd.c |8 > drivers/usb/usbip/vudc_main.c |8 > net/ipv4/netfilter/nf_nat_h323.c |8 > 15 files changed, 61 insertions(+), 61 deletions(-)
Re: [Nouveau] [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:02PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: e467cde23818 ("Block driver using virtio.") > Signed-off-by: Randy Dunlap > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: virtualizat...@lists.linux-foundation.org > Cc: Jens Axboe > Cc: linux-bl...@vger.kernel.org If this is done tree-wide, it's ok to do it for virtio too. Acked-by: Michael S. Tsirkin No real opinion on whether it's a good idea. > --- > drivers/block/virtio_blk.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/drivers/block/virtio_blk.c > +++ lnx-517-rc8/drivers/block/virtio_blk.c > @@ -1058,7 +1058,7 @@ static struct virtio_driver virtio_blk = > #endif > }; > > -static int __init init(void) > +static int __init virtio_blk_init(void) > { > int error; > > @@ -1084,14 +1084,14 @@ out_destroy_workqueue: > return error; > } > > -static void __exit fini(void) > +static void __exit virtio_blk_fini(void) > { > unregister_virtio_driver(&virtio_blk); > unregister_blkdev(major, "virtblk"); > destroy_workqueue(virtblk_wq); > } > -module_init(init); > -module_exit(fini); > +module_init(virtio_blk_init); > +module_exit(virtio_blk_fini); > > MODULE_DEVICE_TABLE(virtio, id_table); > MODULE_DESCRIPTION("Virtio block driver");
[Nouveau] [PATCH 7/9] usb: usbip: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 80fd9cd52de6 ("usbip: vudc: Add VUDC main file") Signed-off-by: Randy Dunlap Cc: Krzysztof Opasiak Cc: Igor Kotrasinski Cc: Greg Kroah-Hartman Cc: Valentina Manea Cc: Shuah Khan Cc: Shuah Khan Cc: linux-...@vger.kernel.org --- drivers/usb/usbip/vudc_main.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/usb/usbip/vudc_main.c +++ lnx-517-rc8/drivers/usb/usbip/vudc_main.c @@ -28,7 +28,7 @@ static struct platform_driver vudc_drive static struct list_head vudc_devices = LIST_HEAD_INIT(vudc_devices); -static int __init init(void) +static int __init vudc_init(void) { int retval = -ENOMEM; int i; @@ -86,9 +86,9 @@ cleanup: out: return retval; } -module_init(init); +module_init(vudc_init); -static void __exit cleanup(void) +static void __exit vudc_cleanup(void) { struct vudc_device *udc_dev = NULL, *udc_dev2 = NULL; @@ -103,7 +103,7 @@ static void __exit cleanup(void) } platform_driver_unregister(&vudc_driver); } -module_exit(cleanup); +module_exit(vudc_cleanup); MODULE_DESCRIPTION("USB over IP Device Controller"); MODULE_AUTHOR("Krzysztof Opasiak, Karol Kosik, Igor Kotrasinski");
[Nouveau] [PATCH 3/9] net: mlx5: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") Signed-off-by: Randy Dunlap Cc: Eli Cohen Cc: Saeed Mahameed Cc: net...@vger.kernel.org Cc: Leon Romanovsky Cc: linux-r...@vger.kernel.org --- drivers/net/ethernet/mellanox/mlx5/core/main.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ lnx-517-rc8/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1893,7 +1893,7 @@ static void mlx5_core_verify_params(void } } -static int __init init(void) +static int __init mlx5_init(void) { int err; @@ -1929,7 +1929,7 @@ err_debug: return err; } -static void __exit cleanup(void) +static void __exit mlx5_cleanup(void) { mlx5e_cleanup(); mlx5_sf_driver_unregister(); @@ -1937,5 +1937,5 @@ static void __exit cleanup(void) mlx5_unregister_debugfs(); } -module_init(init); -module_exit(cleanup); +module_init(mlx5_init); +module_exit(mlx5_cleanup);
Re: [Nouveau] [PATCH 5/9] virtio-scsi: eliminate anonymous module_init & module_exit
On Wed, Mar 16, 2022 at 12:20:06PM -0700, Randy Dunlap wrote: > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: 4fe74b1cb051 ("[SCSI] virtio-scsi: SCSI driver for QEMU based virtual > machines") > Signed-off-by: Randy Dunlap > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: "James E.J. Bottomley" > Cc: "Martin K. Petersen" > Cc: linux-s...@vger.kernel.org > Cc: virtualizat...@lists.linux-foundation.org > --- > drivers/scsi/virtio_scsi.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/drivers/scsi/virtio_scsi.c > +++ lnx-517-rc8/drivers/scsi/virtio_scsi.c > @@ -988,7 +988,7 @@ static struct virtio_driver virtio_scsi_ > .remove = virtscsi_remove, > }; > > -static int __init init(void) > +static int __init virtio_scsi_init(void) > { > int ret = -ENOMEM; > > @@ -1020,14 +1020,14 @@ error: > return ret; > } > > -static void __exit fini(void) > +static void __exit virtio_scsi_fini(void) > { > unregister_virtio_driver(&virtio_scsi_driver); > mempool_destroy(virtscsi_cmd_pool); > kmem_cache_destroy(virtscsi_cmd_cache); > } > -module_init(init); > -module_exit(fini); > +module_init(virtio_scsi_init); > +module_exit(virtio_scsi_fini); > > MODULE_DEVICE_TABLE(virtio, id_table); > MODULE_DESCRIPTION("Virtio SCSI HBA driver"); > Reviewed-by: Stefan Hajnoczi signature.asc Description: PGP signature
[Nouveau] [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: e467cde23818 ("Block driver using virtio.") Signed-off-by: Randy Dunlap Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: virtualizat...@lists.linux-foundation.org Cc: Jens Axboe Cc: linux-bl...@vger.kernel.org --- drivers/block/virtio_blk.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/block/virtio_blk.c +++ lnx-517-rc8/drivers/block/virtio_blk.c @@ -1058,7 +1058,7 @@ static struct virtio_driver virtio_blk = #endif }; -static int __init init(void) +static int __init virtio_blk_init(void) { int error; @@ -1084,14 +1084,14 @@ out_destroy_workqueue: return error; } -static void __exit fini(void) +static void __exit virtio_blk_fini(void) { unregister_virtio_driver(&virtio_blk); unregister_blkdev(major, "virtblk"); destroy_workqueue(virtblk_wq); } -module_init(init); -module_exit(fini); +module_init(virtio_blk_init); +module_exit(virtio_blk_fini); MODULE_DEVICE_TABLE(virtio, id_table); MODULE_DESCRIPTION("Virtio block driver");
[Nouveau] [PATCH 0/9] treewide: eliminate anonymous module_init & module_exit
There are a number of drivers that use "module_init(init)" and "module_exit(exit)", which are anonymous names and can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init 832fca05 t init 832fcbd2 t init 83328f0e t init 8332c5b1 t init 8332d9eb t init 8332f0aa t init 83330e25 t init 833317a5 t init 8333dd6b t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs calling init+0x0/0x73 @ 1 initcall init+0x0/0x73 returned 0 after 6 usecs calling init+0x0/0x73 @ 1 initcall init+0x0/0x73 returned 0 after 4 usecs calling init+0x0/0xf5 @ 1 initcall init+0x0/0xf5 returned 0 after 27 usecs calling init+0x0/0x7d @ 1 initcall init+0x0/0x7d returned 0 after 11 usecs calling init+0x0/0xc9 @ 1 initcall init+0x0/0xc9 returned 0 after 19 usecs calling init+0x0/0x9d @ 1 initcall init+0x0/0x9d returned 0 after 37 usecs calling init+0x0/0x63f @ 1 initcall init+0x0/0x63f returned 0 after 411 usecs calling init+0x0/0x171 @ 1 initcall init+0x0/0x171 returned 0 after 61 usecs calling init+0x0/0xef @ 1 initcall init+0x0/0xef returned 0 after 3 usecs Cc: "Michael S. Tsirkin" Cc: Jason Wang Cc: Paolo Bonzini Cc: Stefan Hajnoczi Cc: Jens Axboe Cc: Amit Shah Cc: Arnd Bergmann Cc: Greg Kroah-Hartman Cc: Eli Cohen Cc: Saeed Mahameed Cc: Leon Romanovsky Cc: Pablo Neira Ayuso Cc: Jozsef Kadlecsik Cc: Florian Westphal Cc: "David S. Miller" Cc: Jakub Kicinski Cc: "James E.J. Bottomley" Cc: "Martin K. Petersen" Cc: Felipe Balbi Cc: Michał Mirosław Cc: Sebastian Andrzej Siewior Cc: Krzysztof Opasiak Cc: Igor Kotrasinski Cc: Valentina Manea Cc: Shuah Khan Cc: Shuah Khan Cc: Jussi Kivilinna Cc: Joachim Fritschi Cc: Herbert Xu Cc: Thomas Gleixner Cc: Steven Rostedt Cc: Ingo Molnar Cc: Karol Herbst Cc: Pekka Paalanen Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: netfilter-de...@vger.kernel.org Cc: coret...@netfilter.org Cc: net...@vger.kernel.org Cc: linux-bl...@vger.kernel.org Cc: linux-cry...@vger.kernel.org Cc: linux-r...@vger.kernel.org Cc: linux-s...@vger.kernel.org Cc: linux-...@vger.kernel.org Cc: nouveau@lists.freedesktop.org Cc: virtualizat...@lists.linux-foundation.org Cc: x...@kernel.org patches: [PATCH 1/9] virtio_blk: eliminate anonymous module_init & module_exit [PATCH 2/9] virtio_console: eliminate anonymous module_init & module_exit [PATCH 3/9] net: mlx5: eliminate anonymous module_init & module_exit [PATCH 4/9] netfilter: h323: eliminate anonymous module_init & module_exit [PATCH 5/9] virtio-scsi: eliminate anonymous module_init & module_exit [PATCH 6/9] usb: gadget: eliminate anonymous module_init & module_exit [PATCH 7/9] usb: usbip: eliminate anonymous module_init & module_exit [PATCH 8/9] x86/crypto: eliminate anonymous module_init & module_exit [PATCH 9/9] testmmiotrace: eliminate anonymous module_init & module_exit diffstat: arch/x86/crypto/blowfish_glue.c|8 arch/x86/crypto/camellia_glue.c|8 arch/x86/crypto/serpent_avx2_glue.c|8 arch/x86/crypto/twofish_glue.c |8 arch/x86/crypto/twofish_glue_3way.c|8 arch/x86/mm/testmmiotrace.c|8 drivers/block/virtio_blk.c |8 drivers/char/virtio_console.c |8 drivers/net/ethernet/mellanox/mlx5/core/main.c |8 drivers/scsi/virtio_scsi.c |8 drivers/usb/gadget/legacy/inode.c |8 drivers/usb/gadget/legacy/serial.c | 10 +- drivers/usb/gadget/udc/dummy_hcd.c |8 drivers/usb/usbip/vudc_main.c |8 net/ipv4/netfilter/nf_nat_h323.c |8 15 files changed, 61 insertions(+), 61 deletions(-)
[Nouveau] [PATCH 8/9] x86/crypto: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 64b94ceae8c1 ("crypto: blowfish - add x86_64 assembly implementation") Fixes: 676a38046f4f ("crypto: camellia-x86_64 - module init/exit functions should be static") Fixes: 0b95ec56ae19 ("crypto: camellia - add assembler implementation for x86_64") Fixes: 56d76c96a9f3 ("crypto: serpent - add AVX2/x86_64 assembler implementation of serpent cipher") Fixes: b9f535ffe38f ("[CRYPTO] twofish: i586 assembly version") Fixes: ff0a70fe0536 ("crypto: twofish-x86_64-3way - module init/exit functions should be static") Fixes: 8280daad436e ("crypto: twofish - add 3-way parallel x86_64 assembler implemention") Signed-off-by: Randy Dunlap Cc: Jussi Kivilinna Cc: Joachim Fritschi Cc: Herbert Xu Cc: "David S. Miller" Cc: linux-cry...@vger.kernel.org Cc: x...@kernel.org --- arch/x86/crypto/blowfish_glue.c |8 arch/x86/crypto/camellia_glue.c |8 arch/x86/crypto/serpent_avx2_glue.c |8 arch/x86/crypto/twofish_glue.c |8 arch/x86/crypto/twofish_glue_3way.c |8 5 files changed, 20 insertions(+), 20 deletions(-) --- lnx-517-rc8.orig/arch/x86/crypto/blowfish_glue.c +++ lnx-517-rc8/arch/x86/crypto/blowfish_glue.c @@ -315,7 +315,7 @@ static int force; module_param(force, int, 0); MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist"); -static int __init init(void) +static int __init blowfish_init(void) { int err; @@ -339,15 +339,15 @@ static int __init init(void) return err; } -static void __exit fini(void) +static void __exit blowfish_fini(void) { crypto_unregister_alg(&bf_cipher_alg); crypto_unregister_skciphers(bf_skcipher_algs, ARRAY_SIZE(bf_skcipher_algs)); } -module_init(init); -module_exit(fini); +module_init(blowfish_init); +module_exit(blowfish_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Blowfish Cipher Algorithm, asm optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/camellia_glue.c +++ lnx-517-rc8/arch/x86/crypto/camellia_glue.c @@ -1377,7 +1377,7 @@ static int force; module_param(force, int, 0); MODULE_PARM_DESC(force, "Force module load, ignore CPU blacklist"); -static int __init init(void) +static int __init camellia_init(void) { int err; @@ -1401,15 +1401,15 @@ static int __init init(void) return err; } -static void __exit fini(void) +static void __exit camellia_fini(void) { crypto_unregister_alg(&camellia_cipher_alg); crypto_unregister_skciphers(camellia_skcipher_algs, ARRAY_SIZE(camellia_skcipher_algs)); } -module_init(init); -module_exit(fini); +module_init(camellia_init); +module_exit(camellia_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Camellia Cipher Algorithm, asm optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/serpent_avx2_glue.c +++ lnx-517-rc8/arch/x86/crypto/serpent_avx2_glue.c @@ -96,7 +96,7 @@ static struct skcipher_alg serpent_algs[ static struct simd_skcipher_alg *serpent_simd_algs[ARRAY_SIZE(serpent_algs)]; -static int __init init(void) +static int __init serpent_avx2_init(void) { const char *feature_name; @@ -115,14 +115,14 @@ static int __init init(void) serpent_simd_algs); } -static void __exit fini(void) +static void __exit serpent_avx2_fini(void) { simd_unregister_skciphers(serpent_algs, ARRAY_SIZE(serpent_algs), serpent_simd_algs); } -module_init(init); -module_exit(fini); +module_init(serpent_avx2_init); +module_exit(serpent_avx2_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Serpent Cipher Algorithm, AVX2 optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/twofish_glue.c +++ lnx-517-rc8/arch/x86/crypto/twofish_glue.c @@ -81,18 +81,18 @@ static struct crypto_alg alg = { } }; -static int __init init(void) +static int __init twofish_glue_init(void) { return crypto_register_alg(&alg); } -static void __exit fini(void) +static void __exit twofish_glue_fini(void) { crypto_unregister_alg(&alg); } -module_init(init); -module_exit(fini); +module_init(twofish_glue_init); +module_exit(twofish_glue_fini); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION ("Twofish Cipher Algorithm, asm optimized"); --- lnx-517-rc8.orig/arch/x86/crypto/twofish_glue_3w
[Nouveau] [PATCH v2] drm/nouveau/bios: Rename prom_init() and friends functions
While working at fixing powerpc headers, I ended up with the following error. drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c:48:1: error: conflicting types for 'prom_init'; have 'void *(struct nvkm_bios *, const char *)' make[5]: *** [scripts/Makefile.build:288: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o] Error 1 powerpc and a few other architectures have a prom_init() global function. One day or another it will conflict with the one in shadowrom.c Those being static, they can easily be renamed. Do it. While at it, also rename the ops structure as 'nvbios_prom' instead of 'nvbios_rom' in order to make it clear that it refers to the NV_PROM device. Signed-off-by: Christophe Leroy --- v2: using nvbios_prom prefix instead of nvbios_rom. Changed structure name to keep things consistant. drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h| 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 2 +- .../gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c | 14 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h index fac1bff1311b..cfa8a0c356dd 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/priv.h @@ -19,7 +19,7 @@ struct nvbios_source { int nvbios_extend(struct nvkm_bios *, u32 length); int nvbios_shadow(struct nvkm_bios *); -extern const struct nvbios_source nvbios_rom; +extern const struct nvbios_source nvbios_prom; extern const struct nvbios_source nvbios_ramin; extern const struct nvbios_source nvbios_acpi_fast; extern const struct nvbios_source nvbios_acpi_slow; diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c index 4b571cc6bc70..19188683c8fc 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c @@ -171,7 +171,7 @@ nvbios_shadow(struct nvkm_bios *bios) struct shadow mthds[] = { { 0, &nvbios_of }, { 0, &nvbios_ramin }, - { 0, &nvbios_rom }, + { 0, &nvbios_prom }, { 0, &nvbios_acpi_fast }, { 4, &nvbios_acpi_slow }, { 1, &nvbios_pcirom }, diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c index ffa4b395220a..39144ceb117b 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c @@ -25,7 +25,7 @@ #include static u32 -prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios) +nvbios_prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios) { struct nvkm_device *device = data; u32 i; @@ -38,14 +38,14 @@ prom_read(void *data, u32 offset, u32 length, struct nvkm_bios *bios) } static void -prom_fini(void *data) +nvbios_prom_fini(void *data) { struct nvkm_device *device = data; nvkm_pci_rom_shadow(device->pci, true); } static void * -prom_init(struct nvkm_bios *bios, const char *name) +nvbios_prom_init(struct nvkm_bios *bios, const char *name) { struct nvkm_device *device = bios->subdev.device; if (device->card_type == NV_40 && device->chipset >= 0x4c) @@ -55,10 +55,10 @@ prom_init(struct nvkm_bios *bios, const char *name) } const struct nvbios_source -nvbios_rom = { +nvbios_prom = { .name = "PROM", - .init = prom_init, - .fini = prom_fini, - .read = prom_read, + .init = nvbios_prom_init, + .fini = nvbios_prom_fini, + .read = nvbios_prom_read, .rw = false, }; -- 2.35.1
[Nouveau] [PATCH 2/9] virtio_console: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 31610434bc35 ("Virtio console driver") Fixes: 7177876fea83 ("virtio: console: Add ability to remove module") Signed-off-by: Randy Dunlap Cc: Amit Shah Cc: virtualizat...@lists.linux-foundation.org Cc: Arnd Bergmann Cc: Greg Kroah-Hartman --- drivers/char/virtio_console.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/drivers/char/virtio_console.c +++ lnx-517-rc8/drivers/char/virtio_console.c @@ -2245,7 +2245,7 @@ static struct virtio_driver virtio_rproc .remove = virtcons_remove, }; -static int __init init(void) +static int __init virtio_console_init(void) { int err; @@ -2280,7 +2280,7 @@ free: return err; } -static void __exit fini(void) +static void __exit virtio_console_fini(void) { reclaim_dma_bufs(); @@ -2290,8 +2290,8 @@ static void __exit fini(void) class_destroy(pdrvdata.class); debugfs_remove_recursive(pdrvdata.debugfs_dir); } -module_init(init); -module_exit(fini); +module_init(virtio_console_init); +module_exit(virtio_console_fini); MODULE_DESCRIPTION("Virtio console driver"); MODULE_LICENSE("GPL");
[Nouveau] [PATCH] drm/nouveau: Fix spelling mistake "endianess" -> "endianness"
There is a spelling mistake in a nvdev_error error message. Fix it. Signed-off-by: Colin Ian King --- drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c index 88d262ba648c..62efbd0f3846 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c @@ -2935,7 +2935,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func, /* switch mmio to cpu's native endianness */ if (!nvkm_device_endianness(device)) { nvdev_error(device, - "Couldn't switch GPU to CPUs endianess\n"); + "Couldn't switch GPU to CPUs endianness\n"); ret = -ENOSYS; goto done; } -- 2.35.1
Re: [Nouveau] [PATCH 5/9] virtio-scsi: eliminate anonymous module_init & module_exit
On Thu, Mar 17, 2022 at 3:24 AM Randy Dunlap wrote: > > Eliminate anonymous module_init() and module_exit(), which can lead to > confusion or ambiguity when reading System.map, crashes/oops/bugs, > or an initcall_debug log. > > Give each of these init and exit functions unique driver-specific > names to eliminate the anonymous names. > > Example 1: (System.map) > 832fc78c t init > 832fc79e t init > 832fc8f8 t init > > Example 2: (initcall_debug log) > calling init+0x0/0x12 @ 1 > initcall init+0x0/0x12 returned 0 after 15 usecs > calling init+0x0/0x60 @ 1 > initcall init+0x0/0x60 returned 0 after 2 usecs > calling init+0x0/0x9a @ 1 > initcall init+0x0/0x9a returned 0 after 74 usecs > > Fixes: 4fe74b1cb051 ("[SCSI] virtio-scsi: SCSI driver for QEMU based virtual > machines") > Signed-off-by: Randy Dunlap > Cc: "Michael S. Tsirkin" > Cc: Jason Wang > Cc: Paolo Bonzini > Cc: Stefan Hajnoczi > Cc: "James E.J. Bottomley" > Cc: "Martin K. Petersen" > Cc: linux-s...@vger.kernel.org > Cc: virtualizat...@lists.linux-foundation.org Acked-by: Jason Wang > --- > drivers/scsi/virtio_scsi.c |8 > 1 file changed, 4 insertions(+), 4 deletions(-) > > --- lnx-517-rc8.orig/drivers/scsi/virtio_scsi.c > +++ lnx-517-rc8/drivers/scsi/virtio_scsi.c > @@ -988,7 +988,7 @@ static struct virtio_driver virtio_scsi_ > .remove = virtscsi_remove, > }; > > -static int __init init(void) > +static int __init virtio_scsi_init(void) > { > int ret = -ENOMEM; > > @@ -1020,14 +1020,14 @@ error: > return ret; > } > > -static void __exit fini(void) > +static void __exit virtio_scsi_fini(void) > { > unregister_virtio_driver(&virtio_scsi_driver); > mempool_destroy(virtscsi_cmd_pool); > kmem_cache_destroy(virtscsi_cmd_cache); > } > -module_init(init); > -module_exit(fini); > +module_init(virtio_scsi_init); > +module_exit(virtio_scsi_fini); > > MODULE_DEVICE_TABLE(virtio, id_table); > MODULE_DESCRIPTION("Virtio SCSI HBA driver"); >
[Nouveau] [PATCH 9/9] testmmiotrace: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: 8b7d89d02ef3 ("x86: mmiotrace - trace memory mapped IO") Signed-off-by: Randy Dunlap Cc: Thomas Gleixner Cc: Steven Rostedt Cc: Ingo Molnar Cc: Karol Herbst Cc: Pekka Paalanen Cc: Dave Hansen Cc: Andy Lutomirski Cc: Peter Zijlstra Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: nouveau@lists.freedesktop.org Cc: x...@kernel.org --- arch/x86/mm/testmmiotrace.c |8 1 file changed, 4 insertions(+), 4 deletions(-) --- lnx-517-rc8.orig/arch/x86/mm/testmmiotrace.c +++ lnx-517-rc8/arch/x86/mm/testmmiotrace.c @@ -113,7 +113,7 @@ static void do_test_bulk_ioremapping(voi synchronize_rcu(); } -static int __init init(void) +static int __init testmmiotrace_init(void) { unsigned long size = (read_far) ? (8 << 20) : (16 << 10); int ret = security_locked_down(LOCKDOWN_MMIOTRACE); @@ -136,11 +136,11 @@ static int __init init(void) return 0; } -static void __exit cleanup(void) +static void __exit testmmiotrace_cleanup(void) { pr_debug("unloaded.\n"); } -module_init(init); -module_exit(cleanup); +module_init(testmmiotrace_init); +module_exit(testmmiotrace_cleanup); MODULE_LICENSE("GPL");
Re: [Nouveau] [PATCH 4/9] netfilter: h323: eliminate anonymous module_init & module_exit
On 3/17/22 08:49, Pablo Neira Ayuso wrote: > On Wed, Mar 16, 2022 at 12:20:05PM -0700, Randy Dunlap wrote: >> Eliminate anonymous module_init() and module_exit(), which can lead to >> confusion or ambiguity when reading System.map, crashes/oops/bugs, >> or an initcall_debug log. >> >> Give each of these init and exit functions unique driver-specific >> names to eliminate the anonymous names. >> >> Example 1: (System.map) >> 832fc78c t init >> 832fc79e t init >> 832fc8f8 t init >> >> Example 2: (initcall_debug log) >> calling init+0x0/0x12 @ 1 >> initcall init+0x0/0x12 returned 0 after 15 usecs >> calling init+0x0/0x60 @ 1 >> initcall init+0x0/0x60 returned 0 after 2 usecs >> calling init+0x0/0x9a @ 1 >> initcall init+0x0/0x9a returned 0 after 74 usecs > > LGTM. > > Should I route this through the netfilter tree? Yes, please. Thanks. > >> Fixes: f587de0e2feb ("[NETFILTER]: nf_conntrack/nf_nat: add H.323 helper >> port") >> Signed-off-by: Randy Dunlap >> Cc: Pablo Neira Ayuso >> Cc: Jozsef Kadlecsik >> Cc: Florian Westphal >> Cc: netfilter-de...@vger.kernel.org >> Cc: coret...@netfilter.org >> Cc: "David S. Miller" >> Cc: Jakub Kicinski >> Cc: net...@vger.kernel.org >> --- >> net/ipv4/netfilter/nf_nat_h323.c |8 >> 1 file changed, 4 insertions(+), 4 deletions(-) >> >> --- lnx-517-rc8.orig/net/ipv4/netfilter/nf_nat_h323.c >> +++ lnx-517-rc8/net/ipv4/netfilter/nf_nat_h323.c >> @@ -580,7 +580,7 @@ static struct nf_ct_helper_expectfn call >> }; >> >> >> // >> -static int __init init(void) >> +static int __init nf_nat_h323_init(void) >> { >> BUG_ON(set_h245_addr_hook != NULL); >> BUG_ON(set_h225_addr_hook != NULL); >> @@ -607,7 +607,7 @@ static int __init init(void) >> } >> >> >> // >> -static void __exit fini(void) >> +static void __exit nf_nat_h323_fini(void) >> { >> RCU_INIT_POINTER(set_h245_addr_hook, NULL); >> RCU_INIT_POINTER(set_h225_addr_hook, NULL); >> @@ -624,8 +624,8 @@ static void __exit fini(void) >> } >> >> >> // >> -module_init(init); >> -module_exit(fini); >> +module_init(nf_nat_h323_init); >> +module_exit(nf_nat_h323_fini); >> >> MODULE_AUTHOR("Jing Min Zhao "); >> MODULE_DESCRIPTION("H.323 NAT helper"); -- ~Randy
[Nouveau] [PATCH 6/9] usb: gadget: eliminate anonymous module_init & module_exit
Eliminate anonymous module_init() and module_exit(), which can lead to confusion or ambiguity when reading System.map, crashes/oops/bugs, or an initcall_debug log. Give each of these init and exit functions unique driver-specific names to eliminate the anonymous names. Example 1: (System.map) 832fc78c t init 832fc79e t init 832fc8f8 t init Example 2: (initcall_debug log) calling init+0x0/0x12 @ 1 initcall init+0x0/0x12 returned 0 after 15 usecs calling init+0x0/0x60 @ 1 initcall init+0x0/0x60 returned 0 after 2 usecs calling init+0x0/0x9a @ 1 initcall init+0x0/0x9a returned 0 after 74 usecs Fixes: bd25a14edb75 ("usb: gadget: legacy/serial: allow dynamic removal") Fixes: 7bb5ea54be47 ("usb gadget serial: use composite gadget framework") Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Signed-off-by: Randy Dunlap Cc: Felipe Balbi Cc: Michał Mirosław Cc: Greg Kroah-Hartman Cc: Sebastian Andrzej Siewior Cc: linux-...@vger.kernel.org --- drivers/usb/gadget/legacy/inode.c |8 drivers/usb/gadget/legacy/serial.c | 10 +- drivers/usb/gadget/udc/dummy_hcd.c |8 3 files changed, 13 insertions(+), 13 deletions(-) --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/serial.c +++ lnx-517-rc8/drivers/usb/gadget/legacy/serial.c @@ -273,7 +273,7 @@ static struct usb_composite_driver gseri static int switch_gserial_enable(bool do_enable) { if (!serial_config_driver.label) - /* init() was not called, yet */ + /* gserial_init() was not called, yet */ return 0; if (do_enable) @@ -283,7 +283,7 @@ static int switch_gserial_enable(bool do return 0; } -static int __init init(void) +static int __init gserial_init(void) { /* We *could* export two configs; that'd be much cleaner... * but neither of these product IDs was defined that way. @@ -314,11 +314,11 @@ static int __init init(void) return usb_composite_probe(&gserial_driver); } -module_init(init); +module_init(gserial_init); -static void __exit cleanup(void) +static void __exit gserial_cleanup(void) { if (enable) usb_composite_unregister(&gserial_driver); } -module_exit(cleanup); +module_exit(gserial_cleanup); --- lnx-517-rc8.orig/drivers/usb/gadget/udc/dummy_hcd.c +++ lnx-517-rc8/drivers/usb/gadget/udc/dummy_hcd.c @@ -2765,7 +2765,7 @@ static struct platform_driver dummy_hcd_ static struct platform_device *the_udc_pdev[MAX_NUM_UDC]; static struct platform_device *the_hcd_pdev[MAX_NUM_UDC]; -static int __init init(void) +static int __init dummy_hcd_init(void) { int retval = -ENOMEM; int i; @@ -2887,9 +2887,9 @@ err_alloc_udc: platform_device_put(the_hcd_pdev[i]); return retval; } -module_init(init); +module_init(dummy_hcd_init); -static void __exit cleanup(void) +static void __exit dummy_hcd_cleanup(void) { int i; @@ -2905,4 +2905,4 @@ static void __exit cleanup(void) platform_driver_unregister(&dummy_udc_driver); platform_driver_unregister(&dummy_hcd_driver); } -module_exit(cleanup); +module_exit(dummy_hcd_cleanup); --- lnx-517-rc8.orig/drivers/usb/gadget/legacy/inode.c +++ lnx-517-rc8/drivers/usb/gadget/legacy/inode.c @@ -2101,7 +2101,7 @@ MODULE_ALIAS_FS("gadgetfs"); /*--*/ -static int __init init (void) +static int __init gadgetfs_init (void) { int status; @@ -2111,12 +2111,12 @@ static int __init init (void) shortname, driver_desc); return status; } -module_init (init); +module_init (gadgetfs_init); -static void __exit cleanup (void) +static void __exit gadgetfs_cleanup (void) { pr_debug ("unregister %s\n", shortname); unregister_filesystem (&gadgetfs_type); } -module_exit (cleanup); +module_exit (gadgetfs_cleanup);