diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2008-01-18 15:32:24 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-01-25 06:52:52 -0500 |
commit | 720c9133ff108998c5fb910d165146de5bc4705a (patch) | |
tree | 9ad5c4376d7b360bdf0245180cf370b6205067b5 /arch | |
parent | d0e5c2185e1c6508894e1ee1a8e9bf79e009e427 (diff) |
[POWERPC] PS3: Checkpatch cleanups for arch/powerpc/platforms/ps3/repository.c
Cleanup coding errors in arch/powerpc/platforms/ps3/repository.c as
reported by sparse and checkpatch.
Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/ps3/repository.c | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c index d66902a632ff..cded41eab10f 100644 --- a/arch/powerpc/platforms/ps3/repository.c +++ b/arch/powerpc/platforms/ps3/repository.c | |||
@@ -33,7 +33,7 @@ enum ps3_lpar_id { | |||
33 | }; | 33 | }; |
34 | 34 | ||
35 | #define dump_field(_a, _b) _dump_field(_a, _b, __func__, __LINE__) | 35 | #define dump_field(_a, _b) _dump_field(_a, _b, __func__, __LINE__) |
36 | static void _dump_field(const char *hdr, u64 n, const char* func, int line) | 36 | static void _dump_field(const char *hdr, u64 n, const char *func, int line) |
37 | { | 37 | { |
38 | #if defined(DEBUG) | 38 | #if defined(DEBUG) |
39 | char s[16]; | 39 | char s[16]; |
@@ -50,8 +50,8 @@ static void _dump_field(const char *hdr, u64 n, const char* func, int line) | |||
50 | 50 | ||
51 | #define dump_node_name(_a, _b, _c, _d, _e) \ | 51 | #define dump_node_name(_a, _b, _c, _d, _e) \ |
52 | _dump_node_name(_a, _b, _c, _d, _e, __func__, __LINE__) | 52 | _dump_node_name(_a, _b, _c, _d, _e, __func__, __LINE__) |
53 | static void _dump_node_name (unsigned int lpar_id, u64 n1, u64 n2, u64 n3, | 53 | static void _dump_node_name(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, |
54 | u64 n4, const char* func, int line) | 54 | u64 n4, const char *func, int line) |
55 | { | 55 | { |
56 | pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id); | 56 | pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id); |
57 | _dump_field("n1: ", n1, func, line); | 57 | _dump_field("n1: ", n1, func, line); |
@@ -63,7 +63,7 @@ static void _dump_node_name (unsigned int lpar_id, u64 n1, u64 n2, u64 n3, | |||
63 | #define dump_node(_a, _b, _c, _d, _e, _f, _g) \ | 63 | #define dump_node(_a, _b, _c, _d, _e, _f, _g) \ |
64 | _dump_node(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__) | 64 | _dump_node(_a, _b, _c, _d, _e, _f, _g, __func__, __LINE__) |
65 | static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4, | 65 | static void _dump_node(unsigned int lpar_id, u64 n1, u64 n2, u64 n3, u64 n4, |
66 | u64 v1, u64 v2, const char* func, int line) | 66 | u64 v1, u64 v2, const char *func, int line) |
67 | { | 67 | { |
68 | pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id); | 68 | pr_debug("%s:%d: lpar: %u\n", func, line, lpar_id); |
69 | _dump_field("n1: ", n1, func, line); | 69 | _dump_field("n1: ", n1, func, line); |
@@ -165,7 +165,7 @@ int ps3_repository_read_bus_str(unsigned int bus_index, const char *bus_str, | |||
165 | make_first_field("bus", bus_index), | 165 | make_first_field("bus", bus_index), |
166 | make_field(bus_str, 0), | 166 | make_field(bus_str, 0), |
167 | 0, 0, | 167 | 0, 0, |
168 | value, 0); | 168 | value, NULL); |
169 | } | 169 | } |
170 | 170 | ||
171 | int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id) | 171 | int ps3_repository_read_bus_id(unsigned int bus_index, u64 *bus_id) |
@@ -190,7 +190,7 @@ int ps3_repository_read_bus_type(unsigned int bus_index, | |||
190 | make_first_field("bus", bus_index), | 190 | make_first_field("bus", bus_index), |
191 | make_field("type", 0), | 191 | make_field("type", 0), |
192 | 0, 0, | 192 | 0, 0, |
193 | &v1, 0); | 193 | &v1, NULL); |
194 | *bus_type = v1; | 194 | *bus_type = v1; |
195 | return result; | 195 | return result; |
196 | } | 196 | } |
@@ -205,7 +205,7 @@ int ps3_repository_read_bus_num_dev(unsigned int bus_index, | |||
205 | make_first_field("bus", bus_index), | 205 | make_first_field("bus", bus_index), |
206 | make_field("num_dev", 0), | 206 | make_field("num_dev", 0), |
207 | 0, 0, | 207 | 0, 0, |
208 | &v1, 0); | 208 | &v1, NULL); |
209 | *num_dev = v1; | 209 | *num_dev = v1; |
210 | return result; | 210 | return result; |
211 | } | 211 | } |
@@ -218,7 +218,7 @@ int ps3_repository_read_dev_str(unsigned int bus_index, | |||
218 | make_field("dev", dev_index), | 218 | make_field("dev", dev_index), |
219 | make_field(dev_str, 0), | 219 | make_field(dev_str, 0), |
220 | 0, | 220 | 0, |
221 | value, 0); | 221 | value, NULL); |
222 | } | 222 | } |
223 | 223 | ||
224 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, | 224 | int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, |
@@ -231,7 +231,7 @@ int ps3_repository_read_dev_id(unsigned int bus_index, unsigned int dev_index, | |||
231 | make_field("dev", dev_index), | 231 | make_field("dev", dev_index), |
232 | make_field("id", 0), | 232 | make_field("id", 0), |
233 | 0, | 233 | 0, |
234 | dev_id, 0); | 234 | dev_id, NULL); |
235 | return result; | 235 | return result; |
236 | } | 236 | } |
237 | 237 | ||
@@ -246,14 +246,14 @@ int ps3_repository_read_dev_type(unsigned int bus_index, | |||
246 | make_field("dev", dev_index), | 246 | make_field("dev", dev_index), |
247 | make_field("type", 0), | 247 | make_field("type", 0), |
248 | 0, | 248 | 0, |
249 | &v1, 0); | 249 | &v1, NULL); |
250 | *dev_type = v1; | 250 | *dev_type = v1; |
251 | return result; | 251 | return result; |
252 | } | 252 | } |
253 | 253 | ||
254 | int ps3_repository_read_dev_intr(unsigned int bus_index, | 254 | int ps3_repository_read_dev_intr(unsigned int bus_index, |
255 | unsigned int dev_index, unsigned int intr_index, | 255 | unsigned int dev_index, unsigned int intr_index, |
256 | enum ps3_interrupt_type *intr_type, unsigned int* interrupt_id) | 256 | enum ps3_interrupt_type *intr_type, unsigned int *interrupt_id) |
257 | { | 257 | { |
258 | int result; | 258 | int result; |
259 | u64 v1; | 259 | u64 v1; |
@@ -282,7 +282,7 @@ int ps3_repository_read_dev_reg_type(unsigned int bus_index, | |||
282 | make_field("dev", dev_index), | 282 | make_field("dev", dev_index), |
283 | make_field("reg", reg_index), | 283 | make_field("reg", reg_index), |
284 | make_field("type", 0), | 284 | make_field("type", 0), |
285 | &v1, 0); | 285 | &v1, NULL); |
286 | *reg_type = v1; | 286 | *reg_type = v1; |
287 | return result; | 287 | return result; |
288 | } | 288 | } |
@@ -588,7 +588,7 @@ int ps3_repository_read_stor_dev_port(unsigned int bus_index, | |||
588 | make_first_field("bus", bus_index), | 588 | make_first_field("bus", bus_index), |
589 | make_field("dev", dev_index), | 589 | make_field("dev", dev_index), |
590 | make_field("port", 0), | 590 | make_field("port", 0), |
591 | 0, port, 0); | 591 | 0, port, NULL); |
592 | } | 592 | } |
593 | 593 | ||
594 | int ps3_repository_read_stor_dev_blk_size(unsigned int bus_index, | 594 | int ps3_repository_read_stor_dev_blk_size(unsigned int bus_index, |
@@ -598,7 +598,7 @@ int ps3_repository_read_stor_dev_blk_size(unsigned int bus_index, | |||
598 | make_first_field("bus", bus_index), | 598 | make_first_field("bus", bus_index), |
599 | make_field("dev", dev_index), | 599 | make_field("dev", dev_index), |
600 | make_field("blk_size", 0), | 600 | make_field("blk_size", 0), |
601 | 0, blk_size, 0); | 601 | 0, blk_size, NULL); |
602 | } | 602 | } |
603 | 603 | ||
604 | int ps3_repository_read_stor_dev_num_blocks(unsigned int bus_index, | 604 | int ps3_repository_read_stor_dev_num_blocks(unsigned int bus_index, |
@@ -608,7 +608,7 @@ int ps3_repository_read_stor_dev_num_blocks(unsigned int bus_index, | |||
608 | make_first_field("bus", bus_index), | 608 | make_first_field("bus", bus_index), |
609 | make_field("dev", dev_index), | 609 | make_field("dev", dev_index), |
610 | make_field("n_blocks", 0), | 610 | make_field("n_blocks", 0), |
611 | 0, num_blocks, 0); | 611 | 0, num_blocks, NULL); |
612 | } | 612 | } |
613 | 613 | ||
614 | int ps3_repository_read_stor_dev_num_regions(unsigned int bus_index, | 614 | int ps3_repository_read_stor_dev_num_regions(unsigned int bus_index, |
@@ -621,7 +621,7 @@ int ps3_repository_read_stor_dev_num_regions(unsigned int bus_index, | |||
621 | make_first_field("bus", bus_index), | 621 | make_first_field("bus", bus_index), |
622 | make_field("dev", dev_index), | 622 | make_field("dev", dev_index), |
623 | make_field("n_regs", 0), | 623 | make_field("n_regs", 0), |
624 | 0, &v1, 0); | 624 | 0, &v1, NULL); |
625 | *num_regions = v1; | 625 | *num_regions = v1; |
626 | return result; | 626 | return result; |
627 | } | 627 | } |
@@ -638,7 +638,7 @@ int ps3_repository_read_stor_dev_region_id(unsigned int bus_index, | |||
638 | make_field("dev", dev_index), | 638 | make_field("dev", dev_index), |
639 | make_field("region", region_index), | 639 | make_field("region", region_index), |
640 | make_field("id", 0), | 640 | make_field("id", 0), |
641 | &v1, 0); | 641 | &v1, NULL); |
642 | *region_id = v1; | 642 | *region_id = v1; |
643 | return result; | 643 | return result; |
644 | } | 644 | } |
@@ -651,7 +651,7 @@ int ps3_repository_read_stor_dev_region_size(unsigned int bus_index, | |||
651 | make_field("dev", dev_index), | 651 | make_field("dev", dev_index), |
652 | make_field("region", region_index), | 652 | make_field("region", region_index), |
653 | make_field("size", 0), | 653 | make_field("size", 0), |
654 | region_size, 0); | 654 | region_size, NULL); |
655 | } | 655 | } |
656 | 656 | ||
657 | int ps3_repository_read_stor_dev_region_start(unsigned int bus_index, | 657 | int ps3_repository_read_stor_dev_region_start(unsigned int bus_index, |
@@ -662,7 +662,7 @@ int ps3_repository_read_stor_dev_region_start(unsigned int bus_index, | |||
662 | make_field("dev", dev_index), | 662 | make_field("dev", dev_index), |
663 | make_field("region", region_index), | 663 | make_field("region", region_index), |
664 | make_field("start", 0), | 664 | make_field("start", 0), |
665 | region_start, 0); | 665 | region_start, NULL); |
666 | } | 666 | } |
667 | 667 | ||
668 | int ps3_repository_read_stor_dev_info(unsigned int bus_index, | 668 | int ps3_repository_read_stor_dev_info(unsigned int bus_index, |
@@ -718,7 +718,7 @@ int ps3_repository_read_rm_size(unsigned int ppe_id, u64 *rm_size) | |||
718 | make_field("pu", 0), | 718 | make_field("pu", 0), |
719 | ppe_id, | 719 | ppe_id, |
720 | make_field("rm_size", 0), | 720 | make_field("rm_size", 0), |
721 | rm_size, 0); | 721 | rm_size, NULL); |
722 | } | 722 | } |
723 | 723 | ||
724 | int ps3_repository_read_region_total(u64 *region_total) | 724 | int ps3_repository_read_region_total(u64 *region_total) |
@@ -727,7 +727,7 @@ int ps3_repository_read_region_total(u64 *region_total) | |||
727 | make_first_field("bi", 0), | 727 | make_first_field("bi", 0), |
728 | make_field("rgntotal", 0), | 728 | make_field("rgntotal", 0), |
729 | 0, 0, | 729 | 0, 0, |
730 | region_total, 0); | 730 | region_total, NULL); |
731 | } | 731 | } |
732 | 732 | ||
733 | /** | 733 | /** |
@@ -763,7 +763,7 @@ int ps3_repository_read_num_spu_reserved(unsigned int *num_spu_reserved) | |||
763 | make_first_field("bi", 0), | 763 | make_first_field("bi", 0), |
764 | make_field("spun", 0), | 764 | make_field("spun", 0), |
765 | 0, 0, | 765 | 0, 0, |
766 | &v1, 0); | 766 | &v1, NULL); |
767 | *num_spu_reserved = v1; | 767 | *num_spu_reserved = v1; |
768 | return result; | 768 | return result; |
769 | } | 769 | } |
@@ -782,7 +782,7 @@ int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id) | |||
782 | make_first_field("bi", 0), | 782 | make_first_field("bi", 0), |
783 | make_field("spursvn", 0), | 783 | make_field("spursvn", 0), |
784 | 0, 0, | 784 | 0, 0, |
785 | &v1, 0); | 785 | &v1, NULL); |
786 | *num_resource_id = v1; | 786 | *num_resource_id = v1; |
787 | return result; | 787 | return result; |
788 | } | 788 | } |
@@ -795,7 +795,7 @@ int ps3_repository_read_num_spu_resource_id(unsigned int *num_resource_id) | |||
795 | */ | 795 | */ |
796 | 796 | ||
797 | int ps3_repository_read_spu_resource_id(unsigned int res_index, | 797 | int ps3_repository_read_spu_resource_id(unsigned int res_index, |
798 | enum ps3_spu_resource_type* resource_type, unsigned int *resource_id) | 798 | enum ps3_spu_resource_type *resource_type, unsigned int *resource_id) |
799 | { | 799 | { |
800 | int result; | 800 | int result; |
801 | u64 v1; | 801 | u64 v1; |
@@ -812,14 +812,14 @@ int ps3_repository_read_spu_resource_id(unsigned int res_index, | |||
812 | return result; | 812 | return result; |
813 | } | 813 | } |
814 | 814 | ||
815 | int ps3_repository_read_boot_dat_address(u64 *address) | 815 | static int ps3_repository_read_boot_dat_address(u64 *address) |
816 | { | 816 | { |
817 | return read_node(PS3_LPAR_ID_CURRENT, | 817 | return read_node(PS3_LPAR_ID_CURRENT, |
818 | make_first_field("bi", 0), | 818 | make_first_field("bi", 0), |
819 | make_field("boot_dat", 0), | 819 | make_field("boot_dat", 0), |
820 | make_field("address", 0), | 820 | make_field("address", 0), |
821 | 0, | 821 | 0, |
822 | address, 0); | 822 | address, NULL); |
823 | } | 823 | } |
824 | 824 | ||
825 | int ps3_repository_read_boot_dat_size(unsigned int *size) | 825 | int ps3_repository_read_boot_dat_size(unsigned int *size) |
@@ -832,7 +832,7 @@ int ps3_repository_read_boot_dat_size(unsigned int *size) | |||
832 | make_field("boot_dat", 0), | 832 | make_field("boot_dat", 0), |
833 | make_field("size", 0), | 833 | make_field("size", 0), |
834 | 0, | 834 | 0, |
835 | &v1, 0); | 835 | &v1, NULL); |
836 | *size = v1; | 836 | *size = v1; |
837 | return result; | 837 | return result; |
838 | } | 838 | } |
@@ -847,7 +847,7 @@ int ps3_repository_read_vuart_av_port(unsigned int *port) | |||
847 | make_field("vir_uart", 0), | 847 | make_field("vir_uart", 0), |
848 | make_field("port", 0), | 848 | make_field("port", 0), |
849 | make_field("avset", 0), | 849 | make_field("avset", 0), |
850 | &v1, 0); | 850 | &v1, NULL); |
851 | *port = v1; | 851 | *port = v1; |
852 | return result; | 852 | return result; |
853 | } | 853 | } |
@@ -862,7 +862,7 @@ int ps3_repository_read_vuart_sysmgr_port(unsigned int *port) | |||
862 | make_field("vir_uart", 0), | 862 | make_field("vir_uart", 0), |
863 | make_field("port", 0), | 863 | make_field("port", 0), |
864 | make_field("sysmgr", 0), | 864 | make_field("sysmgr", 0), |
865 | &v1, 0); | 865 | &v1, NULL); |
866 | *port = v1; | 866 | *port = v1; |
867 | return result; | 867 | return result; |
868 | } | 868 | } |
@@ -893,7 +893,7 @@ int ps3_repository_read_num_be(unsigned int *num_be) | |||
893 | 0, | 893 | 0, |
894 | 0, | 894 | 0, |
895 | 0, | 895 | 0, |
896 | &v1, 0); | 896 | &v1, NULL); |
897 | *num_be = v1; | 897 | *num_be = v1; |
898 | return result; | 898 | return result; |
899 | } | 899 | } |
@@ -905,7 +905,7 @@ int ps3_repository_read_be_node_id(unsigned int be_index, u64 *node_id) | |||
905 | 0, | 905 | 0, |
906 | 0, | 906 | 0, |
907 | 0, | 907 | 0, |
908 | node_id, 0); | 908 | node_id, NULL); |
909 | } | 909 | } |
910 | 910 | ||
911 | int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq) | 911 | int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq) |
@@ -915,7 +915,7 @@ int ps3_repository_read_tb_freq(u64 node_id, u64 *tb_freq) | |||
915 | node_id, | 915 | node_id, |
916 | make_field("clock", 0), | 916 | make_field("clock", 0), |
917 | 0, | 917 | 0, |
918 | tb_freq, 0); | 918 | tb_freq, NULL); |
919 | } | 919 | } |
920 | 920 | ||
921 | int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq) | 921 | int ps3_repository_read_be_tb_freq(unsigned int be_index, u64 *tb_freq) |