1
0
forked from drath/libratbag

hidpp10: use a #define for the max page number

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer
2015-10-19 08:33:12 +10:00
parent 65db99334b
commit 0726537a21
2 changed files with 3 additions and 1 deletions

View File

@@ -1023,7 +1023,7 @@ hidpp10_read_memory(struct hidpp10_device *dev, uint8_t page, uint16_t offset,
return -EINVAL;
}
if (page > 31)
if (page > HIDPP10_MAX_PAGE_NUMBER)
return -EINVAL;
hidpp_log_raw(&dev->base, "Reading memory page %d, offset %#x\n", page, offset);

View File

@@ -38,6 +38,8 @@
* 0 is zeroed, 1 and 2 are garbage, all above 6 is garbage */
#define HIDPP10_NUM_PROFILES 3
#define HIDPP10_MAX_PAGE_NUMBER 31
struct hidpp10_device {
struct hidpp_device base;
unsigned index;