Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2099255ybg; Sat, 19 Oct 2019 08:18:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGCtkHpdyEebYFFR3R+C1d+IiVcSmyPA3kH1X9NhiJ/kjPuhfSQsXwJ2kXyEYpPxQU2S0v X-Received: by 2002:a50:8264:: with SMTP id 91mr1872737edf.69.1571498292716; Sat, 19 Oct 2019 08:18:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571498292; cv=none; d=google.com; s=arc-20160816; b=L8r/EXZrCUZDbCF0scvgtM0IwCP/jA52cU0V5lKznCi9T3cSBsiX3uWog61kvc/uQG OHByfA68gGlfZfL/OWhN3JZ2fDp8w+HpJ2vgp1GQIs9S3Nw2aPWoQo6N9uBQj2RhqD4y IDbYeO946oKa0opqoF7PFNOjBE68KqyFZ2w59Xfi341Iyp7EgHEyfvfFrE2U2ki4AHdn 5Ecih2XHANsTTSQzxMHnnkR0XtPxYH1xYbVk3o3campoUoq0nPy7CdNHmwPlm/MTi3mQ FOZ5NDmQiCW2G/o6y0+J5aJTgITxzsermxL+xklNmvxuhLHcS69dZI3NfLuwAKZDK7/4 JNyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=8WFtumw066F5ckdZl0OY0HJ41gVxjmYXTynWJGw4qiY=; b=twbmqa+KdKQiOlxyoj6D6IxZNakKeJLJFH87kNxqU1hScvNlnNCmheZPa0WiAVhSQU SoT2JfRcUfNni9UxgvQiZ6u5wv2Di3262avPOOu3QHdanmOHk2v8KfirU5Cx8BaEBXS+ AsGQjFJ+BsWOki+4lDlOjJS+reMmv0TIAGmtwDkHTWnj34COypdlqDKfgvL6s2SE19nd WjiXbTWY8j0yxMyk0Kolg/GNCnb+l08uMtW5ULZdpAvR/j6TC52L0UNGM4PCPMbPQ1NL r15mIt9OGGW4cDL1JK+NWEJ4LH5YF7985qBPpbIzynU6uakaRev76eUJjqBBqy46r4d+ sE8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e47si6208079ede.325.2019.10.19.08.17.46; Sat, 19 Oct 2019 08:18:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725943AbfJSPR3 (ORCPT + 99 others); Sat, 19 Oct 2019 11:17:29 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:54695 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725810AbfJSPR3 (ORCPT ); Sat, 19 Oct 2019 11:17:29 -0400 X-IronPort-AV: E=Sophos;i="5.67,316,1566856800"; d="scan'208";a="323302512" Received: from ip-121.net-89-2-166.rev.numericable.fr (HELO hadrien) ([89.2.166.121]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Oct 2019 17:17:25 +0200 Date: Sat, 19 Oct 2019 17:17:25 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Jules Irenge cc: Dan Carpenter , outreachy-kernel@googlegroups.com, devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: Re: [Outreachy kernel] Re: [PATCH v1 1/5] staging: wfx: fix warnings of no space is necessary In-Reply-To: Message-ID: References: <20191019140719.2542-1-jbi.octave@gmail.com> <20191019140719.2542-2-jbi.octave@gmail.com> <20191019142443.GH24678@kadam> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 19 Oct 2019, Jules Irenge wrote: > > > On Sat, 19 Oct 2019, Dan Carpenter wrote: > > > On Sat, Oct 19, 2019 at 03:07:15PM +0100, Jules Irenge wrote: > > > diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c > > > index 3355183fc86c..573216b08042 100644 > > > --- a/drivers/staging/wfx/bh.c > > > +++ b/drivers/staging/wfx/bh.c > > > @@ -69,13 +69,13 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf) > > > if (wfx_data_read(wdev, skb->data, alloc_len)) > > > goto err; > > > > > > - piggyback = le16_to_cpup((u16 *) (skb->data + alloc_len - 2)); > > > + piggyback = le16_to_cpup((u16 *)(skb->data + alloc_len - 2)); > > > _trace_piggyback(piggyback, false); > > > > > > - hif = (struct hif_msg *) skb->data; > > > + hif = (struct hif_msg *)skb->data; > > > WARN(hif->encrypted & 0x1, "unsupported encryption type"); > > > if (hif->encrypted == 0x2) { > > > - if (wfx_sl_decode(wdev, (void *) hif)) { > > > + if (wfx_sl_decode(wdev, (void *)hif)) { > > > > In the future you may want to go through and remove the (void *) casts. > > It's not required here. > > > > > diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c > > > index f65f7d75e731..effd07957753 100644 > > > --- a/drivers/staging/wfx/bus_spi.c > > > +++ b/drivers/staging/wfx/bus_spi.c > > > @@ -90,7 +90,7 @@ static int wfx_spi_copy_to_io(void *priv, unsigned int addr, > > > struct wfx_spi_priv *bus = priv; > > > u16 regaddr = (addr << 12) | (count / 2); > > > // FIXME: use a bounce buffer > > > - u16 *src16 = (void *) src; > > > + u16 *src16 = (void *)src; > > > > Here we are just getting rid of the constness. Apparently we are doing > > that so we can modify it without GCC pointing out the bug!! I don't > > know the code but this seems very wrong. > > > Checkpatch was complaining about space between type cast and the > variable. I just get rid of the space. Well I don't know whether this was > false positive one. I think you missed the point. It would be good to trace through the core and try to figure out where this src value comes from. Is it really const? Or is the const declaration there just to satisfy the type checker, and is the actual data provided not const. This function is stored in a hwbus_ops structure. It would be good to see what other drivers that store a function in the same field of such a structure do, and to see where the function is actually called (via a function pointer) and where the argument comes from. julia