Re: Patch to exposing modalias'es for built in kernel modules (USB)
From: Christophe Leroy
Date: Fri Nov 11 2022 - 04:59:26 EST
Le 10/11/2022 à 23:21, Allen Webb a écrit :
> [Vous ne recevez pas souvent de courriers de allenwebb@xxxxxxxxxx. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
>
> My apologies for any process mistakes in submitting this as it is my
> first ever attempt at a Linux kernel patch.
First problem: your patch is corrupted, it doesn't apply. For instance,
some long line are wrapped. For instance line 514, the "expected to
belong", see
https://patchwork.kernel.org/project/linux-modules/patch/CAJzde042-M4UbpNYKw0eDVg4JqYmwmPYSsmgK+kCMTqsi+-2Yw@xxxxxxxxxxxxxx/
Maybe you can then start with the codiing style. See
https://docs.kernel.org/process/coding-style.html
Then there is a script call checkpatch.pl, located in script/ directory.
All you have to do is:
./scripts/checkpatch.pl -g HEAD
to check a patch in your git tree (replace HEAD by the patch sha if it
is not at the head of the current branch)
Or
./scripts/checkpatch.pl -f patch_file
patch_file being the result of 'git format-patch'
Using --strict option you get even more results, allthough some of the
reported checks may not always be relevant.
With your patch I get:
total: 9 errors, 284 warnings, 512 lines checked
See below the result on your patch:
ERROR: Remove Gerrit Change-Id's before submitting upstream
#135:
Change-Id: I83b6f0c30e06e65cbe223f1606187283fcb13215
WARNING: please, no spaces at the start of a line
#174: FILE: drivers/base/base.h:180:
+ size_t count);$
WARNING: please, no spaces at the start of a line
#177: FILE: drivers/base/base.h:183:
+ size_t count) { return -ENOSUP; }$
WARNING: please, no spaces at the start of a line
#211: FILE: drivers/base/bus.c:201:
+ int error = 0;$
WARNING: please, no spaces at the start of a line
#212: FILE: drivers/base/bus.c:202:
+ struct bus_type *bus;$
WARNING: please, no spaces at the start of a line
#213: FILE: drivers/base/bus.c:203:
+ struct subsys_private *bus_prv;$
WARNING: please, no spaces at the start of a line
#214: FILE: drivers/base/bus.c:204:
+ struct kset *subsys;$
WARNING: please, no spaces at the start of a line
#215: FILE: drivers/base/bus.c:205:
+ struct kobject *k;$
WARNING: please, no spaces at the start of a line
#217: FILE: drivers/base/bus.c:207:
+ spin_lock(&bus_kset->list_lock);$
WARNING: please, no spaces at the start of a line
#219: FILE: drivers/base/bus.c:209:
+ list_for_each_entry(k, &bus_kset->list, entry) {$
WARNING: suspect code indent for conditional statements (1, 1)
#219: FILE: drivers/base/bus.c:209:
+ list_for_each_entry(k, &bus_kset->list, entry) {
+ subsys = container_of(k, struct kset, kobj);
WARNING: please, no spaces at the start of a line
#220: FILE: drivers/base/bus.c:210:
+ subsys = container_of(k, struct kset, kobj);$
WARNING: please, no spaces at the start of a line
#221: FILE: drivers/base/bus.c:211:
+ bus_prv = container_of(subsys, struct subsys_private, subsys);$
WARNING: please, no spaces at the start of a line
#222: FILE: drivers/base/bus.c:212:
+ bus = bus_prv->bus;$
WARNING: please, no spaces at the start of a line
#223: FILE: drivers/base/bus.c:213:
+ error = fn(bus, data);$
WARNING: please, no spaces at the start of a line
#224: FILE: drivers/base/bus.c:214:
+ if (error)$
WARNING: suspect code indent for conditional statements (1, 1)
#224: FILE: drivers/base/bus.c:214:
+ if (error)
+ break;
WARNING: please, no spaces at the start of a line
#225: FILE: drivers/base/bus.c:215:
+ break;$
WARNING: please, no spaces at the start of a line
#226: FILE: drivers/base/bus.c:216:
+ }$
WARNING: please, no spaces at the start of a line
#228: FILE: drivers/base/bus.c:218:
+ spin_unlock(&bus_kset->list_lock);$
WARNING: please, no spaces at the start of a line
#229: FILE: drivers/base/bus.c:219:
+ return error;$
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#237:
new file mode 100644
WARNING: suspect code indent for conditional statements (0, 1)
#256: FILE: drivers/base/mod_devicetable.c:15:
+do { \
+ if (cond) \
WARNING: please, no spaces at the start of a line
#257: FILE: drivers/base/mod_devicetable.c:16:
+ if (cond) \$
WARNING: suspect code indent for conditional statements (1, 1)
#257: FILE: drivers/base/mod_devicetable.c:16:
+ if (cond) \
+ len += scnprintf(&buf[len], \
WARNING: please, no spaces at the start of a line
#258: FILE: drivers/base/mod_devicetable.c:17:
+ len += scnprintf(&buf[len], \$
WARNING: please, no spaces at the start of a line
#259: FILE: drivers/base/mod_devicetable.c:18:
+ count - len, \$
WARNING: please, no spaces at the start of a line
#260: FILE: drivers/base/mod_devicetable.c:19:
+ sizeof(field) == 1 ? sep "%02X" : \$
WARNING: please, no spaces at the start of a line
#261: FILE: drivers/base/mod_devicetable.c:20:
+ sizeof(field) == 2 ? sep "%04X" : \$
WARNING: please, no spaces at the start of a line
#262: FILE: drivers/base/mod_devicetable.c:21:
+ sizeof(field) == 4 ? sep "%08X" : "", \$
WARNING: please, no spaces at the start of a line
#263: FILE: drivers/base/mod_devicetable.c:22:
+ field); \$
WARNING: please, no spaces at the start of a line
#264: FILE: drivers/base/mod_devicetable.c:23:
+ else \$
WARNING: suspect code indent for conditional statements (1, 1)
#264: FILE: drivers/base/mod_devicetable.c:23:
+ else \
+ len += scnprintf(&buf[len], count - len, sep "*"); \
WARNING: please, no spaces at the start of a line
#265: FILE: drivers/base/mod_devicetable.c:24:
+ len += scnprintf(&buf[len], count - len, sep "*"); \$
WARNING: please, no spaces at the start of a line
#274: FILE: drivers/base/mod_devicetable.c:33:
+ unsigned int bcdDevice_initial,$
WARNING: please, no spaces at the start of a line
#275: FILE: drivers/base/mod_devicetable.c:34:
+ int bcdDevice_initial_digits,$
WARNING: please, no spaces at the start of a line
#276: FILE: drivers/base/mod_devicetable.c:35:
+ unsigned char range_lo,$
WARNING: please, no spaces at the start of a line
#277: FILE: drivers/base/mod_devicetable.c:36:
+ unsigned char range_hi,$
WARNING: please, no spaces at the start of a line
#278: FILE: drivers/base/mod_devicetable.c:37:
+ unsigned char max, const char *mod_name,$
WARNING: please, no spaces at the start of a line
#279: FILE: drivers/base/mod_devicetable.c:38:
+ char *buf, size_t count)$
WARNING: please, no spaces at the start of a line
#281: FILE: drivers/base/mod_devicetable.c:40:
+ ssize_t len = 0;$
WARNING: please, no spaces at the start of a line
#283: FILE: drivers/base/mod_devicetable.c:42:
+ ADD(buf, count, len, "alias usb:v",$
WARNING: please, no spaces at the start of a line
#284: FILE: drivers/base/mod_devicetable.c:43:
+ id->match_flags & USB_DEVICE_ID_MATCH_VENDOR, id->idVendor);$
WARNING: please, no spaces at the start of a line
#285: FILE: drivers/base/mod_devicetable.c:44:
+ ADD(buf, count, len, "p", id->match_flags & USB_DEVICE_ID_MATCH_PRODUCT,$
WARNING: please, no spaces at the start of a line
#286: FILE: drivers/base/mod_devicetable.c:45:
+ id->idProduct);$
WARNING: please, no spaces at the start of a line
#288: FILE: drivers/base/mod_devicetable.c:47:
+ len += scnprintf(&buf[len], count - len, "d");$
WARNING: please, no spaces at the start of a line
#289: FILE: drivers/base/mod_devicetable.c:48:
+ if (bcdDevice_initial_digits)$
WARNING: suspect code indent for conditional statements (1, 1)
#289: FILE: drivers/base/mod_devicetable.c:48:
+ if (bcdDevice_initial_digits)
+ len += scnprintf(&buf[len], count - len, "%0*X",
WARNING: please, no spaces at the start of a line
#290: FILE: drivers/base/mod_devicetable.c:49:
+ len += scnprintf(&buf[len], count - len, "%0*X",$
WARNING: please, no spaces at the start of a line
#291: FILE: drivers/base/mod_devicetable.c:50:
+ bcdDevice_initial_digits, bcdDevice_initial);$
WARNING: please, no spaces at the start of a line
#292: FILE: drivers/base/mod_devicetable.c:51:
+ if (range_lo == range_hi)$
WARNING: suspect code indent for conditional statements (1, 1)
#292: FILE: drivers/base/mod_devicetable.c:51:
+ if (range_lo == range_hi)
+ len += scnprintf(&buf[len], count - len, "%X", range_lo);
WARNING: please, no spaces at the start of a line
#293: FILE: drivers/base/mod_devicetable.c:52:
+ len += scnprintf(&buf[len], count - len, "%X", range_lo);$
WARNING: please, no spaces at the start of a line
#294: FILE: drivers/base/mod_devicetable.c:53:
+ else if (range_lo > 0 || range_hi < max) {$
WARNING: suspect code indent for conditional statements (1, 1)
#294: FILE: drivers/base/mod_devicetable.c:53:
+ else if (range_lo > 0 || range_hi < max) {
+ if (range_lo > 0x9 || range_hi < 0xA)
WARNING: please, no spaces at the start of a line
#295: FILE: drivers/base/mod_devicetable.c:54:
+ if (range_lo > 0x9 || range_hi < 0xA)$
WARNING: suspect code indent for conditional statements (1, 1)
#295: FILE: drivers/base/mod_devicetable.c:54:
+ if (range_lo > 0x9 || range_hi < 0xA)
+ len += scnprintf(&buf[len], count - len,
WARNING: please, no spaces at the start of a line
#296: FILE: drivers/base/mod_devicetable.c:55:
+ len += scnprintf(&buf[len], count - len,$
WARNING: please, no spaces at the start of a line
#297: FILE: drivers/base/mod_devicetable.c:56:
+ "[%X-%X]",$
WARNING: please, no spaces at the start of a line
#298: FILE: drivers/base/mod_devicetable.c:57:
+ range_lo,$
WARNING: please, no spaces at the start of a line
#299: FILE: drivers/base/mod_devicetable.c:58:
+ range_hi);$
WARNING: please, no spaces at the start of a line
#300: FILE: drivers/base/mod_devicetable.c:59:
+ else {$
WARNING: suspect code indent for conditional statements (1, 1)
#300: FILE: drivers/base/mod_devicetable.c:59:
+ else {
+ len += scnprintf(&buf[len], count - len,
WARNING: please, no spaces at the start of a line
#301: FILE: drivers/base/mod_devicetable.c:60:
+ len += scnprintf(&buf[len], count - len,$
WARNING: please, no spaces at the start of a line
#302: FILE: drivers/base/mod_devicetable.c:61:
+ range_lo < 0x9 ? "[%X-9" : "[%X",$
WARNING: please, no spaces at the start of a line
#303: FILE: drivers/base/mod_devicetable.c:62:
+ range_lo);$
WARNING: please, no spaces at the start of a line
#304: FILE: drivers/base/mod_devicetable.c:63:
+ len += scnprintf(&buf[len], count - len,$
WARNING: please, no spaces at the start of a line
#305: FILE: drivers/base/mod_devicetable.c:64:
+ range_hi > 0xA ? "A-%X]" : "%X]",$
WARNING: please, no spaces at the start of a line
#306: FILE: drivers/base/mod_devicetable.c:65:
+ range_hi);$
WARNING: please, no spaces at the start of a line
#307: FILE: drivers/base/mod_devicetable.c:66:
+ }$
WARNING: please, no spaces at the start of a line
#308: FILE: drivers/base/mod_devicetable.c:67:
+ }$
WARNING: please, no spaces at the start of a line
#309: FILE: drivers/base/mod_devicetable.c:68:
+ if (bcdDevice_initial_digits < (sizeof(id->bcdDevice_lo) * 2 - 1))$
WARNING: suspect code indent for conditional statements (1, 1)
#309: FILE: drivers/base/mod_devicetable.c:68:
+ if (bcdDevice_initial_digits < (sizeof(id->bcdDevice_lo) * 2 - 1))
+ len += scnprintf(&buf[len], count - len, "*");
WARNING: please, no spaces at the start of a line
#310: FILE: drivers/base/mod_devicetable.c:69:
+ len += scnprintf(&buf[len], count - len, "*");$
WARNING: please, no spaces at the start of a line
#312: FILE: drivers/base/mod_devicetable.c:71:
+ ADD(buf, count, len, "dc",$
WARNING: please, no spaces at the start of a line
#313: FILE: drivers/base/mod_devicetable.c:72:
+ id->match_flags & USB_DEVICE_ID_MATCH_DEV_CLASS, id->bDeviceClass);$
WARNING: please, no spaces at the start of a line
#314: FILE: drivers/base/mod_devicetable.c:73:
+ ADD(buf, count, len, "dsc",$
WARNING: please, no spaces at the start of a line
#315: FILE: drivers/base/mod_devicetable.c:74:
+ id->match_flags & USB_DEVICE_ID_MATCH_DEV_SUBCLASS,$
WARNING: please, no spaces at the start of a line
#316: FILE: drivers/base/mod_devicetable.c:75:
+ id->bDeviceSubClass);$
WARNING: please, no spaces at the start of a line
#317: FILE: drivers/base/mod_devicetable.c:76:
+ ADD(buf, count, len, "dp",$
WARNING: please, no spaces at the start of a line
#318: FILE: drivers/base/mod_devicetable.c:77:
+ id->match_flags & USB_DEVICE_ID_MATCH_DEV_PROTOCOL,$
WARNING: please, no spaces at the start of a line
#319: FILE: drivers/base/mod_devicetable.c:78:
+ id->bDeviceProtocol);$
WARNING: please, no spaces at the start of a line
#320: FILE: drivers/base/mod_devicetable.c:79:
+ ADD(buf, count, len, "ic",$
WARNING: please, no spaces at the start of a line
#321: FILE: drivers/base/mod_devicetable.c:80:
+ id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS,$
WARNING: please, no spaces at the start of a line
#322: FILE: drivers/base/mod_devicetable.c:81:
+ id->bInterfaceClass);$
WARNING: please, no spaces at the start of a line
#323: FILE: drivers/base/mod_devicetable.c:82:
+ ADD(buf, count, len, "isc",$
WARNING: please, no spaces at the start of a line
#324: FILE: drivers/base/mod_devicetable.c:83:
+ id->match_flags & USB_DEVICE_ID_MATCH_INT_SUBCLASS,$
WARNING: please, no spaces at the start of a line
#325: FILE: drivers/base/mod_devicetable.c:84:
+ id->bInterfaceSubClass);$
WARNING: please, no spaces at the start of a line
#326: FILE: drivers/base/mod_devicetable.c:85:
+ ADD(buf, count, len, "ip",$
WARNING: please, no spaces at the start of a line
#327: FILE: drivers/base/mod_devicetable.c:86:
+ id->match_flags & USB_DEVICE_ID_MATCH_INT_PROTOCOL,$
WARNING: please, no spaces at the start of a line
#328: FILE: drivers/base/mod_devicetable.c:87:
+ id->bInterfaceProtocol);$
WARNING: please, no spaces at the start of a line
#329: FILE: drivers/base/mod_devicetable.c:88:
+ ADD(buf, count, len, "in",$
WARNING: please, no spaces at the start of a line
#330: FILE: drivers/base/mod_devicetable.c:89:
+ id->match_flags & USB_DEVICE_ID_MATCH_INT_NUMBER,$
WARNING: please, no spaces at the start of a line
#331: FILE: drivers/base/mod_devicetable.c:90:
+ id->bInterfaceNumber);$
WARNING: please, no spaces at the start of a line
#333: FILE: drivers/base/mod_devicetable.c:92:
+ len += scnprintf(&buf[len], count - len, " %s\n", mod_name);$
WARNING: please, no spaces at the start of a line
#334: FILE: drivers/base/mod_devicetable.c:93:
+ return len;$
WARNING: please, no spaces at the start of a line
#340: FILE: drivers/base/mod_devicetable.c:99:
+ int inc,$
WARNING: please, no spaces at the start of a line
#341: FILE: drivers/base/mod_devicetable.c:100:
+ unsigned char max,$
WARNING: please, no spaces at the start of a line
#342: FILE: drivers/base/mod_devicetable.c:101:
+ size_t chars)$
WARNING: please, no spaces at the start of a line
#344: FILE: drivers/base/mod_devicetable.c:103:
+ unsigned int init = *bcd, i, j;$
WARNING: please, no spaces at the start of a line
#345: FILE: drivers/base/mod_devicetable.c:104:
+ unsigned long long c, dec = 0;$
WARNING: please, no spaces at the start of a line
#348: FILE: drivers/base/mod_devicetable.c:107:
+ if (max > 0x9) {$
WARNING: suspect code indent for conditional statements (1, 1)
#348: FILE: drivers/base/mod_devicetable.c:107:
+ if (max > 0x9) {
+ *bcd += inc;
WARNING: please, no spaces at the start of a line
#349: FILE: drivers/base/mod_devicetable.c:108:
+ *bcd += inc;$
WARNING: please, no spaces at the start of a line
#350: FILE: drivers/base/mod_devicetable.c:109:
+ return init;$
WARNING: please, no spaces at the start of a line
#351: FILE: drivers/base/mod_devicetable.c:110:
+ }$
WARNING: please, no spaces at the start of a line
#354: FILE: drivers/base/mod_devicetable.c:113:
+ for (i = 0 ; i < chars ; i++) {$
WARNING: suspect code indent for conditional statements (1, 1)
#354: FILE: drivers/base/mod_devicetable.c:113:
+ for (i = 0 ; i < chars ; i++) {
+ c = (*bcd >> (i << 2)) & 0xf;
WARNING: please, no spaces at the start of a line
#355: FILE: drivers/base/mod_devicetable.c:114:
+ c = (*bcd >> (i << 2)) & 0xf;$
WARNING: please, no spaces at the start of a line
#356: FILE: drivers/base/mod_devicetable.c:115:
+ c = c > 9 ? 9 : c; /* force to bcd just in case */$
WARNING: please, no spaces at the start of a line
#357: FILE: drivers/base/mod_devicetable.c:116:
+ for (j = 0 ; j < i ; j++)$
WARNING: suspect code indent for conditional statements (1, 1)
#357: FILE: drivers/base/mod_devicetable.c:116:
+ for (j = 0 ; j < i ; j++)
+ c = c * 10;
WARNING: please, no spaces at the start of a line
#358: FILE: drivers/base/mod_devicetable.c:117:
+ c = c * 10;$
WARNING: please, no spaces at the start of a line
#359: FILE: drivers/base/mod_devicetable.c:118:
+ dec += c;$
WARNING: please, no spaces at the start of a line
#360: FILE: drivers/base/mod_devicetable.c:119:
+ }$
WARNING: please, no spaces at the start of a line
#363: FILE: drivers/base/mod_devicetable.c:122:
+ dec += inc;$
WARNING: please, no spaces at the start of a line
#364: FILE: drivers/base/mod_devicetable.c:123:
+ *bcd = 0;$
WARNING: please, no spaces at the start of a line
#367: FILE: drivers/base/mod_devicetable.c:126:
+ for (i = 0 ; i < chars ; i++) {$
WARNING: suspect code indent for conditional statements (1, 1)
#367: FILE: drivers/base/mod_devicetable.c:126:
+ for (i = 0 ; i < chars ; i++) {
+ for (c = 1, j = 0 ; j < i ; j++)
WARNING: please, no spaces at the start of a line
#368: FILE: drivers/base/mod_devicetable.c:127:
+ for (c = 1, j = 0 ; j < i ; j++)$
WARNING: suspect code indent for conditional statements (1, 1)
#368: FILE: drivers/base/mod_devicetable.c:127:
+ for (c = 1, j = 0 ; j < i ; j++)
+ c = c * 10;
WARNING: please, no spaces at the start of a line
#369: FILE: drivers/base/mod_devicetable.c:128:
+ c = c * 10;$
WARNING: please, no spaces at the start of a line
#370: FILE: drivers/base/mod_devicetable.c:129:
+ c = (dec / c) % 10;$
WARNING: please, no spaces at the start of a line
#371: FILE: drivers/base/mod_devicetable.c:130:
+ *bcd += c << (i << 2);$
WARNING: please, no spaces at the start of a line
#372: FILE: drivers/base/mod_devicetable.c:131:
+ }$
WARNING: please, no spaces at the start of a line
#373: FILE: drivers/base/mod_devicetable.c:132:
+ return init;$
WARNING: please, no spaces at the start of a line
#379: FILE: drivers/base/mod_devicetable.c:138:
+ const char *mod_name, char *buf,$
WARNING: please, no spaces at the start of a line
#380: FILE: drivers/base/mod_devicetable.c:139:
+ size_t count)$
WARNING: please, no spaces at the start of a line
#382: FILE: drivers/base/mod_devicetable.c:141:
+ ssize_t len = 0;$
WARNING: please, no spaces at the start of a line
#383: FILE: drivers/base/mod_devicetable.c:142:
+ unsigned int devlo, devhi;$
WARNING: please, no spaces at the start of a line
#384: FILE: drivers/base/mod_devicetable.c:143:
+ unsigned char chi, clo, max;$
WARNING: please, no spaces at the start of a line
#385: FILE: drivers/base/mod_devicetable.c:144:
+ int ndigits;$
WARNING: please, no spaces at the start of a line
#387: FILE: drivers/base/mod_devicetable.c:146:
+ devlo = id->match_flags & USB_DEVICE_ID_MATCH_DEV_LO ?$
WARNING: please, no spaces at the start of a line
#388: FILE: drivers/base/mod_devicetable.c:147:
+ id->bcdDevice_lo : 0x0U;$
WARNING: please, no spaces at the start of a line
#389: FILE: drivers/base/mod_devicetable.c:148:
+ devhi = id->match_flags & USB_DEVICE_ID_MATCH_DEV_HI ?$
WARNING: please, no spaces at the start of a line
#390: FILE: drivers/base/mod_devicetable.c:149:
+ id->bcdDevice_hi : ~0x0U;$
WARNING: please, no spaces at the start of a line
#393: FILE: drivers/base/mod_devicetable.c:152:
+ max = 0x9; /* Default to decimal format */$
WARNING: please, no spaces at the start of a line
#394: FILE: drivers/base/mod_devicetable.c:153:
+ for (ndigits = 0 ; ndigits < sizeof(id->bcdDevice_lo) * 2 ; ndigits++) {$
WARNING: suspect code indent for conditional statements (1, 1)
#394: FILE: drivers/base/mod_devicetable.c:153:
+ for (ndigits = 0 ; ndigits < sizeof(id->bcdDevice_lo) * 2 ; ndigits++) {
+ clo = (devlo >> (ndigits << 2)) & 0xf;
WARNING: please, no spaces at the start of a line
#395: FILE: drivers/base/mod_devicetable.c:154:
+ clo = (devlo >> (ndigits << 2)) & 0xf;$
WARNING: please, no spaces at the start of a line
#396: FILE: drivers/base/mod_devicetable.c:155:
+ chi = ((devhi > 0x9999 ? 0x9999 : devhi) >>$
ERROR: code indent should use tabs where possible
#397: FILE: drivers/base/mod_devicetable.c:156:
+ (ndigits << 2)) & 0xf;$
WARNING: please, no spaces at the start of a line
#397: FILE: drivers/base/mod_devicetable.c:156:
+ (ndigits << 2)) & 0xf;$
WARNING: please, no spaces at the start of a line
#398: FILE: drivers/base/mod_devicetable.c:157:
+ if (clo > max || chi > max) {$
WARNING: suspect code indent for conditional statements (1, 1)
#398: FILE: drivers/base/mod_devicetable.c:157:
+ if (clo > max || chi > max) {
+ max = 0xf;
WARNING: please, no spaces at the start of a line
#399: FILE: drivers/base/mod_devicetable.c:158:
+ max = 0xf;$
WARNING: please, no spaces at the start of a line
#400: FILE: drivers/base/mod_devicetable.c:159:
+ break;$
WARNING: please, no spaces at the start of a line
#401: FILE: drivers/base/mod_devicetable.c:160:
+ }$
WARNING: please, no spaces at the start of a line
#402: FILE: drivers/base/mod_devicetable.c:161:
+ }$
WARNING: Block comments should align the * on each line
#405: FILE: drivers/base/mod_devicetable.c:164:
+ /*
+ * Some modules (visor) have empty slots as placeholder for
WARNING: please, no spaces at the start of a line
#408: FILE: drivers/base/mod_devicetable.c:167:
+ if (!(id->idVendor || id->idProduct || id->bDeviceClass ||$
WARNING: suspect code indent for conditional statements (1, 1)
#408: FILE: drivers/base/mod_devicetable.c:167:
+ if (!(id->idVendor || id->idProduct || id->bDeviceClass ||
[...]
+ return len;
WARNING: please, no spaces at the start of a line
#409: FILE: drivers/base/mod_devicetable.c:168:
+ id->bInterfaceClass))$
WARNING: please, no spaces at the start of a line
#410: FILE: drivers/base/mod_devicetable.c:169:
+ return len;$
WARNING: please, no spaces at the start of a line
#413: FILE: drivers/base/mod_devicetable.c:172:
+ for (ndigits = sizeof(id->bcdDevice_lo) * 2 - 1; devlo <= devhi;$
WARNING: suspect code indent for conditional statements (1, 1)
#413: FILE: drivers/base/mod_devicetable.c:172:
+ for (ndigits = sizeof(id->bcdDevice_lo) * 2 - 1; devlo <= devhi;
[...]
+ clo = devlo & 0xf;
WARNING: please, no spaces at the start of a line
#414: FILE: drivers/base/mod_devicetable.c:173:
+ ndigits--) {$
WARNING: please, no spaces at the start of a line
#415: FILE: drivers/base/mod_devicetable.c:174:
+ clo = devlo & 0xf;$
WARNING: please, no spaces at the start of a line
#416: FILE: drivers/base/mod_devicetable.c:175:
+ chi = devhi & 0xf;$
WARNING: please, no spaces at the start of a line
#418: FILE: drivers/base/mod_devicetable.c:177:
+ if (chi > max)$
WARNING: suspect code indent for conditional statements (1, 1)
#418: FILE: drivers/base/mod_devicetable.c:177:
+ if (chi > max)
+ chi = max;
WARNING: please, no spaces at the start of a line
#419: FILE: drivers/base/mod_devicetable.c:178:
+ chi = max;$
WARNING: please, no spaces at the start of a line
#420: FILE: drivers/base/mod_devicetable.c:179:
+ devlo >>= 4;$
WARNING: please, no spaces at the start of a line
#421: FILE: drivers/base/mod_devicetable.c:180:
+ devhi >>= 4;$
WARNING: please, no spaces at the start of a line
#423: FILE: drivers/base/mod_devicetable.c:182:
+ if (devlo == devhi || !ndigits) {$
WARNING: suspect code indent for conditional statements (1, 1)
#423: FILE: drivers/base/mod_devicetable.c:182:
+ if (devlo == devhi || !ndigits) {
+ len += usb_id_to_modalias(id, devlo, ndigits, clo, chi,
WARNING: please, no spaces at the start of a line
#424: FILE: drivers/base/mod_devicetable.c:183:
+ len += usb_id_to_modalias(id, devlo, ndigits, clo, chi,$
WARNING: please, no spaces at the start of a line
#425: FILE: drivers/base/mod_devicetable.c:184:
+ max, mod_name, buf + len,$
WARNING: please, no spaces at the start of a line
#426: FILE: drivers/base/mod_devicetable.c:185:
+ count - len);$
WARNING: please, no spaces at the start of a line
#427: FILE: drivers/base/mod_devicetable.c:186:
+ break;$
WARNING: please, no spaces at the start of a line
#428: FILE: drivers/base/mod_devicetable.c:187:
+ }$
WARNING: please, no spaces at the start of a line
#430: FILE: drivers/base/mod_devicetable.c:189:
+ if (clo > 0x0)$
WARNING: suspect code indent for conditional statements (1, 1)
#430: FILE: drivers/base/mod_devicetable.c:189:
+ if (clo > 0x0)
+ len += usb_id_to_modalias(id,
WARNING: please, no spaces at the start of a line
#431: FILE: drivers/base/mod_devicetable.c:190:
+ len += usb_id_to_modalias(id,$
WARNING: please, no spaces at the start of a line
#432: FILE: drivers/base/mod_devicetable.c:191:
+ incbcd(&devlo, 1, max,$
ERROR: code indent should use tabs where possible
#433: FILE: drivers/base/mod_devicetable.c:192:
+ sizeof(id->bcdDevice_lo) * 2),$
WARNING: please, no spaces at the start of a line
#433: FILE: drivers/base/mod_devicetable.c:192:
+ sizeof(id->bcdDevice_lo) * 2),$
WARNING: please, no spaces at the start of a line
#434: FILE: drivers/base/mod_devicetable.c:193:
+ ndigits, clo, max, max, mod_name, buf + len,$
WARNING: please, no spaces at the start of a line
#435: FILE: drivers/base/mod_devicetable.c:194:
+ count - len);$
WARNING: please, no spaces at the start of a line
#437: FILE: drivers/base/mod_devicetable.c:196:
+ if (chi < max)$
WARNING: suspect code indent for conditional statements (1, 1)
#437: FILE: drivers/base/mod_devicetable.c:196:
+ if (chi < max)
+ len += usb_id_to_modalias(id,
WARNING: please, no spaces at the start of a line
#438: FILE: drivers/base/mod_devicetable.c:197:
+ len += usb_id_to_modalias(id,$
WARNING: please, no spaces at the start of a line
#439: FILE: drivers/base/mod_devicetable.c:198:
+ incbcd(&devhi, -1, max,$
ERROR: code indent should use tabs where possible
#440: FILE: drivers/base/mod_devicetable.c:199:
+ sizeof(id->bcdDevice_lo) * 2),$
WARNING: please, no spaces at the start of a line
#440: FILE: drivers/base/mod_devicetable.c:199:
+ sizeof(id->bcdDevice_lo) * 2),$
WARNING: please, no spaces at the start of a line
#441: FILE: drivers/base/mod_devicetable.c:200:
+ ndigits, 0x0, chi, max, mod_name, buf + len,$
WARNING: please, no spaces at the start of a line
#442: FILE: drivers/base/mod_devicetable.c:201:
+ count - len);$
WARNING: please, no spaces at the start of a line
#443: FILE: drivers/base/mod_devicetable.c:202:
+ }$
WARNING: please, no spaces at the start of a line
#444: FILE: drivers/base/mod_devicetable.c:203:
+ return len;$
WARNING: please, no spaces at the start of a line
#458: FILE: drivers/base/mod_devicetable.c:217:
+ size_t count)$
WARNING: please, no spaces at the start of a line
#460: FILE: drivers/base/mod_devicetable.c:219:
+ ssize_t len = 0;$
WARNING: please, no spaces at the start of a line
#461: FILE: drivers/base/mod_devicetable.c:220:
+ const struct usb_device_id *id;$
WARNING: please, no spaces at the start of a line
#462: FILE: drivers/base/mod_devicetable.c:221:
+ const char *mod_name;$
WARNING: please, no spaces at the start of a line
#464: FILE: drivers/base/mod_devicetable.c:223:
+ if (drv->bus != &usb_bus_type)$
WARNING: suspect code indent for conditional statements (1, 1)
#464: FILE: drivers/base/mod_devicetable.c:223:
+ if (drv->bus != &usb_bus_type)
+ return -EINVAL;
WARNING: please, no spaces at the start of a line
#465: FILE: drivers/base/mod_devicetable.c:224:
+ return -EINVAL;$
WARNING: please, no spaces at the start of a line
#467: FILE: drivers/base/mod_devicetable.c:226:
+ if (drv->owner)$
WARNING: suspect code indent for conditional statements (1, 1)
#467: FILE: drivers/base/mod_devicetable.c:226:
+ if (drv->owner)
+ mod_name = drv->owner->name;
WARNING: please, no spaces at the start of a line
#468: FILE: drivers/base/mod_devicetable.c:227:
+ mod_name = drv->owner->name;$
WARNING: please, no spaces at the start of a line
#469: FILE: drivers/base/mod_devicetable.c:228:
+ else$
WARNING: suspect code indent for conditional statements (1, 1)
#469: FILE: drivers/base/mod_devicetable.c:228:
+ else
+ mod_name = drv->mod_name;
WARNING: please, no spaces at the start of a line
#470: FILE: drivers/base/mod_devicetable.c:229:
+ mod_name = drv->mod_name;$
WARNING: please, no spaces at the start of a line
#472: FILE: drivers/base/mod_devicetable.c:231:
+ if (is_usb_device_driver(drv))$
WARNING: suspect code indent for conditional statements (1, 1)
#472: FILE: drivers/base/mod_devicetable.c:231:
+ if (is_usb_device_driver(drv))
+ id = to_usb_device_driver(drv)->id_table;
WARNING: please, no spaces at the start of a line
#473: FILE: drivers/base/mod_devicetable.c:232:
+ id = to_usb_device_driver(drv)->id_table;$
WARNING: please, no spaces at the start of a line
#474: FILE: drivers/base/mod_devicetable.c:233:
+ else$
WARNING: suspect code indent for conditional statements (1, 1)
#474: FILE: drivers/base/mod_devicetable.c:233:
+ else
+ id = to_usb_driver(drv)->id_table;
WARNING: please, no spaces at the start of a line
#475: FILE: drivers/base/mod_devicetable.c:234:
+ id = to_usb_driver(drv)->id_table;$
WARNING: please, no spaces at the start of a line
#476: FILE: drivers/base/mod_devicetable.c:235:
+ if (!id)$
WARNING: suspect code indent for conditional statements (1, 1)
#476: FILE: drivers/base/mod_devicetable.c:235:
+ if (!id)
+ return len;
WARNING: please, no spaces at the start of a line
#477: FILE: drivers/base/mod_devicetable.c:236:
+ return len;$
WARNING: please, no spaces at the start of a line
#479: FILE: drivers/base/mod_devicetable.c:238:
+ for (; id->match_flags; id++) {$
WARNING: suspect code indent for conditional statements (1, 1)
#479: FILE: drivers/base/mod_devicetable.c:238:
+ for (; id->match_flags; id++) {
+ len += usb_id_to_modalias_multi(id, mod_name, buf + len,
WARNING: please, no spaces at the start of a line
#480: FILE: drivers/base/mod_devicetable.c:239:
+ len += usb_id_to_modalias_multi(id, mod_name, buf + len,$
WARNING: please, no spaces at the start of a line
#481: FILE: drivers/base/mod_devicetable.c:240:
+ count - len);$
WARNING: please, no spaces at the start of a line
#482: FILE: drivers/base/mod_devicetable.c:241:
+ }$
WARNING: please, no spaces at the start of a line
#483: FILE: drivers/base/mod_devicetable.c:242:
+ return len;$
WARNING: please, no spaces at the start of a line
#501: FILE: drivers/usb/core/driver.c:2034:
+ .drv_to_modalias = usb_drv_to_modalias,$
WARNING: please, no spaces at the start of a line
#522: FILE: include/linux/device/bus.h:114:
+ ssize_t (*drv_to_modalias)(struct device_driver *drv, char *buf,$
WARNING: please, no spaces at the start of a line
#523: FILE: include/linux/device/bus.h:115:
+ size_t count);$
WARNING: please, no spaces at the start of a line
#544: FILE: include/linux/module.h:51:
+ struct bin_attribute modalias_attr;$
ERROR: patch seems to be corrupt (line wrapped?)
#553: FILE: kernel/module/internal.h:258:
*mod, const struct load_info *info
WARNING: please, no spaces at the start of a line
#590: FILE: kernel/module/sysfs.c:249:
+ struct module_kobject *mk;$
WARNING: please, no spaces at the start of a line
#591: FILE: kernel/module/sysfs.c:250:
+ char *buf;$
WARNING: please, no spaces at the start of a line
#592: FILE: kernel/module/sysfs.c:251:
+ size_t count;$
WARNING: please, no spaces at the start of a line
#593: FILE: kernel/module/sysfs.c:252:
+ ssize_t len;$
WARNING: please, no spaces at the start of a line
#598: FILE: kernel/module/sysfs.c:257:
+ struct modalias_bus_print_state *s = p;$
WARNING: please, no spaces at the start of a line
#599: FILE: kernel/module/sysfs.c:258:
+ struct module_kobject *mk = s->mk;$
WARNING: please, no spaces at the start of a line
#600: FILE: kernel/module/sysfs.c:259:
+ ssize_t len;$
WARNING: please, no spaces at the start of a line
#602: FILE: kernel/module/sysfs.c:261:
+ if (mk->mod) {$
WARNING: suspect code indent for conditional statements (1, 1)
#602: FILE: kernel/module/sysfs.c:261:
+ if (mk->mod) {
+ if (mk->mod != drv->owner)
WARNING: please, no spaces at the start of a line
#603: FILE: kernel/module/sysfs.c:262:
+ if (mk->mod != drv->owner)$
WARNING: suspect code indent for conditional statements (1, 1)
#603: FILE: kernel/module/sysfs.c:262:
+ if (mk->mod != drv->owner)
+ return 0;
WARNING: please, no spaces at the start of a line
#604: FILE: kernel/module/sysfs.c:263:
+ return 0;$
WARNING: please, no spaces at the start of a line
#605: FILE: kernel/module/sysfs.c:264:
+ } else if (!mk->kobj.name || !drv->mod_name ||$
WARNING: suspect code indent for conditional statements (1, 1)
#605: FILE: kernel/module/sysfs.c:264:
+ } else if (!mk->kobj.name || !drv->mod_name ||
[...]
+ return 0;
WARNING: please, no spaces at the start of a line
#606: FILE: kernel/module/sysfs.c:265:
+ strcmp(mk->kobj.name, drv->mod_name))$
WARNING: please, no spaces at the start of a line
#607: FILE: kernel/module/sysfs.c:266:
+ return 0;$
WARNING: please, no spaces at the start of a line
#609: FILE: kernel/module/sysfs.c:268:
+ if (drv->bus && drv->bus->drv_to_modalias) {$
WARNING: suspect code indent for conditional statements (1, 1)
#609: FILE: kernel/module/sysfs.c:268:
+ if (drv->bus && drv->bus->drv_to_modalias) {
+ len = drv->bus->drv_to_modalias(drv, s->buf + s->len,
WARNING: please, no spaces at the start of a line
#610: FILE: kernel/module/sysfs.c:269:
+ len = drv->bus->drv_to_modalias(drv, s->buf + s->len,$
WARNING: please, no spaces at the start of a line
#611: FILE: kernel/module/sysfs.c:270:
+ s->count - s->len);$
WARNING: please, no spaces at the start of a line
#612: FILE: kernel/module/sysfs.c:271:
+ if (len < 0)$
WARNING: suspect code indent for conditional statements (1, 1)
#612: FILE: kernel/module/sysfs.c:271:
+ if (len < 0)
+ return len;
WARNING: please, no spaces at the start of a line
#613: FILE: kernel/module/sysfs.c:272:
+ return len;$
WARNING: please, no spaces at the start of a line
#614: FILE: kernel/module/sysfs.c:273:
+ s->len += len;$
WARNING: please, no spaces at the start of a line
#615: FILE: kernel/module/sysfs.c:274:
+ }$
WARNING: please, no spaces at the start of a line
#617: FILE: kernel/module/sysfs.c:276:
+ s->len += scnprintf(&s->buf[s->len], s->count - s->len, "driver %s\n",$
WARNING: please, no spaces at the start of a line
#618: FILE: kernel/module/sysfs.c:277:
+ drv->name);$
WARNING: please, no spaces at the start of a line
#619: FILE: kernel/module/sysfs.c:278:
+ return 0;$
WARNING: please, no spaces at the start of a line
#624: FILE: kernel/module/sysfs.c:283:
+ return bus_for_each_drv(type, NULL, p, print_modalias_for_drv);$
WARNING: please, no spaces at the start of a line
#628: FILE: kernel/module/sysfs.c:287:
+ struct bin_attribute *bin_attr,$
WARNING: please, no spaces at the start of a line
#629: FILE: kernel/module/sysfs.c:288:
+ char *buf, loff_t pos, size_t count)$
WARNING: please, no spaces at the start of a line
#631: FILE: kernel/module/sysfs.c:290:
+ struct module_kobject *mk = container_of(kobj, struct module_kobject,$
WARNING: please, no spaces at the start of a line
#632: FILE: kernel/module/sysfs.c:291:
+ kobj);$
WARNING: please, no spaces at the start of a line
#633: FILE: kernel/module/sysfs.c:292:
+ struct modalias_bus_print_state state = {mk, buf, count, 0};$
WARNING: please, no spaces at the start of a line
#634: FILE: kernel/module/sysfs.c:293:
+ int error = 0;$
WARNING: please, no spaces at the start of a line
#636: FILE: kernel/module/sysfs.c:295:
+ if (pos != 0)$
WARNING: suspect code indent for conditional statements (1, 1)
#636: FILE: kernel/module/sysfs.c:295:
+ if (pos != 0)
+ return -EINVAL;
WARNING: please, no spaces at the start of a line
#637: FILE: kernel/module/sysfs.c:296:
+ return -EINVAL;$
WARNING: please, no spaces at the start of a line
#639: FILE: kernel/module/sysfs.c:298:
+ error = bus_for_each(&state, print_modalias_for_bus);$
WARNING: please, no spaces at the start of a line
#640: FILE: kernel/module/sysfs.c:299:
+ if (error)$
WARNING: suspect code indent for conditional statements (1, 1)
#640: FILE: kernel/module/sysfs.c:299:
+ if (error)
+ return error;
WARNING: please, no spaces at the start of a line
#641: FILE: kernel/module/sysfs.c:300:
+ return error;$
WARNING: please, no spaces at the start of a line
#643: FILE: kernel/module/sysfs.c:302:
+ if (mk->mod)$
WARNING: suspect code indent for conditional statements (1, 1)
#643: FILE: kernel/module/sysfs.c:302:
+ if (mk->mod)
+ state.len += scnprintf(&buf[state.len], count - state.len,
WARNING: please, no spaces at the start of a line
#644: FILE: kernel/module/sysfs.c:303:
+ state.len += scnprintf(&buf[state.len], count - state.len,$
ERROR: code indent should use tabs where possible
#645: FILE: kernel/module/sysfs.c:304:
+ "modalias %s %s\n", kobject_name(kobj),$
WARNING: please, no spaces at the start of a line
#645: FILE: kernel/module/sysfs.c:304:
+ "modalias %s %s\n", kobject_name(kobj),$
ERROR: code indent should use tabs where possible
#646: FILE: kernel/module/sysfs.c:305:
+ mk->mod->name);$
WARNING: please, no spaces at the start of a line
#646: FILE: kernel/module/sysfs.c:305:
+ mk->mod->name);$
WARNING: please, no spaces at the start of a line
#647: FILE: kernel/module/sysfs.c:306:
+ else$
WARNING: suspect code indent for conditional statements (1, 1)
#647: FILE: kernel/module/sysfs.c:306:
+ else
+ state.len += scnprintf(&buf[state.len], count - state.len,
WARNING: please, no spaces at the start of a line
#648: FILE: kernel/module/sysfs.c:307:
+ state.len += scnprintf(&buf[state.len], count - state.len,$
ERROR: code indent should use tabs where possible
#649: FILE: kernel/module/sysfs.c:308:
+ "modalias %s NULL\n",$
WARNING: please, no spaces at the start of a line
#649: FILE: kernel/module/sysfs.c:308:
+ "modalias %s NULL\n",$
ERROR: code indent should use tabs where possible
#650: FILE: kernel/module/sysfs.c:309:
+ kobject_name(kobj));$
WARNING: please, no spaces at the start of a line
#650: FILE: kernel/module/sysfs.c:309:
+ kobject_name(kobj));$
WARNING: Block comments should align the * on each line
#653: FILE: kernel/module/sysfs.c:312:
+ /*
+ * The caller checked the pos and count against our size.
WARNING: please, no spaces at the start of a line
#655: FILE: kernel/module/sysfs.c:314:
+ return state.len;$
WARNING: please, no spaces at the start of a line
#665: FILE: kernel/module/sysfs.c:324:
+ sysfs_bin_attr_init(&mk->modalias_attr);$
WARNING: please, no spaces at the start of a line
#666: FILE: kernel/module/sysfs.c:325:
+ mk->modalias_attr.attr.name = "modalias";$
WARNING: please, no spaces at the start of a line
#667: FILE: kernel/module/sysfs.c:326:
+ mk->modalias_attr.attr.mode = 0444;$
WARNING: please, no spaces at the start of a line
#668: FILE: kernel/module/sysfs.c:327:
+ mk->modalias_attr.read = module_modalias_read;$
WARNING: please, no spaces at the start of a line
#669: FILE: kernel/module/sysfs.c:328:
+ if (sysfs_create_bin_file(&mk->kobj, &mk->modalias_attr)) {$
WARNING: suspect code indent for conditional statements (1, 1)
#669: FILE: kernel/module/sysfs.c:328:
+ if (sysfs_create_bin_file(&mk->kobj, &mk->modalias_attr)) {
[...]
+ return;
WARNING: Block comments should align the * on each line
#671: FILE: kernel/module/sysfs.c:330:
+ /* We shouldn't ignore the return type, but there is nothing to
+ * do.
WARNING: please, no spaces at the start of a line
#673: FILE: kernel/module/sysfs.c:332:
+ return;$
WARNING: please, no spaces at the start of a line
#674: FILE: kernel/module/sysfs.c:333:
+ }$
WARNING: please, no spaces at the start of a line
#679: FILE: kernel/module/sysfs.c:338:
+ sysfs_remove_bin_file(&mk->kobj, &mk->modalias_attr);$
WARNING: please, no spaces at the start of a line
#689: FILE: kernel/module/sysfs.c:499:
+ add_modalias_attr(&mod->mkobj);$
WARNING: please, no spaces at the start of a line
#697: FILE: kernel/module/sysfs.c:517:
+ remove_modalias_attr(&mod->mkobj);$
WARNING: please, no spaces at the start of a line
#717: FILE: kernel/params.c:819:
+ add_modalias_attr(mk);$
total: 9 errors, 284 warnings, 512 lines checked
NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or
--fix-inplace.
NOTE: Whitespace errors detected.
You may wish to use scripts/cleanpatch or scripts/cleanfile
/home/chleroy/Téléchargements/Patch-to-exposing-modalias-es-for-built-in-kernel-modules-USB.patch
has style problems, please review.
NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.
---
Christophe