Skip to contentSkip to conversation

esp_scsi: make number of tags configurable

DISCUSSION Geert Uytterhoeven 2 participants 2 messages Dec 10, 2014 – Dec 30, 2014 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 29 lines · Linux Kernel Mailing List
Gitweb:     http://git.kernel.org/linus/;a=commit;h=3707a186c8970e3c4f3c8d9ccf4230b8657e919f
Commit:     3707a186c8970e3c4f3c8d9ccf4230b8657e919f
Parent:     a87bf29362c763cf35faa17154b699471a8b902e
Refname:    refs/heads/master
Author:     Hannes Reinecke <[email protected]>
AuthorDate: Mon Nov 24 15:37:20 2014 +0100
Committer:  Christoph Hellwig <[email protected]>
CommitDate: Mon Nov 24 16:10:23 2014 +0100

esp_scsi: make number of tags configurable

Add a field 'num_tags' to the esp structure to allow drivers to overwrite the number of avialable tags if required. Default is ESP_DEFAULT_TAGS.

---
 drivers/scsi/esp_scsi.c | 12 ++++++------
 drivers/scsi/esp_scsi.h |  3 +--
 2 files changed, 7 insertions(+), 8 deletions(-)
drivers/scsi/esp_scsi.c +0 -0
index 7e7687f..57ccb14 100644

drivers/scsi/esp_scsi.c int scsi_esp_register(struct esp *esp, struct device *dev) · line 2322

Quoted 6 lines
drivers/scsi/esp_scsi.c +3 -0
@@ -2317,6 +2317,10 @@ int scsi_esp_register(struct esp *esp, struct device *dev)
        static int instance;
        int err;
 
+       if (!esp->num_tags)
+               esp->num_tags = ESP_DEFAULT_TAGS;
+       else if (esp->num_tags >= ESP_MAX_TAG)

drivers/scsi/esp_scsi.c: In function ‘scsi_esp_register’:
drivers/scsi/esp_scsi.c:2399: warning: comparison is always false due to limited range of data type

ESP_MAX_TAG is 256, num_tags is u8.

drivers/scsi/esp_scsi.c int scsi_esp_register(struct esp *esp, struct device *dev) · line 2323

Quoted 1 line
drivers/scsi/esp_scsi.c +1 -0
+               esp->num_tags = ESP_MAX_TAG - 1;

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 14 lines · Geert Uytterhoeven

drivers/scsi/esp_scsi.c int scsi_esp_register(struct esp *esp, struct device *dev) · line 2322

Quoted 9 lines
drivers/scsi/esp_scsi.c +3 -0
@@ -2317,6 +2317,10 @@ int scsi_esp_register(struct esp *esp, struct device *dev)
        static int instance;
        int err;
 
+       if (!esp->num_tags)
+               esp->num_tags = ESP_DEFAULT_TAGS;
+       else if (esp->num_tags >= ESP_MAX_TAG)

drivers/scsi/esp_scsi.c: In function ???scsi_esp_register???:
drivers/scsi/esp_scsi.c:2399: warning: comparison is always false due to limited range of data type

Quoted 1 line

ESP_MAX_TAG is 256, num_tags is u8.

Can you send me a patch to just remove that conditional?