Skip to content

Commit 73686e7

Browse files
author
Al Viro
committed
Merge remote-tracking branch 'sparc/master' into work.sparc32
... and resolve a non-textual conflict in arch/sparc/lib/memset.S - EXT(...) stuff shouldn't be reintroduced on merge.
2 parents b4edf06 + 0a95a6d commit 73686e7

File tree

7 files changed

+19
-18
lines changed

7 files changed

+19
-18
lines changed

arch/sparc/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ config SMP
176176
Management" code will be disabled if you say Y here.
177177

178178
See also <file:Documentation/admin-guide/lockup-watchdogs.rst> and the SMP-HOWTO
179-
available at <http://www.tldp.org/docs.html#howto>.
179+
available at <https://www.tldp.org/docs.html#howto>.
180180

181181
If you don't know what to do here, say N.
182182

arch/sparc/boot/piggyback.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,10 @@ static off_t get_hdrs_offset(int kernelfd, const char *filename)
154154
offset -= LOOKBACK;
155155
/* skip a.out header */
156156
offset += AOUT_TEXT_OFFSET;
157+
if (offset < 0) {
158+
errno = -EINVAL;
159+
die("Calculated a negative offset, probably elftoaout generated an invalid image. Did you use a recent elftoaout ?");
160+
}
157161
if (lseek(kernelfd, offset, SEEK_SET) < 0)
158162
die("lseek");
159163
if (read(kernelfd, buffer, BUFSIZE) != BUFSIZE)

arch/sparc/include/asm/backoff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* When we spin, we try to use an operation that will cause the
2020
* current cpu strand to block, and therefore make the core fully
21-
* available to any other other runnable strands. There are two
21+
* available to any other runnable strands. There are two
2222
* options, based upon cpu capabilities.
2323
*
2424
* On all cpus prior to SPARC-T4 we do three dummy reads of the

arch/sparc/include/asm/pgtsrmmu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ extern unsigned long last_valid_pfn;
113113
extern void *srmmu_nocache_pool;
114114
#define __nocache_pa(VADDR) (((unsigned long)VADDR) - SRMMU_NOCACHE_VADDR + __pa((unsigned long)srmmu_nocache_pool))
115115
#define __nocache_va(PADDR) (__va((unsigned long)PADDR) - (unsigned long)srmmu_nocache_pool + SRMMU_NOCACHE_VADDR)
116-
#define __nocache_fix(VADDR) __va(__nocache_pa(VADDR))
116+
#define __nocache_fix(VADDR) ((__typeof__(VADDR))__va(__nocache_pa(VADDR)))
117117

118118
/* Accessing the MMU control register. */
119119
unsigned int srmmu_get_mmureg(void);

arch/sparc/kernel/pci.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,8 @@ static void pci_of_scan_bus(struct pci_pbm_info *pbm,
552552
pci_info(bus, "scan_bus[%pOF] bus no %d\n",
553553
node, bus->number);
554554

555-
child = NULL;
556555
prev_devfn = -1;
557-
while ((child = of_get_next_child(node, child)) != NULL) {
556+
for_each_child_of_node(node, child) {
558557
if (ofpci_verbose)
559558
pci_info(bus, " * %pOF\n", child);
560559
reg = of_get_property(child, "reg", &reglen);

arch/sparc/kernel/viohs.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static int process_dreg_info(struct vio_driver_state *vio,
428428
struct vio_dring_register *pkt)
429429
{
430430
struct vio_dring_state *dr;
431-
int i, len;
431+
int i;
432432

433433
viodbg(HS, "GOT DRING_REG INFO ident[%llx] "
434434
"ndesc[%u] dsz[%u] opt[0x%x] ncookies[%u]\n",
@@ -482,9 +482,7 @@ static int process_dreg_info(struct vio_driver_state *vio,
482482
pkt->num_descr, pkt->descr_size, pkt->options,
483483
pkt->num_cookies);
484484

485-
len = (sizeof(*pkt) +
486-
(dr->ncookies * sizeof(struct ldc_trans_cookie)));
487-
if (send_ctrl(vio, &pkt->tag, len) < 0)
485+
if (send_ctrl(vio, &pkt->tag, struct_size(pkt, cookies, dr->ncookies)) < 0)
488486
goto send_nack;
489487

490488
vio->dr_state |= VIO_DR_STATE_RXREG;

arch/sparc/mm/srmmu.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ static void __init srmmu_early_allocate_ptable_skeleton(unsigned long start,
689689
pgdp = pgd_offset_k(start);
690690
p4dp = p4d_offset(pgdp, start);
691691
pudp = pud_offset(p4dp, start);
692-
if (pud_none(*(pud_t *)__nocache_fix(pudp))) {
692+
if (pud_none(*__nocache_fix(pudp))) {
693693
pmdp = __srmmu_get_nocache(
694694
SRMMU_PMD_TABLE_SIZE, SRMMU_PMD_TABLE_SIZE);
695695
if (pmdp == NULL)
@@ -698,7 +698,7 @@ static void __init srmmu_early_allocate_ptable_skeleton(unsigned long start,
698698
pud_set(__nocache_fix(pudp), pmdp);
699699
}
700700
pmdp = pmd_offset(__nocache_fix(pudp), start);
701-
if (srmmu_pmd_none(*(pmd_t *)__nocache_fix(pmdp))) {
701+
if (srmmu_pmd_none(*__nocache_fix(pmdp))) {
702702
ptep = __srmmu_get_nocache(PTE_SIZE, PTE_SIZE);
703703
if (ptep == NULL)
704704
early_pgtable_allocfail("pte");
@@ -810,33 +810,33 @@ static void __init srmmu_inherit_prom_mappings(unsigned long start,
810810
p4dp = p4d_offset(pgdp, start);
811811
pudp = pud_offset(p4dp, start);
812812
if (what == 2) {
813-
*(pgd_t *)__nocache_fix(pgdp) = __pgd(probed);
813+
*__nocache_fix(pgdp) = __pgd(probed);
814814
start += PGDIR_SIZE;
815815
continue;
816816
}
817-
if (pud_none(*(pud_t *)__nocache_fix(pudp))) {
817+
if (pud_none(*__nocache_fix(pudp))) {
818818
pmdp = __srmmu_get_nocache(SRMMU_PMD_TABLE_SIZE,
819819
SRMMU_PMD_TABLE_SIZE);
820820
if (pmdp == NULL)
821821
early_pgtable_allocfail("pmd");
822822
memset(__nocache_fix(pmdp), 0, SRMMU_PMD_TABLE_SIZE);
823823
pud_set(__nocache_fix(pudp), pmdp);
824824
}
825-
pmdp = pmd_offset(__nocache_fix(pgdp), start);
825+
pmdp = pmd_offset(__nocache_fix(pudp), start);
826826
if (what == 1) {
827827
*(pmd_t *)__nocache_fix(pmdp) = __pmd(probed);
828828
start += PMD_SIZE;
829829
continue;
830830
}
831-
if (srmmu_pmd_none(*(pmd_t *)__nocache_fix(pmdp))) {
831+
if (srmmu_pmd_none(*__nocache_fix(pmdp))) {
832832
ptep = __srmmu_get_nocache(PTE_SIZE, PTE_SIZE);
833833
if (ptep == NULL)
834834
early_pgtable_allocfail("pte");
835835
memset(__nocache_fix(ptep), 0, PTE_SIZE);
836836
pmd_set(__nocache_fix(pmdp), ptep);
837837
}
838838
ptep = pte_offset_kernel(__nocache_fix(pmdp), start);
839-
*(pte_t *)__nocache_fix(ptep) = __pte(probed);
839+
*__nocache_fix(ptep) = __pte(probed);
840840
start += PAGE_SIZE;
841841
}
842842
}
@@ -850,7 +850,7 @@ static void __init do_large_mapping(unsigned long vaddr, unsigned long phys_base
850850
unsigned long big_pte;
851851

852852
big_pte = KERNEL_PTE(phys_base >> 4);
853-
*(pgd_t *)__nocache_fix(pgdp) = __pgd(big_pte);
853+
*__nocache_fix(pgdp) = __pgd(big_pte);
854854
}
855855

856856
/* Map sp_bank entry SP_ENTRY, starting at virtual address VBASE. */
@@ -940,7 +940,7 @@ void __init srmmu_paging_init(void)
940940
srmmu_ctx_table_phys = (ctxd_t *)__nocache_pa(srmmu_context_table);
941941

942942
for (i = 0; i < num_contexts; i++)
943-
srmmu_ctxd_set((ctxd_t *)__nocache_fix(&srmmu_context_table[i]), srmmu_swapper_pg_dir);
943+
srmmu_ctxd_set(__nocache_fix(&srmmu_context_table[i]), srmmu_swapper_pg_dir);
944944

945945
flush_cache_all();
946946
srmmu_set_ctable_ptr((unsigned long)srmmu_ctx_table_phys);

0 commit comments

Comments
 (0)