lkml.org 
[lkml]   [2007]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 20/30] scsi: In the Advansys driver, do not cast allocation function return values
    There's no reason to cast void pointers returned by the generic
    memory allocation functions.

    Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
    ---
    drivers/scsi/advansys.c | 9 +++------
    1 files changed, 3 insertions(+), 6 deletions(-)

    diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c
    index 79c0b6e..b28729c 100644
    --- a/drivers/scsi/advansys.c
    +++ b/drivers/scsi/advansys.c
    @@ -18513,7 +18513,7 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
    * Allocate buffer carrier structures. The total size
    * is about 4 KB, so allocate all at once.
    */
    - carrp = (ADV_CARR_T *) kmalloc(ADV_CARRIER_BUFSIZE, GFP_ATOMIC);
    + carrp = kmalloc(ADV_CARRIER_BUFSIZE, GFP_ATOMIC);
    ASC_DBG1(1, "advansys_board_found: carrp 0x%lx\n", (ulong)carrp);

    if (carrp == NULL) {
    @@ -18529,8 +18529,7 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
    for (req_cnt = adv_dvc_varp->max_host_qng;
    req_cnt > 0; req_cnt--) {

    - reqp = (adv_req_t *)
    - kmalloc(sizeof(adv_req_t) * req_cnt, GFP_ATOMIC);
    + reqp = kmalloc(sizeof(adv_req_t) * req_cnt, GFP_ATOMIC);

    ASC_DBG3(1,
    "advansys_board_found: reqp 0x%lx, req_cnt %d, bytes %lu\n",
    @@ -18552,9 +18551,7 @@ advansys_board_found(int iop, struct device *dev, int bus_type)
    boardp->adv_sgblkp = NULL;
    for (sg_cnt = 0; sg_cnt < ADV_TOT_SG_BLOCK; sg_cnt++) {

    - sgp = (adv_sgblk_t *)
    - kmalloc(sizeof(adv_sgblk_t), GFP_ATOMIC);
    -
    + sgp = kmalloc(sizeof(adv_sgblk_t), GFP_ATOMIC);
    if (sgp == NULL) {
    break;
    }
    --
    1.5.2.2
    -
    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: 2007-08-24 02:23    [W:3.353 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site