From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel-janitors@vger.kernel.org
Subject: re: Mailbox: Add support for Platform Communication Channel
Date: Mon, 15 Dec 2014 21:56:43 +0000 [thread overview]
Message-ID: <20141215215643.GA2882@mwanda> (raw)
Hello Ashwin Chaugule,
The patch 86c22f8c9a3b: "Mailbox: Add support for Platform
Communication Channel" from Nov 12, 2014, leads to the following
static checker warning:
drivers/mailbox/pcc.c:119 pcc_mbox_request_channel()
error: 'chan' dereferencing possible ERR_PTR()
drivers/mailbox/pcc.c
110 /*
111 * Each PCC Subspace is a Mailbox Channel.
112 * The PCC Clients get their PCC Subspace ID
113 * from their own tables and pass it here.
114 * This returns a pointer to the PCC subspace
115 * for the Client to operate on.
116 */
117 chan = get_pcc_channel(subspace_id);
118
119 if (!chan || chan->cl) {
^^^^^
Should be checking IS_ERR(). Also is the error message correct?
120 dev_err(dev, "%s: PCC mailbox not free\n", __func__);
121 return ERR_PTR(-EBUSY);
122 }
drivers/mailbox/pcc.c:220 pcc_send_data()
warn: impossible condition '(ss_idx < 0) => (0-65535 < 0)'
215 u16 cmd = *(u16 *) data;
216 u16 ss_idx = -1;
^^^^^^^^^^^^^^^^
Make this an int. Remove the bogus initializer.
217
218 ss_idx = get_subspace_id(chan);
219
Don't put a blank line between the function calls and the error
handling, they are part of the same paragraph.
220 if (ss_idx < 0) {
221 pr_err("Invalid Subspace ID from PCC client\n");
222 return -EINVAL;
223 }
224
Also this file has some Sparse warnings:
drivers/mailbox/pcc.c:103:18: warning: symbol 'pcc_mbox_request_channel' was not declared. Should it be static?
drivers/mailbox/pcc.c:146:6: warning: symbol 'pcc_mbox_free_channel' was not declared. Should it be static?
drivers/mailbox/pcc.c:180:18: warning: incorrect type in argument 1 (different address spaces)
drivers/mailbox/pcc.c:180:18: expected void const volatile [noderef] <asn:2>*addr
drivers/mailbox/pcc.c:180:18: got unsigned short *<noident>
drivers/mailbox/pcc.c:230:22: warning: incorrect type in argument 2 (different address spaces)
drivers/mailbox/pcc.c:230:22: expected void volatile [noderef] <asn:2>*addr
drivers/mailbox/pcc.c:230:22: got unsigned short *<noident>
drivers/mailbox/pcc.c:233:47: warning: incorrect type in argument 2 (different address spaces)
drivers/mailbox/pcc.c:233:47: expected void volatile [noderef] <asn:2>*addr
drivers/mailbox/pcc.c:233:47: got unsigned int *<noident>
drivers/mailbox/pcc.c:236:20: warning: incorrect type in argument 2 (different address spaces)
drivers/mailbox/pcc.c:236:20: expected void volatile [noderef] <asn:2>*addr
drivers/mailbox/pcc.c:236:20: got unsigned short *<noident>
drivers/mailbox/pcc.c:369:24: warning: symbol 'pcc_mbox_driver' was not declared. Should it be static?
regards,
dan carpenter
next reply other threads:[~2014-12-15 21:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-15 21:56 Dan Carpenter [this message]
2014-12-17 16:46 ` Mailbox: Add support for Platform Communication Channel Ashwin Chaugule
2014-12-17 18:56 ` Dan Carpenter
2014-12-20 14:56 ` Ashwin Chaugule
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141215215643.GA2882@mwanda \
--to=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.