Subject: Re: [PATCH net-next v2 1/3] ieee802154: cc2520: adds driver for TI CC2520 radio

From: Varka Bhadram <[email-masked]>
Date: Wed, 18 Jun 2014 14:56:16 +0530

On 06/18/2014 02:40 PM, Mark Rutland wrote:
> On Wed, Jun 18, 2014 at 06:16:03AM +0100, Varka Bhadram wrote:
>> Driver support:
>>          - Tx and Rx of IEEE-802.15.4 packets.
>>          - Energy Detection on channel.
>>          - Setting the Channel for the radio. [b/w 11 - 26 channels]
>>          - Start and Stop the radio.
>>
>> Signed-off-by: Varka Bhadram <[email-masked]>
>> ---
>>   drivers/net/ieee802154/cc2520.c |  968 +++++++++++++++++++++++++++++++++++++++
>>   include/linux/spi/cc2520.h      |   26 ++
>>   2 files changed, 994 insertions(+)
>>   create mode 100644 drivers/net/ieee802154/cc2520.c
>>   create mode 100644 include/linux/spi/cc2520.h
> [...]
>
>> +static struct cc2520_platform_data *
>> +cc2520_get_platform_data(struct spi_device *spi)
>> +{
>> +       struct cc2520_platform_data *pdata;
>> +       struct device_node __maybe_unused *np = spi->dev.of_node;
>> +       struct cc2520_private *priv = spi_get_drvdata(spi);
>> +
>> +       if (!IS_ENABLED(CONFIG_OF) || !np)
>> +               return spi->dev.platform_data;
> Surely "if (!np)" is good enough?

This condition i chooses because either of thing is defined.
If the CONFIG_OF is enabled or devicetree node defined in the devicetree source.

I think checking np is enough.

> [...]
>
>> +static int cc2520_probe(struct spi_device *spi)
>> +{
>> +       struct cc2520_private *priv;
>> +       struct pinctrl *pinctrl;
>> +       struct cc2520_platform_data *pdata;
>> +       struct device_node __maybe_unused *np = spi->dev.of_node;
> This looks to be definitely unused rather than __maybe_unused. There are
> no other occuences of "np" in this function.

|This macro defined like this.
#define  __maybe_unused  __attribute__((unused))

|

> Mark.

Varka Bhadram

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems

_______________________________________________
Linux-zigbee-devel mailing list
[email-masked]
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel