lkml.org 
[lkml]   [2006]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 03/22] pHype specific stuff
    > +u64 hipz_galpa_load(struct h_galpa galpa, u32 offset)
    > +{
    > + u64 addr = galpa.fw_handle + offset;
    > + u64 out;
    > + EDEB_EN(7, "addr=%lx offset=%x ", addr, offset);
    > + out = *(u64 *) addr;

    why does this cast an u64 to a pointer?

    > +#ifndef EHCA_USERDRIVER
    > +inline static int hcall_map_page(u64 physaddr, u64 * mapaddr)
    > +{
    > + *mapaddr = (u64)(ioremap(physaddr, 4096));
    > +
    > + EDEB(7, "ioremap physaddr=%lx mapaddr=%lx", physaddr, *mapaddr);
    > + return 0;

    ioremap returns void __iomem * and casting that to any integer type is
    wrong.

    > +inline static int hcall_unmap_page(u64 mapaddr)
    > +{
    > + EDEB(7, "mapaddr=%lx", mapaddr);
    > + iounmap((void *)(mapaddr));
    > + return 0;

    dito for iounmap and casting back.

    guys, please run this driver through sparse, thanks.

    > + /* if phype returns LongBusyXXX,
    > + * we retry several times, but not forever */
    > + for (i = 0; i < 5; i++) {
    > + __asm__ __volatile__("mr 3,%10\n"
    > + "mr 4,%11\n"
    > + "mr 5,%12\n"

    assembly code under drivers/ is not acceptable. please create
    and <asm/ehca.h> for it or something similar.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-02-18 13:25    [W:0.033 / U:30.212 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site