Re: [PATCH v3 1/6] scsi: Define MODULE_DEVICE_TABLE only if necessary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 27, 2025 at 07:58:27AM -0400, James Bottomley wrote:
> On Tue, 2025-05-27 at 13:54 +0200, Alexey Gladkov wrote:
> > On Tue, May 27, 2025 at 07:28:59AM -0400, James Bottomley wrote:
> > > On Tue, 2025-05-27 at 11:07 +0200, Alexey Gladkov wrote:
> > > > Define MODULE_DEVICE_TABLE only if a structure is defined for it.
> > > > 
> > > > drivers/scsi/BusLogic.c:3735:26: error: use of undeclared
> > > > identifier
> > > > 'blogic_pci_tbl'
> > > >  3735 | MODULE_DEVICE_TABLE(pci, blogic_pci_tbl);
> > > 
> > > Well, a) need to cc the scsi list
> > 
> > Sorry. I miss it.
> > 
> > > and b) how is this possible when MODULE_DEVICE_TABLE() has an empty
> > > definition if MODULE isn't defined (so the guard you move should be
> > > over an empty statement)?
> > 
> > In the next patch:
> > 
> > [PATCH v3 4/6] modpost: Create modalias for builtin modules
> > 
> > I remove this condition for the MODULE_DEVICE_TABLE macro and it will
> > be always defined.
> 
> Well, why?  If there's a reason for the table to always exist, wouldn't
> the best fix then be to remove the module guards from the PCI table in
> the buslogic ... they only really exist to prevent a defined but not
> used error which it sounds like you're getting rid of?

I wanted to keep the original logic and remove the build error. Before my
changes blogic_pci_tbl was only used when the module was built separately
(MODULE case).

But yes, you are right. In this case, it would be more appropriate to
remove the MODULE condition at all since MODULE_DEVICE_TABLE always
makes sense after my changes.

-- 
Rgrds, legion





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux