aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2018-03-23 18:54:39 -0400
committerDavid S. Miller <davem@davemloft.net>2018-03-26 12:07:49 -0400
commitd61e40385655fbba659fc3d81df9bdf1b848e263 (patch)
tree434dfc436eae37889fa25c484c310ce05952269a
parentd6444062f8f07c346a21bd815af4a3dc8b231574 (diff)
drivers/net: Use octal not symbolic permissions
Prefer the direct use of octal for permissions. Done with checkpatch -f --types=SYMBOLIC_PERMS --fix-inplace and some typing. Miscellanea: o Whitespace neatening around these conversions. Signed-off-by: Joe Perches <joe@perches.com> Reviewed-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_procfs.c2
-rw-r--r--drivers/net/bonding/bond_sysfs.c73
-rw-r--r--drivers/net/bonding/bond_sysfs_slave.c4
-rw-r--r--drivers/net/caif/caif_serial.c32
-rw-r--r--drivers/net/caif/caif_spi.c16
-rw-r--r--drivers/net/caif/caif_virtio.c16
-rw-r--r--drivers/net/can/at91_can.c3
-rw-r--r--drivers/net/can/cc770/cc770.c4
-rw-r--r--drivers/net/can/cc770/cc770_isa.c16
-rw-r--r--drivers/net/can/grcan.c4
-rw-r--r--drivers/net/can/janz-ican3.c6
-rw-r--r--drivers/net/can/sja1000/sja1000_isa.c14
-rw-r--r--drivers/net/can/softing/softing_main.c4
-rw-r--r--drivers/net/can/spi/mcp251x.c2
-rw-r--r--drivers/net/can/usb/esd_usb2.c6
-rw-r--r--drivers/net/can/vcan.c2
-rw-r--r--drivers/net/hamradio/bpqether.c3
-rw-r--r--drivers/net/hamradio/yam.c2
-rw-r--r--drivers/net/hyperv/netvsc_drv.c4
-rw-r--r--drivers/net/ieee802154/at86rf230.c2
-rw-r--r--drivers/net/phy/spi_ks8995.c2
-rw-r--r--drivers/net/ppp/ppp_generic.c2
-rw-r--r--drivers/net/ppp/pppoe.c2
-rw-r--r--drivers/net/usb/cdc_ncm.c12
-rw-r--r--drivers/net/usb/hso.c8
-rw-r--r--drivers/net/xen-netback/xenbus.c4
-rw-r--r--drivers/net/xen-netfront.c6
27 files changed, 124 insertions, 127 deletions
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index f7799321dffb..01059f1a7bca 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -287,7 +287,7 @@ void bond_create_proc_entry(struct bonding *bond)
287 287
288 if (bn->proc_dir) { 288 if (bn->proc_dir) {
289 bond->proc_entry = proc_create_data(bond_dev->name, 289 bond->proc_entry = proc_create_data(bond_dev->name,
290 S_IRUGO, bn->proc_dir, 290 0444, bn->proc_dir,
291 &bond_info_fops, bond); 291 &bond_info_fops, bond);
292 if (bond->proc_entry == NULL) 292 if (bond->proc_entry == NULL)
293 netdev_warn(bond_dev, "Cannot create /proc/net/%s/%s\n", 293 netdev_warn(bond_dev, "Cannot create /proc/net/%s/%s\n",
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 040b493f60ae..6096440e96ea 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -147,7 +147,7 @@ err_no_cmd:
147static const struct class_attribute class_attr_bonding_masters = { 147static const struct class_attribute class_attr_bonding_masters = {
148 .attr = { 148 .attr = {
149 .name = "bonding_masters", 149 .name = "bonding_masters",
150 .mode = S_IWUSR | S_IRUGO, 150 .mode = 0644,
151 }, 151 },
152 .show = bonding_show_bonds, 152 .show = bonding_show_bonds,
153 .store = bonding_store_bonds, 153 .store = bonding_store_bonds,
@@ -202,7 +202,7 @@ static ssize_t bonding_show_slaves(struct device *d,
202 202
203 return res; 203 return res;
204} 204}
205static DEVICE_ATTR(slaves, S_IRUGO | S_IWUSR, bonding_show_slaves, 205static DEVICE_ATTR(slaves, 0644, bonding_show_slaves,
206 bonding_sysfs_store_option); 206 bonding_sysfs_store_option);
207 207
208/* Show the bonding mode. */ 208/* Show the bonding mode. */
@@ -216,8 +216,7 @@ static ssize_t bonding_show_mode(struct device *d,
216 216
217 return sprintf(buf, "%s %d\n", val->string, BOND_MODE(bond)); 217 return sprintf(buf, "%s %d\n", val->string, BOND_MODE(bond));
218} 218}
219static DEVICE_ATTR(mode, S_IRUGO | S_IWUSR, 219static DEVICE_ATTR(mode, 0644, bonding_show_mode, bonding_sysfs_store_option);
220 bonding_show_mode, bonding_sysfs_store_option);
221 220
222/* Show the bonding transmit hash method. */ 221/* Show the bonding transmit hash method. */
223static ssize_t bonding_show_xmit_hash(struct device *d, 222static ssize_t bonding_show_xmit_hash(struct device *d,
@@ -231,7 +230,7 @@ static ssize_t bonding_show_xmit_hash(struct device *d,
231 230
232 return sprintf(buf, "%s %d\n", val->string, bond->params.xmit_policy); 231 return sprintf(buf, "%s %d\n", val->string, bond->params.xmit_policy);
233} 232}
234static DEVICE_ATTR(xmit_hash_policy, S_IRUGO | S_IWUSR, 233static DEVICE_ATTR(xmit_hash_policy, 0644,
235 bonding_show_xmit_hash, bonding_sysfs_store_option); 234 bonding_show_xmit_hash, bonding_sysfs_store_option);
236 235
237/* Show arp_validate. */ 236/* Show arp_validate. */
@@ -247,7 +246,7 @@ static ssize_t bonding_show_arp_validate(struct device *d,
247 246
248 return sprintf(buf, "%s %d\n", val->string, bond->params.arp_validate); 247 return sprintf(buf, "%s %d\n", val->string, bond->params.arp_validate);
249} 248}
250static DEVICE_ATTR(arp_validate, S_IRUGO | S_IWUSR, bonding_show_arp_validate, 249static DEVICE_ATTR(arp_validate, 0644, bonding_show_arp_validate,
251 bonding_sysfs_store_option); 250 bonding_sysfs_store_option);
252 251
253/* Show arp_all_targets. */ 252/* Show arp_all_targets. */
@@ -263,7 +262,7 @@ static ssize_t bonding_show_arp_all_targets(struct device *d,
263 return sprintf(buf, "%s %d\n", 262 return sprintf(buf, "%s %d\n",
264 val->string, bond->params.arp_all_targets); 263 val->string, bond->params.arp_all_targets);
265} 264}
266static DEVICE_ATTR(arp_all_targets, S_IRUGO | S_IWUSR, 265static DEVICE_ATTR(arp_all_targets, 0644,
267 bonding_show_arp_all_targets, bonding_sysfs_store_option); 266 bonding_show_arp_all_targets, bonding_sysfs_store_option);
268 267
269/* Show fail_over_mac. */ 268/* Show fail_over_mac. */
@@ -279,7 +278,7 @@ static ssize_t bonding_show_fail_over_mac(struct device *d,
279 278
280 return sprintf(buf, "%s %d\n", val->string, bond->params.fail_over_mac); 279 return sprintf(buf, "%s %d\n", val->string, bond->params.fail_over_mac);
281} 280}
282static DEVICE_ATTR(fail_over_mac, S_IRUGO | S_IWUSR, 281static DEVICE_ATTR(fail_over_mac, 0644,
283 bonding_show_fail_over_mac, bonding_sysfs_store_option); 282 bonding_show_fail_over_mac, bonding_sysfs_store_option);
284 283
285/* Show the arp timer interval. */ 284/* Show the arp timer interval. */
@@ -291,7 +290,7 @@ static ssize_t bonding_show_arp_interval(struct device *d,
291 290
292 return sprintf(buf, "%d\n", bond->params.arp_interval); 291 return sprintf(buf, "%d\n", bond->params.arp_interval);
293} 292}
294static DEVICE_ATTR(arp_interval, S_IRUGO | S_IWUSR, 293static DEVICE_ATTR(arp_interval, 0644,
295 bonding_show_arp_interval, bonding_sysfs_store_option); 294 bonding_show_arp_interval, bonding_sysfs_store_option);
296 295
297/* Show the arp targets. */ 296/* Show the arp targets. */
@@ -312,7 +311,7 @@ static ssize_t bonding_show_arp_targets(struct device *d,
312 311
313 return res; 312 return res;
314} 313}
315static DEVICE_ATTR(arp_ip_target, S_IRUGO | S_IWUSR, 314static DEVICE_ATTR(arp_ip_target, 0644,
316 bonding_show_arp_targets, bonding_sysfs_store_option); 315 bonding_show_arp_targets, bonding_sysfs_store_option);
317 316
318/* Show the up and down delays. */ 317/* Show the up and down delays. */
@@ -324,7 +323,7 @@ static ssize_t bonding_show_downdelay(struct device *d,
324 323
325 return sprintf(buf, "%d\n", bond->params.downdelay * bond->params.miimon); 324 return sprintf(buf, "%d\n", bond->params.downdelay * bond->params.miimon);
326} 325}
327static DEVICE_ATTR(downdelay, S_IRUGO | S_IWUSR, 326static DEVICE_ATTR(downdelay, 0644,
328 bonding_show_downdelay, bonding_sysfs_store_option); 327 bonding_show_downdelay, bonding_sysfs_store_option);
329 328
330static ssize_t bonding_show_updelay(struct device *d, 329static ssize_t bonding_show_updelay(struct device *d,
@@ -336,7 +335,7 @@ static ssize_t bonding_show_updelay(struct device *d,
336 return sprintf(buf, "%d\n", bond->params.updelay * bond->params.miimon); 335 return sprintf(buf, "%d\n", bond->params.updelay * bond->params.miimon);
337 336
338} 337}
339static DEVICE_ATTR(updelay, S_IRUGO | S_IWUSR, 338static DEVICE_ATTR(updelay, 0644,
340 bonding_show_updelay, bonding_sysfs_store_option); 339 bonding_show_updelay, bonding_sysfs_store_option);
341 340
342/* Show the LACP interval. */ 341/* Show the LACP interval. */
@@ -351,7 +350,7 @@ static ssize_t bonding_show_lacp(struct device *d,
351 350
352 return sprintf(buf, "%s %d\n", val->string, bond->params.lacp_fast); 351 return sprintf(buf, "%s %d\n", val->string, bond->params.lacp_fast);
353} 352}
354static DEVICE_ATTR(lacp_rate, S_IRUGO | S_IWUSR, 353static DEVICE_ATTR(lacp_rate, 0644,
355 bonding_show_lacp, bonding_sysfs_store_option); 354 bonding_show_lacp, bonding_sysfs_store_option);
356 355
357static ssize_t bonding_show_min_links(struct device *d, 356static ssize_t bonding_show_min_links(struct device *d,
@@ -362,7 +361,7 @@ static ssize_t bonding_show_min_links(struct device *d,
362 361
363 return sprintf(buf, "%u\n", bond->params.min_links); 362 return sprintf(buf, "%u\n", bond->params.min_links);
364} 363}
365static DEVICE_ATTR(min_links, S_IRUGO | S_IWUSR, 364static DEVICE_ATTR(min_links, 0644,
366 bonding_show_min_links, bonding_sysfs_store_option); 365 bonding_show_min_links, bonding_sysfs_store_option);
367 366
368static ssize_t bonding_show_ad_select(struct device *d, 367static ssize_t bonding_show_ad_select(struct device *d,
@@ -376,7 +375,7 @@ static ssize_t bonding_show_ad_select(struct device *d,
376 375
377 return sprintf(buf, "%s %d\n", val->string, bond->params.ad_select); 376 return sprintf(buf, "%s %d\n", val->string, bond->params.ad_select);
378} 377}
379static DEVICE_ATTR(ad_select, S_IRUGO | S_IWUSR, 378static DEVICE_ATTR(ad_select, 0644,
380 bonding_show_ad_select, bonding_sysfs_store_option); 379 bonding_show_ad_select, bonding_sysfs_store_option);
381 380
382/* Show the number of peer notifications to send after a failover event. */ 381/* Show the number of peer notifications to send after a failover event. */
@@ -387,9 +386,9 @@ static ssize_t bonding_show_num_peer_notif(struct device *d,
387 struct bonding *bond = to_bond(d); 386 struct bonding *bond = to_bond(d);
388 return sprintf(buf, "%d\n", bond->params.num_peer_notif); 387 return sprintf(buf, "%d\n", bond->params.num_peer_notif);
389} 388}
390static DEVICE_ATTR(num_grat_arp, S_IRUGO | S_IWUSR, 389static DEVICE_ATTR(num_grat_arp, 0644,
391 bonding_show_num_peer_notif, bonding_sysfs_store_option); 390 bonding_show_num_peer_notif, bonding_sysfs_store_option);
392static DEVICE_ATTR(num_unsol_na, S_IRUGO | S_IWUSR, 391static DEVICE_ATTR(num_unsol_na, 0644,
393 bonding_show_num_peer_notif, bonding_sysfs_store_option); 392 bonding_show_num_peer_notif, bonding_sysfs_store_option);
394 393
395/* Show the MII monitor interval. */ 394/* Show the MII monitor interval. */
@@ -401,7 +400,7 @@ static ssize_t bonding_show_miimon(struct device *d,
401 400
402 return sprintf(buf, "%d\n", bond->params.miimon); 401 return sprintf(buf, "%d\n", bond->params.miimon);
403} 402}
404static DEVICE_ATTR(miimon, S_IRUGO | S_IWUSR, 403static DEVICE_ATTR(miimon, 0644,
405 bonding_show_miimon, bonding_sysfs_store_option); 404 bonding_show_miimon, bonding_sysfs_store_option);
406 405
407/* Show the primary slave. */ 406/* Show the primary slave. */
@@ -421,7 +420,7 @@ static ssize_t bonding_show_primary(struct device *d,
421 420
422 return count; 421 return count;
423} 422}
424static DEVICE_ATTR(primary, S_IRUGO | S_IWUSR, 423static DEVICE_ATTR(primary, 0644,
425 bonding_show_primary, bonding_sysfs_store_option); 424 bonding_show_primary, bonding_sysfs_store_option);
426 425
427/* Show the primary_reselect flag. */ 426/* Show the primary_reselect flag. */
@@ -438,7 +437,7 @@ static ssize_t bonding_show_primary_reselect(struct device *d,
438 return sprintf(buf, "%s %d\n", 437 return sprintf(buf, "%s %d\n",
439 val->string, bond->params.primary_reselect); 438 val->string, bond->params.primary_reselect);
440} 439}
441static DEVICE_ATTR(primary_reselect, S_IRUGO | S_IWUSR, 440static DEVICE_ATTR(primary_reselect, 0644,
442 bonding_show_primary_reselect, bonding_sysfs_store_option); 441 bonding_show_primary_reselect, bonding_sysfs_store_option);
443 442
444/* Show the use_carrier flag. */ 443/* Show the use_carrier flag. */
@@ -450,7 +449,7 @@ static ssize_t bonding_show_carrier(struct device *d,
450 449
451 return sprintf(buf, "%d\n", bond->params.use_carrier); 450 return sprintf(buf, "%d\n", bond->params.use_carrier);
452} 451}
453static DEVICE_ATTR(use_carrier, S_IRUGO | S_IWUSR, 452static DEVICE_ATTR(use_carrier, 0644,
454 bonding_show_carrier, bonding_sysfs_store_option); 453 bonding_show_carrier, bonding_sysfs_store_option);
455 454
456 455
@@ -471,7 +470,7 @@ static ssize_t bonding_show_active_slave(struct device *d,
471 470
472 return count; 471 return count;
473} 472}
474static DEVICE_ATTR(active_slave, S_IRUGO | S_IWUSR, 473static DEVICE_ATTR(active_slave, 0644,
475 bonding_show_active_slave, bonding_sysfs_store_option); 474 bonding_show_active_slave, bonding_sysfs_store_option);
476 475
477/* Show link status of the bond interface. */ 476/* Show link status of the bond interface. */
@@ -484,7 +483,7 @@ static ssize_t bonding_show_mii_status(struct device *d,
484 483
485 return sprintf(buf, "%s\n", active ? "up" : "down"); 484 return sprintf(buf, "%s\n", active ? "up" : "down");
486} 485}
487static DEVICE_ATTR(mii_status, S_IRUGO, bonding_show_mii_status, NULL); 486static DEVICE_ATTR(mii_status, 0444, bonding_show_mii_status, NULL);
488 487
489/* Show current 802.3ad aggregator ID. */ 488/* Show current 802.3ad aggregator ID. */
490static ssize_t bonding_show_ad_aggregator(struct device *d, 489static ssize_t bonding_show_ad_aggregator(struct device *d,
@@ -503,7 +502,7 @@ static ssize_t bonding_show_ad_aggregator(struct device *d,
503 502
504 return count; 503 return count;
505} 504}
506static DEVICE_ATTR(ad_aggregator, S_IRUGO, bonding_show_ad_aggregator, NULL); 505static DEVICE_ATTR(ad_aggregator, 0444, bonding_show_ad_aggregator, NULL);
507 506
508 507
509/* Show number of active 802.3ad ports. */ 508/* Show number of active 802.3ad ports. */
@@ -523,7 +522,7 @@ static ssize_t bonding_show_ad_num_ports(struct device *d,
523 522
524 return count; 523 return count;
525} 524}
526static DEVICE_ATTR(ad_num_ports, S_IRUGO, bonding_show_ad_num_ports, NULL); 525static DEVICE_ATTR(ad_num_ports, 0444, bonding_show_ad_num_ports, NULL);
527 526
528 527
529/* Show current 802.3ad actor key. */ 528/* Show current 802.3ad actor key. */
@@ -543,7 +542,7 @@ static ssize_t bonding_show_ad_actor_key(struct device *d,
543 542
544 return count; 543 return count;
545} 544}
546static DEVICE_ATTR(ad_actor_key, S_IRUGO, bonding_show_ad_actor_key, NULL); 545static DEVICE_ATTR(ad_actor_key, 0444, bonding_show_ad_actor_key, NULL);
547 546
548 547
549/* Show current 802.3ad partner key. */ 548/* Show current 802.3ad partner key. */
@@ -563,7 +562,7 @@ static ssize_t bonding_show_ad_partner_key(struct device *d,
563 562
564 return count; 563 return count;
565} 564}
566static DEVICE_ATTR(ad_partner_key, S_IRUGO, bonding_show_ad_partner_key, NULL); 565static DEVICE_ATTR(ad_partner_key, 0444, bonding_show_ad_partner_key, NULL);
567 566
568 567
569/* Show current 802.3ad partner mac. */ 568/* Show current 802.3ad partner mac. */
@@ -582,7 +581,7 @@ static ssize_t bonding_show_ad_partner_mac(struct device *d,
582 581
583 return count; 582 return count;
584} 583}
585static DEVICE_ATTR(ad_partner_mac, S_IRUGO, bonding_show_ad_partner_mac, NULL); 584static DEVICE_ATTR(ad_partner_mac, 0444, bonding_show_ad_partner_mac, NULL);
586 585
587/* Show the queue_ids of the slaves in the current bond. */ 586/* Show the queue_ids of the slaves in the current bond. */
588static ssize_t bonding_show_queue_id(struct device *d, 587static ssize_t bonding_show_queue_id(struct device *d,
@@ -615,7 +614,7 @@ static ssize_t bonding_show_queue_id(struct device *d,
615 614
616 return res; 615 return res;
617} 616}
618static DEVICE_ATTR(queue_id, S_IRUGO | S_IWUSR, bonding_show_queue_id, 617static DEVICE_ATTR(queue_id, 0644, bonding_show_queue_id,
619 bonding_sysfs_store_option); 618 bonding_sysfs_store_option);
620 619
621 620
@@ -628,7 +627,7 @@ static ssize_t bonding_show_slaves_active(struct device *d,
628 627
629 return sprintf(buf, "%d\n", bond->params.all_slaves_active); 628 return sprintf(buf, "%d\n", bond->params.all_slaves_active);
630} 629}
631static DEVICE_ATTR(all_slaves_active, S_IRUGO | S_IWUSR, 630static DEVICE_ATTR(all_slaves_active, 0644,
632 bonding_show_slaves_active, bonding_sysfs_store_option); 631 bonding_show_slaves_active, bonding_sysfs_store_option);
633 632
634/* Show the number of IGMP membership reports to send on link failure */ 633/* Show the number of IGMP membership reports to send on link failure */
@@ -640,7 +639,7 @@ static ssize_t bonding_show_resend_igmp(struct device *d,
640 639
641 return sprintf(buf, "%d\n", bond->params.resend_igmp); 640 return sprintf(buf, "%d\n", bond->params.resend_igmp);
642} 641}
643static DEVICE_ATTR(resend_igmp, S_IRUGO | S_IWUSR, 642static DEVICE_ATTR(resend_igmp, 0644,
644 bonding_show_resend_igmp, bonding_sysfs_store_option); 643 bonding_show_resend_igmp, bonding_sysfs_store_option);
645 644
646 645
@@ -652,7 +651,7 @@ static ssize_t bonding_show_lp_interval(struct device *d,
652 651
653 return sprintf(buf, "%d\n", bond->params.lp_interval); 652 return sprintf(buf, "%d\n", bond->params.lp_interval);
654} 653}
655static DEVICE_ATTR(lp_interval, S_IRUGO | S_IWUSR, 654static DEVICE_ATTR(lp_interval, 0644,
656 bonding_show_lp_interval, bonding_sysfs_store_option); 655 bonding_show_lp_interval, bonding_sysfs_store_option);
657 656
658static ssize_t bonding_show_tlb_dynamic_lb(struct device *d, 657static ssize_t bonding_show_tlb_dynamic_lb(struct device *d,
@@ -662,7 +661,7 @@ static ssize_t bonding_show_tlb_dynamic_lb(struct device *d,
662 struct bonding *bond = to_bond(d); 661 struct bonding *bond = to_bond(d);
663 return sprintf(buf, "%d\n", bond->params.tlb_dynamic_lb); 662 return sprintf(buf, "%d\n", bond->params.tlb_dynamic_lb);
664} 663}
665static DEVICE_ATTR(tlb_dynamic_lb, S_IRUGO | S_IWUSR, 664static DEVICE_ATTR(tlb_dynamic_lb, 0644,
666 bonding_show_tlb_dynamic_lb, bonding_sysfs_store_option); 665 bonding_show_tlb_dynamic_lb, bonding_sysfs_store_option);
667 666
668static ssize_t bonding_show_packets_per_slave(struct device *d, 667static ssize_t bonding_show_packets_per_slave(struct device *d,
@@ -674,7 +673,7 @@ static ssize_t bonding_show_packets_per_slave(struct device *d,
674 673
675 return sprintf(buf, "%u\n", packets_per_slave); 674 return sprintf(buf, "%u\n", packets_per_slave);
676} 675}
677static DEVICE_ATTR(packets_per_slave, S_IRUGO | S_IWUSR, 676static DEVICE_ATTR(packets_per_slave, 0644,
678 bonding_show_packets_per_slave, bonding_sysfs_store_option); 677 bonding_show_packets_per_slave, bonding_sysfs_store_option);
679 678
680static ssize_t bonding_show_ad_actor_sys_prio(struct device *d, 679static ssize_t bonding_show_ad_actor_sys_prio(struct device *d,
@@ -688,7 +687,7 @@ static ssize_t bonding_show_ad_actor_sys_prio(struct device *d,
688 687
689 return 0; 688 return 0;
690} 689}
691static DEVICE_ATTR(ad_actor_sys_prio, S_IRUGO | S_IWUSR, 690static DEVICE_ATTR(ad_actor_sys_prio, 0644,
692 bonding_show_ad_actor_sys_prio, bonding_sysfs_store_option); 691 bonding_show_ad_actor_sys_prio, bonding_sysfs_store_option);
693 692
694static ssize_t bonding_show_ad_actor_system(struct device *d, 693static ssize_t bonding_show_ad_actor_system(struct device *d,
@@ -703,7 +702,7 @@ static ssize_t bonding_show_ad_actor_system(struct device *d,
703 return 0; 702 return 0;
704} 703}
705 704
706static DEVICE_ATTR(ad_actor_system, S_IRUGO | S_IWUSR, 705static DEVICE_ATTR(ad_actor_system, 0644,
707 bonding_show_ad_actor_system, bonding_sysfs_store_option); 706 bonding_show_ad_actor_system, bonding_sysfs_store_option);
708 707
709static ssize_t bonding_show_ad_user_port_key(struct device *d, 708static ssize_t bonding_show_ad_user_port_key(struct device *d,
@@ -717,7 +716,7 @@ static ssize_t bonding_show_ad_user_port_key(struct device *d,
717 716
718 return 0; 717 return 0;
719} 718}
720static DEVICE_ATTR(ad_user_port_key, S_IRUGO | S_IWUSR, 719static DEVICE_ATTR(ad_user_port_key, 0644,
721 bonding_show_ad_user_port_key, bonding_sysfs_store_option); 720 bonding_show_ad_user_port_key, bonding_sysfs_store_option);
722 721
723static struct attribute *per_bond_attrs[] = { 722static struct attribute *per_bond_attrs[] = {
diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
index 7d16c51e6913..2f120b2ffef0 100644
--- a/drivers/net/bonding/bond_sysfs_slave.c
+++ b/drivers/net/bonding/bond_sysfs_slave.c
@@ -25,8 +25,8 @@ const struct slave_attribute slave_attr_##_name = { \
25 .mode = _mode }, \ 25 .mode = _mode }, \
26 .show = _show, \ 26 .show = _show, \
27}; 27};
28#define SLAVE_ATTR_RO(_name) \ 28#define SLAVE_ATTR_RO(_name) \
29 SLAVE_ATTR(_name, S_IRUGO, _name##_show) 29 SLAVE_ATTR(_name, 0444, _name##_show)
30 30
31static ssize_t state_show(struct slave *slave, char *buf) 31static ssize_t state_show(struct slave *slave, char *buf)
32{ 32{
diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
index 709838e4c062..a0f954f36c09 100644
--- a/drivers/net/caif/caif_serial.c
+++ b/drivers/net/caif/caif_serial.c
@@ -40,20 +40,20 @@ static LIST_HEAD(ser_list);
40static LIST_HEAD(ser_release_list); 40static LIST_HEAD(ser_release_list);
41 41
42static bool ser_loop; 42static bool ser_loop;
43module_param(ser_loop, bool, S_IRUGO); 43module_param(ser_loop, bool, 0444);
44MODULE_PARM_DESC(ser_loop, "Run in simulated loopback mode."); 44MODULE_PARM_DESC(ser_loop, "Run in simulated loopback mode.");
45 45
46static bool ser_use_stx = true; 46static bool ser_use_stx = true;
47module_param(ser_use_stx, bool, S_IRUGO); 47module_param(ser_use_stx, bool, 0444);
48MODULE_PARM_DESC(ser_use_stx, "STX enabled or not."); 48MODULE_PARM_DESC(ser_use_stx, "STX enabled or not.");
49 49
50static bool ser_use_fcs = true; 50static bool ser_use_fcs = true;
51 51
52module_param(ser_use_fcs, bool, S_IRUGO); 52module_param(ser_use_fcs, bool, 0444);
53MODULE_PARM_DESC(ser_use_fcs, "FCS enabled or not."); 53MODULE_PARM_DESC(ser_use_fcs, "FCS enabled or not.");
54 54
55static int ser_write_chunk = MAX_WRITE_CHUNK; 55static int ser_write_chunk = MAX_WRITE_CHUNK;
56module_param(ser_write_chunk, int, S_IRUGO); 56module_param(ser_write_chunk, int, 0444);
57 57
58MODULE_PARM_DESC(ser_write_chunk, "Maximum size of data written to UART."); 58MODULE_PARM_DESC(ser_write_chunk, "Maximum size of data written to UART.");
59 59
@@ -97,21 +97,21 @@ static inline void debugfs_init(struct ser_device *ser, struct tty_struct *tty)
97 ser->debugfs_tty_dir = 97 ser->debugfs_tty_dir =
98 debugfs_create_dir(tty->name, debugfsdir); 98 debugfs_create_dir(tty->name, debugfsdir);
99 if (!IS_ERR(ser->debugfs_tty_dir)) { 99 if (!IS_ERR(ser->debugfs_tty_dir)) {
100 debugfs_create_blob("last_tx_msg", S_IRUSR, 100 debugfs_create_blob("last_tx_msg", 0400,
101 ser->debugfs_tty_dir, 101 ser->debugfs_tty_dir,
102 &ser->tx_blob); 102 &ser->tx_blob);
103 103
104 debugfs_create_blob("last_rx_msg", S_IRUSR, 104 debugfs_create_blob("last_rx_msg", 0400,
105 ser->debugfs_tty_dir, 105 ser->debugfs_tty_dir,
106 &ser->rx_blob); 106 &ser->rx_blob);
107 107
108 debugfs_create_x32("ser_state", S_IRUSR, 108 debugfs_create_x32("ser_state", 0400,
109 ser->debugfs_tty_dir, 109 ser->debugfs_tty_dir,
110 (u32 *)&ser->state); 110 (u32 *)&ser->state);
111 111
112 debugfs_create_x8("tty_status", S_IRUSR, 112 debugfs_create_x8("tty_status", 0400,
113 ser->debugfs_tty_dir, 113 ser->debugfs_tty_dir,
114 &ser->tty_status); 114 &ser->tty_status);
115 115
116 } 116 }
117 ser->tx_blob.data = ser->tx_data; 117 ser->tx_blob.data = ser->tx_data;
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 980eace53d44..d28a1398c091 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -35,27 +35,27 @@ MODULE_DESCRIPTION("CAIF SPI driver");
35#define PAD_POW2(x, pow) ((((x)&((pow)-1))==0) ? 0 : (((pow)-((x)&((pow)-1))))) 35#define PAD_POW2(x, pow) ((((x)&((pow)-1))==0) ? 0 : (((pow)-((x)&((pow)-1)))))
36 36
37static bool spi_loop; 37static bool spi_loop;
38module_param(spi_loop, bool, S_IRUGO); 38module_param(spi_loop, bool, 0444);
39MODULE_PARM_DESC(spi_loop, "SPI running in loopback mode."); 39MODULE_PARM_DESC(spi_loop, "SPI running in loopback mode.");
40 40
41/* SPI frame alignment. */ 41/* SPI frame alignment. */
42module_param(spi_frm_align, int, S_IRUGO); 42module_param(spi_frm_align, int, 0444);
43MODULE_PARM_DESC(spi_frm_align, "SPI frame alignment."); 43MODULE_PARM_DESC(spi_frm_align, "SPI frame alignment.");
44 44
45/* 45/*
46 * SPI padding options. 46 * SPI padding options.
47 * Warning: must be a base of 2 (& operation used) and can not be zero ! 47 * Warning: must be a base of 2 (& operation used) and can not be zero !
48 */ 48 */
49module_param(spi_up_head_align, int, S_IRUGO); 49module_param(spi_up_head_align, int, 0444);
50MODULE_PARM_DESC(spi_up_head_align, "SPI uplink head alignment."); 50MODULE_PARM_DESC(spi_up_head_align, "SPI uplink head alignment.");
51 51
52module_param(spi_up_tail_align, int, S_IRUGO); 52module_param(spi_up_tail_align, int, 0444);
53MODULE_PARM_DESC(spi_up_tail_align, "SPI uplink tail alignment."); 53MODULE_PARM_DESC(spi_up_tail_align, "SPI uplink tail alignment.");
54 54
55module_param(spi_down_head_align, int, S_IRUGO); 55module_param(spi_down_head_align, int, 0444);
56MODULE_PARM_DESC(spi_down_head_align, "SPI downlink head alignment."); 56MODULE_PARM_DESC(spi_down_head_align, "SPI downlink head alignment.");
57 57
58module_param(spi_down_tail_align, int, S_IRUGO); 58module_param(spi_down_tail_align, int, 0444);
59MODULE_PARM_DESC(spi_down_tail_align, "SPI downlink tail alignment."); 59MODULE_PARM_DESC(spi_down_tail_align, "SPI downlink tail alignment.");
60 60
61#ifdef CONFIG_ARM 61#ifdef CONFIG_ARM
@@ -250,10 +250,10 @@ static const struct file_operations dbgfs_frame_fops = {
250static inline void dev_debugfs_add(struct cfspi *cfspi) 250static inline void dev_debugfs_add(struct cfspi *cfspi)
251{ 251{
252 cfspi->dbgfs_dir = debugfs_create_dir(cfspi->pdev->name, dbgfs_root); 252 cfspi->dbgfs_dir = debugfs_create_dir(cfspi->pdev->name, dbgfs_root);
253 cfspi->dbgfs_state = debugfs_create_file("state", S_IRUGO, 253 cfspi->dbgfs_state = debugfs_create_file("state", 0444,
254 cfspi->dbgfs_dir, cfspi, 254 cfspi->dbgfs_dir, cfspi,
255 &dbgfs_state_fops); 255 &dbgfs_state_fops);
256 cfspi->dbgfs_frame = debugfs_create_file("frame", S_IRUGO, 256 cfspi->dbgfs_frame = debugfs_create_file("frame", 0444,
257 cfspi->dbgfs_dir, cfspi, 257 cfspi->dbgfs_dir, cfspi,
258 &dbgfs_frame_fops); 258 &dbgfs_frame_fops);
259} 259}
diff --git a/drivers/net/caif/caif_virtio.c b/drivers/net/caif/caif_virtio.c
index c3d104feee13..2814e0dee4bb 100644
--- a/drivers/net/caif/caif_virtio.c
+++ b/drivers/net/caif/caif_virtio.c
@@ -629,21 +629,21 @@ static inline void debugfs_init(struct cfv_info *cfv)
629 if (IS_ERR(cfv->debugfs)) 629 if (IS_ERR(cfv->debugfs))
630 return; 630 return;
631 631
632 debugfs_create_u32("rx-napi-complete", S_IRUSR, cfv->debugfs, 632 debugfs_create_u32("rx-napi-complete", 0400, cfv->debugfs,
633 &cfv->stats.rx_napi_complete); 633 &cfv->stats.rx_napi_complete);
634 debugfs_create_u32("rx-napi-resched", S_IRUSR, cfv->debugfs, 634 debugfs_create_u32("rx-napi-resched", 0400, cfv->debugfs,
635 &cfv->stats.rx_napi_resched); 635 &cfv->stats.rx_napi_resched);
636 debugfs_create_u32("rx-nomem", S_IRUSR, cfv->debugfs, 636 debugfs_create_u32("rx-nomem", 0400, cfv->debugfs,
637 &cfv->stats.rx_nomem); 637 &cfv->stats.rx_nomem);
638 debugfs_create_u32("rx-kicks", S_IRUSR, cfv->debugfs, 638 debugfs_create_u32("rx-kicks", 0400, cfv->debugfs,
639 &cfv->stats.rx_kicks); 639 &cfv->stats.rx_kicks);
640 debugfs_create_u32("tx-full-ring", S_IRUSR, cfv->debugfs, 640 debugfs_create_u32("tx-full-ring", 0400, cfv->debugfs,
641 &cfv->stats.tx_full_ring); 641 &cfv->stats.tx_full_ring);
642 debugfs_create_u32("tx-no-mem", S_IRUSR, cfv->debugfs, 642 debugfs_create_u32("tx-no-mem", 0400, cfv->debugfs,
643 &cfv->stats.tx_no_mem); 643 &cfv->stats.tx_no_mem);
644 debugfs_create_u32("tx-kicks", S_IRUSR, cfv->debugfs, 644 debugfs_create_u32("tx-kicks", 0400, cfv->debugfs,
645 &cfv->stats.tx_kicks); 645 &cfv->stats.tx_kicks);
646 debugfs_create_u32("tx-flow-on", S_IRUSR, cfv->debugfs, 646 debugfs_create_u32("tx-flow-on", 0400, cfv->debugfs,
647 &cfv->stats.tx_flow_on); 647 &cfv->stats.tx_flow_on);
648} 648}
649 649
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index f37ce0e1b603..d98c69045b17 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -1224,8 +1224,7 @@ static ssize_t at91_sysfs_set_mb0_id(struct device *dev,
1224 return ret; 1224 return ret;
1225} 1225}
1226 1226
1227static DEVICE_ATTR(mb0_id, S_IWUSR | S_IRUGO, 1227static DEVICE_ATTR(mb0_id, 0644, at91_sysfs_show_mb0_id, at91_sysfs_set_mb0_id);
1228 at91_sysfs_show_mb0_id, at91_sysfs_set_mb0_id);
1229 1228
1230static struct attribute *at91_sysfs_attrs[] = { 1229static struct attribute *at91_sysfs_attrs[] = {
1231 &dev_attr_mb0_id.attr, 1230 &dev_attr_mb0_id.attr,
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c
index 6da69af103e6..d4dd4da23997 100644
--- a/drivers/net/can/cc770/cc770.c
+++ b/drivers/net/can/cc770/cc770.c
@@ -67,12 +67,12 @@ MODULE_DESCRIPTION(KBUILD_MODNAME "CAN netdevice driver");
67 * otherwise 11 bit SFF messages. 67 * otherwise 11 bit SFF messages.
68 */ 68 */
69static int msgobj15_eff; 69static int msgobj15_eff;
70module_param(msgobj15_eff, int, S_IRUGO); 70module_param(msgobj15_eff, int, 0444);
71MODULE_PARM_DESC(msgobj15_eff, "Extended 29-bit frames for message object 15 " 71MODULE_PARM_DESC(msgobj15_eff, "Extended 29-bit frames for message object 15 "
72 "(default: 11-bit standard frames)"); 72 "(default: 11-bit standard frames)");
73 73
74static int i82527_compat; 74static int i82527_compat;
75module_param(i82527_compat, int, S_IRUGO); 75module_param(i82527_compat, int, 0444);
76MODULE_PARM_DESC(i82527_compat, "Strict Intel 82527 comptibility mode " 76MODULE_PARM_DESC(i82527_compat, "Strict Intel 82527 comptibility mode "
77 "without using additional functions"); 77 "without using additional functions");
78 78
diff --git a/drivers/net/can/cc770/cc770_isa.c b/drivers/net/can/cc770/cc770_isa.c
index 3a30fd3b4498..fcd34698074f 100644
--- a/drivers/net/can/cc770/cc770_isa.c
+++ b/drivers/net/can/cc770/cc770_isa.c
@@ -82,29 +82,29 @@ static u8 cor[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
82static u8 bcr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff}; 82static u8 bcr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
83static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1}; 83static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
84 84
85module_param_hw_array(port, ulong, ioport, NULL, S_IRUGO); 85module_param_hw_array(port, ulong, ioport, NULL, 0444);
86MODULE_PARM_DESC(port, "I/O port number"); 86MODULE_PARM_DESC(port, "I/O port number");
87 87
88module_param_hw_array(mem, ulong, iomem, NULL, S_IRUGO); 88module_param_hw_array(mem, ulong, iomem, NULL, 0444);
89MODULE_PARM_DESC(mem, "I/O memory address"); 89MODULE_PARM_DESC(mem, "I/O memory address");
90 90
91module_param_hw_array(indirect, int, ioport, NULL, S_IRUGO); 91module_param_hw_array(indirect, int, ioport, NULL, 0444);
92MODULE_PARM_DESC(indirect, "Indirect access via address and data port"); 92MODULE_PARM_DESC(indirect, "Indirect access via address and data port");
93 93
94module_param_hw_array(irq, int, irq, NULL, S_IRUGO); 94module_param_hw_array(irq, int, irq, NULL, 0444);
95MODULE_PARM_DESC(irq, "IRQ number"); 95MODULE_PARM_DESC(irq, "IRQ number");
96 96
97module_param_array(clk, int, NULL, S_IRUGO); 97module_param_array(clk, int, NULL, 0444);
98MODULE_PARM_DESC(clk, "External oscillator clock frequency " 98MODULE_PARM_DESC(clk, "External oscillator clock frequency "
99 "(default=16000000 [16 MHz])"); 99 "(default=16000000 [16 MHz])");
100 100
101module_param_array(cir, byte, NULL, S_IRUGO); 101module_param_array(cir, byte, NULL, 0444);
102MODULE_PARM_DESC(cir, "CPU interface register (default=0x40 [DSC])"); 102MODULE_PARM_DESC(cir, "CPU interface register (default=0x40 [DSC])");
103 103
104module_param_array(cor, byte, NULL, S_IRUGO); 104module_param_array(cor, byte, NULL, 0444);
105MODULE_PARM_DESC(cor, "Clockout register (default=0x00)"); 105MODULE_PARM_DESC(cor, "Clockout register (default=0x00)");
106 106
107module_param_array(bcr, byte, NULL, S_IRUGO); 107module_param_array(bcr, byte, NULL, 0444);
108MODULE_PARM_DESC(bcr, "Bus configuration register (default=0x40 [CBY])"); 108MODULE_PARM_DESC(bcr, "Bus configuration register (default=0x40 [CBY])");
109 109
110#define CC770_IOSIZE 0x20 110#define CC770_IOSIZE 0x20
diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
index 897c6b113d3f..2d3046afa80d 100644
--- a/drivers/net/can/grcan.c
+++ b/drivers/net/can/grcan.c
@@ -1484,7 +1484,7 @@ static netdev_tx_t grcan_start_xmit(struct sk_buff *skb,
1484 } \ 1484 } \
1485 } \ 1485 } \
1486 module_param_named(name, grcan_module_config.name, \ 1486 module_param_named(name, grcan_module_config.name, \
1487 mtype, S_IRUGO); \ 1487 mtype, 0444); \
1488 MODULE_PARM_DESC(name, desc) 1488 MODULE_PARM_DESC(name, desc)
1489 1489
1490#define GRCAN_CONFIG_ATTR(name, desc) \ 1490#define GRCAN_CONFIG_ATTR(name, desc) \
@@ -1513,7 +1513,7 @@ static netdev_tx_t grcan_start_xmit(struct sk_buff *skb,
1513 struct grcan_priv *priv = netdev_priv(dev); \ 1513 struct grcan_priv *priv = netdev_priv(dev); \
1514 return sprintf(buf, "%d\n", priv->config.name); \ 1514 return sprintf(buf, "%d\n", priv->config.name); \
1515 } \ 1515 } \
1516 static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, \ 1516 static DEVICE_ATTR(name, 0644, \
1517 grcan_show_##name, \ 1517 grcan_show_##name, \
1518 grcan_store_##name); \ 1518 grcan_store_##name); \
1519 GRCAN_MODULE_PARAM(name, ushort, GRCAN_NOT_BOOL, desc) 1519 GRCAN_MODULE_PARAM(name, ushort, GRCAN_NOT_BOOL, desc)
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 12a53c8e8e1d..adfdb66a486e 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1865,9 +1865,9 @@ static ssize_t ican3_sysfs_show_fwinfo(struct device *dev,
1865 return scnprintf(buf, PAGE_SIZE, "%s\n", mod->fwinfo); 1865 return scnprintf(buf, PAGE_SIZE, "%s\n", mod->fwinfo);
1866} 1866}
1867 1867
1868static DEVICE_ATTR(termination, S_IWUSR | S_IRUGO, ican3_sysfs_show_term, 1868static DEVICE_ATTR(termination, 0644, ican3_sysfs_show_term,
1869 ican3_sysfs_set_term); 1869 ican3_sysfs_set_term);
1870static DEVICE_ATTR(fwinfo, S_IRUSR | S_IRUGO, ican3_sysfs_show_fwinfo, NULL); 1870static DEVICE_ATTR(fwinfo, 0444, ican3_sysfs_show_fwinfo, NULL);
1871 1871
1872static struct attribute *ican3_sysfs_attrs[] = { 1872static struct attribute *ican3_sysfs_attrs[] = {
1873 &dev_attr_termination.attr, 1873 &dev_attr_termination.attr,
diff --git a/drivers/net/can/sja1000/sja1000_isa.c b/drivers/net/can/sja1000/sja1000_isa.c
index a89c1e92554d..1a2ae6ce8d87 100644
--- a/drivers/net/can/sja1000/sja1000_isa.c
+++ b/drivers/net/can/sja1000/sja1000_isa.c
@@ -48,27 +48,27 @@ static unsigned char ocr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
48static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1}; 48static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
49static spinlock_t indirect_lock[MAXDEV]; /* lock for indirect access mode */ 49static spinlock_t indirect_lock[MAXDEV]; /* lock for indirect access mode */
50 50
51module_param_hw_array(port, ulong, ioport, NULL, S_IRUGO); 51module_param_hw_array(port, ulong, ioport, NULL, 0444);
52MODULE_PARM_DESC(port, "I/O port number"); 52MODULE_PARM_DESC(port, "I/O port number");
53 53
54module_param_hw_array(mem, ulong, iomem, NULL, S_IRUGO); 54module_param_hw_array(mem, ulong, iomem, NULL, 0444);
55MODULE_PARM_DESC(mem, "I/O memory address"); 55MODULE_PARM_DESC(mem, "I/O memory address");
56 56
57module_param_hw_array(indirect, int, ioport, NULL, S_IRUGO); 57module_param_hw_array(indirect, int, ioport, NULL, 0444);
58MODULE_PARM_DESC(indirect, "Indirect access via address and data port"); 58MODULE_PARM_DESC(indirect, "Indirect access via address and data port");
59 59
60module_param_hw_array(irq, int, irq, NULL, S_IRUGO); 60module_param_hw_array(irq, int, irq, NULL, 0444);
61MODULE_PARM_DESC(irq, "IRQ number"); 61MODULE_PARM_DESC(irq, "IRQ number");
62 62
63module_param_array(clk, int, NULL, S_IRUGO); 63module_param_array(clk, int, NULL, 0444);
64MODULE_PARM_DESC(clk, "External oscillator clock frequency " 64MODULE_PARM_DESC(clk, "External oscillator clock frequency "
65 "(default=16000000 [16 MHz])"); 65 "(default=16000000 [16 MHz])");
66 66
67module_param_array(cdr, byte, NULL, S_IRUGO); 67module_param_array(cdr, byte, NULL, 0444);
68MODULE_PARM_DESC(cdr, "Clock divider register " 68MODULE_PARM_DESC(cdr, "Clock divider register "
69 "(default=0x48 [CDR_CBP | CDR_CLK_OFF])"); 69 "(default=0x48 [CDR_CBP | CDR_CLK_OFF])");
70 70
71module_param_array(ocr, byte, NULL, S_IRUGO); 71module_param_array(ocr, byte, NULL, 0444);
72MODULE_PARM_DESC(ocr, "Output control register " 72MODULE_PARM_DESC(ocr, "Output control register "
73 "(default=0x18 [OCR_TX0_PUSHPULL])"); 73 "(default=0x18 [OCR_TX0_PUSHPULL])");
74 74
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 5f64deec9f6c..e22696190583 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -601,8 +601,8 @@ static ssize_t store_output(struct device *dev, struct device_attribute *attr,
601 return count; 601 return count;
602} 602}
603 603
604static const DEVICE_ATTR(chip, S_IRUGO, show_chip, NULL); 604static const DEVICE_ATTR(chip, 0444, show_chip, NULL);
605static const DEVICE_ATTR(output, S_IRUGO | S_IWUSR, show_output, store_output); 605static const DEVICE_ATTR(output, 0644, show_output, store_output);
606 606
607static const struct attribute *const netdev_sysfs_attrs[] = { 607static const struct attribute *const netdev_sysfs_attrs[] = {
608 &dev_attr_chip.attr, 608 &dev_attr_chip.attr,
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c
index 98d118b3aaf4..e90817608645 100644
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -220,7 +220,7 @@
220#define DEVICE_NAME "mcp251x" 220#define DEVICE_NAME "mcp251x"
221 221
222static int mcp251x_enable_dma; /* Enable SPI DMA. Default: 0 (Off) */ 222static int mcp251x_enable_dma; /* Enable SPI DMA. Default: 0 (Off) */
223module_param(mcp251x_enable_dma, int, S_IRUGO); 223module_param(mcp251x_enable_dma, int, 0444);
224MODULE_PARM_DESC(mcp251x_enable_dma, "Enable SPI DMA. Default: 0 (Off)"); 224MODULE_PARM_DESC(mcp251x_enable_dma, "Enable SPI DMA. Default: 0 (Off)");
225 225
226static const struct can_bittiming_const mcp251x_bittiming_const = { 226static const struct can_bittiming_const mcp251x_bittiming_const = {
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index c6dcf93675c0..5820fd5b69b5 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -496,7 +496,7 @@ static ssize_t show_firmware(struct device *d,
496 (dev->version >> 8) & 0xf, 496 (dev->version >> 8) & 0xf,
497 dev->version & 0xff); 497 dev->version & 0xff);
498} 498}
499static DEVICE_ATTR(firmware, S_IRUGO, show_firmware, NULL); 499static DEVICE_ATTR(firmware, 0444, show_firmware, NULL);
500 500
501static ssize_t show_hardware(struct device *d, 501static ssize_t show_hardware(struct device *d,
502 struct device_attribute *attr, char *buf) 502 struct device_attribute *attr, char *buf)
@@ -509,7 +509,7 @@ static ssize_t show_hardware(struct device *d,
509 (dev->version >> 24) & 0xf, 509 (dev->version >> 24) & 0xf,
510 (dev->version >> 16) & 0xff); 510 (dev->version >> 16) & 0xff);
511} 511}
512static DEVICE_ATTR(hardware, S_IRUGO, show_hardware, NULL); 512static DEVICE_ATTR(hardware, 0444, show_hardware, NULL);
513 513
514static ssize_t show_nets(struct device *d, 514static ssize_t show_nets(struct device *d,
515 struct device_attribute *attr, char *buf) 515 struct device_attribute *attr, char *buf)
@@ -519,7 +519,7 @@ static ssize_t show_nets(struct device *d,
519 519
520 return sprintf(buf, "%d", dev->net_count); 520 return sprintf(buf, "%d", dev->net_count);
521} 521}
522static DEVICE_ATTR(nets, S_IRUGO, show_nets, NULL); 522static DEVICE_ATTR(nets, 0444, show_nets, NULL);
523 523
524static int esd_usb2_send_msg(struct esd_usb2 *dev, struct esd_usb2_msg *msg) 524static int esd_usb2_send_msg(struct esd_usb2 *dev, struct esd_usb2_msg *msg)
525{ 525{
diff --git a/drivers/net/can/vcan.c b/drivers/net/can/vcan.c
index c2b04f505e16..d200a5b0651c 100644
--- a/drivers/net/can/vcan.c
+++ b/drivers/net/can/vcan.c
@@ -65,7 +65,7 @@ MODULE_ALIAS_RTNL_LINK(DRV_NAME);
65 */ 65 */
66 66
67static bool echo; /* echo testing. Default: 0 (Off) */ 67static bool echo; /* echo testing. Default: 0 (Off) */
68module_param(echo, bool, S_IRUGO); 68module_param(echo, bool, 0444);
69MODULE_PARM_DESC(echo, "Echo sent frames (for testing). Default: 0 (Off)"); 69MODULE_PARM_DESC(echo, "Echo sent frames (for testing). Default: 0 (Off)");
70 70
71 71
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 78a6414c5fd9..dfabbae72efd 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -590,8 +590,7 @@ static int bpq_device_event(struct notifier_block *this,
590static int __init bpq_init_driver(void) 590static int __init bpq_init_driver(void)
591{ 591{
592#ifdef CONFIG_PROC_FS 592#ifdef CONFIG_PROC_FS
593 if (!proc_create("bpqether", S_IRUGO, init_net.proc_net, 593 if (!proc_create("bpqether", 0444, init_net.proc_net, &bpq_info_fops)) {
594 &bpq_info_fops)) {
595 printk(KERN_ERR 594 printk(KERN_ERR
596 "bpq: cannot create /proc/net/bpqether entry.\n"); 595 "bpq: cannot create /proc/net/bpqether entry.\n");
597 return -ENOENT; 596 return -ENOENT;
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 14c3632b8cde..83034eb7ed4f 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -1168,7 +1168,7 @@ static int __init yam_init_driver(void)
1168 yam_timer.expires = jiffies + HZ / 100; 1168 yam_timer.expires = jiffies + HZ / 100;
1169 add_timer(&yam_timer); 1169 add_timer(&yam_timer);
1170 1170
1171 proc_create("yam", S_IRUGO, init_net.proc_net, &yam_info_fops); 1171 proc_create("yam", 0444, init_net.proc_net, &yam_info_fops);
1172 return 0; 1172 return 0;
1173 error: 1173 error:
1174 while (--i >= 0) { 1174 while (--i >= 0) {
diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
index 5d716750ae22..ecc84954c511 100644
--- a/drivers/net/hyperv/netvsc_drv.c
+++ b/drivers/net/hyperv/netvsc_drv.c
@@ -55,7 +55,7 @@
55#define VF_TAKEOVER_INT (HZ / 10) 55#define VF_TAKEOVER_INT (HZ / 10)
56 56
57static unsigned int ring_size __ro_after_init = 128; 57static unsigned int ring_size __ro_after_init = 128;
58module_param(ring_size, uint, S_IRUGO); 58module_param(ring_size, uint, 0444);
59MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)"); 59MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
60unsigned int netvsc_ring_bytes __ro_after_init; 60unsigned int netvsc_ring_bytes __ro_after_init;
61struct reciprocal_value netvsc_ring_reciprocal __ro_after_init; 61struct reciprocal_value netvsc_ring_reciprocal __ro_after_init;
@@ -66,7 +66,7 @@ static const u32 default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
66 NETIF_MSG_TX_ERR; 66 NETIF_MSG_TX_ERR;
67 67
68static int debug = -1; 68static int debug = -1;
69module_param(debug, int, S_IRUGO); 69module_param(debug, int, 0444);
70MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); 70MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
71 71
72static void netvsc_change_rx_flags(struct net_device *net, int change) 72static void netvsc_change_rx_flags(struct net_device *net, int change)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 548d9d026a85..77abedf0b524 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1661,7 +1661,7 @@ static int at86rf230_debugfs_init(struct at86rf230_local *lp)
1661 if (!at86rf230_debugfs_root) 1661 if (!at86rf230_debugfs_root)
1662 return -ENOMEM; 1662 return -ENOMEM;
1663 1663
1664 stats = debugfs_create_file("trac_stats", S_IRUGO, 1664 stats = debugfs_create_file("trac_stats", 0444,
1665 at86rf230_debugfs_root, lp, 1665 at86rf230_debugfs_root, lp,
1666 &at86rf230_stats_fops); 1666 &at86rf230_stats_fops);
1667 if (!stats) 1667 if (!stats)
diff --git a/drivers/net/phy/spi_ks8995.c b/drivers/net/phy/spi_ks8995.c
index 1e2d4f1179da..f17b3441779b 100644
--- a/drivers/net/phy/spi_ks8995.c
+++ b/drivers/net/phy/spi_ks8995.c
@@ -417,7 +417,7 @@ static void ks8995_parse_dt(struct ks8995_switch *ks)
417static const struct bin_attribute ks8995_registers_attr = { 417static const struct bin_attribute ks8995_registers_attr = {
418 .attr = { 418 .attr = {
419 .name = "registers", 419 .name = "registers",
420 .mode = S_IRUSR | S_IWUSR, 420 .mode = 0600,
421 }, 421 },
422 .size = KS8995_REGS_SIZE, 422 .size = KS8995_REGS_SIZE,
423 .read = ks8995_registers_read, 423 .read = ks8995_registers_read,
diff --git a/drivers/net/ppp/ppp_generic.c b/drivers/net/ppp/ppp_generic.c
index 926c2c322d43..22fcff3c7a9a 100644
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -1687,7 +1687,7 @@ ppp_push(struct ppp *ppp)
1687 1687
1688#ifdef CONFIG_PPP_MULTILINK 1688#ifdef CONFIG_PPP_MULTILINK
1689static bool mp_protocol_compress __read_mostly = true; 1689static bool mp_protocol_compress __read_mostly = true;
1690module_param(mp_protocol_compress, bool, S_IRUGO | S_IWUSR); 1690module_param(mp_protocol_compress, bool, 0644);
1691MODULE_PARM_DESC(mp_protocol_compress, 1691MODULE_PARM_DESC(mp_protocol_compress,
1692 "compress protocol id in multilink fragments"); 1692 "compress protocol id in multilink fragments");
1693 1693
diff --git a/drivers/net/ppp/pppoe.c b/drivers/net/ppp/pppoe.c
index c10e6181a2f0..f9552a400271 100644
--- a/drivers/net/ppp/pppoe.c
+++ b/drivers/net/ppp/pppoe.c
@@ -1142,7 +1142,7 @@ static __net_init int pppoe_init_net(struct net *net)
1142 1142
1143 rwlock_init(&pn->hash_lock); 1143 rwlock_init(&pn->hash_lock);
1144 1144
1145 pde = proc_create("pppoe", S_IRUGO, net->proc_net, &pppoe_seq_fops); 1145 pde = proc_create("pppoe", 0444, net->proc_net, &pppoe_seq_fops);
1146#ifdef CONFIG_PROC_FS 1146#ifdef CONFIG_PROC_FS
1147 if (!pde) 1147 if (!pde)
1148 return -ENOMEM; 1148 return -ENOMEM;
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 9e1b74590682..90d07ed224d5 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -58,7 +58,7 @@ static bool prefer_mbim = true;
58#else 58#else
59static bool prefer_mbim; 59static bool prefer_mbim;
60#endif 60#endif
61module_param(prefer_mbim, bool, S_IRUGO | S_IWUSR); 61module_param(prefer_mbim, bool, 0644);
62MODULE_PARM_DESC(prefer_mbim, "Prefer MBIM setting on dual NCM/MBIM functions"); 62MODULE_PARM_DESC(prefer_mbim, "Prefer MBIM setting on dual NCM/MBIM functions");
63 63
64static void cdc_ncm_txpath_bh(unsigned long param); 64static void cdc_ncm_txpath_bh(unsigned long param);
@@ -281,10 +281,10 @@ static ssize_t cdc_ncm_store_tx_timer_usecs(struct device *d, struct device_att
281 return len; 281 return len;
282} 282}
283 283
284static DEVICE_ATTR(min_tx_pkt, S_IRUGO | S_IWUSR, cdc_ncm_show_min_tx_pkt, cdc_ncm_store_min_tx_pkt); 284static DEVICE_ATTR(min_tx_pkt, 0644, cdc_ncm_show_min_tx_pkt, cdc_ncm_store_min_tx_pkt);
285static DEVICE_ATTR(rx_max, S_IRUGO | S_IWUSR, cdc_ncm_show_rx_max, cdc_ncm_store_rx_max); 285static DEVICE_ATTR(rx_max, 0644, cdc_ncm_show_rx_max, cdc_ncm_store_rx_max);
286static DEVICE_ATTR(tx_max, S_IRUGO | S_IWUSR, cdc_ncm_show_tx_max, cdc_ncm_store_tx_max); 286static DEVICE_ATTR(tx_max, 0644, cdc_ncm_show_tx_max, cdc_ncm_store_tx_max);
287static DEVICE_ATTR(tx_timer_usecs, S_IRUGO | S_IWUSR, cdc_ncm_show_tx_timer_usecs, cdc_ncm_store_tx_timer_usecs); 287static DEVICE_ATTR(tx_timer_usecs, 0644, cdc_ncm_show_tx_timer_usecs, cdc_ncm_store_tx_timer_usecs);
288 288
289static ssize_t ndp_to_end_show(struct device *d, struct device_attribute *attr, char *buf) 289static ssize_t ndp_to_end_show(struct device *d, struct device_attribute *attr, char *buf)
290{ 290{
@@ -335,7 +335,7 @@ static ssize_t cdc_ncm_show_##name(struct device *d, struct device_attribute *at
335 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; \ 335 struct cdc_ncm_ctx *ctx = (struct cdc_ncm_ctx *)dev->data[0]; \
336 return sprintf(buf, format "\n", tocpu(ctx->ncm_parm.name)); \ 336 return sprintf(buf, format "\n", tocpu(ctx->ncm_parm.name)); \
337} \ 337} \
338static DEVICE_ATTR(name, S_IRUGO, cdc_ncm_show_##name, NULL) 338static DEVICE_ATTR(name, 0444, cdc_ncm_show_##name, NULL)
339 339
340NCM_PARM_ATTR(bmNtbFormatsSupported, "0x%04x", le16_to_cpu); 340NCM_PARM_ATTR(bmNtbFormatsSupported, "0x%04x", le16_to_cpu);
341NCM_PARM_ATTR(dwNtbInMaxSize, "%u", le32_to_cpu); 341NCM_PARM_ATTR(dwNtbInMaxSize, "%u", le32_to_cpu);
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c
index 981c931a7a1f..e53883ad6107 100644
--- a/drivers/net/usb/hso.c
+++ b/drivers/net/usb/hso.c
@@ -519,7 +519,7 @@ static ssize_t hso_sysfs_show_porttype(struct device *dev,
519 519
520 return sprintf(buf, "%s\n", port_name); 520 return sprintf(buf, "%s\n", port_name);
521} 521}
522static DEVICE_ATTR(hsotype, S_IRUGO, hso_sysfs_show_porttype, NULL); 522static DEVICE_ATTR(hsotype, 0444, hso_sysfs_show_porttype, NULL);
523 523
524static struct attribute *hso_serial_dev_attrs[] = { 524static struct attribute *hso_serial_dev_attrs[] = {
525 &dev_attr_hsotype.attr, 525 &dev_attr_hsotype.attr,
@@ -3289,12 +3289,12 @@ MODULE_LICENSE("GPL");
3289 3289
3290/* change the debug level (eg: insmod hso.ko debug=0x04) */ 3290/* change the debug level (eg: insmod hso.ko debug=0x04) */
3291MODULE_PARM_DESC(debug, "debug level mask [0x01 | 0x02 | 0x04 | 0x08 | 0x10]"); 3291MODULE_PARM_DESC(debug, "debug level mask [0x01 | 0x02 | 0x04 | 0x08 | 0x10]");
3292module_param(debug, int, S_IRUGO | S_IWUSR); 3292module_param(debug, int, 0644);
3293 3293
3294/* set the major tty number (eg: insmod hso.ko tty_major=245) */ 3294/* set the major tty number (eg: insmod hso.ko tty_major=245) */
3295MODULE_PARM_DESC(tty_major, "Set the major tty number"); 3295MODULE_PARM_DESC(tty_major, "Set the major tty number");
3296module_param(tty_major, int, S_IRUGO | S_IWUSR); 3296module_param(tty_major, int, 0644);
3297 3297
3298/* disable network interface (eg: insmod hso.ko disable_net=1) */ 3298/* disable network interface (eg: insmod hso.ko disable_net=1) */
3299MODULE_PARM_DESC(disable_net, "Disable the network interface"); 3299MODULE_PARM_DESC(disable_net, "Disable the network interface");
3300module_param(disable_net, int, S_IRUGO | S_IWUSR); 3300module_param(disable_net, int, 0644);
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index a56d3eab35dd..e1aef253601e 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -224,7 +224,7 @@ static void xenvif_debugfs_addif(struct xenvif *vif)
224 224
225 snprintf(filename, sizeof(filename), "io_ring_q%d", i); 225 snprintf(filename, sizeof(filename), "io_ring_q%d", i);
226 pfile = debugfs_create_file(filename, 226 pfile = debugfs_create_file(filename,
227 S_IRUSR | S_IWUSR, 227 0600,
228 vif->xenvif_dbg_root, 228 vif->xenvif_dbg_root,
229 &vif->queues[i], 229 &vif->queues[i],
230 &xenvif_dbg_io_ring_ops_fops); 230 &xenvif_dbg_io_ring_ops_fops);
@@ -235,7 +235,7 @@ static void xenvif_debugfs_addif(struct xenvif *vif)
235 235
236 if (vif->ctrl_irq) { 236 if (vif->ctrl_irq) {
237 pfile = debugfs_create_file("ctrl", 237 pfile = debugfs_create_file("ctrl",
238 S_IRUSR, 238 0400,
239 vif->xenvif_dbg_root, 239 vif->xenvif_dbg_root,
240 vif, 240 vif,
241 &xenvif_dbg_ctrl_ops_fops); 241 &xenvif_dbg_ctrl_ops_fops);
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3127bc8633ca..4dd0668003e7 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -2113,9 +2113,9 @@ static ssize_t store_rxbuf(struct device *dev,
2113 return len; 2113 return len;
2114} 2114}
2115 2115
2116static DEVICE_ATTR(rxbuf_min, S_IRUGO|S_IWUSR, show_rxbuf, store_rxbuf); 2116static DEVICE_ATTR(rxbuf_min, 0644, show_rxbuf, store_rxbuf);
2117static DEVICE_ATTR(rxbuf_max, S_IRUGO|S_IWUSR, show_rxbuf, store_rxbuf); 2117static DEVICE_ATTR(rxbuf_max, 0644, show_rxbuf, store_rxbuf);
2118static DEVICE_ATTR(rxbuf_cur, S_IRUGO, show_rxbuf, NULL); 2118static DEVICE_ATTR(rxbuf_cur, 0444, show_rxbuf, NULL);
2119 2119
2120static struct attribute *xennet_dev_attrs[] = { 2120static struct attribute *xennet_dev_attrs[] = {
2121 &dev_attr_rxbuf_min.attr, 2121 &dev_attr_rxbuf_min.attr,