linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Enrico Weigelt, metux IT consult" <lkml@metux.net>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>
Cc: linux-kernel@vger.kernel.org, rjw@rjwysocki.net,
	viresh.kumar@linaro.org, jdelvare@suse.com,
	khalid@gonehiking.org, jejb@linux.ibm.com,
	martin.petersen@oracle.com, aacraid@microsemi.com,
	linux-pm@vger.kernel.org, linux-hwmon@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH 3/3] drivers: hwmon: i5k_amb: remove unnecessary #ifdef MODULE
Date: Wed, 5 Jun 2019 18:35:28 -0700	[thread overview]
Message-ID: <b830e977-88a6-7780-a048-08d8847fc325@roeck-us.net> (raw)
In-Reply-To: <e91fabd4-a7a4-3afa-9f3a-95a6d90e8c7b@metux.net>

On 6/5/19 4:59 PM, Enrico Weigelt, metux IT consult wrote:
> On 01.06.19 22:49, Guenter Roeck wrote:
>> On Sat, Jun 01, 2019 at 04:01:40PM +0200, Enrico Weigelt, metux IT consult wrote:
>>> The MODULE_DEVICE_TABLE() macro already checks for MODULE defined,
>>> so the extra check here is not necessary.
>>>
>>> Signed-off-by: Enrico Weigelt <info@metux.net>
>>> ---
>>>   drivers/hwmon/i5k_amb.c | 2 --
>>>   1 file changed, 2 deletions(-)
>>>
>>> diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c
>>> index b09c39a..b674c2f 100644
>>> --- a/drivers/hwmon/i5k_amb.c
>>> +++ b/drivers/hwmon/i5k_amb.c
>>> @@ -482,14 +482,12 @@ static int i5k_channel_probe(u16 *amb_present, unsigned long dev_id)
>>>       { 0, 0 }
>>>   };
>>> -#ifdef MODULE
>>>   static const struct pci_device_id i5k_amb_ids[] = {
>>>       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
>>>       { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5400_ERR) },
>>>       { 0, }
>>>   };
>>>   MODULE_DEVICE_TABLE(pci, i5k_amb_ids);
>>> -#endif
>>
>> I'd rather know what this table is used for in the first place.
> 
> Seems it's really just used for the module loader, while actual probing
> is using a different table. IMHO, the worst thing my patch could do is
> introducing a warning on unused variable (IMHO shouldn't happen when
> it's static const).
> 

You are wrong. You'll need __maybe_unused qualifiers for those variables
to avoid the warning.

Guenter

> I've just rewritten it to move everything into i5k_amb_ids ... just need
> to run build tests on it (unfortunately can't run-test, as I don't have
> that device).
> 
> 
> --mtx
> 


  reply	other threads:[~2019-06-06  1:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-01 14:01 remove unneeded #ifdef MODULE Enrico Weigelt, metux IT consult
2019-06-01 14:01 ` [PATCH 1/3] drivers: cpufreq: cpufreq-nforce2: remove unnecessary " Enrico Weigelt, metux IT consult
2019-06-01 14:01 ` [PATCH 2/3] drivers: scsi: " Enrico Weigelt, metux IT consult
2019-06-01 15:40   ` Elliott, Robert (Servers)
2019-06-05 23:22     ` Enrico Weigelt, metux IT consult
2019-06-03 16:46   ` Khalid Aziz
2019-06-01 14:01 ` [PATCH 3/3] drivers: hwmon: i5k_amb: " Enrico Weigelt, metux IT consult
2019-06-01 22:49   ` Guenter Roeck
2019-06-05 23:59     ` Enrico Weigelt, metux IT consult
2019-06-06  1:35       ` Guenter Roeck [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-31 15:09 clean some unneeded " Enrico Weigelt, metux IT consult
2019-05-31 15:09 ` [PATCH 3/3] drivers: hwmon: i5k_amb: remove unnecessary " Enrico Weigelt, metux IT consult

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b830e977-88a6-7780-a048-08d8847fc325@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=aacraid@microsemi.com \
    --cc=info@metux.net \
    --cc=jdelvare@suse.com \
    --cc=jejb@linux.ibm.com \
    --cc=khalid@gonehiking.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkml@metux.net \
    --cc=martin.petersen@oracle.com \
    --cc=rjw@rjwysocki.net \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).